From a45c3e7a861f66973358767c56752b10aef60ebc Mon Sep 17 00:00:00 2001 From: Sean Conroy <141843633+seconroy@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:43:11 +0100 Subject: [PATCH] Add conditional attribute support to profile parcels (#300) --- CHANGELOG.md | 5 + .../system_remote_access_profile_parcel.md | 16 +- docs/guides/changelog.md | 5 + .../system_remote_access_profile_parcel.md | 85 +- ...transport_management_vpn_profile_parcel.md | 4 +- .../transport_wan_vpn_profile_parcel.md | 4 +- .../resource.tf | 44 +- .../profile_parcels/system_remote_access.yaml | 82 +- gen/generator.go | 5 + gen/schema/schema.yaml | 3 +- gen/templates/profile_parcels/model.go | 190 +- gen/templates/profile_parcels/resource.go | 8 +- ...wan_system_remote_access_profile_parcel.go | 28 +- ...ystem_remote_access_profile_parcel_test.go | 13 +- ...tion_priority_qos_policy_profile_parcel.go | 74 +- ...n_vpn_interface_ethernet_profile_parcel.go | 1288 +++++++---- ...ce_lan_vpn_interface_gre_profile_parcel.go | 194 +- ..._lan_vpn_interface_ipsec_profile_parcel.go | 462 ++-- ...ce_lan_vpn_interface_svi_profile_parcel.go | 882 +++++--- ...el_sdwan_service_lan_vpn_profile_parcel.go | 1916 ++++++++++------- ...ice_object_tracker_group_profile_parcel.go | 46 +- ...n_service_object_tracker_profile_parcel.go | 76 +- ...an_service_tracker_group_profile_parcel.go | 36 +- ...el_sdwan_service_tracker_profile_parcel.go | 162 +- .../model_sdwan_system_aaa_profile_parcel.go | 778 ++++--- ...odel_sdwan_system_banner_profile_parcel.go | 36 +- ...model_sdwan_system_basic_profile_parcel.go | 602 ++++-- .../model_sdwan_system_bfd_profile_parcel.go | 184 +- ...stem_flexible_port_speed_profile_parcel.go | 18 +- ...odel_sdwan_system_global_profile_parcel.go | 408 ++-- ...ystem_ipv4_device_access_profile_parcel.go | 138 +- ...ystem_ipv6_device_access_profile_parcel.go | 146 +- ...del_sdwan_system_logging_profile_parcel.go | 546 +++-- .../model_sdwan_system_mrf_profile_parcel.go | 62 +- .../model_sdwan_system_ntp_profile_parcel.go | 270 ++- .../model_sdwan_system_omp_profile_parcel.go | 520 +++-- ...m_performance_monitoring_profile_parcel.go | 62 +- ...wan_system_remote_access_profile_parcel.go | 558 ++--- ...el_sdwan_system_security_profile_parcel.go | 454 ++-- .../model_sdwan_system_snmp_profile_parcel.go | 474 ++-- ...sport_ipv6_tracker_group_profile_parcel.go | 46 +- ...n_transport_ipv6_tracker_profile_parcel.go | 138 +- ...t_vpn_interface_ethernet_profile_parcel.go | 444 ++-- ...transport_management_vpn_profile_parcel.go | 388 ++-- ...an_transport_routing_bgp_profile_parcel.go | 1830 ++++++++++------ ..._transport_tracker_group_profile_parcel.go | 36 +- ..._sdwan_transport_tracker_profile_parcel.go | 138 +- ...n_vpn_interface_cellular_profile_parcel.go | 1128 ++++++---- ...n_vpn_interface_ethernet_profile_parcel.go | 1786 +++++++++------ ...rt_wan_vpn_interface_gre_profile_parcel.go | 194 +- ..._wan_vpn_interface_ipsec_profile_parcel.go | 462 ++-- ...n_interface_t1_e1_serial_profile_parcel.go | 906 +++++--- ..._sdwan_transport_wan_vpn_profile_parcel.go | 470 ++-- ...wan_system_remote_access_profile_parcel.go | 60 +- ...ystem_remote_access_profile_parcel_test.go | 13 +- ...transport_management_vpn_profile_parcel.go | 4 +- ..._sdwan_transport_wan_vpn_profile_parcel.go | 4 +- templates/guides/changelog.md.tmpl | 5 + 58 files changed, 11993 insertions(+), 6943 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c67e362b..6eeb98c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ - Add `sdwan_transport_ipv6_tracker_group_profile_parcel` resource and data source - Add `sdwan_service_object_tracker_profile_parcel` resource and data source - Add `sdwan_service_object_tracker_group_profile_parcel` resource and data source +- BREAKING CHANGE: Rename `enable_crl_check` attribute of `sdwan_system_remote_access_profile_parcel,` resource to `enable_certificate_list_check` +- 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 ## 0.3.13 diff --git a/docs/data-sources/system_remote_access_profile_parcel.md b/docs/data-sources/system_remote_access_profile_parcel.md index 8a58b8cf..a4990d64 100644 --- a/docs/data-sources/system_remote_access_profile_parcel.md +++ b/docs/data-sources/system_remote_access_profile_parcel.md @@ -29,10 +29,10 @@ data "sdwan_system_remote_access_profile_parcel" "example" { ### Read-Only -- `aaa_derive_name_domain` (String) -- `aaa_derive_name_domain_variable` (String) Variable name -- `aaa_derive_name_identity` (String) -- `aaa_derive_name_identity_variable` (String) Variable name +- `aaa_derive_name_from_peer_domain` (String) +- `aaa_derive_name_from_peer_domain_variable` (String) Variable name +- `aaa_derive_name_from_peer_identity` (String) +- `aaa_derive_name_from_peer_identity_variable` (String) Variable name - `aaa_enable_accounting` (Boolean) Enable Accounting - `aaa_enable_accounting_variable` (String) Variable name - `aaa_specify_name_policy_name` (String) @@ -40,14 +40,10 @@ data "sdwan_system_remote_access_profile_parcel" "example" { - `aaa_specify_name_policy_password` (String) - `aaa_specify_name_policy_password_variable` (String) Variable name - `any_connect_eap_authentication_type` (String) -- `any_connect_eap_profile_download_status` (String) -- `any_connect_eap_profile_download_status_variable` (String) Variable name -- `any_connect_eap_profile_file_name` (String) -- `any_connect_eap_profile_file_name_variable` (String) Variable name - `connection_type_ssl` (Boolean) Enabled SSL VPN - `description` (String) The description of the profile parcel -- `enable_crl_check` (Boolean) -- `enable_crl_check_variable` (String) Variable name +- `enable_certificate_list_check` (Boolean) +- `enable_certificate_list_check_variable` (String) Variable name - `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold - `ikev2_anti_dos_threshold_variable` (String) Variable name - `ikev2_local_ike_identity_type` (String) diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 4b6b93d8..9fc4e20f 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -16,6 +16,11 @@ description: |- - Add `sdwan_transport_ipv6_tracker_group_profile_parcel` resource and data source - Add `sdwan_service_object_tracker_profile_parcel` resource and data source - Add `sdwan_service_object_tracker_group_profile_parcel` resource and data source +- BREAKING CHANGE: Rename `enable_crl_check` attribute of `sdwan_system_remote_access_profile_parcel,` resource to `enable_certificate_list_check` +- 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 ## 0.3.13 diff --git a/docs/resources/system_remote_access_profile_parcel.md b/docs/resources/system_remote_access_profile_parcel.md index 2f2d8c4e..e93549ca 100644 --- a/docs/resources/system_remote_access_profile_parcel.md +++ b/docs/resources/system_remote_access_profile_parcel.md @@ -16,29 +16,27 @@ This resource can manage a System Remote Access profile parcel. ```terraform resource "sdwan_system_remote_access_profile_parcel" "example" { - name = "Example" - description = "My Example" - feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" - connection_type_ssl = false - any_connect_eap_authentication_type = "user" - any_connect_eap_profile_download_status = "INITIALIZED" - any_connect_eap_profile_file_name = "" - ipv4_pool_size = 50 - ipv6_pool_size = 1024 - enable_crl_check = false - psk_authentication_type = "aaa" - psk_authentication_pre_shared_key = "Cisco123" - radius_group_name = "radius-1" - aaa_derive_name_identity = "MyPassword" - aaa_enable_accounting = false - ikev2_local_ike_identity_type = "EMAIL" - ikev2_local_ike_identity_value = "abc@xyz.com" - ikev2_security_association_lifetime = 86400 - ikev2_anti_dos_threshold = 99 - ipsec_enable_anti_replay = false - ipsec_anti_replay_window_size = 64 - ipsec_security_association_lifetime = 3600 - ipsec_enable_perfect_foward_secrecy = false + name = "Example" + description = "My Example" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" + connection_type_ssl = false + any_connect_eap_authentication_type = "user" + ipv4_pool_size = 50 + ipv6_pool_size = 1024 + enable_certificate_list_check = false + psk_authentication_type = "aaa" + psk_authentication_pre_shared_key = "Cisco123" + radius_group_name = "radius-1" + aaa_derive_name_from_peer_identity = "MyPassword" + aaa_enable_accounting = false + ikev2_local_ike_identity_type = "EMAIL" + ikev2_local_ike_identity_value = "abc@xyz.com" + ikev2_security_association_lifetime = 86400 + ikev2_anti_dos_threshold = 99 + ipsec_enable_anti_replay = false + ipsec_anti_replay_window_size = 64 + ipsec_security_association_lifetime = 3600 + ipsec_enable_perfect_foward_secrecy = false } ``` @@ -47,16 +45,17 @@ resource "sdwan_system_remote_access_profile_parcel" "example" { ### Required -- `any_connect_eap_authentication_type` (String) - Choices: `user`, `device` +- `any_connect_eap_authentication_type` (String) , Attribute conditional on `connection_type_ssl` being equal to `false` + - Choices: `user`, `device` - `name` (String) The name of the profile parcel - `radius_group_name` (String) ### Optional -- `aaa_derive_name_domain` (String) -- `aaa_derive_name_domain_variable` (String) Variable name -- `aaa_derive_name_identity` (String) -- `aaa_derive_name_identity_variable` (String) Variable name +- `aaa_derive_name_from_peer_domain` (String) , Attribute conditional on `connection_type_ssl` being equal to `false` +- `aaa_derive_name_from_peer_domain_variable` (String) Variable name +- `aaa_derive_name_from_peer_identity` (String) , Attribute conditional on `connection_type_ssl` being equal to `false` +- `aaa_derive_name_from_peer_identity_variable` (String) Variable name - `aaa_enable_accounting` (Boolean) Enable Accounting - Default value: `true` - `aaa_enable_accounting_variable` (String) Variable name @@ -64,39 +63,35 @@ resource "sdwan_system_remote_access_profile_parcel" "example" { - `aaa_specify_name_policy_name_variable` (String) Variable name - `aaa_specify_name_policy_password` (String) - `aaa_specify_name_policy_password_variable` (String) Variable name -- `any_connect_eap_profile_download_status` (String) - Choices: `NONE`, `INITIALIZED`, `INITIALIZED_ERROR`, `COMPLETE`, `COMPLETE_ERROR` - - Default value: `NONE` -- `any_connect_eap_profile_download_status_variable` (String) Variable name -- `any_connect_eap_profile_file_name` (String) -- `any_connect_eap_profile_file_name_variable` (String) Variable name - `connection_type_ssl` (Boolean) Enabled SSL VPN - Default value: `false` - `description` (String) The description of the profile parcel -- `enable_crl_check` (Boolean) - Default value: `false` -- `enable_crl_check_variable` (String) Variable name +- `enable_certificate_list_check` (Boolean) - Default value: `false` +- `enable_certificate_list_check_variable` (String) Variable name - `feature_profile_id` (String) Feature Profile ID -- `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold +- `ikev2_anti_dos_threshold` (Number) Anti-DOS Threshold, Attribute conditional on `connection_type_ssl` being equal to `false` - Range: `10`-`1000` - Default value: `100` - `ikev2_anti_dos_threshold_variable` (String) Variable name -- `ikev2_local_ike_identity_type` (String) - Choices: `EMAIL`, `FQDN`, `KEYID`, `IPv4 ADDRESS`, `IPv6 ADDRESS` +- `ikev2_local_ike_identity_type` (String) , Attribute conditional on `connection_type_ssl` being equal to `false` + - Choices: `EMAIL`, `FQDN`, `KEYID`, `IPv4 ADDRESS`, `IPv6 ADDRESS` - `ikev2_local_ike_identity_type_variable` (String) Variable name -- `ikev2_local_ike_identity_value` (String) +- `ikev2_local_ike_identity_value` (String) , Attribute conditional on `connection_type_ssl` being equal to `false` - `ikev2_local_ike_identity_value_variable` (String) Variable name -- `ikev2_security_association_lifetime` (Number) Security Association Lifetime in Seconds +- `ikev2_security_association_lifetime` (Number) Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false` - Range: `3600`-`86400` - Default value: `86400` - `ikev2_security_association_lifetime_variable` (String) Variable name -- `ipsec_anti_replay_window_size` (Number) security Association Lifetime +- `ipsec_anti_replay_window_size` (Number) security Association Lifetime, Attribute conditional on `ipsec_enable_anti_replay` being equal to `true` - Default value: `64` - `ipsec_anti_replay_window_size_variable` (String) Variable name -- `ipsec_enable_anti_replay` (Boolean) Enable Anti-Replay +- `ipsec_enable_anti_replay` (Boolean) Enable Anti-Replay, Attribute conditional on `connection_type_ssl` being equal to `false` - Default value: `true` - `ipsec_enable_anti_replay_variable` (String) Variable name -- `ipsec_enable_perfect_foward_secrecy` (Boolean) security Association Lifetime +- `ipsec_enable_perfect_foward_secrecy` (Boolean) security Association Lifetime, Attribute conditional on `connection_type_ssl` being equal to `false` - Default value: `false` - `ipsec_enable_perfect_foward_secrecy_variable` (String) Variable name -- `ipsec_security_association_lifetime` (Number) Security Association Lifetime in Seconds +- `ipsec_security_association_lifetime` (Number) Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false` - Range: `3600`-`86400` - Default value: `3600` - `ipsec_security_association_lifetime_variable` (String) Variable name @@ -106,9 +101,9 @@ resource "sdwan_system_remote_access_profile_parcel" "example" { - `ipv6_pool_size` (Number) IPv6 Pool Size - Default value: `1024` - `ipv6_pool_size_variable` (String) Variable name -- `psk_authentication_pre_shared_key` (String) PSK Pre Shared Key +- `psk_authentication_pre_shared_key` (String) PSK Pre Shared Key, Attribute conditional on `psk_authentication_type` being equal to `group` - `psk_authentication_pre_shared_key_variable` (String) Variable name -- `psk_authentication_type` (String) PSK Selection +- `psk_authentication_type` (String) PSK Selection, Attribute conditional on `connection_type_ssl` being equal to `false` - Choices: `aaa`, `group` - `psk_authentication_type_variable` (String) Variable name - `radius_group_name_variable` (String) Variable name diff --git a/docs/resources/transport_management_vpn_profile_parcel.md b/docs/resources/transport_management_vpn_profile_parcel.md index dc0f5131..5fd65793 100644 --- a/docs/resources/transport_management_vpn_profile_parcel.md +++ b/docs/resources/transport_management_vpn_profile_parcel.md @@ -93,7 +93,7 @@ resource "sdwan_transport_management_vpn_profile_parcel" "example" { Optional: -- `administrative_distance` (Number) Administrative distance +- `administrative_distance` (Number) Administrative distance, Attribute conditional on `gateway` being equal to `null0` - Range: `1`-`255` - Default value: `1` - `administrative_distance_variable` (String) Variable name @@ -102,7 +102,7 @@ Optional: - Default value: `nextHop` - `network_address` (String) IP Address - `network_address_variable` (String) Variable name -- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops)) +- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops)) - `subnet_mask` (String) Subnet Mask - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0` - `subnet_mask_variable` (String) Variable name diff --git a/docs/resources/transport_wan_vpn_profile_parcel.md b/docs/resources/transport_wan_vpn_profile_parcel.md index d7a24c70..68e04bf1 100644 --- a/docs/resources/transport_wan_vpn_profile_parcel.md +++ b/docs/resources/transport_wan_vpn_profile_parcel.md @@ -112,7 +112,7 @@ resource "sdwan_transport_wan_vpn_profile_parcel" "example" { Optional: -- `administrative_distance` (Number) Administrative distance +- `administrative_distance` (Number) Administrative distance, Attribute conditional on `gateway` being equal to `null0` - Range: `1`-`255` - Default value: `1` - `administrative_distance_variable` (String) Variable name @@ -121,7 +121,7 @@ Optional: - Default value: `nextHop` - `network_address` (String) IP Address - `network_address_variable` (String) Variable name -- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops)) +- `next_hops` (Attributes List) IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop` (see [below for nested schema](#nestedatt--ipv4_static_routes--next_hops)) - `subnet_mask` (String) Subnet Mask - Choices: `255.255.255.255`, `255.255.255.254`, `255.255.255.252`, `255.255.255.248`, `255.255.255.240`, `255.255.255.224`, `255.255.255.192`, `255.255.255.128`, `255.255.255.0`, `255.255.254.0`, `255.255.252.0`, `255.255.248.0`, `255.255.240.0`, `255.255.224.0`, `255.255.192.0`, `255.255.128.0`, `255.255.0.0`, `255.254.0.0`, `255.252.0.0`, `255.240.0.0`, `255.224.0.0`, `255.192.0.0`, `255.128.0.0`, `255.0.0.0`, `254.0.0.0`, `252.0.0.0`, `248.0.0.0`, `240.0.0.0`, `224.0.0.0`, `192.0.0.0`, `128.0.0.0`, `0.0.0.0` - `subnet_mask_variable` (String) Variable name diff --git a/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf b/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf index ca62acd0..56e679c4 100644 --- a/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf +++ b/examples/resources/sdwan_system_remote_access_profile_parcel/resource.tf @@ -1,25 +1,23 @@ resource "sdwan_system_remote_access_profile_parcel" "example" { - name = "Example" - description = "My Example" - feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" - connection_type_ssl = false - any_connect_eap_authentication_type = "user" - any_connect_eap_profile_download_status = "INITIALIZED" - any_connect_eap_profile_file_name = "" - ipv4_pool_size = 50 - ipv6_pool_size = 1024 - enable_crl_check = false - psk_authentication_type = "aaa" - psk_authentication_pre_shared_key = "Cisco123" - radius_group_name = "radius-1" - aaa_derive_name_identity = "MyPassword" - aaa_enable_accounting = false - ikev2_local_ike_identity_type = "EMAIL" - ikev2_local_ike_identity_value = "abc@xyz.com" - ikev2_security_association_lifetime = 86400 - ikev2_anti_dos_threshold = 99 - ipsec_enable_anti_replay = false - ipsec_anti_replay_window_size = 64 - ipsec_security_association_lifetime = 3600 - ipsec_enable_perfect_foward_secrecy = false + name = "Example" + description = "My Example" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" + connection_type_ssl = false + any_connect_eap_authentication_type = "user" + ipv4_pool_size = 50 + ipv6_pool_size = 1024 + enable_certificate_list_check = false + psk_authentication_type = "aaa" + psk_authentication_pre_shared_key = "Cisco123" + radius_group_name = "radius-1" + aaa_derive_name_from_peer_identity = "MyPassword" + aaa_enable_accounting = false + ikev2_local_ike_identity_type = "EMAIL" + ikev2_local_ike_identity_value = "abc@xyz.com" + ikev2_security_association_lifetime = 86400 + ikev2_anti_dos_threshold = 99 + ipsec_enable_anti_replay = false + ipsec_anti_replay_window_size = 64 + ipsec_security_association_lifetime = 3600 + ipsec_enable_perfect_foward_secrecy = false } diff --git a/gen/definitions/profile_parcels/system_remote_access.yaml b/gen/definitions/profile_parcels/system_remote_access.yaml index 6eccaa7e..5142fa67 100644 --- a/gen/definitions/profile_parcels/system_remote_access.yaml +++ b/gen/definitions/profile_parcels/system_remote_access.yaml @@ -15,34 +15,44 @@ attributes: example: false - model_name: anyConnectEapAuth tf_name: any_connect_eap_authentication_type - example: user - - model_name: anyConnectProfileDownloadStatus - tf_name: any_connect_eap_profile_download_status - conditional_attribute: - name: anyConnectEapAuth - value: device - example: INITIALIZED - - model_name: anyConnectProfileFileName - tf_name: any_connect_eap_profile_file_name conditional_attribute: - name: anyConnectEapAuth - value: device - example: "" + name: connection_type_ssl + value: false + type: Bool + example: user + # ==== Requires support for file upload === + # - model_name: anyConnectProfileDownloadStatus + # tf_name: any_connect_eap_profile_download_status + # example: INITIALIZED + # conditional_attribute: + # name: any_connect_eap_authentication_type + # value: device + # - model_name: anyConnectProfileFileName + # tf_name: any_connect_eap_profile_file_name + # example: "" + # conditional_attribute: + # name: any_connect_eap_authentication_type + # value: device - model_name: ipv4PoolSize example: 50 - model_name: ipv6PoolSize example: 1024 - model_name: enableCrlCheck + tf_name: enable_certificate_list_check example: false - model_name: pskSelection tf_name: psk_authentication_type data_path: [pskAuth] + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: aaa - model_name: preSharedKey tf_name: psk_authentication_pre_shared_key data_path: [pskAuth] conditional_attribute: - name: pskSelection + name: psk_authentication_type value: group example: Cisco123 - model_name: radiusGroupName @@ -59,12 +69,20 @@ attributes: exclude_test: true example: cisco123 - model_name: deriveNameIdentity - tf_name: aaa_derive_name_identity + tf_name: aaa_derive_name_from_peer_identity data_path: [aaaPolicy] + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: MyPassword - model_name: deriveNameDomain - tf_name: aaa_derive_name_domain + tf_name: aaa_derive_name_from_peer_domain data_path: [aaaPolicy] + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool exclude_test: true example: MyPassword - model_name: enableAccounting @@ -72,31 +90,63 @@ attributes: example: false - model_name: localIkev2IdentityType tf_name: ikev2_local_ike_identity_type + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: EMAIL - model_name: localIkev2IdentityValue tf_name: ikev2_local_ike_identity_value + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: abc@xyz.com - model_name: ikev2SaLifetime tf_name: ikev2_security_association_lifetime + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: 86400 - model_name: antiDosThreshold tf_name: ikev2_anti_dos_threshold + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: 99 - model_name: enableAntiReplay tf_name: ipsec_enable_anti_replay + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: false - model_name: antiReplayWindowSize tf_name: ipsec_anti_replay_window_size + conditional_attribute: + name: ipsec_enable_anti_replay + value: true + type: Bool example: 64 - model_name: ipSecSaLifetime tf_name: ipsec_security_association_lifetime + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: 3600 - model_name: enablePFS tf_name: ipsec_enable_perfect_foward_secrecy + conditional_attribute: + name: connection_type_ssl + value: false + type: Bool example: false test_prerequisites: | resource "sdwan_system_feature_profile" "test" { name = "TF_TEST" description = "Terraform test" - } + } \ No newline at end of file diff --git a/gen/generator.go b/gen/generator.go index 9a84df1f..59f765ce 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -272,6 +272,7 @@ type YamlConfigAttribute struct { type YamlConfigConditionalAttribute struct { Name string `yaml:"name"` Value string `yaml:"value"` + Type string `yaml:"type"` } // Templating helper function to convert TF name to GO name @@ -723,6 +724,10 @@ func parseProfileParcelAttribute(attr *YamlConfigAttribute, model gjson.Result, attr.TfName = SnakeCase(attr.ModelName) } + if attr.ConditionalAttribute.Name != "" { + attr.ConditionalAttribute.Name = SnakeCase(attr.ConditionalAttribute.Name) + } + if r.Get("type").String() == "object" || !r.Get("type").Exists() { noGlobal := false diff --git a/gen/schema/schema.yaml b/gen/schema/schema.yaml index 2a256d76..368f638d 100644 --- a/gen/schema/schema.yaml +++ b/gen/schema/schema.yaml @@ -83,4 +83,5 @@ attribute: conditional_attribute: name: str() # Reference to other attribute - value: str() # Attribute value + value: any(str(), bool()) # Attribute value + type: str(required=False) # Attribute value type (default is String but can be set to Bool) diff --git a/gen/templates/profile_parcels/model.go b/gen/templates/profile_parcels/model.go index 94ff7d42..7320cbe3 100644 --- a/gen/templates/profile_parcels/model.go +++ b/gen/templates/profile_parcels/model.go @@ -161,19 +161,26 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string { path := "data." {{- range .Attributes}} {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } {{- else if and (or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)) (not .Reference)}} {{if .Variable}} if !data.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", data.{{toGoName .TfName}}Variable.ValueString()) + } } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if data.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") {{if or .DefaultValue .DefaultValueEmptyString}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default") } else {{else}}if !data.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") {{- if isListSet .}} var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} @@ -182,102 +189,132 @@ func (data {{camelCase .Name}}) toBody(ctx context.Context) string { {{- else}} body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", data.{{toGoName .TfName}}.Value{{.Type}}()) {{- end}} + } } {{- else if isNestedListSet .}} - {{if and (not .MinList) (not .ExcludeNull)}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} - for _, item := range data.{{toGoName .TfName}} { - itemBody := "" - {{- range .Attributes}} - {{- if .Value}} - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} - {{if .Variable}} - if !item.{{toGoName .TfName}}Variable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}Variable.ValueString()) - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if item.{{toGoName .TfName}}.IsNull() { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} - } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() { - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default") - } else {{else}}if !item.{{toGoName .TfName}}.IsNull(){{end}} { - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") - {{- if isListSet .}} - var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - item.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) - {{- else}} - itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}.Value{{.Type}}()) - {{- end}} - } - {{- else if isNestedListSet .}} - {{if and (not .MinList) (not .ExcludeNull)}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} - for _, childItem := range item.{{toGoName .TfName}} { - itemChildBody := "" + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && data.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + {{if and (not .MinList) (not .ExcludeNull)}}body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} + for _, item := range data.{{toGoName .TfName}} { + itemBody := "" {{- range .Attributes}} {{- if .Value}} - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} {{if .Variable}} - if !childItem.{{toGoName .TfName}}Variable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}Variable.ValueString()) - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childItem.{{toGoName .TfName}}.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + if !item.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if item.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() { body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default") - } else {{else}}if !childItem.{{toGoName .TfName}}.IsNull(){{end}} { - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + } else {{else}}if !item.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") {{- if isListSet .}} var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - childItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + item.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) {{- else}} - itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}.Value{{.Type}}()) + itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", item.{{toGoName .TfName}}.Value{{.Type}}()) {{- end}} + } } {{- else if isNestedListSet .}} - {{if and (not .MinList) (not .ExcludeNull)}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} - for _, childChildItem := range childItem.{{toGoName .TfName}} { - itemChildChildBody := "" - {{- range .Attributes}} - {{- if .Value}} - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) - {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} - {{if .Variable}} - if !childChildItem.{{toGoName .TfName}}Variable.IsNull() { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}Variable.ValueString()) - } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childChildItem.{{toGoName .TfName}}.IsNull() { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") - {{if or .DefaultValue .DefaultValueEmptyString}}itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} - } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() { - body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default") - } else {{else}}if !childChildItem.{{toGoName .TfName}}.IsNull(){{end}} { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") - {{- if isListSet .}} - var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} - childChildItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) - {{- else}} - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}.Value{{.Type}}()) + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && item.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + {{if and (not .MinList) (not .ExcludeNull)}}itemBody, _ = sjson.Set(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} + for _, childItem := range item.{{toGoName .TfName}} { + itemChildBody := "" + {{- range .Attributes}} + {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } + {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{if .Variable}} + if !childItem.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childItem.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } + } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() { + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default") + } else {{else}}if !childItem.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + {{- if isListSet .}} + var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} + childItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + {{- else}} + itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childItem.{{toGoName .TfName}}.Value{{.Type}}()) + {{- end}} + } + } + {{- else if isNestedListSet .}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && itemChildBody.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && itemChildBody.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + {{if and (not .MinList) (not .ExcludeNull)}}itemChildBody, _ = sjson.Set(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}", []interface{}{}){{end}} + for _, childChildItem := range childItem.{{toGoName .TfName}} { + itemChildChildBody := "" + {{- range .Attributes}} + {{- if .Value}} + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.Value}}{{if eq .Type "String"}}"{{end}}) + } + {{- else if or (eq .Type "String") (eq .Type "Int64") (eq .Type "Float64") (eq .Type "Bool") (isListSet .)}} + {{if .Variable}} + if !childChildItem.{{toGoName .TfName}}Variable.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "variable") + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}Variable.ValueString()) + } + } else {{end}}{{if and .DefaultValuePresent (not .ExcludeNull)}}if childChildItem.{{toGoName .TfName}}.IsNull() { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "default") + {{if or .DefaultValue .DefaultValueEmptyString}}itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", {{if eq .Type "String"}}"{{end}}{{.DefaultValue}}{{if eq .Type "String"}}"{{end}}){{end}} + } else {{else if .AlwaysIncludeParent }}if data.{{toGoName .TfName}}.IsNull() { + body, _ = sjson.Set(body, path+"{{range .DataPath}}{{.}}.{{end}}optionType", "default") + } else {{else}}if !childChildItem.{{toGoName .TfName}}.IsNull(){{end}} { + if true{{if ne .ConditionalAttribute.Name ""}} {{if eq .ConditionalAttribute.Type "Bool"}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueBool() == {{.ConditionalAttribute.Value}} {{else}} && childChildItem.{{toGoName .ConditionalAttribute.Name}}.ValueString() == "{{.ConditionalAttribute.Value}}" {{end}}{{end}} { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.optionType", "global") + {{- if isListSet .}} + var values []{{if isStringListSet .}}string{{else if isInt64ListSet .}}int64{{end}} + childChildItem.{{toGoName .TfName}}.ElementsAs(ctx, &values, false) + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", values) + {{- else}} + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.value", childChildItem.{{toGoName .TfName}}.Value{{.Type}}()) + {{- end}} + } + } + {{- end}} + {{- end}} + itemChildBody, _ = sjson.SetRaw(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildChildBody) + } + } {{- end}} + {{- end}} + itemBody, _ = sjson.SetRaw(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildBody) } - {{- end}} - {{- end}} - itemChildBody, _ = sjson.SetRaw(itemChildBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildChildBody) } {{- end}} {{- end}} - itemBody, _ = sjson.SetRaw(itemBody, "{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemBody) } - {{- end}} - {{- end}} - body, _ = sjson.SetRaw(body, path+"{{range .DataPath}}{{.}}.{{end}}{{.ModelName}}.-1", itemBody) } {{- end}} {{- end}} @@ -563,3 +600,4 @@ func (data *{{camelCase .Name}}) isNull(ctx context.Context, res gjson.Result) b return true } // End of section. //template:end isNull + diff --git a/gen/templates/profile_parcels/resource.go b/gen/templates/profile_parcels/resource.go index 82876b02..8f03a4c9 100644 --- a/gen/templates/profile_parcels/resource.go +++ b/gen/templates/profile_parcels/resource.go @@ -86,7 +86,7 @@ func (r *{{camelCase .Name}}ProfileParcelResource) Schema(ctx context.Context, r {{- range .Attributes}} {{- if not .Value}} "{{.TfName}}": schema.{{if isNestedListSet .}}{{.Type}}Nested{{else if isList .}}List{{else if isSet .}}Set{{else}}{{.Type}}{{end}}Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}") + MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}{{if .ConditionalAttribute.Name}}, Attribute conditional on `{{.ConditionalAttribute.Name}}` being equal to `{{.ConditionalAttribute.Value}}`{{end}}") {{- if and (len .EnumValues) (not .IgnoreEnum) -}} .AddStringEnumDescription({{range .EnumValues}}"{{.}}", {{end}}) {{- end -}} @@ -152,7 +152,7 @@ func (r *{{camelCase .Name}}ProfileParcelResource) Schema(ctx context.Context, r {{- range .Attributes}} {{- if not .Value}} "{{.TfName}}": schema.{{if isNestedListSet .}}{{.Type}}Nested{{else if isList .}}List{{else if isSet .}}Set{{else}}{{.Type}}{{end}}Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}") + MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}{{if .ConditionalAttribute.Name}}, Attribute conditional on `{{.ConditionalAttribute.Name}}` being equal to `{{.ConditionalAttribute.Value}}`{{end}}") {{- if and (len .EnumValues) (not .IgnoreEnum) -}} .AddStringEnumDescription({{range .EnumValues}}"{{.}}", {{end}}) {{- end -}} @@ -214,7 +214,7 @@ func (r *{{camelCase .Name}}ProfileParcelResource) Schema(ctx context.Context, r {{- range .Attributes}} {{- if not .Value}} "{{.TfName}}": schema.{{if isNestedListSet .}}{{.Type}}Nested{{else if isList .}}List{{else if isSet .}}Set{{else}}{{.Type}}{{end}}Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}") + MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}{{if .ConditionalAttribute.Name}}, Attribute conditional on `{{.ConditionalAttribute.Name}}` being equal to `{{.ConditionalAttribute.Value}}`{{end}}") {{- if and (len .EnumValues) (not .IgnoreEnum) -}} .AddStringEnumDescription({{range .EnumValues}}"{{.}}", {{end}}) {{- end -}} @@ -276,7 +276,7 @@ func (r *{{camelCase .Name}}ProfileParcelResource) Schema(ctx context.Context, r {{- range .Attributes}} {{- if not .Value}} "{{.TfName}}": schema.{{if isList .}}List{{else if isSet .}}Set{{else}}{{.Type}}{{end}}Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}") + MarkdownDescription: helpers.NewAttributeDescription("{{.Description}}{{if .ConditionalAttribute.Name}}, Attribute conditional on `{{.ConditionalAttribute.Name}}` being equal to `{{.ConditionalAttribute.Value}}`{{end}}") {{- if and (len .EnumValues) (not .IgnoreEnum) -}} .AddStringEnumDescription({{range .EnumValues}}"{{.}}", {{end}}) {{- end -}} diff --git a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go b/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go index 4b4dceb0..4750a162 100644 --- a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go +++ b/internal/provider/data_source_sdwan_system_remote_access_profile_parcel.go @@ -86,22 +86,6 @@ func (d *SystemRemoteAccessProfileParcelDataSource) Schema(ctx context.Context, MarkdownDescription: "", Computed: true, }, - "any_connect_eap_profile_download_status": schema.StringAttribute{ - MarkdownDescription: "", - Computed: true, - }, - "any_connect_eap_profile_download_status_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Computed: true, - }, - "any_connect_eap_profile_file_name": schema.StringAttribute{ - MarkdownDescription: "", - Computed: true, - }, - "any_connect_eap_profile_file_name_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Computed: true, - }, "ipv4_pool_size": schema.Int64Attribute{ MarkdownDescription: "IPv4 Pool Size", Computed: true, @@ -118,11 +102,11 @@ func (d *SystemRemoteAccessProfileParcelDataSource) Schema(ctx context.Context, MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, - "enable_crl_check": schema.BoolAttribute{ + "enable_certificate_list_check": schema.BoolAttribute{ MarkdownDescription: "", Computed: true, }, - "enable_crl_check_variable": schema.StringAttribute{ + "enable_certificate_list_check_variable": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, @@ -166,19 +150,19 @@ func (d *SystemRemoteAccessProfileParcelDataSource) Schema(ctx context.Context, MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, - "aaa_derive_name_identity": schema.StringAttribute{ + "aaa_derive_name_from_peer_identity": schema.StringAttribute{ MarkdownDescription: "", Computed: true, }, - "aaa_derive_name_identity_variable": schema.StringAttribute{ + "aaa_derive_name_from_peer_identity_variable": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, - "aaa_derive_name_domain": schema.StringAttribute{ + "aaa_derive_name_from_peer_domain": schema.StringAttribute{ MarkdownDescription: "", Computed: true, }, - "aaa_derive_name_domain_variable": schema.StringAttribute{ + "aaa_derive_name_from_peer_domain_variable": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Computed: true, }, diff --git a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel_test.go b/internal/provider/data_source_sdwan_system_remote_access_profile_parcel_test.go index a96de297..67869009 100644 --- a/internal/provider/data_source_sdwan_system_remote_access_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_system_remote_access_profile_parcel_test.go @@ -35,15 +35,13 @@ func TestAccDataSourceSdwanSystemRemoteAccessProfileParcel(t *testing.T) { var checks []resource.TestCheckFunc checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "connection_type_ssl", "false")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_authentication_type", "user")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_profile_download_status", "INITIALIZED")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_profile_file_name", "")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipv4_pool_size", "50")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ipv6_pool_size", "1024")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "enable_crl_check", "false")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "enable_certificate_list_check", "false")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "psk_authentication_type", "aaa")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "psk_authentication_pre_shared_key", "Cisco123")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "radius_group_name", "radius-1")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "aaa_derive_name_identity", "MyPassword")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "aaa_derive_name_from_peer_identity", "MyPassword")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "aaa_enable_accounting", "false")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_type", "EMAIL")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_value", "abc@xyz.com")) @@ -73,7 +71,6 @@ resource "sdwan_system_feature_profile" "test" { name = "TF_TEST" description = "Terraform test" } - ` // End of section. //template:end testPrerequisites @@ -86,15 +83,13 @@ func testAccDataSourceSdwanSystemRemoteAccessProfileParcelConfig() string { config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n" config += ` connection_type_ssl = false` + "\n" config += ` any_connect_eap_authentication_type = "user"` + "\n" - config += ` any_connect_eap_profile_download_status = "INITIALIZED"` + "\n" - config += ` any_connect_eap_profile_file_name = ""` + "\n" config += ` ipv4_pool_size = 50` + "\n" config += ` ipv6_pool_size = 1024` + "\n" - config += ` enable_crl_check = false` + "\n" + config += ` enable_certificate_list_check = false` + "\n" config += ` psk_authentication_type = "aaa"` + "\n" config += ` psk_authentication_pre_shared_key = "Cisco123"` + "\n" config += ` radius_group_name = "radius-1"` + "\n" - config += ` aaa_derive_name_identity = "MyPassword"` + "\n" + config += ` aaa_derive_name_from_peer_identity = "MyPassword"` + "\n" config += ` aaa_enable_accounting = false` + "\n" config += ` ikev2_local_ike_identity_type = "EMAIL"` + "\n" config += ` ikev2_local_ike_identity_value = "abc@xyz.com"` + "\n" diff --git a/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go b/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go index 2fcc9fe7..4a789c9a 100644 --- a/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go +++ b/internal/provider/model_sdwan_application_priority_qos_policy_profile_parcel.go @@ -75,38 +75,54 @@ func (data ApplicationPriorityQoSPolicy) toBody(ctx context.Context) string { path := "data." if !data.TargetInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"target.interfaces.optionType", "variable") - body, _ = sjson.Set(body, path+"target.interfaces.value", data.TargetInterfaceVariable.ValueString()) - } else if !data.TargetInterface.IsNull() { - body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global") - var values []string - data.TargetInterface.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"target.interfaces.value", values) - } - body, _ = sjson.Set(body, path+"qosMap.qosSchedulers", []interface{}{}) - for _, item := range data.QosSchedulers { - itemBody := "" - if !item.ForwardingClassId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString()) - } - if !item.Drops.IsNull() { - itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString()) - } - if !item.Queue.IsNull() { - itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString()) + if true { + body, _ = sjson.Set(body, path+"target.interfaces.optionType", "variable") + body, _ = sjson.Set(body, path+"target.interfaces.value", data.TargetInterfaceVariable.ValueString()) } - if !item.Bandwidth.IsNull() { - itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString()) + } else if !data.TargetInterface.IsNull() { + if true { + body, _ = sjson.Set(body, path+"target.interfaces.optionType", "global") + var values []string + data.TargetInterface.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"target.interfaces.value", values) } - if !item.SchedulingType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString()) + } + if true { + body, _ = sjson.Set(body, path+"qosMap.qosSchedulers", []interface{}{}) + for _, item := range data.QosSchedulers { + itemBody := "" + if !item.ForwardingClassId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "classMapRef.refId.value", item.ForwardingClassId.ValueString()) + } + } + if !item.Drops.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "drops.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "drops.value", item.Drops.ValueString()) + } + } + if !item.Queue.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "queue.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "queue.value", item.Queue.ValueString()) + } + } + if !item.Bandwidth.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "bandwidthPercent.value", item.Bandwidth.ValueString()) + } + } + if !item.SchedulingType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "scheduling.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "scheduling.value", item.SchedulingType.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"qosMap.qosSchedulers.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"qosMap.qosSchedulers.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go index c9682902..f6bf2317 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_ethernet_profile_parcel.go @@ -232,691 +232,1051 @@ func (data ServiceLANVPNInterfaceEthernet) toBody(ctx context.Context) string { path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpDistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) + } } else if !data.Ipv4DhcpDistance.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } + if true { - for _, item := range data.Ipv4SecondaryAddresses { - itemBody := "" + for _, item := range data.Ipv4SecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } if !data.Ipv4DhcpHelperVariable.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") - body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") + body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + } } else if data.Ipv4DhcpHelper.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + } } + if true { - for _, item := range data.Ipv6DhcpSecondaryAddresses { - itemBody := "" + for _, item := range data.Ipv6DhcpSecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody) } if !data.Ipv6AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) + } } else if !data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + } } + if true { - for _, item := range data.Ipv6SecondaryAddresses { - itemBody := "" + for _, item := range data.Ipv6SecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody) } + if true { - for _, item := range data.Ipv6DhcpHelpers { - itemBody := "" + for _, item := range data.Ipv6DhcpHelpers { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } - if !item.Dhcpv6HelperVpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpnVariable.ValueString()) - } else if !item.Dhcpv6HelperVpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpn.ValueInt64()) + if !item.Dhcpv6HelperVpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpnVariable.ValueString()) + } + } else if !item.Dhcpv6HelperVpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Dhcpv6HelperVpn.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.dhcpHelperV6.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.dhcpHelperV6.-1", itemBody) } if data.Ipv4Nat.IsNull() { - body, _ = sjson.Set(body, path+"nat.optionType", "default") - body, _ = sjson.Set(body, path+"nat.value", false) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "default") + body, _ = sjson.Set(body, path+"nat.value", false) + } } else { - body, _ = sjson.Set(body, path+"nat.optionType", "global") - body, _ = sjson.Set(body, path+"nat.value", data.Ipv4Nat.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "global") + body, _ = sjson.Set(body, path+"nat.value", data.Ipv4Nat.ValueBool()) + } } if !data.Ipv4NatTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatTypeVariable.ValueString()) + } } else if !data.Ipv4NatType.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.Ipv4NatType.ValueString()) + } } if !data.Ipv4NatRangeStartVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStartVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStartVariable.ValueString()) + } } else if data.Ipv4NatRangeStart.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStart.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.Ipv4NatRangeStart.ValueString()) + } } if !data.Ipv4NatRangeEndVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEndVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEndVariable.ValueString()) + } } else if data.Ipv4NatRangeEnd.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEnd.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.Ipv4NatRangeEnd.ValueString()) + } } if !data.Ipv4NatPrefixLengthVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLengthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLengthVariable.ValueString()) + } } else if data.Ipv4NatPrefixLength.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLength.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.Ipv4NatPrefixLength.ValueInt64()) + } } if !data.Ipv4NatOverloadVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverloadVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverloadVariable.ValueString()) + } } else if data.Ipv4NatOverload.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", true) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", true) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverload.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.Ipv4NatOverload.ValueBool()) + } } if !data.Ipv4NatLoopbackVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopbackVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopbackVariable.ValueString()) + } } else if data.Ipv4NatLoopback.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.Ipv4NatLoopback.ValueString()) + } } if !data.Ipv4NatUdpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeoutVariable.ValueString()) + } } else if data.Ipv4NatUdpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.Ipv4NatUdpTimeout.ValueInt64()) + } } if !data.Ipv4NatTcpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeoutVariable.ValueString()) + } } else if data.Ipv4NatTcpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeout.ValueInt64()) - } - body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{}) - for _, item := range data.StaticNats { - itemBody := "" - - if !item.SourceIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) - } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) - } - - if !item.TranslateIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIpVariable.ValueString()) - } else if !item.TranslateIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIp.ValueString()) - } - if item.Direction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside") - } else { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) - } - - if !item.SourceVpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) - } else if item.SourceVpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.Ipv4NatTcpTimeout.ValueInt64()) + } + } + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{}) + for _, item := range data.StaticNats { + itemBody := "" + + if !item.SourceIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) + } + } else if !item.SourceIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } + } + + if !item.TranslateIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIpVariable.ValueString()) + } + } else if !item.TranslateIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslateIp.ValueString()) + } + } + if item.Direction.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) + } + } + + if !item.SourceVpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) + } + } else if item.SourceVpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody) + } } if data.Ipv6Nat.IsNull() { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "default") - body, _ = sjson.Set(body, path+"natIpv6.value", false) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "default") + body, _ = sjson.Set(body, path+"natIpv6.value", false) + } } else { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"natIpv6.value", data.Ipv6Nat.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"natIpv6.value", data.Ipv6Nat.ValueBool()) + } } if !data.Nat64.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + } } if !data.AclShapingRateVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRateVariable.ValueString()) + } } else if data.AclShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.AclShapingRate.ValueInt64()) + } } if !data.AclIpv4EgressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.value", data.AclIpv4EgressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv4AclEgress.refId.value", data.AclIpv4EgressPolicyId.ValueString()) + } } if !data.AclIpv4IngressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.value", data.AclIpv4IngressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv4AclIngress.refId.value", data.AclIpv4IngressPolicyId.ValueString()) + } } if !data.AclIpv6EgressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.value", data.AclIpv6EgressPolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv6AclEgress.refId.value", data.AclIpv6EgressPolicyId.ValueString()) + } } if !data.AclIpv6IngressPolicyId.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.value", data.AclIpv6IngressPolicyId.ValueString()) - } - body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{}) - for _, item := range data.Ipv6Vrrps { - itemBody := "" - - if !item.GroupIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString()) - } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) - } - - if !item.PriorityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) - } else if item.Priority.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "priority.value", 100) - } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) - } - - if !item.TimerVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) - } else if item.Timer.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) - } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) - } - if item.TrackOmp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) - } - itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{}) - for _, childItem := range item.Ipv6Addresses { - itemChildBody := "" - - if !childItem.LinkLocalAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString()) - } else if !childItem.LinkLocalAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) - } - - if !childItem.GlobalAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString()) - } else if childItem.GlobalAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.ipv6AclIngress.refId.value", data.AclIpv6IngressPolicyId.ValueString()) + } + } + if true { + body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{}) + for _, item := range data.Ipv6Vrrps { + itemBody := "" + if !item.GroupIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString()) + } + } else if !item.GroupId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) + } + } + + if !item.PriorityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) + } + } else if item.Priority.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "priority.value", 100) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody) - } - body, _ = sjson.Set(body, path+"vrrp", []interface{}{}) - for _, item := range data.Ipv4Vrrps { - itemBody := "" - - if !item.GroupIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString()) - } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) - } - - if !item.PriorityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) - } else if item.Priority.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "priority.value", 100) - } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) - } - - if !item.TimerVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) - } else if item.Timer.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) - } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) - } - if item.TrackOmp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) - } - - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{}) - for _, childItem := range item.SecondaryAddresses { - itemChildBody := "" - - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.Address.ValueString()) - } - - if !childItem.SubnetMaskVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMaskVariable.ValueString()) - } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMask.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody) - } - if item.TlocPrefixChange.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) - } - if item.TlocPrefChangeValue.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefChangeValue.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody) - } - body, _ = sjson.Set(body, path+"arp", []interface{}{}) - for _, item := range data.Arps { - itemBody := "" - - if !item.IpAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) - } else if item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) - } - - if !item.MacAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) - } else if !item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } + } + + if !item.TimerVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) + } + } else if item.Timer.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } + } + if item.TrackOmp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{}) + for _, childItem := range item.Ipv6Addresses { + itemChildBody := "" + + if !childItem.LinkLocalAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString()) + } + } else if !childItem.LinkLocalAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) + } + } + + if !childItem.GlobalAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString()) + } + } else if childItem.GlobalAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"vrrp", []interface{}{}) + for _, item := range data.Ipv4Vrrps { + itemBody := "" + + if !item.GroupIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString()) + } + } else if !item.GroupId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) + } + } + + if !item.PriorityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) + } + } else if item.Priority.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "priority.value", 100) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } + } + + if !item.TimerVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) + } + } else if item.Timer.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } + } + if item.TrackOmp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } + } + + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{}) + for _, childItem := range item.SecondaryAddresses { + itemChildBody := "" + + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipAddress.value", childItem.Address.ValueString()) + } + } + + if !childItem.SubnetMaskVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMaskVariable.ValueString()) + } + } else if !childItem.SubnetMask.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "subnetMask.value", childItem.SubnetMask.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody) + } + } + if item.TlocPrefixChange.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) + } + } + if item.TlocPrefChangeValue.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefChangeValue.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"arp", []interface{}{}) + for _, item := range data.Arps { + itemBody := "" + + if !item.IpAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) + } + } else if item.IpAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } + } + + if !item.MacAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) + } + } else if !item.MacAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) + } } if data.TrustsecEnableSgtPropogation.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "default") - body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", false) + if true { + body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "default") + body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", false) + } } else { - body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", data.TrustsecEnableSgtPropogation.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.enableSGTPropogation.value", data.TrustsecEnableSgtPropogation.ValueBool()) + } } if data.TrustsecPropogate.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "default") - body, _ = sjson.Set(body, path+"trustsec.propogate.value", true) + if true { + body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "default") + body, _ = sjson.Set(body, path+"trustsec.propogate.value", true) + } } else { - body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.propogate.value", data.TrustsecPropogate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trustsec.propogate.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.propogate.value", data.TrustsecPropogate.ValueBool()) + } } if !data.TrustsecSecurityGroupTagVariable.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "variable") - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTagVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "variable") + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTagVariable.ValueString()) + } } else if data.TrustsecSecurityGroupTag.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTag.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.securityGroupTag.value", data.TrustsecSecurityGroupTag.ValueInt64()) + } } if data.TrustsecEnableEnforcedPropogation.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.value", data.TrustsecEnableEnforcedPropogation.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.enableEnforcedPropogation.value", data.TrustsecEnableEnforcedPropogation.ValueBool()) + } } if !data.TrustsecEnforcedSecurityGroupTagVariable.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "variable") - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTagVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "variable") + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTagVariable.ValueString()) + } } else if data.TrustsecEnforcedSecurityGroupTag.IsNull() { - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "global") - body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTag.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.optionType", "global") + body, _ = sjson.Set(body, path+"trustsec.enforcedSecurityGroupTag.value", data.TrustsecEnforcedSecurityGroupTag.ValueInt64()) + } } if !data.DuplexVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString()) + } } else if data.Duplex.IsNull() { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + } } if !data.MacAddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString()) + } } else if data.MacAddress.IsNull() { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + } } else if data.InterfaceMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.SpeedVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString()) + } } else if data.Speed.IsNull() { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + } } if !data.ArpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + } } else if data.ArpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.AutonegotiateVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString()) + } } else if data.Autonegotiate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + } } if !data.MediaTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString()) + } } else if data.MediaType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + } } if !data.LoadIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString()) + } } else if data.LoadInterval.IsNull() { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) + } } else { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + } } if !data.TrackerVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString()) + } } else if data.Tracker.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + } } if !data.IcmpRedirectDisableVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + } } else if data.IcmpRedirectDisable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } if !data.XconnectVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.XconnectVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.XconnectVariable.ValueString()) + } } else if data.Xconnect.IsNull() { - body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.Xconnect.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.xconnect.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.xconnect.value", data.Xconnect.ValueString()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + } } else if data.IpDirectedBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go index 9784013c..a6359158 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_gre_profile_parcel.go @@ -92,130 +92,196 @@ func (data ServiceLANVPNInterfaceGRE) toBody(ctx context.Context) string { path := "data." if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") - body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") + body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.description.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"basic.description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.description.optionType", "global") - body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "global") + body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"basic.shutdown.value", false) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"basic.shutdown.value", false) + } } else { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString()) + } } else if !data.TunnelSourceInterfaceLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + } } if !data.TunnelRouteViaLoopbackVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString()) + } } else if !data.TunnelRouteViaLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default") - body, _ = sjson.Set(body, path+"basic.mtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default") + body, _ = sjson.Set(body, path+"basic.mtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") - body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") + body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + } } else if data.ClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString()) + } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go index 2701e150..33637e43 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_ipsec_profile_parcel.go @@ -123,299 +123,457 @@ func (data ServiceLANVPNInterfaceIPSec) toBody(ctx context.Context) string { path := "data." if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"ifName.optionType", "variable") - body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifName.optionType", "variable") + body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"ifName.optionType", "global") - body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifName.optionType", "global") + body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + } } if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"address.address.optionType", "global") - body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.address.optionType", "global") + body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"address.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString()) + } } else if !data.TunnelSourceIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString()) + } } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"application.optionType", "variable") - body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"application.optionType", "variable") + body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString()) + } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"application.optionType", "global") - body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"application.optionType", "global") + body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable") - body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable") + body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + } } else if data.ClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"mtu.optionType", "variable") - body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "variable") + body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"mtu.optionType", "default") - body, _ = sjson.Set(body, path+"mtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "default") + body, _ = sjson.Set(body, path+"mtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"mtu.optionType", "global") - body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "global") + body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + } } if !data.DpdIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString()) + } } else if data.DpdInterval.IsNull() { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default") - body, _ = sjson.Set(body, path+"dpdInterval.value", 10) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default") + body, _ = sjson.Set(body, path+"dpdInterval.value", 10) + } } else { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") - body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") + body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + } } if !data.DpdRetriesVariable.IsNull() { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable") - body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable") + body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString()) + } } else if data.DpdRetries.IsNull() { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default") - body, _ = sjson.Set(body, path+"dpdRetries.value", 3) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default") + body, _ = sjson.Set(body, path+"dpdRetries.value", 3) + } } else { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") - body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") + body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + } } if !data.IkePresharedKeyVariable.IsNull() { - body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable") - body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable") + body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString()) + } } else if !data.IkePresharedKey.IsNull() { - body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") - body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + if true { + body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") + body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + } } if data.IkeVersion.IsNull() { - body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default") - body, _ = sjson.Set(body, path+"ikeVersion.value", 1) + if true { + body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default") + body, _ = sjson.Set(body, path+"ikeVersion.value", 1) + } } else { - body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") - body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") + body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + } } if !data.IkeIntegrityProtocolVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString()) + } } else if data.IkeIntegrityProtocol.IsNull() { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "default") - body, _ = sjson.Set(body, path+"ikeMode.value", "main") + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "default") + body, _ = sjson.Set(body, path+"ikeMode.value", "main") + } } else { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") - body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") + body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + } } if !data.IkeRekeyIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString()) + } } else if data.IkeRekeyInterval.IsNull() { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400) + } } else { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + } } if !data.IkeCiphersuiteVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString()) + } } else if data.IkeCiphersuite.IsNull() { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1") + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1") + } } else { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + } } if !data.IkeDiffieHellmanGroupVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString()) + } } else if data.IkeDiffieHellmanGroup.IsNull() { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default") - body, _ = sjson.Set(body, path+"ikeGroup.value", "16") + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default") + body, _ = sjson.Set(body, path+"ikeGroup.value", "16") + } } else { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") - body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") + body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + } } if !data.IkeIdLocalEndPointVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString()) + } } else if data.IkeIdLocalEndPoint.IsNull() { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + } } if !data.IkeIdRemoteEndPointVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString()) + } } else if data.IkeIdRemoteEndPoint.IsNull() { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + } } if !data.IpsecRekeyIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString()) + } } else if data.IpsecRekeyInterval.IsNull() { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600) + } } else { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + } } if !data.IpsecReplayWindowVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString()) + } } else if data.IpsecReplayWindow.IsNull() { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512) + } } else { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + } } if !data.IpsecCiphersuiteVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString()) + } } else if data.IpsecCiphersuite.IsNull() { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm") + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm") + } } else { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + } } if !data.PerfectForwardSecrecyVariable.IsNull() { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString()) + } } else if data.PerfectForwardSecrecy.IsNull() { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16") + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16") + } } else { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + } } if !data.TrackerIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"tracker.optionType", "variable") - body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "variable") + body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString()) + } } else if data.TrackerId.IsNull() { - body, _ = sjson.Set(body, path+"tracker.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tracker.optionType", "global") - body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "global") + body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + } } if !data.TunnelRouteViaVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString()) + } } else if data.TunnelRouteVia.IsNull() { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go index 440fb027..8b5f8e8d 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_interface_svi_profile_parcel.go @@ -176,419 +176,633 @@ func (data ServiceLANVPNInterfaceSVI) toBody(ctx context.Context) string { path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.InterfaceMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"ifMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtuVariable.ValueString()) + } } else if data.InterfaceMtu.IsNull() { - body, _ = sjson.Set(body, path+"ifMtu.optionType", "default") - body, _ = sjson.Set(body, path+"ifMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"ifMtu.optionType", "default") + body, _ = sjson.Set(body, path+"ifMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"ifMtu.optionType", "global") - body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ifMtu.optionType", "global") + body, _ = sjson.Set(body, path+"ifMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"ipMtu.optionType", "default") - body, _ = sjson.Set(body, path+"ipMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"ipMtu.optionType", "default") + body, _ = sjson.Set(body, path+"ipMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"ipv4.addressV4.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"ipv4.addressV4.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } - body, _ = sjson.Set(body, path+"ipv4.secondaryAddressV4", []interface{}{}) - for _, item := range data.Ipv4SecondaryAddresses { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"ipv4.secondaryAddressV4", []interface{}{}) + for _, item := range data.Ipv4SecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } - if !item.Ipv4SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMaskVariable.ValueString()) - } else if !item.Ipv4SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMask.ValueString()) + if !item.Ipv4SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMaskVariable.ValueString()) + } + } else if !item.Ipv4SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.Ipv4SubnetMask.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv4.secondaryAddressV4.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv4.secondaryAddressV4.-1", itemBody) } if !data.Ipv4DhcpHelpersVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", data.Ipv4DhcpHelpersVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", data.Ipv4DhcpHelpersVariable.ValueString()) + } } else if data.Ipv4DhcpHelpers.IsNull() { - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "global") - var values []string - data.Ipv4DhcpHelpers.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", values) + if true { + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.optionType", "global") + var values []string + data.Ipv4DhcpHelpers.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"ipv4.dhcpHelperV4.value", values) + } } if !data.Ipv6AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6AddressVariable.ValueString()) + } } else if data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6Address.ValueString()) - } - body, _ = sjson.Set(body, path+"ipv6.secondaryAddressV6", []interface{}{}) - for _, item := range data.Ipv6SecondaryAddresses { - itemBody := "" - - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"ipv6.secondaryAddressV6.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ipv6.dhcpHelperV6", []interface{}{}) - for _, item := range data.Ipv6DhcpHelpers { - itemBody := "" - - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) - } - - if !item.VpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) - } else if item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"ipv6.dhcpHelperV6.-1", itemBody) - } - body, _ = sjson.Set(body, path+"arp", []interface{}{}) - for _, item := range data.Arps { - itemBody := "" - - if !item.IpAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) - } else if !item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) - } - - if !item.MacAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) - } else if !item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) - } - body, _ = sjson.Set(body, path+"vrrp", []interface{}{}) - for _, item := range data.Ipv4Vrrps { - itemBody := "" - - if !item.GroupIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString()) - } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) - } - - if !item.PriorityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) - } else if item.Priority.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "priority.value", 100) - } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) - } - - if !item.TimerVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) - } else if item.Timer.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) - } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) - } - - if !item.TrackOmpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString()) - } else if item.TrackOmp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) - } - - if !item.PrefixListVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixListVariable.ValueString()) - } else if item.PrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixList.ValueString()) - } - - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{}) - for _, childItem := range item.SecondaryAddresses { - itemChildBody := "" - - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody) - } - if item.TlocPrefixChange.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) - } - - if !item.TlocPrefixChangeValueVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValueVariable.ValueString()) - } else if !item.TlocPrefixChangeValue.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValue.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody) - } - body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{}) - for _, item := range data.Ipv6Vrrps { - itemBody := "" - - if !item.GroupIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString()) - } else if !item.GroupId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) - } - - if !item.PriorityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) - } else if item.Priority.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "priority.value", 100) - } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) - } - - if !item.TimerVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) - } else if item.Timer.IsNull() { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) - } else { - itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) - } - - if !item.TrackOmpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString()) - } else if item.TrackOmp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) - } - - if !item.TrackPrefixListVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixListVariable.ValueString()) - } else if item.TrackPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixList.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{}) - for _, childItem := range item.Addresses { - itemChildBody := "" - - if !childItem.LinkLocalAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString()) - } else if !childItem.LinkLocalAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) - } - - if !childItem.GlobalAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString()) - } else if childItem.GlobalAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ipv6.addressV6.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6.addressV6.value", data.Ipv6Address.ValueString()) + } + } + if true { + body, _ = sjson.Set(body, path+"ipv6.secondaryAddressV6", []interface{}{}) + for _, item := range data.Ipv6SecondaryAddresses { + itemBody := "" + + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6.secondaryAddressV6.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"ipv6.dhcpHelperV6", []interface{}{}) + for _, item := range data.Ipv6DhcpHelpers { + itemBody := "" + + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + + if !item.VpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) + } + } else if item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6.dhcpHelperV6.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"arp", []interface{}{}) + for _, item := range data.Arps { + itemBody := "" + + if !item.IpAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) + } + } else if !item.IpAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } + } + + if !item.MacAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) + } + } else if !item.MacAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"vrrp", []interface{}{}) + for _, item := range data.Ipv4Vrrps { + itemBody := "" + + if !item.GroupIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupIdVariable.ValueString()) + } + } else if !item.GroupId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group_id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "group_id.value", item.GroupId.ValueInt64()) + } + } + + if !item.PriorityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) + } + } else if item.Priority.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "priority.value", 100) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } + } + + if !item.TimerVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) + } + } else if item.Timer.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } + } + + if !item.TrackOmpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString()) + } + } else if item.TrackOmp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } + } + if !item.PrefixListVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixListVariable.ValueString()) + } + } else if item.PrefixList.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "default") + + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "prefixList.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefixList.value", item.PrefixList.ValueString()) + } + } + + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddressSecondary", []interface{}{}) + for _, childItem := range item.SecondaryAddresses { + itemChildBody := "" + + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ipAddressSecondary.-1", itemChildBody) + } + } + if item.TlocPrefixChange.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChange.value", item.TlocPrefixChange.ValueBool()) + } + } + + if !item.TlocPrefixChangeValueVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValueVariable.ValueString()) + } + } else if !item.TlocPrefixChangeValue.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlocPrefChangeValue.value", item.TlocPrefixChangeValue.ValueInt64()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"vrrp.-1", itemBody) } - itemBody, _ = sjson.Set(itemBody, "ipv6Secondary", []interface{}{}) - for _, childItem := range item.SecondaryAddresses { - itemChildBody := "" + } + if true { + body, _ = sjson.Set(body, path+"vrrpIpv6", []interface{}{}) + for _, item := range data.Ipv6Vrrps { + itemBody := "" - if !childItem.PrefixVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString()) - } else if !childItem.Prefix.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + if !item.GroupIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupIdVariable.ValueString()) + } + } else if !item.GroupId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "groupId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupId.value", item.GroupId.ValueInt64()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "ipv6Secondary.-1", itemChildBody) + + if !item.PriorityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) + } + } else if item.Priority.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "priority.value", 100) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueInt64()) + } + } + + if !item.TimerVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.TimerVariable.ValueString()) + } + } else if item.Timer.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "timer.value", 1000) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "timer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "timer.value", item.Timer.ValueInt64()) + } + } + + if !item.TrackOmpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmpVariable.ValueString()) + } + } else if item.TrackOmp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "trackOmp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackOmp.value", item.TrackOmp.ValueBool()) + } + } + + if !item.TrackPrefixListVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixListVariable.ValueString()) + } + } else if item.TrackPrefixList.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackPrefixList.value", item.TrackPrefixList.ValueString()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "ipv6", []interface{}{}) + for _, childItem := range item.Addresses { + itemChildBody := "" + + if !childItem.LinkLocalAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddressVariable.ValueString()) + } + } else if !childItem.LinkLocalAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "ipv6LinkLocal.value", childItem.LinkLocalAddress.ValueString()) + } + } + + if !childItem.GlobalAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddressVariable.ValueString()) + } + } else if childItem.GlobalAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.GlobalAddress.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ipv6.-1", itemChildBody) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "ipv6Secondary", []interface{}{}) + for _, childItem := range item.SecondaryAddresses { + itemChildBody := "" + + if !childItem.PrefixVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString()) + } + } else if !childItem.Prefix.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "ipv6Secondary.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"vrrpIpv6.-1", itemBody) } if !data.EnableDhcpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "variable") - body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "variable") + body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6Variable.ValueString()) + } } else if data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "default") - body, _ = sjson.Set(body, path+"dhcpClientV6.value", false) + if true { + body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "default") + body, _ = sjson.Set(body, path+"dhcpClientV6.value", false) + } } else { - body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "global") - body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"dhcpClientV6.optionType", "global") + body, _ = sjson.Set(body, path+"dhcpClientV6.value", data.EnableDhcpv6.ValueBool()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.ArpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + } } else if data.ArpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + } } else if data.IpDirectedBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } if !data.IcmpRedirectDisableVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + } } else if data.IcmpRedirectDisable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go b/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go index fcdb19ab..86cc3e38 100644 --- a/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go +++ b/internal/provider/model_sdwan_service_lan_vpn_profile_parcel.go @@ -336,848 +336,1262 @@ func (data ServiceLANVPN) toBody(ctx context.Context) string { path := "data." if !data.VpnVariable.IsNull() { - body, _ = sjson.Set(body, path+"vpnId.optionType", "variable") - body, _ = sjson.Set(body, path+"vpnId.value", data.VpnVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "variable") + body, _ = sjson.Set(body, path+"vpnId.value", data.VpnVariable.ValueString()) + } } else if data.Vpn.IsNull() { - body, _ = sjson.Set(body, path+"vpnId.optionType", "default") - body, _ = sjson.Set(body, path+"vpnId.value", 0) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "default") + body, _ = sjson.Set(body, path+"vpnId.value", 0) + } } else { - body, _ = sjson.Set(body, path+"vpnId.optionType", "global") - body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "global") + body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + } } if !data.ConfigDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"name.optionType", "variable") - body, _ = sjson.Set(body, path+"name.value", data.ConfigDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"name.optionType", "variable") + body, _ = sjson.Set(body, path+"name.value", data.ConfigDescriptionVariable.ValueString()) + } } else if data.ConfigDescription.IsNull() { - body, _ = sjson.Set(body, path+"name.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"name.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"name.optionType", "global") - body, _ = sjson.Set(body, path+"name.value", data.ConfigDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"name.optionType", "global") + body, _ = sjson.Set(body, path+"name.value", data.ConfigDescription.ValueString()) + } } if !data.OmpAdminDistanceIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4Variable.ValueString()) + } } else if data.OmpAdminDistanceIpv4.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistance.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistance.value", data.OmpAdminDistanceIpv4.ValueInt64()) + } } if !data.OmpAdminDistanceIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6Variable.ValueString()) + } } else if data.OmpAdminDistanceIpv6.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + } } if data.EnableSdwanRemoteAccess.IsNull() { - body, _ = sjson.Set(body, path+"enableSdra.optionType", "default") - body, _ = sjson.Set(body, path+"enableSdra.value", false) + if true { + body, _ = sjson.Set(body, path+"enableSdra.optionType", "default") + body, _ = sjson.Set(body, path+"enableSdra.value", false) + } } else { - body, _ = sjson.Set(body, path+"enableSdra.optionType", "global") - body, _ = sjson.Set(body, path+"enableSdra.value", data.EnableSdwanRemoteAccess.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableSdra.optionType", "global") + body, _ = sjson.Set(body, path+"enableSdra.value", data.EnableSdwanRemoteAccess.ValueBool()) + } } if !data.PrimaryDnsAddressIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) + } } else if data.PrimaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + } } if !data.SecondaryDnsAddressIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) + } } else if !data.SecondaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + } } if !data.PrimaryDnsAddressIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) + } } else if data.PrimaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + } } if !data.SecondaryDnsAddressIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) + } } else if !data.SecondaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) - } - body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) - for _, item := range data.HostMappings { - itemBody := "" - - if !item.HostNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) - } else if !item.HostName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) - } - - if !item.ListOfIpsVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpsVariable.ValueString()) - } else if !item.ListOfIps.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") - var values []string - item.ListOfIps.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) - } - body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ompAdvertiseIp4", []interface{}{}) - for _, item := range data.AdvertiseOmpIpv4s { - itemBody := "" - - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString()) - } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) - } - - for _, childItem := range item.Prefixes { - itemChildBody := "" - - if !childItem.NetworkAddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddressVariable.ValueString()) - } else if !childItem.NetworkAddress.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddress.ValueString()) - } - - if !childItem.SubnetMaskVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMaskVariable.ValueString()) - } else if !childItem.SubnetMask.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMask.ValueString()) - } - if childItem.AggregateOnly.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + } + } + if true { + body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) + for _, item := range data.HostMappings { + itemBody := "" + + if !item.HostNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) + } + } else if !item.HostName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + } } - if !childItem.RegionVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.RegionVariable.ValueString()) - } else if childItem.Region.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "region.value", "core-and-access") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.Region.ValueString()) + if !item.ListOfIpsVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpsVariable.ValueString()) + } + } else if !item.ListOfIps.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") + var values []string + item.ListOfIps.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + } } - itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ompAdvertiseIp4.-1", itemBody) } - body, _ = sjson.Set(body, path+"ompAdvertiseIpv6", []interface{}{}) - for _, item := range data.AdvertiseOmpIpv6s { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"ompAdvertiseIp4", []interface{}{}) + for _, item := range data.AdvertiseOmpIpv4s { + itemBody := "" + + if !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ompProtocol.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()) + } + } + if true { + + for _, childItem := range item.Prefixes { + itemChildBody := "" + + if !childItem.NetworkAddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddressVariable.ValueString()) + } + } else if !childItem.NetworkAddress.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.address.value", childItem.NetworkAddress.ValueString()) + } + } + + if !childItem.SubnetMaskVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMaskVariable.ValueString()) + } + } else if !childItem.SubnetMask.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.mask.value", childItem.SubnetMask.ValueString()) + } + } + if childItem.AggregateOnly.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + } + } - if !item.ProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString()) - } else if !item.Protocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.Protocol.ValueString()) + if !childItem.RegionVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.RegionVariable.ValueString()) + } + } else if childItem.Region.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "region.value", "core-and-access") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "region.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "region.value", childItem.Region.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"ompAdvertiseIp4.-1", itemBody) } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) + } + if true { + body, _ = sjson.Set(body, path+"ompAdvertiseIpv6", []interface{}{}) + for _, item := range data.AdvertiseOmpIpv6s { + itemBody := "" + + if !item.ProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ompProtocol.value", item.ProtocolVariable.ValueString()) + } + } else if !item.Protocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ompProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ompProtocol.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()) + } + } + + if !item.ProtocolSubTypeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubTypeVariable.ValueString()) + } + } else if item.ProtocolSubType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubType.ValueString()) + } + } + if true { + + for _, childItem := range item.Prefixes { + itemChildBody := "" + + if !childItem.PrefixVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString()) + } + } else if !childItem.Prefix.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + } + } + if childItem.AggregateOnly.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"ompAdvertiseIpv6.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{}) + for _, item := range data.Ipv4StaticRoutes { + itemBody := "" + + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } + } + + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } + } + if true { + + for _, childItem := range item.NextHops { + itemChildBody := "" + + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } - if !item.ProtocolSubTypeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubTypeVariable.ValueString()) - } else if item.ProtocolSubType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "default") + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if !childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) + } + } + if true { - } else { - itemBody, _ = sjson.Set(itemBody, "protocolSubType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "protocolSubType.value", item.ProtocolSubType.ValueString()) + for _, childItem := range item.NextHopWithTrackers { + itemChildBody := "" + + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } + + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if !childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + if !childItem.TrackerId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.value", childItem.TrackerId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHopWithTracker.-1", itemChildBody) + } + } + if !item.Null0.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } + } + if !item.GatewayDhcp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.value", item.GatewayDhcp.ValueBool()) + } + } + if !item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.value", item.Vpn.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{}) + for _, item := range data.Ipv6StaticRoutes { + itemBody := "" + + if !item.PrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) + } + } else if !item.Prefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } + } + if true { + + for _, childItem := range item.NextHops { + itemChildBody := "" - for _, childItem := range item.Prefixes { - itemChildBody := "" + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } - if !childItem.PrefixVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.PrefixVariable.ValueString()) - } else if !childItem.Prefix.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "prefix.value", childItem.Prefix.ValueString()) + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if !childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) + } } - if childItem.AggregateOnly.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "aggregateOnly.value", childItem.AggregateOnly.ValueBool()) + if !item.Null0.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } + } + + if !item.NatVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) + } + } else if !item.Nat.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "prefixList.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ompAdvertiseIpv6.-1", itemBody) } - body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{}) - for _, item := range data.Ipv4StaticRoutes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"service", []interface{}{}) + for _, item := range data.Services { + itemBody := "" + + if !item.ServiceTypeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceTypeVariable.ValueString()) + } + } else if !item.ServiceType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + } + } - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + if !item.Ipv4AddressesVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", item.Ipv4AddressesVariable.ValueString()) + } + } else if !item.Ipv4Addresses.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "global") + var values []string + item.Ipv4Addresses.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", values) + } + } + + if !item.TrackingVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tracking.value", item.TrackingVariable.ValueString()) + } + } else if item.Tracking.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tracking.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tracking.value", item.Tracking.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"service.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"serviceRoute", []interface{}{}) + for _, item := range data.ServiceRoutes { + itemBody := "" + + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } + } - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } + } + + if !item.ServiceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "service.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "service.value", item.ServiceVariable.ValueString()) + } + } else if item.Service.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "service.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "service.value", "SIG") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "service.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "service.value", item.Service.ValueString()) + } + } + if !item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"serviceRoute.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"greRoute", []interface{}{}) + for _, item := range data.GreRoutes { + itemBody := "" + + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } + } + + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } + } - for _, childItem := range item.NextHops { - itemChildBody := "" + if !item.InterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString()) + } + } else if item.Interface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default") - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") + var values []string + item.Interface.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "interface.value", values) + } + } + if !item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"greRoute.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"ipsecRoute", []interface{}{}) + for _, item := range data.IpsecRoutes { + itemBody := "" + + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } } - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) + + if !item.InterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString()) + } + } else if item.Interface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") + var values []string + item.Interface.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "interface.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"ipsecRoute.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"natPool", []interface{}{}) + for _, item := range data.NatPools { + itemBody := "" + + if !item.NatPoolNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) + } + } else if !item.NatPoolName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + } + } - for _, childItem := range item.NextHopWithTrackers { - itemChildBody := "" + if !item.PrefixLengthVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLengthVariable.ValueString()) + } + } else if !item.PrefixLength.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLength.ValueInt64()) + } + } - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if !item.RangeStartVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStartVariable.ValueString()) + } + } else if !item.RangeStart.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStart.ValueString()) + } } - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if !item.RangeEndVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEndVariable.ValueString()) + } + } else if !item.RangeEnd.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEnd.ValueString()) + } } - if !childItem.TrackerId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "tracker.refId.value", childItem.TrackerId.ValueString()) + + if !item.OverloadVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "overload.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "overload.value", item.OverloadVariable.ValueString()) + } + } else if item.Overload.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "overload.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "overload.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "overload.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "overload.value", item.Overload.ValueBool()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHopWithTracker.-1", itemChildBody) - } - if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) - } - if !item.GatewayDhcp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.dhcp.value", item.GatewayDhcp.ValueBool()) + + if !item.DirectionVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "direction.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "direction.value", item.DirectionVariable.ValueString()) + } + } else if !item.Direction.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "direction.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "direction.value", item.Direction.ValueString()) + } + } + if !item.TrackerObjectId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"natPool.-1", itemBody) } - if !item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.vpn.value", item.Vpn.ValueBool()) + } + if true { + body, _ = sjson.Set(body, path+"natPortForward", []interface{}{}) + for _, item := range data.NatPortForwards { + itemBody := "" + + if !item.NatPoolNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) + } + } else if item.NatPoolName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + } + } + + if !item.SourcePortVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePortVariable.ValueString()) + } + } else if !item.SourcePort.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePort.ValueInt64()) + } + } + + if !item.TranslatePortVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePortVariable.ValueString()) + } + } else if !item.TranslatePort.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePort.ValueInt64()) + } + } + + if !item.SourceIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) + } + } else if !item.SourceIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } + } + + if !item.TranslatedSourceIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString()) + } + } else if !item.TranslatedSourceIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.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()) + } + } + body, _ = sjson.SetRaw(body, path+"natPortForward.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } - body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{}) - for _, item := range data.Ipv6StaticRoutes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"staticNat", []interface{}{}) + for _, item := range data.StaticNats { + itemBody := "" + + if !item.NatPoolNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) + } + } else if item.NatPoolName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default") - if !item.PrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) - } else if !item.Prefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) + } + } + + if !item.SourceIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) + } + } else if !item.SourceIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } + } + + if !item.TranslatedSourceIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString()) + } + } else if !item.TranslatedSourceIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) + } + } + + if !item.StaticNatDirectionVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirectionVariable.ValueString()) + } + } else if !item.StaticNatDirection.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirection.ValueString()) + } + } + if !item.TrackerObjectId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"staticNat.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{}) + for _, item := range data.Nat64V4Pools { + itemBody := "" + + if !item.NameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.NameVariable.ValueString()) + } + } else if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Name.ValueString()) + } + } - for _, childItem := range item.NextHops { - itemChildBody := "" + if !item.RangeStartVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStartVariable.ValueString()) + } + } else if !item.RangeStart.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStart.ValueString()) + } + } - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) - } - - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if !item.RangeEndVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEndVariable.ValueString()) + } + } else if !item.RangeEnd.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEnd.ValueString()) + } + } + + if !item.OverloadVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.OverloadVariable.ValueString()) + } + } else if item.Overload.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Overload.ValueBool()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody) } - if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } + if true { + body, _ = sjson.Set(body, path+"routeLeakFromGlobal", []interface{}{}) + for _, item := range data.RouteLeakFromGlobalVpns { + itemBody := "" + + if !item.RouteProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) + } + } else if !item.RouteProtocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.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()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) + for _, childItem := range item.Redistributions { + itemChildBody := "" + + if !childItem.ProtocolVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) + } + } else if !childItem.Protocol.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + } + } + if !childItem.RedistributionPolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"routeLeakFromGlobal.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"routeLeakFromService", []interface{}{}) + for _, item := range data.RouteLeakToGlobalVpns { + itemBody := "" + + if !item.RouteProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) + } + } else if !item.RouteProtocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.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()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) + for _, childItem := range item.Redistributions { + itemChildBody := "" - if !item.NatVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) - } else if !item.Nat.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) - } - body, _ = sjson.Set(body, path+"service", []interface{}{}) - for _, item := range data.Services { - itemBody := "" - - if !item.ServiceTypeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceTypeVariable.ValueString()) - } else if !item.ServiceType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) - } + if !childItem.ProtocolVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) + } + } else if !childItem.Protocol.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + } + } + if !childItem.RedistributionPolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"routeLeakFromService.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"routeLeakBetweenServices", []interface{}{}) + for _, item := range data.RouteLeakFromOtherServices { + itemBody := "" + + if !item.SourceVpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) + } + } else if !item.SourceVpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + } + } - if !item.Ipv4AddressesVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", item.Ipv4AddressesVariable.ValueString()) - } else if !item.Ipv4Addresses.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.optionType", "global") - var values []string - item.Ipv4Addresses.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "ipv4Addresses.value", values) - } - - if !item.TrackingVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tracking.value", item.TrackingVariable.ValueString()) - } else if item.Tracking.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tracking.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "tracking.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tracking.value", item.Tracking.ValueBool()) - } - body, _ = sjson.SetRaw(body, path+"service.-1", itemBody) - } - body, _ = sjson.Set(body, path+"serviceRoute", []interface{}{}) - for _, item := range data.ServiceRoutes { - itemBody := "" - - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) - } - - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) - } - - if !item.ServiceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "service.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "service.value", item.ServiceVariable.ValueString()) - } else if item.Service.IsNull() { - itemBody, _ = sjson.Set(itemBody, "service.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "service.value", "SIG") - } else { - itemBody, _ = sjson.Set(itemBody, "service.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "service.value", item.Service.ValueString()) - } - if !item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"serviceRoute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"greRoute", []interface{}{}) - for _, item := range data.GreRoutes { - itemBody := "" - - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) - } - - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) - } - - if !item.InterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString()) - } else if item.Interface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") - var values []string - item.Interface.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "interface.value", values) - } - if !item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"greRoute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ipsecRoute", []interface{}{}) - for _, item := range data.IpsecRoutes { - itemBody := "" - - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) - } - - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) - } - - if !item.InterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "interface.value", item.InterfaceVariable.ValueString()) - } else if item.Interface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "interface.optionType", "global") - var values []string - item.Interface.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "interface.value", values) - } - body, _ = sjson.SetRaw(body, path+"ipsecRoute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"natPool", []interface{}{}) - for _, item := range data.NatPools { - itemBody := "" - - if !item.NatPoolNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) - } else if !item.NatPoolName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) - } - - if !item.PrefixLengthVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLengthVariable.ValueString()) - } else if !item.PrefixLength.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefixLength.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefixLength.value", item.PrefixLength.ValueInt64()) - } - - if !item.RangeStartVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStartVariable.ValueString()) - } else if !item.RangeStart.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rangeStart.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rangeStart.value", item.RangeStart.ValueString()) - } - - if !item.RangeEndVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEndVariable.ValueString()) - } else if !item.RangeEnd.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rangeEnd.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rangeEnd.value", item.RangeEnd.ValueString()) - } - - if !item.OverloadVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "overload.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "overload.value", item.OverloadVariable.ValueString()) - } else if item.Overload.IsNull() { - itemBody, _ = sjson.Set(itemBody, "overload.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "overload.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "overload.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "overload.value", item.Overload.ValueBool()) - } + if !item.RouteProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) + } + } else if !item.RouteProtocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.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()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) + for _, childItem := range item.Redistributions { + itemChildBody := "" - if !item.DirectionVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "direction.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "direction.value", item.DirectionVariable.ValueString()) - } else if !item.Direction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "direction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "direction.value", item.Direction.ValueString()) - } - if !item.TrackerObjectId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"natPool.-1", itemBody) + if !childItem.ProtocolVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) + } + } else if !childItem.Protocol.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) + } + } + if !childItem.RedistributionPolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"routeLeakBetweenServices.-1", itemBody) + } } - body, _ = sjson.Set(body, path+"natPortForward", []interface{}{}) - for _, item := range data.NatPortForwards { - itemBody := "" - - if !item.NatPoolNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) - } else if item.NatPoolName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) - } - - if !item.SourcePortVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePortVariable.ValueString()) - } else if !item.SourcePort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourcePort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourcePort.value", item.SourcePort.ValueInt64()) - } - - if !item.TranslatePortVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePortVariable.ValueString()) - } else if !item.TranslatePort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translatePort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translatePort.value", item.TranslatePort.ValueInt64()) - } - - if !item.SourceIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) - } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) - } - - if !item.TranslatedSourceIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString()) - } else if !item.TranslatedSourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) - } - - if !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()) - } - body, _ = sjson.SetRaw(body, path+"natPortForward.-1", itemBody) - } - body, _ = sjson.Set(body, path+"staticNat", []interface{}{}) - for _, item := range data.StaticNats { - itemBody := "" - - if !item.NatPoolNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolNameVariable.ValueString()) - } else if item.NatPoolName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "natPoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "natPoolName.value", item.NatPoolName.ValueInt64()) - } - - if !item.SourceIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) - } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) - } - - if !item.TranslatedSourceIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIpVariable.ValueString()) - } else if !item.TranslatedSourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "TranslatedSourceIp.value", item.TranslatedSourceIp.ValueString()) - } - - if !item.StaticNatDirectionVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirectionVariable.ValueString()) - } else if !item.StaticNatDirection.IsNull() { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.StaticNatDirection.ValueString()) - } - if !item.TrackerObjectId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackingObject.trackerId.refId.value", item.TrackerObjectId.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"staticNat.-1", itemBody) - } - body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{}) - for _, item := range data.Nat64V4Pools { - itemBody := "" - - if !item.NameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.NameVariable.ValueString()) - } else if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Name.ValueString()) - } - - if !item.RangeStartVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStartVariable.ValueString()) - } else if !item.RangeStart.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.RangeStart.ValueString()) - } - - if !item.RangeEndVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEndVariable.ValueString()) - } else if !item.RangeEnd.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.RangeEnd.ValueString()) - } - - if !item.OverloadVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.OverloadVariable.ValueString()) - } else if item.Overload.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Overload.ValueBool()) - } - body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody) - } - body, _ = sjson.Set(body, path+"routeLeakFromGlobal", []interface{}{}) - for _, item := range data.RouteLeakFromGlobalVpns { - itemBody := "" - - if !item.RouteProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) - } else if !item.RouteProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) - for _, childItem := range item.Redistributions { - itemChildBody := "" - - if !childItem.ProtocolVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) - } else if !childItem.Protocol.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) - } - if !childItem.RedistributionPolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"routeLeakFromGlobal.-1", itemBody) - } - body, _ = sjson.Set(body, path+"routeLeakFromService", []interface{}{}) - for _, item := range data.RouteLeakToGlobalVpns { - itemBody := "" - - if !item.RouteProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) - } else if !item.RouteProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) - for _, childItem := range item.Redistributions { - itemChildBody := "" - - if !childItem.ProtocolVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) - } else if !childItem.Protocol.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) - } - if !childItem.RedistributionPolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"routeLeakFromService.-1", itemBody) - } - body, _ = sjson.Set(body, path+"routeLeakBetweenServices", []interface{}{}) - for _, item := range data.RouteLeakFromOtherServices { - itemBody := "" - - if !item.SourceVpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) - } else if !item.SourceVpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) - } - - if !item.RouteProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocolVariable.ValueString()) - } else if !item.RouteProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routeProtocol.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routeProtocol.value", item.RouteProtocol.ValueString()) - } - if !item.RoutePolicyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "routePolicy.refId.value", item.RoutePolicyId.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "redistributeToProtocol", []interface{}{}) - for _, childItem := range item.Redistributions { - itemChildBody := "" - - if !childItem.ProtocolVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.ProtocolVariable.ValueString()) - } else if !childItem.Protocol.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "protocol.value", childItem.Protocol.ValueString()) - } - if !childItem.RedistributionPolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "policy.refId.value", childItem.RedistributionPolicyId.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "redistributeToProtocol.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"routeLeakBetweenServices.-1", itemBody) - } - body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.importRtList", []interface{}{}) - for _, item := range data.Ipv4ImportRouteTargets { - itemBody := "" - - if !item.RouteTargetVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) - } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.importRtList.-1", itemBody) - } - body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.exportRtList", []interface{}{}) - for _, item := range data.Ipv4ExportRouteTargets { - itemBody := "" - - if !item.RouteTargetVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) - } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.exportRtList.-1", itemBody) - } - body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.importRtList", []interface{}{}) - for _, item := range data.Ipv6ImportRouteTargets { - itemBody := "" - - if !item.RouteTargetVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) - } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.importRtList.-1", itemBody) - } - body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.exportRtList", []interface{}{}) - for _, item := range data.Ipv6ExportRouteTargets { - itemBody := "" - - if !item.RouteTargetVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) - } else if !item.RouteTarget.IsNull() { - itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + if true { + body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.importRtList", []interface{}{}) + for _, item := range data.Ipv4ImportRouteTargets { + itemBody := "" + + if !item.RouteTargetVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) + } + } else if !item.RouteTarget.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.importRtList.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"mplsVpnIpv4RouteTarget.exportRtList", []interface{}{}) + for _, item := range data.Ipv4ExportRouteTargets { + itemBody := "" + + if !item.RouteTargetVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) + } + } else if !item.RouteTarget.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"mplsVpnIpv4RouteTarget.exportRtList.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.importRtList", []interface{}{}) + for _, item := range data.Ipv6ImportRouteTargets { + itemBody := "" + + if !item.RouteTargetVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) + } + } else if !item.RouteTarget.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.importRtList.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"mplsVpnIpv6RouteTarget.exportRtList", []interface{}{}) + for _, item := range data.Ipv6ExportRouteTargets { + itemBody := "" + + if !item.RouteTargetVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTargetVariable.ValueString()) + } + } else if !item.RouteTarget.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "rt.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "rt.value", item.RouteTarget.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.exportRtList.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"mplsVpnIpv6RouteTarget.exportRtList.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_service_object_tracker_group_profile_parcel.go b/internal/provider/model_sdwan_service_object_tracker_group_profile_parcel.go index ec6501ac..bcee4e79 100644 --- a/internal/provider/model_sdwan_service_object_tracker_group_profile_parcel.go +++ b/internal/provider/model_sdwan_service_object_tracker_group_profile_parcel.go @@ -72,31 +72,45 @@ func (data ServiceObjectTrackerGroup) toBody(ctx context.Context) string { path := "data." if !data.ObjectTrackerIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"objectId.optionType", "variable") - body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"objectId.optionType", "variable") + body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerIdVariable.ValueString()) + } } else if !data.ObjectTrackerId.IsNull() { - body, _ = sjson.Set(body, path+"objectId.optionType", "global") - body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"objectId.optionType", "global") + body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerId.ValueInt64()) + } } + if true { - for _, item := range data.TrackerElements { - itemBody := "" - if !item.ObjectTrackerId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.ObjectTrackerId.ValueString()) + for _, item := range data.TrackerElements { + itemBody := "" + if !item.ObjectTrackerId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.ObjectTrackerId.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } if !data.ReachableVariable.IsNull() { - body, _ = sjson.Set(body, path+"criteria.optionType", "variable") - body, _ = sjson.Set(body, path+"criteria.value", data.ReachableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"criteria.optionType", "variable") + body, _ = sjson.Set(body, path+"criteria.value", data.ReachableVariable.ValueString()) + } } else if data.Reachable.IsNull() { - body, _ = sjson.Set(body, path+"criteria.optionType", "default") - body, _ = sjson.Set(body, path+"criteria.value", "or") + if true { + body, _ = sjson.Set(body, path+"criteria.optionType", "default") + body, _ = sjson.Set(body, path+"criteria.value", "or") + } } else { - body, _ = sjson.Set(body, path+"criteria.optionType", "global") - body, _ = sjson.Set(body, path+"criteria.value", data.Reachable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"criteria.optionType", "global") + body, _ = sjson.Set(body, path+"criteria.value", data.Reachable.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_service_object_tracker_profile_parcel.go b/internal/provider/model_sdwan_service_object_tracker_profile_parcel.go index e14bbaad..61a342a4 100644 --- a/internal/provider/model_sdwan_service_object_tracker_profile_parcel.go +++ b/internal/provider/model_sdwan_service_object_tracker_profile_parcel.go @@ -74,53 +74,79 @@ func (data ServiceObjectTracker) toBody(ctx context.Context) string { path := "data." if !data.ObjectTrackerIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"objectId.optionType", "variable") - body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"objectId.optionType", "variable") + body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerIdVariable.ValueString()) + } } else if !data.ObjectTrackerId.IsNull() { - body, _ = sjson.Set(body, path+"objectId.optionType", "global") - body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"objectId.optionType", "global") + body, _ = sjson.Set(body, path+"objectId.value", data.ObjectTrackerId.ValueInt64()) + } } if !data.ObjectTrackerType.IsNull() { - body, _ = sjson.Set(body, path+"objectTrackerType.optionType", "global") - body, _ = sjson.Set(body, path+"objectTrackerType.value", data.ObjectTrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"objectTrackerType.optionType", "global") + body, _ = sjson.Set(body, path+"objectTrackerType.value", data.ObjectTrackerType.ValueString()) + } } if !data.InterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"interface.optionType", "variable") - body, _ = sjson.Set(body, path+"interface.value", data.InterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interface.optionType", "variable") + body, _ = sjson.Set(body, path+"interface.value", data.InterfaceVariable.ValueString()) + } } else if !data.Interface.IsNull() { - body, _ = sjson.Set(body, path+"interface.optionType", "global") - body, _ = sjson.Set(body, path+"interface.value", data.Interface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interface.optionType", "global") + body, _ = sjson.Set(body, path+"interface.value", data.Interface.ValueString()) + } } if !data.RouteIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"routeIp.optionType", "variable") - body, _ = sjson.Set(body, path+"routeIp.value", data.RouteIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routeIp.optionType", "variable") + body, _ = sjson.Set(body, path+"routeIp.value", data.RouteIpVariable.ValueString()) + } } else if !data.RouteIp.IsNull() { - body, _ = sjson.Set(body, path+"routeIp.optionType", "global") - body, _ = sjson.Set(body, path+"routeIp.value", data.RouteIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routeIp.optionType", "global") + body, _ = sjson.Set(body, path+"routeIp.value", data.RouteIp.ValueString()) + } } if !data.RouteMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"routeMask.optionType", "variable") - body, _ = sjson.Set(body, path+"routeMask.value", data.RouteMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routeMask.optionType", "variable") + body, _ = sjson.Set(body, path+"routeMask.value", data.RouteMaskVariable.ValueString()) + } } else if data.RouteMask.IsNull() { - body, _ = sjson.Set(body, path+"routeMask.optionType", "default") - body, _ = sjson.Set(body, path+"routeMask.value", "0.0.0.0") + if true { + body, _ = sjson.Set(body, path+"routeMask.optionType", "default") + body, _ = sjson.Set(body, path+"routeMask.value", "0.0.0.0") + } } else { - body, _ = sjson.Set(body, path+"routeMask.optionType", "global") - body, _ = sjson.Set(body, path+"routeMask.value", data.RouteMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"routeMask.optionType", "global") + body, _ = sjson.Set(body, path+"routeMask.value", data.RouteMask.ValueString()) + } } if !data.VpnVariable.IsNull() { - body, _ = sjson.Set(body, path+"vpn.optionType", "variable") - body, _ = sjson.Set(body, path+"vpn.value", data.VpnVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"vpn.optionType", "variable") + body, _ = sjson.Set(body, path+"vpn.value", data.VpnVariable.ValueString()) + } } else if data.Vpn.IsNull() { - body, _ = sjson.Set(body, path+"vpn.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"vpn.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"vpn.optionType", "global") - body, _ = sjson.Set(body, path+"vpn.value", data.Vpn.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"vpn.optionType", "global") + body, _ = sjson.Set(body, path+"vpn.value", data.Vpn.ValueInt64()) + } } return body } diff --git a/internal/provider/model_sdwan_service_tracker_group_profile_parcel.go b/internal/provider/model_sdwan_service_tracker_group_profile_parcel.go index c45e4a6b..5b961f26 100644 --- a/internal/provider/model_sdwan_service_tracker_group_profile_parcel.go +++ b/internal/provider/model_sdwan_service_tracker_group_profile_parcel.go @@ -68,25 +68,35 @@ func (data ServiceTrackerGroup) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." - - for _, item := range data.TrackerElements { - itemBody := "" - if !item.TrackerId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString()) + if true { + + for _, item := range data.TrackerElements { + itemBody := "" + if !item.TrackerId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } if !data.TrackerBooleanVariable.IsNull() { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable") - body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable") + body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString()) + } } else if data.TrackerBoolean.IsNull() { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default") - body, _ = sjson.Set(body, path+"combineBoolean.value", "or") + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default") + body, _ = sjson.Set(body, path+"combineBoolean.value", "or") + } } else { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global") - body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString()) + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global") + body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_service_tracker_profile_parcel.go b/internal/provider/model_sdwan_service_tracker_profile_parcel.go index 81d9152f..80383631 100644 --- a/internal/provider/model_sdwan_service_tracker_profile_parcel.go +++ b/internal/provider/model_sdwan_service_tracker_profile_parcel.go @@ -85,106 +85,160 @@ func (data ServiceTracker) toBody(ctx context.Context) string { path := "data." if !data.TrackerNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) + } } else if !data.TrackerName.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "global") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "global") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + } } if !data.EndpointApiUrlVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) + } } else if !data.EndpointApiUrl.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + } } if !data.EndpointDnsNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) + } } else if !data.EndpointDnsName.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + } } if !data.EndpointIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) + } } else if !data.EndpointIp.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + } } if !data.ProtocolVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.ProtocolVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.ProtocolVariable.ValueString()) + } } else if !data.Protocol.IsNull() { - body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.Protocol.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTcpUdp.protocol.value", data.Protocol.ValueString()) + } } if !data.PortVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointTcpUdp.port.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.PortVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTcpUdp.port.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.PortVariable.ValueString()) + } } else if !data.Port.IsNull() { - body, _ = sjson.Set(body, path+"endpointTcpUdp.port.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.Port.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"endpointTcpUdp.port.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTcpUdp.port.value", data.Port.ValueInt64()) + } } if !data.IntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"interval.optionType", "variable") - body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "variable") + body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString()) + } } else if data.Interval.IsNull() { - body, _ = sjson.Set(body, path+"interval.optionType", "default") - body, _ = sjson.Set(body, path+"interval.value", 60) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "default") + body, _ = sjson.Set(body, path+"interval.value", 60) + } } else { - body, _ = sjson.Set(body, path+"interval.optionType", "global") - body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "global") + body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + } } if !data.MultiplierVariable.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") - body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") + body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + } } else if data.Multiplier.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "default") - body, _ = sjson.Set(body, path+"multiplier.value", 3) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "default") + body, _ = sjson.Set(body, path+"multiplier.value", 3) + } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.ThresholdVariable.IsNull() { - body, _ = sjson.Set(body, path+"threshold.optionType", "variable") - body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "variable") + body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString()) + } } else if data.Threshold.IsNull() { - body, _ = sjson.Set(body, path+"threshold.optionType", "default") - body, _ = sjson.Set(body, path+"threshold.value", 300) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "default") + body, _ = sjson.Set(body, path+"threshold.value", 300) + } } else { - body, _ = sjson.Set(body, path+"threshold.optionType", "global") - body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "global") + body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + } } if !data.EndpointTrackerTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString()) + } } else if data.EndpointTrackerType.IsNull() { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", "static-route") + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", "static-route") + } } else { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + } } if !data.TrackerTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerType.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString()) + } } else if data.TrackerType.IsNull() { - body, _ = sjson.Set(body, path+"trackerType.optionType", "default") - body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "default") + body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") + } } else { - body, _ = sjson.Set(body, path+"trackerType.optionType", "global") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "global") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_aaa_profile_parcel.go b/internal/provider/model_sdwan_system_aaa_profile_parcel.go index ce2e0318..86d26702 100644 --- a/internal/provider/model_sdwan_system_aaa_profile_parcel.go +++ b/internal/provider/model_sdwan_system_aaa_profile_parcel.go @@ -157,362 +157,546 @@ func (data SystemAAA) toBody(ctx context.Context) string { path := "data." if !data.AuthenticationGroupVariable.IsNull() { - body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "variable") - body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroupVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "variable") + body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroupVariable.ValueString()) + } } else if data.AuthenticationGroup.IsNull() { - body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "default") - body, _ = sjson.Set(body, path+"authenticationGroup.value", false) + if true { + body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "default") + body, _ = sjson.Set(body, path+"authenticationGroup.value", false) + } } else { - body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "global") - body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroup.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"authenticationGroup.optionType", "global") + body, _ = sjson.Set(body, path+"authenticationGroup.value", data.AuthenticationGroup.ValueBool()) + } } if !data.AccountingGroupVariable.IsNull() { - body, _ = sjson.Set(body, path+"accountingGroup.optionType", "variable") - body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroupVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"accountingGroup.optionType", "variable") + body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroupVariable.ValueString()) + } } else if data.AccountingGroup.IsNull() { - body, _ = sjson.Set(body, path+"accountingGroup.optionType", "default") - body, _ = sjson.Set(body, path+"accountingGroup.value", false) + if true { + body, _ = sjson.Set(body, path+"accountingGroup.optionType", "default") + body, _ = sjson.Set(body, path+"accountingGroup.value", false) + } } else { - body, _ = sjson.Set(body, path+"accountingGroup.optionType", "global") - body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroup.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"accountingGroup.optionType", "global") + body, _ = sjson.Set(body, path+"accountingGroup.value", data.AccountingGroup.ValueBool()) + } } if !data.ServerAuthOrder.IsNull() { - body, _ = sjson.Set(body, path+"serverAuthOrder.optionType", "global") - var values []string - data.ServerAuthOrder.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"serverAuthOrder.value", values) + if true { + body, _ = sjson.Set(body, path+"serverAuthOrder.optionType", "global") + var values []string + data.ServerAuthOrder.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"serverAuthOrder.value", values) + } } + if true { - for _, item := range data.Users { - itemBody := "" + for _, item := range data.Users { + itemBody := "" - if !item.NameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "name.value", item.NameVariable.ValueString()) - } else if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) - } - - if !item.PasswordVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) - } else if !item.Password.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) - } - - if !item.PrivilegeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "privilege.value", item.PrivilegeVariable.ValueString()) - } else if item.Privilege.IsNull() { - itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "privilege.value", "15") - } else { - itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "privilege.value", item.Privilege.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "pubkeyChain", []interface{}{}) - for _, childItem := range item.PublicKeys { - itemChildBody := "" - if !childItem.KeyString.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyString.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyString.value", childItem.KeyString.ValueString()) + if !item.NameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "name.value", item.NameVariable.ValueString()) + } + } else if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } - if !childItem.KeyTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString()) - } else if childItem.KeyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default") + if !item.PasswordVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) + } + } else if !item.Password.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + } + } + if !item.PrivilegeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "privilege.value", item.PrivilegeVariable.ValueString()) + } + } else if item.Privilege.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "privilege.value", "15") + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "privilege.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "privilege.value", item.Privilege.ValueString()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "pubkeyChain.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"user.-1", itemBody) - } - body, _ = sjson.Set(body, path+"radius", []interface{}{}) - for _, item := range data.RadiusGroups { - itemBody := "" - if !item.GroupName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) - } - if item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } + if true { + itemBody, _ = sjson.Set(itemBody, "pubkeyChain", []interface{}{}) + for _, childItem := range item.PublicKeys { + itemChildBody := "" + if !childItem.KeyString.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyString.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyString.value", childItem.KeyString.ValueString()) + } + } - if !item.SourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) - } else if item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") + if !childItem.KeyTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString()) + } + } else if childItem.KeyType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "pubkeyChain.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"user.-1", itemBody) } - itemBody, _ = sjson.Set(itemBody, "server", []interface{}{}) - for _, childItem := range item.Servers { - itemChildBody := "" - if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) - } - - if !childItem.AuthPortVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPortVariable.ValueString()) - } else if childItem.AuthPort.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", 1812) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPort.ValueInt64()) + } + if true { + body, _ = sjson.Set(body, path+"radius", []interface{}{}) + for _, item := range data.RadiusGroups { + itemBody := "" + if !item.GroupName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) + } } - - if !childItem.AcctPortVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPortVariable.ValueString()) - } else if childItem.AcctPort.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", 1813) + if item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPort.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } - if !childItem.TimeoutVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString()) - } else if childItem.Timeout.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) - } + if !item.SourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) + } + } else if item.SourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") - if !childItem.RetransmitVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.RetransmitVariable.ValueString()) - } else if childItem.Retransmit.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", 3) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.Retransmit.ValueInt64()) - } - if !childItem.Key.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "server", []interface{}{}) + for _, childItem := range item.Servers { + itemChildBody := "" + if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } - if !childItem.SecretKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString()) - } else if childItem.SecretKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "default") + if !childItem.AuthPortVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPortVariable.ValueString()) + } + } else if childItem.AuthPort.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", 1812) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "authPort.value", childItem.AuthPort.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) - } - if childItem.KeyEnum.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default") + if !childItem.AcctPortVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPortVariable.ValueString()) + } + } else if childItem.AcctPort.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", 1813) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "acctPort.value", childItem.AcctPort.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) - } + if !childItem.TimeoutVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString()) + } + } else if childItem.Timeout.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) + } + } - if !childItem.KeyTypeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString()) - } else if childItem.KeyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", "key") - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"radius.-1", itemBody) - } - body, _ = sjson.Set(body, path+"tacacs", []interface{}{}) - for _, item := range data.TacacsGroups { - itemBody := "" - if !item.GroupName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) - } - if item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } + if !childItem.RetransmitVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.RetransmitVariable.ValueString()) + } + } else if childItem.Retransmit.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", 3) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "retransmit.value", childItem.Retransmit.ValueInt64()) + } + } + if !childItem.Key.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + } + } + + if !childItem.SecretKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString()) + } + } else if childItem.SecretKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) + } + } + if childItem.KeyEnum.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default") - if !item.SourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) - } else if item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + } + } - } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if !childItem.KeyTypeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyTypeVariable.ValueString()) + } + } else if childItem.KeyType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", "key") + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyType.value", childItem.KeyType.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"radius.-1", itemBody) } - itemBody, _ = sjson.Set(itemBody, "server", []interface{}{}) - for _, childItem := range item.Servers { - itemChildBody := "" - if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) - } - - if !childItem.PortVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.PortVariable.ValueString()) - } else if childItem.Port.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "port.value", 49) + } + if true { + body, _ = sjson.Set(body, path+"tacacs", []interface{}{}) + for _, item := range data.TacacsGroups { + itemBody := "" + if !item.GroupName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "groupName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "groupName.value", item.GroupName.ValueString()) + } + } + if item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.Port.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } } - if !childItem.TimeoutVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString()) - } else if childItem.Timeout.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5) + if !item.SourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) + } + } else if item.SourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") + + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) - } - if !childItem.Key.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "server", []interface{}{}) + for _, childItem := range item.Servers { + itemChildBody := "" + if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } - if !childItem.SecretKeyVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString()) - } else if !childItem.SecretKey.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) - } - if childItem.KeyEnum.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default") + if !childItem.PortVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.PortVariable.ValueString()) + } + } else if childItem.Port.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "port.value", 49) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "port.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "port.value", childItem.Port.ValueInt64()) + } + } - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + if !childItem.TimeoutVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.TimeoutVariable.ValueString()) + } + } else if childItem.Timeout.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", 5) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "timeout.value", childItem.Timeout.ValueInt64()) + } + } + if !childItem.Key.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "key.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "key.value", childItem.Key.ValueString()) + } + } + + if !childItem.SecretKeyVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKeyVariable.ValueString()) + } + } else if !childItem.SecretKey.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "secretKey.value", childItem.SecretKey.ValueString()) + } + } + if childItem.KeyEnum.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "default") + + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "keyEnum.value", childItem.KeyEnum.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "server.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"tacacs.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"tacacs.-1", itemBody) } - body, _ = sjson.Set(body, path+"accountingRule", []interface{}{}) - for _, item := range data.AccountingRules { - itemBody := "" - if !item.RuleId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) - } - if !item.Method.IsNull() { - itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) - } - if item.Level.IsNull() { - itemBody, _ = sjson.Set(itemBody, "level.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"accountingRule", []interface{}{}) + for _, item := range data.AccountingRules { + itemBody := "" + if !item.RuleId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + } + } + if !item.Method.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) + } + } + if item.Level.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "level.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + } + } - if !item.StartStopVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStopVariable.ValueString()) - } else if item.StartStop.IsNull() { - itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "startStop.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStop.ValueBool()) - } - if !item.Group.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") - var values []string - item.Group.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "group.value", values) + if !item.StartStopVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStopVariable.ValueString()) + } + } else if item.StartStop.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "startStop.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "startStop.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "startStop.value", item.StartStop.ValueBool()) + } + } + if !item.Group.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") + var values []string + item.Group.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "group.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"accountingRule.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"accountingRule.-1", itemBody) } if !data.AuthorizationConsoleVariable.IsNull() { - body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "variable") - body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsoleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "variable") + body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsoleVariable.ValueString()) + } } else if data.AuthorizationConsole.IsNull() { - body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "default") - body, _ = sjson.Set(body, path+"authorizationConsole.value", false) + if true { + body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "default") + body, _ = sjson.Set(body, path+"authorizationConsole.value", false) + } } else { - body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "global") - body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsole.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"authorizationConsole.optionType", "global") + body, _ = sjson.Set(body, path+"authorizationConsole.value", data.AuthorizationConsole.ValueBool()) + } } if !data.AuthorizationConfigCommandsVariable.IsNull() { - body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "variable") - body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommandsVariable.ValueString()) - } else if data.AuthorizationConfigCommands.IsNull() { - body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "default") - body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", false) - } else { - body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "global") - body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommands.ValueBool()) - } - body, _ = sjson.Set(body, path+"authorizationRule", []interface{}{}) - for _, item := range data.AuthorizationRules { - itemBody := "" - if !item.RuleId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "variable") + body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommandsVariable.ValueString()) } - if !item.Method.IsNull() { - itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) - } - if !item.Level.IsNull() { - itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + } else if data.AuthorizationConfigCommands.IsNull() { + if true { + body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "default") + body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", false) } - if !item.Group.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") - var values []string - item.Group.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "group.value", values) + } else { + if true { + body, _ = sjson.Set(body, path+"authorizationConfigCommands.optionType", "global") + body, _ = sjson.Set(body, path+"authorizationConfigCommands.value", data.AuthorizationConfigCommands.ValueBool()) } - if item.IfAuthenticated.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", item.IfAuthenticated.ValueBool()) + } + if true { + body, _ = sjson.Set(body, path+"authorizationRule", []interface{}{}) + for _, item := range data.AuthorizationRules { + itemBody := "" + if !item.RuleId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ruleId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ruleId.value", item.RuleId.ValueString()) + } + } + if !item.Method.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "method.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "method.value", item.Method.ValueString()) + } + } + if !item.Level.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "level.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "level.value", item.Level.ValueString()) + } + } + if !item.Group.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") + var values []string + item.Group.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "group.value", values) + } + } + if item.IfAuthenticated.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifAuthenticated.value", item.IfAuthenticated.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"authorizationRule.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"authorizationRule.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_system_banner_profile_parcel.go b/internal/provider/model_sdwan_system_banner_profile_parcel.go index 7fc4242c..ced8a81d 100644 --- a/internal/provider/model_sdwan_system_banner_profile_parcel.go +++ b/internal/provider/model_sdwan_system_banner_profile_parcel.go @@ -67,25 +67,37 @@ func (data SystemBanner) toBody(ctx context.Context) string { path := "data." if !data.LoginVariable.IsNull() { - body, _ = sjson.Set(body, path+"login.optionType", "variable") - body, _ = sjson.Set(body, path+"login.value", data.LoginVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"login.optionType", "variable") + body, _ = sjson.Set(body, path+"login.value", data.LoginVariable.ValueString()) + } } else if data.Login.IsNull() { - body, _ = sjson.Set(body, path+"login.optionType", "default") - body, _ = sjson.Set(body, path+"login.value", "") + if true { + body, _ = sjson.Set(body, path+"login.optionType", "default") + body, _ = sjson.Set(body, path+"login.value", "") + } } else { - body, _ = sjson.Set(body, path+"login.optionType", "global") - body, _ = sjson.Set(body, path+"login.value", data.Login.ValueString()) + if true { + body, _ = sjson.Set(body, path+"login.optionType", "global") + body, _ = sjson.Set(body, path+"login.value", data.Login.ValueString()) + } } if !data.MotdVariable.IsNull() { - body, _ = sjson.Set(body, path+"motd.optionType", "variable") - body, _ = sjson.Set(body, path+"motd.value", data.MotdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"motd.optionType", "variable") + body, _ = sjson.Set(body, path+"motd.value", data.MotdVariable.ValueString()) + } } else if data.Motd.IsNull() { - body, _ = sjson.Set(body, path+"motd.optionType", "default") - body, _ = sjson.Set(body, path+"motd.value", "") + if true { + body, _ = sjson.Set(body, path+"motd.optionType", "default") + body, _ = sjson.Set(body, path+"motd.value", "") + } } else { - body, _ = sjson.Set(body, path+"motd.optionType", "global") - body, _ = sjson.Set(body, path+"motd.value", data.Motd.ValueString()) + if true { + body, _ = sjson.Set(body, path+"motd.optionType", "global") + body, _ = sjson.Set(body, path+"motd.value", data.Motd.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_basic_profile_parcel.go b/internal/provider/model_sdwan_system_basic_profile_parcel.go index a0dff7f5..c4110fdc 100644 --- a/internal/provider/model_sdwan_system_basic_profile_parcel.go +++ b/internal/provider/model_sdwan_system_basic_profile_parcel.go @@ -137,373 +137,569 @@ func (data SystemBasic) toBody(ctx context.Context) string { path := "data." if !data.TimezoneVariable.IsNull() { - body, _ = sjson.Set(body, path+"clock.timezone.optionType", "variable") - body, _ = sjson.Set(body, path+"clock.timezone.value", data.TimezoneVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clock.timezone.optionType", "variable") + body, _ = sjson.Set(body, path+"clock.timezone.value", data.TimezoneVariable.ValueString()) + } } else if data.Timezone.IsNull() { - body, _ = sjson.Set(body, path+"clock.timezone.optionType", "default") - body, _ = sjson.Set(body, path+"clock.timezone.value", "UTC") + if true { + body, _ = sjson.Set(body, path+"clock.timezone.optionType", "default") + body, _ = sjson.Set(body, path+"clock.timezone.value", "UTC") + } } else { - body, _ = sjson.Set(body, path+"clock.timezone.optionType", "global") - body, _ = sjson.Set(body, path+"clock.timezone.value", data.Timezone.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clock.timezone.optionType", "global") + body, _ = sjson.Set(body, path+"clock.timezone.value", data.Timezone.ValueString()) + } } if !data.ConfigDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.ConfigDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.ConfigDescriptionVariable.ValueString()) + } } else if data.ConfigDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.ConfigDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.ConfigDescription.ValueString()) + } } if !data.LocationVariable.IsNull() { - body, _ = sjson.Set(body, path+"location.optionType", "variable") - body, _ = sjson.Set(body, path+"location.value", data.LocationVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"location.optionType", "variable") + body, _ = sjson.Set(body, path+"location.value", data.LocationVariable.ValueString()) + } } else if data.Location.IsNull() { - body, _ = sjson.Set(body, path+"location.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"location.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"location.optionType", "global") - body, _ = sjson.Set(body, path+"location.value", data.Location.ValueString()) + if true { + body, _ = sjson.Set(body, path+"location.optionType", "global") + body, _ = sjson.Set(body, path+"location.value", data.Location.ValueString()) + } } if !data.GpsLongitudeVariable.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "variable") - body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitudeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "variable") + body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitudeVariable.ValueString()) + } } else if data.GpsLongitude.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitude.ValueFloat64()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.longitude.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.longitude.value", data.GpsLongitude.ValueFloat64()) + } } if !data.GpsLatitudeVariable.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "variable") - body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitudeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "variable") + body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitudeVariable.ValueString()) + } } else if data.GpsLatitude.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitude.ValueFloat64()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.latitude.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.latitude.value", data.GpsLatitude.ValueFloat64()) + } } if data.GpsGeoFencingEnable.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "default") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", false) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "default") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", false) + } } else { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", data.GpsGeoFencingEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.enable.value", data.GpsGeoFencingEnable.ValueBool()) + } } if !data.GpsGeoFencingRangeVariable.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "variable") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRangeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "variable") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRangeVariable.ValueString()) + } } else if data.GpsGeoFencingRange.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "default") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", 100) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "default") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", 100) + } } else { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRange.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.range.value", data.GpsGeoFencingRange.ValueInt64()) + } } if data.GpsSmsEnable.IsNull() { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "default") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", false) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "default") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", false) + } } else { - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "global") - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", data.GpsSmsEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.optionType", "global") + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.enable.value", data.GpsSmsEnable.ValueBool()) + } } - body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.mobileNumber", []interface{}{}) - for _, item := range data.GpsSmsMobileNumbers { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"gpsLocation.geoFencing.sms.mobileNumber", []interface{}{}) + for _, item := range data.GpsSmsMobileNumbers { + itemBody := "" - if !item.NumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "number.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "number.value", item.NumberVariable.ValueString()) - } else if !item.Number.IsNull() { - itemBody, _ = sjson.Set(itemBody, "number.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "number.value", item.Number.ValueString()) + if !item.NumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "number.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "number.value", item.NumberVariable.ValueString()) + } + } else if !item.Number.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "number.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "number.value", item.Number.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"gpsLocation.geoFencing.sms.mobileNumber.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"gpsLocation.geoFencing.sms.mobileNumber.-1", itemBody) } if !data.DeviceGroupsVariable.IsNull() { - body, _ = sjson.Set(body, path+"deviceGroups.optionType", "variable") - body, _ = sjson.Set(body, path+"deviceGroups.value", data.DeviceGroupsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"deviceGroups.optionType", "variable") + body, _ = sjson.Set(body, path+"deviceGroups.value", data.DeviceGroupsVariable.ValueString()) + } } else if data.DeviceGroups.IsNull() { - body, _ = sjson.Set(body, path+"deviceGroups.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"deviceGroups.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"deviceGroups.optionType", "global") - var values []string - data.DeviceGroups.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"deviceGroups.value", values) + if true { + body, _ = sjson.Set(body, path+"deviceGroups.optionType", "global") + var values []string + data.DeviceGroups.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"deviceGroups.value", values) + } } if !data.ControllerGroupsVariable.IsNull() { - body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "variable") - body, _ = sjson.Set(body, path+"controllerGroupList.value", data.ControllerGroupsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "variable") + body, _ = sjson.Set(body, path+"controllerGroupList.value", data.ControllerGroupsVariable.ValueString()) + } } else if data.ControllerGroups.IsNull() { - body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "global") - var values []int64 - data.ControllerGroups.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"controllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"controllerGroupList.optionType", "global") + var values []int64 + data.ControllerGroups.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"controllerGroupList.value", values) + } } if !data.OverlayIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"overlayId.optionType", "variable") - body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"overlayId.optionType", "variable") + body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayIdVariable.ValueString()) + } } else if data.OverlayId.IsNull() { - body, _ = sjson.Set(body, path+"overlayId.optionType", "default") - body, _ = sjson.Set(body, path+"overlayId.value", 1) + if true { + body, _ = sjson.Set(body, path+"overlayId.optionType", "default") + body, _ = sjson.Set(body, path+"overlayId.value", 1) + } } else { - body, _ = sjson.Set(body, path+"overlayId.optionType", "global") - body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"overlayId.optionType", "global") + body, _ = sjson.Set(body, path+"overlayId.value", data.OverlayId.ValueInt64()) + } } if !data.PortOffsetVariable.IsNull() { - body, _ = sjson.Set(body, path+"portOffset.optionType", "variable") - body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffsetVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"portOffset.optionType", "variable") + body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffsetVariable.ValueString()) + } } else if data.PortOffset.IsNull() { - body, _ = sjson.Set(body, path+"portOffset.optionType", "default") - body, _ = sjson.Set(body, path+"portOffset.value", 0) + if true { + body, _ = sjson.Set(body, path+"portOffset.optionType", "default") + body, _ = sjson.Set(body, path+"portOffset.value", 0) + } } else { - body, _ = sjson.Set(body, path+"portOffset.optionType", "global") - body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffset.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"portOffset.optionType", "global") + body, _ = sjson.Set(body, path+"portOffset.value", data.PortOffset.ValueInt64()) + } } if !data.PortHoppingVariable.IsNull() { - body, _ = sjson.Set(body, path+"portHop.optionType", "variable") - body, _ = sjson.Set(body, path+"portHop.value", data.PortHoppingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"portHop.optionType", "variable") + body, _ = sjson.Set(body, path+"portHop.value", data.PortHoppingVariable.ValueString()) + } } else if data.PortHopping.IsNull() { - body, _ = sjson.Set(body, path+"portHop.optionType", "default") - body, _ = sjson.Set(body, path+"portHop.value", true) + if true { + body, _ = sjson.Set(body, path+"portHop.optionType", "default") + body, _ = sjson.Set(body, path+"portHop.value", true) + } } else { - body, _ = sjson.Set(body, path+"portHop.optionType", "global") - body, _ = sjson.Set(body, path+"portHop.value", data.PortHopping.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"portHop.optionType", "global") + body, _ = sjson.Set(body, path+"portHop.value", data.PortHopping.ValueBool()) + } } if !data.ControlSessionPpsVariable.IsNull() { - body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "variable") - body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPpsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "variable") + body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPpsVariable.ValueString()) + } } else if data.ControlSessionPps.IsNull() { - body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "default") - body, _ = sjson.Set(body, path+"controlSessionPps.value", 300) + if true { + body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "default") + body, _ = sjson.Set(body, path+"controlSessionPps.value", 300) + } } else { - body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "global") - body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPps.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"controlSessionPps.optionType", "global") + body, _ = sjson.Set(body, path+"controlSessionPps.value", data.ControlSessionPps.ValueInt64()) + } } if !data.TrackTransportVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackTransport.optionType", "variable") - body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransportVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackTransport.optionType", "variable") + body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransportVariable.ValueString()) + } } else if data.TrackTransport.IsNull() { - body, _ = sjson.Set(body, path+"trackTransport.optionType", "default") - body, _ = sjson.Set(body, path+"trackTransport.value", true) + if true { + body, _ = sjson.Set(body, path+"trackTransport.optionType", "default") + body, _ = sjson.Set(body, path+"trackTransport.value", true) + } } else { - body, _ = sjson.Set(body, path+"trackTransport.optionType", "global") - body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransport.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trackTransport.optionType", "global") + body, _ = sjson.Set(body, path+"trackTransport.value", data.TrackTransport.ValueBool()) + } } if !data.TrackInterfaceTagVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "variable") - body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTagVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "variable") + body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTagVariable.ValueString()) + } } else if data.TrackInterfaceTag.IsNull() { - body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "global") - body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTag.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"trackInterfaceTag.optionType", "global") + body, _ = sjson.Set(body, path+"trackInterfaceTag.value", data.TrackInterfaceTag.ValueInt64()) + } } if !data.ConsoleBaudRateVariable.IsNull() { - body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "variable") - body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "variable") + body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRateVariable.ValueString()) + } } else if data.ConsoleBaudRate.IsNull() { - body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "default") - body, _ = sjson.Set(body, path+"consoleBaudRate.value", "9600") + if true { + body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "default") + body, _ = sjson.Set(body, path+"consoleBaudRate.value", "9600") + } } else { - body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "global") - body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRate.ValueString()) + if true { + body, _ = sjson.Set(body, path+"consoleBaudRate.optionType", "global") + body, _ = sjson.Set(body, path+"consoleBaudRate.value", data.ConsoleBaudRate.ValueString()) + } } if !data.MaxOmpSessionsVariable.IsNull() { - body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "variable") - body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessionsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "variable") + body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessionsVariable.ValueString()) + } } else if data.MaxOmpSessions.IsNull() { - body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "global") - body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessions.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"maxOmpSessions.optionType", "global") + body, _ = sjson.Set(body, path+"maxOmpSessions.value", data.MaxOmpSessions.ValueInt64()) + } } if !data.MultiTenantVariable.IsNull() { - body, _ = sjson.Set(body, path+"multiTenant.optionType", "variable") - body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenantVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"multiTenant.optionType", "variable") + body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenantVariable.ValueString()) + } } else if data.MultiTenant.IsNull() { - body, _ = sjson.Set(body, path+"multiTenant.optionType", "default") - body, _ = sjson.Set(body, path+"multiTenant.value", false) + if true { + body, _ = sjson.Set(body, path+"multiTenant.optionType", "default") + body, _ = sjson.Set(body, path+"multiTenant.value", false) + } } else { - body, _ = sjson.Set(body, path+"multiTenant.optionType", "global") - body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenant.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"multiTenant.optionType", "global") + body, _ = sjson.Set(body, path+"multiTenant.value", data.MultiTenant.ValueBool()) + } } if !data.TrackDefaultGatewayVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "variable") - body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGatewayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "variable") + body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGatewayVariable.ValueString()) + } } else if data.TrackDefaultGateway.IsNull() { - body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "default") - body, _ = sjson.Set(body, path+"trackDefaultGateway.value", true) + if true { + body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "default") + body, _ = sjson.Set(body, path+"trackDefaultGateway.value", true) + } } else { - body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "global") - body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGateway.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"trackDefaultGateway.optionType", "global") + body, _ = sjson.Set(body, path+"trackDefaultGateway.value", data.TrackDefaultGateway.ValueBool()) + } } if !data.AdminTechOnFailureVariable.IsNull() { - body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "variable") - body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailureVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "variable") + body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailureVariable.ValueString()) + } } else if data.AdminTechOnFailure.IsNull() { - body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "default") - body, _ = sjson.Set(body, path+"adminTechOnFailure.value", true) + if true { + body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "default") + body, _ = sjson.Set(body, path+"adminTechOnFailure.value", true) + } } else { - body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "global") - body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailure.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"adminTechOnFailure.optionType", "global") + body, _ = sjson.Set(body, path+"adminTechOnFailure.value", data.AdminTechOnFailure.ValueBool()) + } } if !data.IdleTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"idleTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"idleTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeoutVariable.ValueString()) + } } else if data.IdleTimeout.IsNull() { - body, _ = sjson.Set(body, path+"idleTimeout.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"idleTimeout.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"idleTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"idleTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"idleTimeout.value", data.IdleTimeout.ValueInt64()) + } } if !data.OnDemandEnableVariable.IsNull() { - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "variable") - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "variable") + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnableVariable.ValueString()) + } } else if data.OnDemandEnable.IsNull() { - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "default") - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", false) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "default") + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", false) + } } else { - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "global") - body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.optionType", "global") + body, _ = sjson.Set(body, path+"onDemand.onDemandEnable.value", data.OnDemandEnable.ValueBool()) + } } if !data.OnDemandIdleTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeoutVariable.ValueString()) + } } else if data.OnDemandIdleTimeout.IsNull() { - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", 10) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", 10) + } } else { - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"onDemand.onDemandIdleTimeout.value", data.OnDemandIdleTimeout.ValueInt64()) + } } if !data.TransportGatewayVariable.IsNull() { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "variable") - body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGatewayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "variable") + body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGatewayVariable.ValueString()) + } } else if data.TransportGateway.IsNull() { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "default") - body, _ = sjson.Set(body, path+"transportGateway.value", false) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "default") + body, _ = sjson.Set(body, path+"transportGateway.value", false) + } } else { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") - body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") + body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueBool()) + } } if !data.EnhancedAppAwareRoutingVariable.IsNull() { - body, _ = sjson.Set(body, path+"epfr.optionType", "variable") - body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRoutingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"epfr.optionType", "variable") + body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRoutingVariable.ValueString()) + } } else if data.EnhancedAppAwareRouting.IsNull() { - body, _ = sjson.Set(body, path+"epfr.optionType", "default") - body, _ = sjson.Set(body, path+"epfr.value", "disabled") + if true { + body, _ = sjson.Set(body, path+"epfr.optionType", "default") + body, _ = sjson.Set(body, path+"epfr.value", "disabled") + } } else { - body, _ = sjson.Set(body, path+"epfr.optionType", "global") - body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRouting.ValueString()) + if true { + body, _ = sjson.Set(body, path+"epfr.optionType", "global") + body, _ = sjson.Set(body, path+"epfr.value", data.EnhancedAppAwareRouting.ValueString()) + } } if !data.SiteTypesVariable.IsNull() { - body, _ = sjson.Set(body, path+"siteType.optionType", "variable") - body, _ = sjson.Set(body, path+"siteType.value", data.SiteTypesVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"siteType.optionType", "variable") + body, _ = sjson.Set(body, path+"siteType.value", data.SiteTypesVariable.ValueString()) + } } else if data.SiteTypes.IsNull() { - body, _ = sjson.Set(body, path+"siteType.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"siteType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"siteType.optionType", "global") - var values []string - data.SiteTypes.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"siteType.value", values) + if true { + body, _ = sjson.Set(body, path+"siteType.optionType", "global") + var values []string + data.SiteTypes.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"siteType.value", values) + } } if !data.AffinityGroupNumberVariable.IsNull() { - body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "variable") - body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumberVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "variable") + body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumberVariable.ValueString()) + } } else if data.AffinityGroupNumber.IsNull() { - body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "global") - body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumber.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"affinityGroupNumber.optionType", "global") + body, _ = sjson.Set(body, path+"affinityGroupNumber.value", data.AffinityGroupNumber.ValueInt64()) + } } if !data.AffinityGroupPreferencesVariable.IsNull() { - body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "variable") - body, _ = sjson.Set(body, path+"affinityGroupPreference.value", data.AffinityGroupPreferencesVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "variable") + body, _ = sjson.Set(body, path+"affinityGroupPreference.value", data.AffinityGroupPreferencesVariable.ValueString()) + } } else if data.AffinityGroupPreferences.IsNull() { - body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "global") - var values []int64 - data.AffinityGroupPreferences.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"affinityGroupPreference.value", values) + if true { + body, _ = sjson.Set(body, path+"affinityGroupPreference.optionType", "global") + var values []int64 + data.AffinityGroupPreferences.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"affinityGroupPreference.value", values) + } } if !data.AffinityPreferenceAutoVariable.IsNull() { - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "variable") - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAutoVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "variable") + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAutoVariable.ValueString()) + } } else if data.AffinityPreferenceAuto.IsNull() { - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "default") - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", false) + if true { + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "default") + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", false) + } } else { - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "global") - body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAuto.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.optionType", "global") + body, _ = sjson.Set(body, path+"affinityPreferenceAuto.value", data.AffinityPreferenceAuto.ValueBool()) + } } - body, _ = sjson.Set(body, path+"affinityPerVrf", []interface{}{}) - for _, item := range data.AffinityPerVrfs { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"affinityPerVrf", []interface{}{}) + for _, item := range data.AffinityPerVrfs { + itemBody := "" - if !item.AffinityGroupNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumberVariable.ValueString()) - } else if item.AffinityGroupNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "default") + if !item.AffinityGroupNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumberVariable.ValueString()) + } + } else if item.AffinityGroupNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumber.ValueInt64()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "affinityGroupNumber.value", item.AffinityGroupNumber.ValueInt64()) + } + } - if !item.VrfRangeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRangeVariable.ValueString()) - } else if item.VrfRange.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "default") + if !item.VrfRangeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRangeVariable.ValueString()) + } + } else if item.VrfRange.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRange.ValueString()) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "vrfRange.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vrfRange.value", item.VrfRange.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"affinityPerVrf.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"affinityPerVrf.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_system_bfd_profile_parcel.go b/internal/provider/model_sdwan_system_bfd_profile_parcel.go index 13eb4b71..d0018854 100644 --- a/internal/provider/model_sdwan_system_bfd_profile_parcel.go +++ b/internal/provider/model_sdwan_system_bfd_profile_parcel.go @@ -83,93 +83,141 @@ func (data SystemBFD) toBody(ctx context.Context) string { path := "data." if !data.MultiplierVariable.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") - body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") + body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + } } else if data.Multiplier.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "default") - body, _ = sjson.Set(body, path+"multiplier.value", 6) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "default") + body, _ = sjson.Set(body, path+"multiplier.value", 6) + } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.PollIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"pollInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"pollInterval.value", data.PollIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"pollInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"pollInterval.value", data.PollIntervalVariable.ValueString()) + } } else if data.PollInterval.IsNull() { - body, _ = sjson.Set(body, path+"pollInterval.optionType", "default") - body, _ = sjson.Set(body, path+"pollInterval.value", 600000) + if true { + body, _ = sjson.Set(body, path+"pollInterval.optionType", "default") + body, _ = sjson.Set(body, path+"pollInterval.value", 600000) + } } else { - body, _ = sjson.Set(body, path+"pollInterval.optionType", "global") - body, _ = sjson.Set(body, path+"pollInterval.value", data.PollInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"pollInterval.optionType", "global") + body, _ = sjson.Set(body, path+"pollInterval.value", data.PollInterval.ValueInt64()) + } } if !data.DefaultDscpVariable.IsNull() { - body, _ = sjson.Set(body, path+"defaultDscp.optionType", "variable") - body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultDscp.optionType", "variable") + body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscpVariable.ValueString()) + } } else if data.DefaultDscp.IsNull() { - body, _ = sjson.Set(body, path+"defaultDscp.optionType", "default") - body, _ = sjson.Set(body, path+"defaultDscp.value", 48) + if true { + body, _ = sjson.Set(body, path+"defaultDscp.optionType", "default") + body, _ = sjson.Set(body, path+"defaultDscp.value", 48) + } } else { - body, _ = sjson.Set(body, path+"defaultDscp.optionType", "global") - body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscp.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"defaultDscp.optionType", "global") + body, _ = sjson.Set(body, path+"defaultDscp.value", data.DefaultDscp.ValueInt64()) + } } - body, _ = sjson.Set(body, path+"colors", []interface{}{}) - for _, item := range data.Colors { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"colors", []interface{}{}) + for _, item := range data.Colors { + itemBody := "" - if !item.ColorVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "color.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "color.value", item.ColorVariable.ValueString()) - } else if !item.Color.IsNull() { - itemBody, _ = sjson.Set(itemBody, "color.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString()) - } + if !item.ColorVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "color.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "color.value", item.ColorVariable.ValueString()) + } + } else if !item.Color.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "color.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "color.value", item.Color.ValueString()) + } + } - if !item.HelloIntervalVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloIntervalVariable.ValueString()) - } else if item.HelloInterval.IsNull() { - itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "helloInterval.value", 1000) - } else { - itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloInterval.ValueInt64()) - } + if !item.HelloIntervalVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloIntervalVariable.ValueString()) + } + } else if item.HelloInterval.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "helloInterval.value", 1000) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "helloInterval.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "helloInterval.value", item.HelloInterval.ValueInt64()) + } + } - if !item.MultiplierVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.MultiplierVariable.ValueString()) - } else if item.Multiplier.IsNull() { - itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "multiplier.value", 7) - } else { - itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.Multiplier.ValueInt64()) - } + if !item.MultiplierVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.MultiplierVariable.ValueString()) + } + } else if item.Multiplier.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "multiplier.value", 7) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "multiplier.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "multiplier.value", item.Multiplier.ValueInt64()) + } + } - if !item.PmtuDiscoveryVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscoveryVariable.ValueString()) - } else if item.PmtuDiscovery.IsNull() { - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscovery.ValueBool()) - } + if !item.PmtuDiscoveryVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscoveryVariable.ValueString()) + } + } else if item.PmtuDiscovery.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "pmtuDiscovery.value", item.PmtuDiscovery.ValueBool()) + } + } - if !item.DscpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "dscp.value", item.DscpVariable.ValueString()) - } else if item.Dscp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "dscp.value", 48) - } else { - itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "dscp.value", item.Dscp.ValueInt64()) + if !item.DscpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "dscp.value", item.DscpVariable.ValueString()) + } + } else if item.Dscp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "dscp.value", 48) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "dscp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "dscp.value", item.Dscp.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"colors.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"colors.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go b/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go index 2be194b7..7e11d4fe 100644 --- a/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go +++ b/internal/provider/model_sdwan_system_flexible_port_speed_profile_parcel.go @@ -65,14 +65,20 @@ func (data SystemFlexiblePortSpeed) toBody(ctx context.Context) string { path := "data." if !data.PortTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"portType.optionType", "variable") - body, _ = sjson.Set(body, path+"portType.value", data.PortTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"portType.optionType", "variable") + body, _ = sjson.Set(body, path+"portType.value", data.PortTypeVariable.ValueString()) + } } else if data.PortType.IsNull() { - body, _ = sjson.Set(body, path+"portType.optionType", "default") - body, _ = sjson.Set(body, path+"portType.value", "12 ports of 1/10GE + 3 ports 40GE") + if true { + body, _ = sjson.Set(body, path+"portType.optionType", "default") + body, _ = sjson.Set(body, path+"portType.value", "12 ports of 1/10GE + 3 ports 40GE") + } } else { - body, _ = sjson.Set(body, path+"portType.optionType", "global") - body, _ = sjson.Set(body, path+"portType.value", data.PortType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"portType.optionType", "global") + body, _ = sjson.Set(body, path+"portType.value", data.PortType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_global_profile_parcel.go b/internal/provider/model_sdwan_system_global_profile_parcel.go index fbfff617..a46bca6f 100644 --- a/internal/provider/model_sdwan_system_global_profile_parcel.go +++ b/internal/provider/model_sdwan_system_global_profile_parcel.go @@ -109,256 +109,394 @@ func (data SystemGlobal) toBody(ctx context.Context) string { path := "data." if !data.HttpServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", data.HttpServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", data.HttpServerVariable.ValueString()) + } } else if data.HttpServer.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", data.HttpServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpServer.value", data.HttpServer.ValueBool()) + } } if !data.HttpsServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", data.HttpsServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", data.HttpsServerVariable.ValueString()) + } } else if data.HttpsServer.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", data.HttpsServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpHttpsServer.value", data.HttpsServer.ValueBool()) + } } if !data.FtpPassiveVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", data.FtpPassiveVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", data.FtpPassiveVariable.ValueString()) + } } else if data.FtpPassive.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", data.FtpPassive.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpFtpPassive.value", data.FtpPassive.ValueBool()) + } } if !data.DomainLookupVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", data.DomainLookupVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", data.DomainLookupVariable.ValueString()) + } } else if data.DomainLookup.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", data.DomainLookup.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpDomainLookup.value", data.DomainLookup.ValueBool()) + } } if !data.ArpProxyVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", data.ArpProxyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", data.ArpProxyVariable.ValueString()) + } } else if data.ArpProxy.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", data.ArpProxy.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpArpProxy.value", data.ArpProxy.ValueBool()) + } } if !data.RshRcpVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", data.RshRcpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", data.RshRcpVariable.ValueString()) + } } else if data.RshRcp.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", data.RshRcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpRcmd.value", data.RshRcp.ValueBool()) + } } if !data.LineVtyVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", data.LineVtyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", data.LineVtyVariable.ValueString()) + } } else if data.LineVty.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", data.LineVty.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLineVty.value", data.LineVty.ValueBool()) + } } if !data.CdpVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", data.CdpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", data.CdpVariable.ValueString()) + } } else if data.Cdp.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", data.Cdp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpCdp.value", data.Cdp.ValueBool()) + } } if !data.LldpVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", data.LldpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", data.LldpVariable.ValueString()) + } } else if data.Lldp.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", data.Lldp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpLldp.value", data.Lldp.ValueBool()) + } } if !data.SourceInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.value", data.SourceInterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.value", data.SourceInterfaceVariable.ValueString()) + } } else if data.SourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.value", data.SourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.servicesGlobalServicesIpSourceIntrf.value", data.SourceInterface.ValueString()) + } } if !data.TcpKeepalivesInVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", data.TcpKeepalivesInVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", data.TcpKeepalivesInVariable.ValueString()) + } } else if data.TcpKeepalivesIn.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", data.TcpKeepalivesIn.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesIn.value", data.TcpKeepalivesIn.ValueBool()) + } } if !data.TcpKeepalivesOutVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", data.TcpKeepalivesOutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", data.TcpKeepalivesOutVariable.ValueString()) + } } else if data.TcpKeepalivesOut.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", data.TcpKeepalivesOut.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpKeepalivesOut.value", data.TcpKeepalivesOut.ValueBool()) + } } if !data.TcpSmallServersVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", data.TcpSmallServersVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", data.TcpSmallServersVariable.ValueString()) + } } else if data.TcpSmallServers.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", data.TcpSmallServers.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsTcpSmallServers.value", data.TcpSmallServers.ValueBool()) + } } if !data.UdpSmallServersVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", data.UdpSmallServersVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", data.UdpSmallServersVariable.ValueString()) + } } else if data.UdpSmallServers.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", data.UdpSmallServers.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsUdpSmallServers.value", data.UdpSmallServers.ValueBool()) + } } if !data.ConsoleLoggingVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", data.ConsoleLoggingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", data.ConsoleLoggingVariable.ValueString()) + } } else if data.ConsoleLogging.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", data.ConsoleLogging.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsConsoleLogging.value", data.ConsoleLogging.ValueBool()) + } } if !data.IpSourceRoutingVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", data.IpSourceRoutingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", data.IpSourceRoutingVariable.ValueString()) + } } else if data.IpSourceRouting.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", data.IpSourceRouting.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIPSourceRoute.value", data.IpSourceRouting.ValueBool()) + } } if !data.VtyLineLoggingVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", data.VtyLineLoggingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", data.VtyLineLoggingVariable.ValueString()) + } } else if data.VtyLineLogging.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", false) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", false) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", data.VtyLineLogging.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsVtyLineLogging.value", data.VtyLineLogging.ValueBool()) + } } if !data.SnmpIfindexPersistVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", data.SnmpIfindexPersistVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", data.SnmpIfindexPersistVariable.ValueString()) + } } else if data.SnmpIfindexPersist.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", data.SnmpIfindexPersist.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsSnmpIfindexPersist.value", data.SnmpIfindexPersist.ValueBool()) + } } if !data.IgnoreBootpVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", data.IgnoreBootpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", data.IgnoreBootpVariable.ValueString()) + } } else if data.IgnoreBootp.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", true) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", true) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", data.IgnoreBootp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalOtherSettingsIgnoreBootp.value", data.IgnoreBootp.ValueBool()) + } } if !data.Nat64UdpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", data.Nat64UdpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", data.Nat64UdpTimeoutVariable.ValueString()) + } } else if data.Nat64UdpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", 300) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", 300) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", data.Nat64UdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64UdpTimeout.value", data.Nat64UdpTimeout.ValueInt64()) + } } if !data.Nat64TcpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", data.Nat64TcpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", data.Nat64TcpTimeoutVariable.ValueString()) + } } else if data.Nat64TcpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", 3600) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", 3600) + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", data.Nat64TcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsNat64TcpTimeout.value", data.Nat64TcpTimeout.ValueInt64()) + } } if !data.HttpAuthenticationVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.value", data.HttpAuthenticationVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.value", data.HttpAuthenticationVariable.ValueString()) + } } else if data.HttpAuthentication.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.value", data.HttpAuthentication.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsHttpAuthentication.value", data.HttpAuthentication.ValueString()) + } } if !data.SshVersionVariable.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "variable") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.value", data.SshVersionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "variable") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.value", data.SshVersionVariable.ValueString()) + } } else if data.SshVersion.IsNull() { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "global") - body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.value", data.SshVersion.ValueString()) + if true { + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.optionType", "global") + body, _ = sjson.Set(body, path+"services_global.services_ip.globalSettingsSSHVersion.value", data.SshVersion.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go b/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go index 0b0c0e1a..cf42210a 100644 --- a/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go +++ b/internal/provider/model_sdwan_system_ipv4_device_access_profile_parcel.go @@ -80,66 +80,94 @@ func (data SystemIPv4DeviceAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.DefaultAction.IsNull() { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") - body, _ = sjson.Set(body, path+"defaultAction.value", "drop") - } else { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") - body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) - } - body, _ = sjson.Set(body, path+"sequences", []interface{}{}) - for _, item := range data.Sequences { - itemBody := "" - if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) - } - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) - } - if !item.BaseAction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") + body, _ = sjson.Set(body, path+"defaultAction.value", "drop") } - if !item.DeviceAccessPort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) - } - if !item.DestinationDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + } else { + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") + body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) } + } + if true { + body, _ = sjson.Set(body, path+"sequences", []interface{}{}) + for _, item := range data.Sequences { + itemBody := "" + if !item.Id.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) + } + } + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + } + } + if !item.BaseAction.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + } + } + if !item.DeviceAccessPort.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) + } + } + if !item.DestinationDataPrefixListId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + } + } - if !item.DestinationIpPrefixListVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString()) - } else if !item.DestinationIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") - var values []string - item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) - } - if !item.SourcePorts.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") - var values []int64 - item.SourcePorts.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) - } - if !item.SourceDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) - } + if !item.DestinationIpPrefixListVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString()) + } + } else if !item.DestinationIpPrefixList.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") + var values []string + item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) + } + } + if !item.SourcePorts.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") + var values []int64 + item.SourcePorts.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) + } + } + if !item.SourceDataPrefixListId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) + } + } - if !item.SourceIpPrefixListVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString()) - } else if !item.SourceIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") - var values []string - item.SourceIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + if !item.SourceIpPrefixListVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString()) + } + } else if !item.SourceIpPrefixList.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") + var values []string + item.SourceIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go b/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go index 9c687192..c8598381 100644 --- a/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go +++ b/internal/provider/model_sdwan_system_ipv6_device_access_profile_parcel.go @@ -80,69 +80,99 @@ func (data SystemIPv6DeviceAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.DefaultAction.IsNull() { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") - body, _ = sjson.Set(body, path+"defaultAction.value", "drop") - } else { - body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") - body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) - } - body, _ = sjson.Set(body, path+"sequences", []interface{}{}) - for _, item := range data.Sequences { - itemBody := "" - if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) - } - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) - } - if item.BaseAction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", "accept") - } else { - itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "default") + body, _ = sjson.Set(body, path+"defaultAction.value", "drop") } - if !item.DeviceAccessPort.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) - } - if !item.DestinationDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + } else { + if true { + body, _ = sjson.Set(body, path+"defaultAction.optionType", "global") + body, _ = sjson.Set(body, path+"defaultAction.value", data.DefaultAction.ValueString()) } + } + if true { + body, _ = sjson.Set(body, path+"sequences", []interface{}{}) + for _, item := range data.Sequences { + itemBody := "" + if !item.Id.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceId.value", item.Id.ValueInt64()) + } + } + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sequenceName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sequenceName.value", item.Name.ValueString()) + } + } + if item.BaseAction.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "baseAction.value", "accept") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "baseAction.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "baseAction.value", item.BaseAction.ValueString()) + } + } + if !item.DeviceAccessPort.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationPort.value", item.DeviceAccessPort.ValueInt64()) + } + } + if !item.DestinationDataPrefixListId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationDataPrefixList.refId.value", item.DestinationDataPrefixListId.ValueString()) + } + } - if !item.DestinationIpPrefixListVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString()) - } else if !item.DestinationIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") - var values []string - item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) - } - if !item.SourcePorts.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") - var values []int64 - item.SourcePorts.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) - } - if !item.SourceDataPrefixListId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) - } + if !item.DestinationIpPrefixListVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", item.DestinationIpPrefixListVariable.ValueString()) + } + } else if !item.DestinationIpPrefixList.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.optionType", "global") + var values []string + item.DestinationIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.destinationDataPrefix.destinationIpPrefixList.value", values) + } + } + if !item.SourcePorts.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.optionType", "global") + var values []int64 + item.SourcePorts.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourcePorts.value", values) + } + } + if !item.SourceDataPrefixListId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceDataPrefixList.refId.value", item.SourceDataPrefixListId.ValueString()) + } + } - if !item.SourceIpPrefixListVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString()) - } else if !item.SourceIpPrefixList.IsNull() { - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") - var values []string - item.SourceIpPrefixList.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + if !item.SourceIpPrefixListVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", item.SourceIpPrefixListVariable.ValueString()) + } + } else if !item.SourceIpPrefixList.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.optionType", "global") + var values []string + item.SourceIpPrefixList.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "matchEntries.sourceDataPrefix.sourceIpPrefixList.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"sequences.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_system_logging_profile_parcel.go b/internal/provider/model_sdwan_system_logging_profile_parcel.go index 144e7994..225c3617 100644 --- a/internal/provider/model_sdwan_system_logging_profile_parcel.go +++ b/internal/provider/model_sdwan_system_logging_profile_parcel.go @@ -116,233 +116,355 @@ func (data SystemLogging) toBody(ctx context.Context) string { path := "data." if !data.DiskEnableVariable.IsNull() { - body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "variable") - body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "variable") + body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnableVariable.ValueString()) + } } else if data.DiskEnable.IsNull() { - body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "default") - body, _ = sjson.Set(body, path+"disk.diskEnable.value", true) + if true { + body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "default") + body, _ = sjson.Set(body, path+"disk.diskEnable.value", true) + } } else { - body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "global") - body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"disk.diskEnable.optionType", "global") + body, _ = sjson.Set(body, path+"disk.diskEnable.value", data.DiskEnable.ValueBool()) + } } if !data.DiskFileSizeVariable.IsNull() { - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "variable") - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSizeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "variable") + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSizeVariable.ValueString()) + } } else if data.DiskFileSize.IsNull() { - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "default") - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", 10) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "default") + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", 10) + } } else { - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "global") - body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSize.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.optionType", "global") + body, _ = sjson.Set(body, path+"disk.file.diskFileSize.value", data.DiskFileSize.ValueInt64()) + } } if !data.DiskFileRotateVariable.IsNull() { - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "variable") - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "variable") + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotateVariable.ValueString()) + } } else if data.DiskFileRotate.IsNull() { - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "default") - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", 10) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "default") + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", 10) + } } else { - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "global") - body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.optionType", "global") + body, _ = sjson.Set(body, path+"disk.file.diskFileRotate.value", data.DiskFileRotate.ValueInt64()) + } } - body, _ = sjson.Set(body, path+"tlsProfile", []interface{}{}) - for _, item := range data.TlsProfiles { - itemBody := "" - - if !item.ProfileVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "profile.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "profile.value", item.ProfileVariable.ValueString()) - } else if !item.Profile.IsNull() { - itemBody, _ = sjson.Set(itemBody, "profile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "profile.value", item.Profile.ValueString()) - } - - if !item.TlsVersionVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersionVariable.ValueString()) - } else if item.TlsVersion.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", "TLSv1.1") - } else { - itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersion.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "authType.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "authType.value", "Server") - - if !item.CipherSuitesVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", item.CipherSuitesVariable.ValueString()) - } else if item.CipherSuites.IsNull() { - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "global") - var values []string - item.CipherSuites.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", values) - } - body, _ = sjson.SetRaw(body, path+"tlsProfile.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"tlsProfile", []interface{}{}) + for _, item := range data.TlsProfiles { + itemBody := "" + + if !item.ProfileVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "profile.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "profile.value", item.ProfileVariable.ValueString()) + } + } else if !item.Profile.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "profile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "profile.value", item.Profile.ValueString()) + } + } + + if !item.TlsVersionVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersionVariable.ValueString()) + } + } else if item.TlsVersion.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", "TLSv1.1") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsVersion.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsVersion.value", item.TlsVersion.ValueString()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "authType.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "authType.value", "Server") + } + + if !item.CipherSuitesVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", item.CipherSuitesVariable.ValueString()) + } + } else if item.CipherSuites.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.optionType", "global") + var values []string + item.CipherSuites.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "cipherSuiteList.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"tlsProfile.-1", itemBody) + } } - body, _ = sjson.Set(body, path+"server", []interface{}{}) - for _, item := range data.Ipv4Servers { - itemBody := "" - - if !item.HostnameIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString()) - } else if !item.HostnameIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) - } - - if !item.VpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) - } else if item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } - - if !item.SourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) - } else if item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) - } - - if !item.PriorityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) - } else if item.Priority.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "priority.value", "informational") - } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) - } - - if !item.TlsEnableVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString()) - } else if item.TlsEnable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) - } - - if !item.TlsPropertiesCustomProfileVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString()) - } else if item.TlsPropertiesCustomProfile.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) - } - - if !item.TlsPropertiesProfileVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString()) - } else if item.TlsPropertiesProfile.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"server.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"server", []interface{}{}) + for _, item := range data.Ipv4Servers { + itemBody := "" + + if !item.HostnameIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString()) + } + } else if !item.HostnameIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) + } + } + + if !item.VpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) + } + } else if item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } + } + + if !item.SourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) + } + } else if item.SourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } + } + + if !item.PriorityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) + } + } else if item.Priority.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "priority.value", "informational") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) + } + } + + if !item.TlsEnableVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString()) + } + } else if item.TlsEnable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) + } + } + + if !item.TlsPropertiesCustomProfileVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString()) + } + } else if item.TlsPropertiesCustomProfile.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) + } + } + + if !item.TlsPropertiesProfileVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString()) + } + } else if item.TlsPropertiesProfile.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"server.-1", itemBody) + } } - body, _ = sjson.Set(body, path+"ipv6Server", []interface{}{}) - for _, item := range data.Ipv6Servers { - itemBody := "" - - if !item.HostnameIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString()) - } else if !item.HostnameIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) - } - - if !item.VpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) - } else if item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } - - if !item.SourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) - } else if item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) - } - - if !item.PriorityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) - } else if item.Priority.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "priority.value", "informational") - } else { - itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) - } - - if !item.TlsEnableVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString()) - } else if item.TlsEnable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) - } - - if !item.TlsPropertiesCustomProfileVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString()) - } else if item.TlsPropertiesCustomProfile.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) - } - - if !item.TlsPropertiesProfileVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString()) - } else if item.TlsPropertiesProfile.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"ipv6Server.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"ipv6Server", []interface{}{}) + for _, item := range data.Ipv6Servers { + itemBody := "" + + if !item.HostnameIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpVariable.ValueString()) + } + } else if !item.HostnameIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIp.ValueString()) + } + } + + if !item.VpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) + } + } else if item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } + } + + if !item.SourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) + } + } else if item.SourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } + } + + if !item.PriorityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.PriorityVariable.ValueString()) + } + } else if item.Priority.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "priority.value", "informational") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "priority.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priority.value", item.Priority.ValueString()) + } + } + + if !item.TlsEnableVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnableVariable.ValueString()) + } + } else if item.TlsEnable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsEnable.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsEnable.value", item.TlsEnable.ValueBool()) + } + } + + if !item.TlsPropertiesCustomProfileVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfileVariable.ValueString()) + } + } else if item.TlsPropertiesCustomProfile.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesCustomProfile.value", item.TlsPropertiesCustomProfile.ValueBool()) + } + } + + if !item.TlsPropertiesProfileVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfileVariable.ValueString()) + } + } else if item.TlsPropertiesProfile.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tlsPropertiesProfile.value", item.TlsPropertiesProfile.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6Server.-1", itemBody) + } } return body } diff --git a/internal/provider/model_sdwan_system_mrf_profile_parcel.go b/internal/provider/model_sdwan_system_mrf_profile_parcel.go index de00c60a..2f25ea8e 100644 --- a/internal/provider/model_sdwan_system_mrf_profile_parcel.go +++ b/internal/provider/model_sdwan_system_mrf_profile_parcel.go @@ -69,47 +69,71 @@ func (data SystemMRF) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.RegionId.IsNull() { - body, _ = sjson.Set(body, path+"regionId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"regionId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"regionId.optionType", "global") - body, _ = sjson.Set(body, path+"regionId.value", data.RegionId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"regionId.optionType", "global") + body, _ = sjson.Set(body, path+"regionId.value", data.RegionId.ValueInt64()) + } } if !data.SecondaryRegionIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "variable") - body, _ = sjson.Set(body, path+"secondaryRegion.value", data.SecondaryRegionIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "variable") + body, _ = sjson.Set(body, path+"secondaryRegion.value", data.SecondaryRegionIdVariable.ValueString()) + } } else if data.SecondaryRegionId.IsNull() { - body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "global") - body, _ = sjson.Set(body, path+"secondaryRegion.value", data.SecondaryRegionId.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"secondaryRegion.optionType", "global") + body, _ = sjson.Set(body, path+"secondaryRegion.value", data.SecondaryRegionId.ValueInt64()) + } } if !data.RoleVariable.IsNull() { - body, _ = sjson.Set(body, path+"role.optionType", "variable") - body, _ = sjson.Set(body, path+"role.value", data.RoleVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"role.optionType", "variable") + body, _ = sjson.Set(body, path+"role.value", data.RoleVariable.ValueString()) + } } else if data.Role.IsNull() { - body, _ = sjson.Set(body, path+"role.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"role.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"role.optionType", "global") - body, _ = sjson.Set(body, path+"role.value", data.Role.ValueString()) + if true { + body, _ = sjson.Set(body, path+"role.optionType", "global") + body, _ = sjson.Set(body, path+"role.value", data.Role.ValueString()) + } } if data.EnableMigrationToMrf.IsNull() { - body, _ = sjson.Set(body, path+"enableMrfMigration.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"enableMrfMigration.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"enableMrfMigration.optionType", "global") - body, _ = sjson.Set(body, path+"enableMrfMigration.value", data.EnableMigrationToMrf.ValueString()) + if true { + body, _ = sjson.Set(body, path+"enableMrfMigration.optionType", "global") + body, _ = sjson.Set(body, path+"enableMrfMigration.value", data.EnableMigrationToMrf.ValueString()) + } } if data.MigrationBgpCommunity.IsNull() { - body, _ = sjson.Set(body, path+"migrationBgpCommunity.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"migrationBgpCommunity.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"migrationBgpCommunity.optionType", "global") - body, _ = sjson.Set(body, path+"migrationBgpCommunity.value", data.MigrationBgpCommunity.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"migrationBgpCommunity.optionType", "global") + body, _ = sjson.Set(body, path+"migrationBgpCommunity.value", data.MigrationBgpCommunity.ValueInt64()) + } } return body } diff --git a/internal/provider/model_sdwan_system_ntp_profile_parcel.go b/internal/provider/model_sdwan_system_ntp_profile_parcel.go index b5c76489..e9ef90c7 100644 --- a/internal/provider/model_sdwan_system_ntp_profile_parcel.go +++ b/internal/provider/model_sdwan_system_ntp_profile_parcel.go @@ -95,140 +95,210 @@ func (data SystemNTP) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." - body, _ = sjson.Set(body, path+"server", []interface{}{}) - for _, item := range data.Servers { - itemBody := "" - - if !item.HostnameIpAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddressVariable.ValueString()) - } else if !item.HostnameIpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddress.ValueString()) - } + if true { + body, _ = sjson.Set(body, path+"server", []interface{}{}) + for _, item := range data.Servers { + itemBody := "" + + if !item.HostnameIpAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddressVariable.ValueString()) + } + } else if !item.HostnameIpAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.HostnameIpAddress.ValueString()) + } + } - if !item.AuthenticationKeyVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "key.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKeyVariable.ValueString()) - } else if item.AuthenticationKey.IsNull() { - itemBody, _ = sjson.Set(itemBody, "key.optionType", "default") + if !item.AuthenticationKeyVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "key.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKeyVariable.ValueString()) + } + } else if item.AuthenticationKey.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "key.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "key.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKey.ValueInt64()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "key.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "key.value", item.AuthenticationKey.ValueInt64()) + } + } - if !item.VpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) - } else if item.Vpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) - } + if !item.VpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.VpnVariable.ValueString()) + } + } else if item.Vpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "vpn.value", 0) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "vpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpn.value", item.Vpn.ValueInt64()) + } + } - if !item.NtpVersionVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "version.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersionVariable.ValueString()) - } else if item.NtpVersion.IsNull() { - itemBody, _ = sjson.Set(itemBody, "version.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "version.value", 4) - } else { - itemBody, _ = sjson.Set(itemBody, "version.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersion.ValueInt64()) - } + if !item.NtpVersionVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "version.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersionVariable.ValueString()) + } + } else if item.NtpVersion.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "version.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "version.value", 4) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "version.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "version.value", item.NtpVersion.ValueInt64()) + } + } - if !item.SourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) - } else if item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") + if !item.SourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) + } + } else if item.SourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } + } - if !item.PreferThisNtpServerVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServerVariable.ValueString()) - } else if item.PreferThisNtpServer.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "prefer.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServer.ValueBool()) + if !item.PreferThisNtpServerVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServerVariable.ValueString()) + } + } else if item.PreferThisNtpServer.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "prefer.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "prefer.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefer.value", item.PreferThisNtpServer.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"server.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"server.-1", itemBody) } - body, _ = sjson.Set(body, path+"authentication.authenticationKeys", []interface{}{}) - for _, item := range data.AuthenticationKeys { - itemBody := "" - - if !item.KeyIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyIdVariable.ValueString()) - } else if !item.KeyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyId.ValueInt64()) - } + if true { + body, _ = sjson.Set(body, path+"authentication.authenticationKeys", []interface{}{}) + for _, item := range data.AuthenticationKeys { + itemBody := "" + + if !item.KeyIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyIdVariable.ValueString()) + } + } else if !item.KeyId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keyId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keyId.value", item.KeyId.ValueInt64()) + } + } - if !item.Md5ValueVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5ValueVariable.ValueString()) - } else if !item.Md5Value.IsNull() { - itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5Value.ValueString()) + if !item.Md5ValueVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5ValueVariable.ValueString()) + } + } else if !item.Md5Value.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "md5Value.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "md5Value.value", item.Md5Value.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"authentication.authenticationKeys.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"authentication.authenticationKeys.-1", itemBody) } if !data.TrustedKeysVariable.IsNull() { - body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "variable") - body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", data.TrustedKeysVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "variable") + body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", data.TrustedKeysVariable.ValueString()) + } } else if data.TrustedKeys.IsNull() { - body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "global") - var values []int64 - data.TrustedKeys.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", values) + if true { + body, _ = sjson.Set(body, path+"authentication.trustedKeys.optionType", "global") + var values []int64 + data.TrustedKeys.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"authentication.trustedKeys.value", values) + } } if !data.AuthoritativeNtpServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"leader.enable.optionType", "variable") - body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"leader.enable.optionType", "variable") + body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServerVariable.ValueString()) + } } else if data.AuthoritativeNtpServer.IsNull() { - body, _ = sjson.Set(body, path+"leader.enable.optionType", "default") - body, _ = sjson.Set(body, path+"leader.enable.value", false) + if true { + body, _ = sjson.Set(body, path+"leader.enable.optionType", "default") + body, _ = sjson.Set(body, path+"leader.enable.value", false) + } } else { - body, _ = sjson.Set(body, path+"leader.enable.optionType", "global") - body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"leader.enable.optionType", "global") + body, _ = sjson.Set(body, path+"leader.enable.value", data.AuthoritativeNtpServer.ValueBool()) + } } if !data.StratumVariable.IsNull() { - body, _ = sjson.Set(body, path+"leader.stratum.optionType", "variable") - body, _ = sjson.Set(body, path+"leader.stratum.value", data.StratumVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"leader.stratum.optionType", "variable") + body, _ = sjson.Set(body, path+"leader.stratum.value", data.StratumVariable.ValueString()) + } } else if data.Stratum.IsNull() { - body, _ = sjson.Set(body, path+"leader.stratum.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"leader.stratum.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"leader.stratum.optionType", "global") - body, _ = sjson.Set(body, path+"leader.stratum.value", data.Stratum.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"leader.stratum.optionType", "global") + body, _ = sjson.Set(body, path+"leader.stratum.value", data.Stratum.ValueInt64()) + } } if !data.SourceInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"leader.source.optionType", "variable") - body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"leader.source.optionType", "variable") + body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterfaceVariable.ValueString()) + } } else if data.SourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"leader.source.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"leader.source.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"leader.source.optionType", "global") - body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"leader.source.optionType", "global") + body, _ = sjson.Set(body, path+"leader.source.value", data.SourceInterface.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_system_omp_profile_parcel.go b/internal/provider/model_sdwan_system_omp_profile_parcel.go index e8d775bb..f84cdaca 100644 --- a/internal/provider/model_sdwan_system_omp_profile_parcel.go +++ b/internal/provider/model_sdwan_system_omp_profile_parcel.go @@ -122,324 +122,498 @@ func (data SystemOMP) toBody(ctx context.Context) string { path := "data." if !data.GracefulRestartVariable.IsNull() { - body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "variable") - body, _ = sjson.Set(body, path+"gracefulRestart.value", data.GracefulRestartVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "variable") + body, _ = sjson.Set(body, path+"gracefulRestart.value", data.GracefulRestartVariable.ValueString()) + } } else if data.GracefulRestart.IsNull() { - body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "default") - body, _ = sjson.Set(body, path+"gracefulRestart.value", true) + if true { + body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "default") + body, _ = sjson.Set(body, path+"gracefulRestart.value", true) + } } else { - body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "global") - body, _ = sjson.Set(body, path+"gracefulRestart.value", data.GracefulRestart.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"gracefulRestart.optionType", "global") + body, _ = sjson.Set(body, path+"gracefulRestart.value", data.GracefulRestart.ValueBool()) + } } if !data.OverlayAsVariable.IsNull() { - body, _ = sjson.Set(body, path+"overlayAs.optionType", "variable") - body, _ = sjson.Set(body, path+"overlayAs.value", data.OverlayAsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"overlayAs.optionType", "variable") + body, _ = sjson.Set(body, path+"overlayAs.value", data.OverlayAsVariable.ValueString()) + } } else if data.OverlayAs.IsNull() { - body, _ = sjson.Set(body, path+"overlayAs.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"overlayAs.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"overlayAs.optionType", "global") - body, _ = sjson.Set(body, path+"overlayAs.value", data.OverlayAs.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"overlayAs.optionType", "global") + body, _ = sjson.Set(body, path+"overlayAs.value", data.OverlayAs.ValueInt64()) + } } if !data.PathsAdvertisedPerPrefixVariable.IsNull() { - body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "variable") - body, _ = sjson.Set(body, path+"sendPathLimit.value", data.PathsAdvertisedPerPrefixVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "variable") + body, _ = sjson.Set(body, path+"sendPathLimit.value", data.PathsAdvertisedPerPrefixVariable.ValueString()) + } } else if data.PathsAdvertisedPerPrefix.IsNull() { - body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "default") - body, _ = sjson.Set(body, path+"sendPathLimit.value", 4) + if true { + body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "default") + body, _ = sjson.Set(body, path+"sendPathLimit.value", 4) + } } else { - body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "global") - body, _ = sjson.Set(body, path+"sendPathLimit.value", data.PathsAdvertisedPerPrefix.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"sendPathLimit.optionType", "global") + body, _ = sjson.Set(body, path+"sendPathLimit.value", data.PathsAdvertisedPerPrefix.ValueInt64()) + } } if !data.EcmpLimitVariable.IsNull() { - body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "variable") - body, _ = sjson.Set(body, path+"ecmpLimit.value", data.EcmpLimitVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "variable") + body, _ = sjson.Set(body, path+"ecmpLimit.value", data.EcmpLimitVariable.ValueString()) + } } else if data.EcmpLimit.IsNull() { - body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "default") - body, _ = sjson.Set(body, path+"ecmpLimit.value", 4) + if true { + body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "default") + body, _ = sjson.Set(body, path+"ecmpLimit.value", 4) + } } else { - body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "global") - body, _ = sjson.Set(body, path+"ecmpLimit.value", data.EcmpLimit.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ecmpLimit.optionType", "global") + body, _ = sjson.Set(body, path+"ecmpLimit.value", data.EcmpLimit.ValueInt64()) + } } if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", false) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", false) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.OmpAdminDistanceIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", data.OmpAdminDistanceIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", data.OmpAdminDistanceIpv4Variable.ValueString()) + } } else if data.OmpAdminDistanceIpv4.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "default") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", 251) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "default") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", 251) + } } else { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", data.OmpAdminDistanceIpv4.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv4.value", data.OmpAdminDistanceIpv4.ValueInt64()) + } } if !data.OmpAdminDistanceIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6Variable.ValueString()) + } } else if data.OmpAdminDistanceIpv6.IsNull() { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "default") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", 251) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "default") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", 251) + } } else { - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"ompAdminDistanceIpv6.value", data.OmpAdminDistanceIpv6.ValueInt64()) + } } if !data.AdvertisementIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"advertisementInterval.value", data.AdvertisementIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"advertisementInterval.value", data.AdvertisementIntervalVariable.ValueString()) + } } else if data.AdvertisementInterval.IsNull() { - body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "default") - body, _ = sjson.Set(body, path+"advertisementInterval.value", 1) + if true { + body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "default") + body, _ = sjson.Set(body, path+"advertisementInterval.value", 1) + } } else { - body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advertisementInterval.value", data.AdvertisementInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advertisementInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advertisementInterval.value", data.AdvertisementInterval.ValueInt64()) + } } if !data.GracefulRestartTimerVariable.IsNull() { - body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "variable") - body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", data.GracefulRestartTimerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "variable") + body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", data.GracefulRestartTimerVariable.ValueString()) + } } else if data.GracefulRestartTimer.IsNull() { - body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "default") - body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", 43200) + if true { + body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "default") + body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", 43200) + } } else { - body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "global") - body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", data.GracefulRestartTimer.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"gracefulRestartTimer.optionType", "global") + body, _ = sjson.Set(body, path+"gracefulRestartTimer.value", data.GracefulRestartTimer.ValueInt64()) + } } if !data.EorTimerVariable.IsNull() { - body, _ = sjson.Set(body, path+"eorTimer.optionType", "variable") - body, _ = sjson.Set(body, path+"eorTimer.value", data.EorTimerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"eorTimer.optionType", "variable") + body, _ = sjson.Set(body, path+"eorTimer.value", data.EorTimerVariable.ValueString()) + } } else if data.EorTimer.IsNull() { - body, _ = sjson.Set(body, path+"eorTimer.optionType", "default") - body, _ = sjson.Set(body, path+"eorTimer.value", 300) + if true { + body, _ = sjson.Set(body, path+"eorTimer.optionType", "default") + body, _ = sjson.Set(body, path+"eorTimer.value", 300) + } } else { - body, _ = sjson.Set(body, path+"eorTimer.optionType", "global") - body, _ = sjson.Set(body, path+"eorTimer.value", data.EorTimer.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"eorTimer.optionType", "global") + body, _ = sjson.Set(body, path+"eorTimer.value", data.EorTimer.ValueInt64()) + } } if !data.HoldtimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"holdtime.optionType", "variable") - body, _ = sjson.Set(body, path+"holdtime.value", data.HoldtimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "variable") + body, _ = sjson.Set(body, path+"holdtime.value", data.HoldtimeVariable.ValueString()) + } } else if data.Holdtime.IsNull() { - body, _ = sjson.Set(body, path+"holdtime.optionType", "default") - body, _ = sjson.Set(body, path+"holdtime.value", 60) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "default") + body, _ = sjson.Set(body, path+"holdtime.value", 60) + } } else { - body, _ = sjson.Set(body, path+"holdtime.optionType", "global") - body, _ = sjson.Set(body, path+"holdtime.value", data.Holdtime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "global") + body, _ = sjson.Set(body, path+"holdtime.value", data.Holdtime.ValueInt64()) + } } if !data.AdvertiseIpv4BgpVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", data.AdvertiseIpv4BgpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", data.AdvertiseIpv4BgpVariable.ValueString()) + } } else if data.AdvertiseIpv4Bgp.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", data.AdvertiseIpv4Bgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.bgp.value", data.AdvertiseIpv4Bgp.ValueBool()) + } } if !data.AdvertiseIpv4OspfVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", data.AdvertiseIpv4OspfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", data.AdvertiseIpv4OspfVariable.ValueString()) + } } else if data.AdvertiseIpv4Ospf.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", data.AdvertiseIpv4Ospf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospf.value", data.AdvertiseIpv4Ospf.ValueBool()) + } } if !data.AdvertiseIpv4OspfV3Variable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", data.AdvertiseIpv4OspfV3Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", data.AdvertiseIpv4OspfV3Variable.ValueString()) + } } else if data.AdvertiseIpv4OspfV3.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", data.AdvertiseIpv4OspfV3.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.ospfv3.value", data.AdvertiseIpv4OspfV3.ValueBool()) + } } if !data.AdvertiseIpv4ConnectedVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", data.AdvertiseIpv4ConnectedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", data.AdvertiseIpv4ConnectedVariable.ValueString()) + } } else if data.AdvertiseIpv4Connected.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", true) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", true) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", data.AdvertiseIpv4Connected.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.connected.value", data.AdvertiseIpv4Connected.ValueBool()) + } } if !data.AdvertiseIpv4StaticVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", data.AdvertiseIpv4StaticVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", data.AdvertiseIpv4StaticVariable.ValueString()) + } } else if data.AdvertiseIpv4Static.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", true) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", true) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", data.AdvertiseIpv4Static.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.static.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.static.value", data.AdvertiseIpv4Static.ValueBool()) + } } if !data.AdvertiseIpv4EigrpVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", data.AdvertiseIpv4EigrpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", data.AdvertiseIpv4EigrpVariable.ValueString()) + } } else if data.AdvertiseIpv4Eigrp.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", data.AdvertiseIpv4Eigrp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.eigrp.value", data.AdvertiseIpv4Eigrp.ValueBool()) + } } if !data.AdvertiseIpv4LispVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", data.AdvertiseIpv4LispVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", data.AdvertiseIpv4LispVariable.ValueString()) + } } else if data.AdvertiseIpv4Lisp.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", data.AdvertiseIpv4Lisp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.lisp.value", data.AdvertiseIpv4Lisp.ValueBool()) + } } if !data.AdvertiseIpv4IsisVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", data.AdvertiseIpv4IsisVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", data.AdvertiseIpv4IsisVariable.ValueString()) + } } else if data.AdvertiseIpv4Isis.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", data.AdvertiseIpv4Isis.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv4.isis.value", data.AdvertiseIpv4Isis.ValueBool()) + } } if !data.AdvertiseIpv6BgpVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", data.AdvertiseIpv6BgpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", data.AdvertiseIpv6BgpVariable.ValueString()) + } } else if data.AdvertiseIpv6Bgp.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", data.AdvertiseIpv6Bgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.bgp.value", data.AdvertiseIpv6Bgp.ValueBool()) + } } if !data.AdvertiseIpv6OspfVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", data.AdvertiseIpv6OspfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", data.AdvertiseIpv6OspfVariable.ValueString()) + } } else if data.AdvertiseIpv6Ospf.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", data.AdvertiseIpv6Ospf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.ospf.value", data.AdvertiseIpv6Ospf.ValueBool()) + } } if !data.AdvertiseIpv6ConnectedVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", data.AdvertiseIpv6ConnectedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", data.AdvertiseIpv6ConnectedVariable.ValueString()) + } } else if data.AdvertiseIpv6Connected.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", data.AdvertiseIpv6Connected.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.connected.value", data.AdvertiseIpv6Connected.ValueBool()) + } } if !data.AdvertiseIpv6StaticVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", data.AdvertiseIpv6StaticVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", data.AdvertiseIpv6StaticVariable.ValueString()) + } } else if data.AdvertiseIpv6Static.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", data.AdvertiseIpv6Static.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.static.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.static.value", data.AdvertiseIpv6Static.ValueBool()) + } } if !data.AdvertiseIpv6EigrpVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", data.AdvertiseIpv6EigrpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", data.AdvertiseIpv6EigrpVariable.ValueString()) + } } else if data.AdvertiseIpv6Eigrp.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", data.AdvertiseIpv6Eigrp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.eigrp.value", data.AdvertiseIpv6Eigrp.ValueBool()) + } } if !data.AdvertiseIpv6LispVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", data.AdvertiseIpv6LispVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", data.AdvertiseIpv6LispVariable.ValueString()) + } } else if data.AdvertiseIpv6Lisp.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", data.AdvertiseIpv6Lisp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.lisp.value", data.AdvertiseIpv6Lisp.ValueBool()) + } } if !data.AdvertiseIpv6IsisVariable.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "variable") - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", data.AdvertiseIpv6IsisVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "variable") + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", data.AdvertiseIpv6IsisVariable.ValueString()) + } } else if data.AdvertiseIpv6Isis.IsNull() { - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "default") - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", false) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "default") + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", false) + } } else { - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "global") - body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", data.AdvertiseIpv6Isis.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.optionType", "global") + body, _ = sjson.Set(body, path+"advertiseIpv6.isis.value", data.AdvertiseIpv6Isis.ValueBool()) + } } if !data.IgnoreRegionPathLengthVariable.IsNull() { - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "variable") - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", data.IgnoreRegionPathLengthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "variable") + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", data.IgnoreRegionPathLengthVariable.ValueString()) + } } else if data.IgnoreRegionPathLength.IsNull() { - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "default") - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", false) + if true { + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "default") + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", false) + } } else { - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "global") - body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", data.IgnoreRegionPathLength.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.optionType", "global") + body, _ = sjson.Set(body, path+"ignoreRegionPathLength.value", data.IgnoreRegionPathLength.ValueBool()) + } } if !data.TransportGatewayVariable.IsNull() { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "variable") - body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGatewayVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "variable") + body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGatewayVariable.ValueString()) + } } else if data.TransportGateway.IsNull() { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") - body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueString()) + if true { + body, _ = sjson.Set(body, path+"transportGateway.optionType", "global") + body, _ = sjson.Set(body, path+"transportGateway.value", data.TransportGateway.ValueString()) + } } if !data.SiteTypesVariable.IsNull() { - body, _ = sjson.Set(body, path+"siteTypes.optionType", "variable") - body, _ = sjson.Set(body, path+"siteTypes.value", data.SiteTypesVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"siteTypes.optionType", "variable") + body, _ = sjson.Set(body, path+"siteTypes.value", data.SiteTypesVariable.ValueString()) + } } else if data.SiteTypes.IsNull() { - body, _ = sjson.Set(body, path+"siteTypes.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"siteTypes.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"siteTypes.optionType", "global") - var values []string - data.SiteTypes.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"siteTypes.value", values) + if true { + body, _ = sjson.Set(body, path+"siteTypes.optionType", "global") + var values []string + data.SiteTypes.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"siteTypes.value", values) + } } return body } diff --git a/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go b/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go index 466333c0..ee861221 100644 --- a/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go +++ b/internal/provider/model_sdwan_system_performance_monitoring_profile_parcel.go @@ -69,41 +69,59 @@ func (data SystemPerformanceMonitoring) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.AppPerfMonitorEnabled.IsNull() { - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.optionType", "default") - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", false) + if true { + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.optionType", "default") + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", false) + } } else { - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.optionType", "global") - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", data.AppPerfMonitorEnabled.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.optionType", "global") + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.enabled.value", data.AppPerfMonitorEnabled.ValueBool()) + } } if !data.AppPerfMonitorAppGroup.IsNull() { - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.optionType", "global") - var values []string - data.AppPerfMonitorAppGroup.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.value", values) + if true { + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.optionType", "global") + var values []string + data.AppPerfMonitorAppGroup.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"appPerfMonitorConfig.policyFilters.appGroups.value", values) + } } if data.MonitoringConfigEnabled.IsNull() { - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.optionType", "default") - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", false) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.optionType", "default") + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", false) + } } else { - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.optionType", "global") - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", data.MonitoringConfigEnabled.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.optionType", "global") + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.enabled.value", data.MonitoringConfigEnabled.ValueBool()) + } } if !data.MonitoringConfigInterval.IsNull() { - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.optionType", "global") - body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.value", data.MonitoringConfigInterval.ValueString()) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.optionType", "global") + body, _ = sjson.Set(body, path+"umtsConfig.monitoringConfig.interval.value", data.MonitoringConfigInterval.ValueString()) + } } if data.EventDrivenConfigEnabled.IsNull() { - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.optionType", "default") - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", false) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.optionType", "default") + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", false) + } } else { - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.optionType", "global") - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", data.EventDrivenConfigEnabled.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.optionType", "global") + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.enabled.value", data.EventDrivenConfigEnabled.ValueBool()) + } } if !data.EventDrivenEvents.IsNull() { - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.optionType", "global") - var values []string - data.EventDrivenEvents.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.value", values) + if true { + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.optionType", "global") + var values []string + data.EventDrivenEvents.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"umtsConfig.eventDrivenConfig.events.value", values) + } } return body } diff --git a/internal/provider/model_sdwan_system_remote_access_profile_parcel.go b/internal/provider/model_sdwan_system_remote_access_profile_parcel.go index 632f5b4d..656f3a38 100644 --- a/internal/provider/model_sdwan_system_remote_access_profile_parcel.go +++ b/internal/provider/model_sdwan_system_remote_access_profile_parcel.go @@ -32,55 +32,51 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin types type SystemRemoteAccess struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - ConnectionTypeSsl types.Bool `tfsdk:"connection_type_ssl"` - AnyConnectEapAuthenticationType types.String `tfsdk:"any_connect_eap_authentication_type"` - AnyConnectEapProfileDownloadStatus types.String `tfsdk:"any_connect_eap_profile_download_status"` - AnyConnectEapProfileDownloadStatusVariable types.String `tfsdk:"any_connect_eap_profile_download_status_variable"` - AnyConnectEapProfileFileName types.String `tfsdk:"any_connect_eap_profile_file_name"` - AnyConnectEapProfileFileNameVariable types.String `tfsdk:"any_connect_eap_profile_file_name_variable"` - Ipv4PoolSize types.Int64 `tfsdk:"ipv4_pool_size"` - Ipv4PoolSizeVariable types.String `tfsdk:"ipv4_pool_size_variable"` - Ipv6PoolSize types.Int64 `tfsdk:"ipv6_pool_size"` - Ipv6PoolSizeVariable types.String `tfsdk:"ipv6_pool_size_variable"` - EnableCrlCheck types.Bool `tfsdk:"enable_crl_check"` - EnableCrlCheckVariable types.String `tfsdk:"enable_crl_check_variable"` - PskAuthenticationType types.String `tfsdk:"psk_authentication_type"` - PskAuthenticationTypeVariable types.String `tfsdk:"psk_authentication_type_variable"` - PskAuthenticationPreSharedKey types.String `tfsdk:"psk_authentication_pre_shared_key"` - PskAuthenticationPreSharedKeyVariable types.String `tfsdk:"psk_authentication_pre_shared_key_variable"` - RadiusGroupName types.String `tfsdk:"radius_group_name"` - RadiusGroupNameVariable types.String `tfsdk:"radius_group_name_variable"` - AaaSpecifyNamePolicyName types.String `tfsdk:"aaa_specify_name_policy_name"` - AaaSpecifyNamePolicyNameVariable types.String `tfsdk:"aaa_specify_name_policy_name_variable"` - AaaSpecifyNamePolicyPassword types.String `tfsdk:"aaa_specify_name_policy_password"` - AaaSpecifyNamePolicyPasswordVariable types.String `tfsdk:"aaa_specify_name_policy_password_variable"` - AaaDeriveNameIdentity types.String `tfsdk:"aaa_derive_name_identity"` - AaaDeriveNameIdentityVariable types.String `tfsdk:"aaa_derive_name_identity_variable"` - AaaDeriveNameDomain types.String `tfsdk:"aaa_derive_name_domain"` - AaaDeriveNameDomainVariable types.String `tfsdk:"aaa_derive_name_domain_variable"` - AaaEnableAccounting types.Bool `tfsdk:"aaa_enable_accounting"` - AaaEnableAccountingVariable types.String `tfsdk:"aaa_enable_accounting_variable"` - Ikev2LocalIkeIdentityType types.String `tfsdk:"ikev2_local_ike_identity_type"` - Ikev2LocalIkeIdentityTypeVariable types.String `tfsdk:"ikev2_local_ike_identity_type_variable"` - Ikev2LocalIkeIdentityValue types.String `tfsdk:"ikev2_local_ike_identity_value"` - Ikev2LocalIkeIdentityValueVariable types.String `tfsdk:"ikev2_local_ike_identity_value_variable"` - Ikev2SecurityAssociationLifetime types.Int64 `tfsdk:"ikev2_security_association_lifetime"` - Ikev2SecurityAssociationLifetimeVariable types.String `tfsdk:"ikev2_security_association_lifetime_variable"` - Ikev2AntiDosThreshold types.Int64 `tfsdk:"ikev2_anti_dos_threshold"` - Ikev2AntiDosThresholdVariable types.String `tfsdk:"ikev2_anti_dos_threshold_variable"` - IpsecEnableAntiReplay types.Bool `tfsdk:"ipsec_enable_anti_replay"` - IpsecEnableAntiReplayVariable types.String `tfsdk:"ipsec_enable_anti_replay_variable"` - IpsecAntiReplayWindowSize types.Int64 `tfsdk:"ipsec_anti_replay_window_size"` - IpsecAntiReplayWindowSizeVariable types.String `tfsdk:"ipsec_anti_replay_window_size_variable"` - IpsecSecurityAssociationLifetime types.Int64 `tfsdk:"ipsec_security_association_lifetime"` - IpsecSecurityAssociationLifetimeVariable types.String `tfsdk:"ipsec_security_association_lifetime_variable"` - IpsecEnablePerfectFowardSecrecy types.Bool `tfsdk:"ipsec_enable_perfect_foward_secrecy"` - IpsecEnablePerfectFowardSecrecyVariable types.String `tfsdk:"ipsec_enable_perfect_foward_secrecy_variable"` + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + ConnectionTypeSsl types.Bool `tfsdk:"connection_type_ssl"` + AnyConnectEapAuthenticationType types.String `tfsdk:"any_connect_eap_authentication_type"` + Ipv4PoolSize types.Int64 `tfsdk:"ipv4_pool_size"` + Ipv4PoolSizeVariable types.String `tfsdk:"ipv4_pool_size_variable"` + Ipv6PoolSize types.Int64 `tfsdk:"ipv6_pool_size"` + Ipv6PoolSizeVariable types.String `tfsdk:"ipv6_pool_size_variable"` + EnableCertificateListCheck types.Bool `tfsdk:"enable_certificate_list_check"` + EnableCertificateListCheckVariable types.String `tfsdk:"enable_certificate_list_check_variable"` + PskAuthenticationType types.String `tfsdk:"psk_authentication_type"` + PskAuthenticationTypeVariable types.String `tfsdk:"psk_authentication_type_variable"` + PskAuthenticationPreSharedKey types.String `tfsdk:"psk_authentication_pre_shared_key"` + PskAuthenticationPreSharedKeyVariable types.String `tfsdk:"psk_authentication_pre_shared_key_variable"` + RadiusGroupName types.String `tfsdk:"radius_group_name"` + RadiusGroupNameVariable types.String `tfsdk:"radius_group_name_variable"` + AaaSpecifyNamePolicyName types.String `tfsdk:"aaa_specify_name_policy_name"` + AaaSpecifyNamePolicyNameVariable types.String `tfsdk:"aaa_specify_name_policy_name_variable"` + AaaSpecifyNamePolicyPassword types.String `tfsdk:"aaa_specify_name_policy_password"` + AaaSpecifyNamePolicyPasswordVariable types.String `tfsdk:"aaa_specify_name_policy_password_variable"` + AaaDeriveNameFromPeerIdentity types.String `tfsdk:"aaa_derive_name_from_peer_identity"` + AaaDeriveNameFromPeerIdentityVariable types.String `tfsdk:"aaa_derive_name_from_peer_identity_variable"` + AaaDeriveNameFromPeerDomain types.String `tfsdk:"aaa_derive_name_from_peer_domain"` + AaaDeriveNameFromPeerDomainVariable types.String `tfsdk:"aaa_derive_name_from_peer_domain_variable"` + AaaEnableAccounting types.Bool `tfsdk:"aaa_enable_accounting"` + AaaEnableAccountingVariable types.String `tfsdk:"aaa_enable_accounting_variable"` + Ikev2LocalIkeIdentityType types.String `tfsdk:"ikev2_local_ike_identity_type"` + Ikev2LocalIkeIdentityTypeVariable types.String `tfsdk:"ikev2_local_ike_identity_type_variable"` + Ikev2LocalIkeIdentityValue types.String `tfsdk:"ikev2_local_ike_identity_value"` + Ikev2LocalIkeIdentityValueVariable types.String `tfsdk:"ikev2_local_ike_identity_value_variable"` + Ikev2SecurityAssociationLifetime types.Int64 `tfsdk:"ikev2_security_association_lifetime"` + Ikev2SecurityAssociationLifetimeVariable types.String `tfsdk:"ikev2_security_association_lifetime_variable"` + Ikev2AntiDosThreshold types.Int64 `tfsdk:"ikev2_anti_dos_threshold"` + Ikev2AntiDosThresholdVariable types.String `tfsdk:"ikev2_anti_dos_threshold_variable"` + IpsecEnableAntiReplay types.Bool `tfsdk:"ipsec_enable_anti_replay"` + IpsecEnableAntiReplayVariable types.String `tfsdk:"ipsec_enable_anti_replay_variable"` + IpsecAntiReplayWindowSize types.Int64 `tfsdk:"ipsec_anti_replay_window_size"` + IpsecAntiReplayWindowSizeVariable types.String `tfsdk:"ipsec_anti_replay_window_size_variable"` + IpsecSecurityAssociationLifetime types.Int64 `tfsdk:"ipsec_security_association_lifetime"` + IpsecSecurityAssociationLifetimeVariable types.String `tfsdk:"ipsec_security_association_lifetime_variable"` + IpsecEnablePerfectFowardSecrecy types.Bool `tfsdk:"ipsec_enable_perfect_foward_secrecy"` + IpsecEnablePerfectFowardSecrecyVariable types.String `tfsdk:"ipsec_enable_perfect_foward_secrecy_variable"` } // End of section. //template:end types @@ -106,228 +102,314 @@ func (data SystemRemoteAccess) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.ConnectionTypeSsl.IsNull() { - body, _ = sjson.Set(body, path+"enableSSLVPN.optionType", "default") - body, _ = sjson.Set(body, path+"enableSSLVPN.value", false) + if true { + body, _ = sjson.Set(body, path+"enableSSLVPN.optionType", "default") + body, _ = sjson.Set(body, path+"enableSSLVPN.value", false) + } } else { - body, _ = sjson.Set(body, path+"enableSSLVPN.optionType", "global") - body, _ = sjson.Set(body, path+"enableSSLVPN.value", data.ConnectionTypeSsl.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableSSLVPN.optionType", "global") + body, _ = sjson.Set(body, path+"enableSSLVPN.value", data.ConnectionTypeSsl.ValueBool()) + } } if !data.AnyConnectEapAuthenticationType.IsNull() { - body, _ = sjson.Set(body, path+"anyConnectEapAuth.optionType", "global") - body, _ = sjson.Set(body, path+"anyConnectEapAuth.value", data.AnyConnectEapAuthenticationType.ValueString()) - } - - if !data.AnyConnectEapProfileDownloadStatusVariable.IsNull() { - body, _ = sjson.Set(body, path+"anyConnectProfileDownloadStatus.optionType", "variable") - body, _ = sjson.Set(body, path+"anyConnectProfileDownloadStatus.value", data.AnyConnectEapProfileDownloadStatusVariable.ValueString()) - } else if data.AnyConnectEapProfileDownloadStatus.IsNull() { - body, _ = sjson.Set(body, path+"anyConnectProfileDownloadStatus.optionType", "default") - body, _ = sjson.Set(body, path+"anyConnectProfileDownloadStatus.value", "NONE") - } else { - body, _ = sjson.Set(body, path+"anyConnectProfileDownloadStatus.optionType", "global") - body, _ = sjson.Set(body, path+"anyConnectProfileDownloadStatus.value", data.AnyConnectEapProfileDownloadStatus.ValueString()) - } - - if !data.AnyConnectEapProfileFileNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"anyConnectProfileFileName.optionType", "variable") - body, _ = sjson.Set(body, path+"anyConnectProfileFileName.value", data.AnyConnectEapProfileFileNameVariable.ValueString()) - } else if data.AnyConnectEapProfileFileName.IsNull() { - body, _ = sjson.Set(body, path+"anyConnectProfileFileName.optionType", "default") - body, _ = sjson.Set(body, path+"anyConnectProfileFileName.value", "") - } else { - body, _ = sjson.Set(body, path+"anyConnectProfileFileName.optionType", "global") - body, _ = sjson.Set(body, path+"anyConnectProfileFileName.value", data.AnyConnectEapProfileFileName.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"anyConnectEapAuth.optionType", "global") + body, _ = sjson.Set(body, path+"anyConnectEapAuth.value", data.AnyConnectEapAuthenticationType.ValueString()) + } } if !data.Ipv4PoolSizeVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv4PoolSize.value", data.Ipv4PoolSizeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv4PoolSize.value", data.Ipv4PoolSizeVariable.ValueString()) + } } else if data.Ipv4PoolSize.IsNull() { - body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "default") - body, _ = sjson.Set(body, path+"ipv4PoolSize.value", 1000) + if true { + body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "default") + body, _ = sjson.Set(body, path+"ipv4PoolSize.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "global") - body, _ = sjson.Set(body, path+"ipv4PoolSize.value", data.Ipv4PoolSize.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipv4PoolSize.optionType", "global") + body, _ = sjson.Set(body, path+"ipv4PoolSize.value", data.Ipv4PoolSize.ValueInt64()) + } } if !data.Ipv6PoolSizeVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv6PoolSize.value", data.Ipv6PoolSizeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv6PoolSize.value", data.Ipv6PoolSizeVariable.ValueString()) + } } else if data.Ipv6PoolSize.IsNull() { - body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "default") - body, _ = sjson.Set(body, path+"ipv6PoolSize.value", 1024) + if true { + body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "default") + body, _ = sjson.Set(body, path+"ipv6PoolSize.value", 1024) + } } else { - body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6PoolSize.value", data.Ipv6PoolSize.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipv6PoolSize.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6PoolSize.value", data.Ipv6PoolSize.ValueInt64()) + } } - if !data.EnableCrlCheckVariable.IsNull() { - body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "variable") - body, _ = sjson.Set(body, path+"enableCrlCheck.value", data.EnableCrlCheckVariable.ValueString()) - } else if data.EnableCrlCheck.IsNull() { - body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "default") - body, _ = sjson.Set(body, path+"enableCrlCheck.value", false) + if !data.EnableCertificateListCheckVariable.IsNull() { + if true { + body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "variable") + body, _ = sjson.Set(body, path+"enableCrlCheck.value", data.EnableCertificateListCheckVariable.ValueString()) + } + } else if data.EnableCertificateListCheck.IsNull() { + if true { + body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "default") + body, _ = sjson.Set(body, path+"enableCrlCheck.value", false) + } } else { - body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "global") - body, _ = sjson.Set(body, path+"enableCrlCheck.value", data.EnableCrlCheck.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableCrlCheck.optionType", "global") + body, _ = sjson.Set(body, path+"enableCrlCheck.value", data.EnableCertificateListCheck.ValueBool()) + } } if !data.PskAuthenticationTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "variable") - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.value", data.PskAuthenticationTypeVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "variable") + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.value", data.PskAuthenticationTypeVariable.ValueString()) + } } else if data.PskAuthenticationType.IsNull() { - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "default") + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "global") - body, _ = sjson.Set(body, path+"pskAuth.pskSelection.value", data.PskAuthenticationType.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.optionType", "global") + body, _ = sjson.Set(body, path+"pskAuth.pskSelection.value", data.PskAuthenticationType.ValueString()) + } } if !data.PskAuthenticationPreSharedKeyVariable.IsNull() { - body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.optionType", "variable") - body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKeyVariable.ValueString()) + if true && data.PskAuthenticationType.ValueString() == "group" { + body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.optionType", "variable") + body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKeyVariable.ValueString()) + } } else if !data.PskAuthenticationPreSharedKey.IsNull() { - body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.optionType", "global") - body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKey.ValueString()) + if true && data.PskAuthenticationType.ValueString() == "group" { + body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.optionType", "global") + body, _ = sjson.Set(body, path+"pskAuth.preSharedKey.value", data.PskAuthenticationPreSharedKey.ValueString()) + } } if !data.RadiusGroupNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"radiusGroupName.optionType", "variable") - body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"radiusGroupName.optionType", "variable") + body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupNameVariable.ValueString()) + } } else if !data.RadiusGroupName.IsNull() { - body, _ = sjson.Set(body, path+"radiusGroupName.optionType", "global") - body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"radiusGroupName.optionType", "global") + body, _ = sjson.Set(body, path+"radiusGroupName.value", data.RadiusGroupName.ValueString()) + } } if !data.AaaSpecifyNamePolicyNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.optionType", "variable") - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.optionType", "variable") + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyNameVariable.ValueString()) + } } else if !data.AaaSpecifyNamePolicyName.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.policyName.value", data.AaaSpecifyNamePolicyName.ValueString()) + } } if !data.AaaSpecifyNamePolicyPasswordVariable.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.optionType", "variable") - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPasswordVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.optionType", "variable") + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPasswordVariable.ValueString()) + } } else if !data.AaaSpecifyNamePolicyPassword.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPassword.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.specifyName.password.value", data.AaaSpecifyNamePolicyPassword.ValueString()) + } } - if !data.AaaDeriveNameIdentityVariable.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.optionType", "variable") - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameIdentityVariable.ValueString()) - } else if !data.AaaDeriveNameIdentity.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameIdentity.ValueString()) + if !data.AaaDeriveNameFromPeerIdentityVariable.IsNull() { + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.optionType", "variable") + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameFromPeerIdentityVariable.ValueString()) + } + } else if !data.AaaDeriveNameFromPeerIdentity.IsNull() { + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameIdentity.value", data.AaaDeriveNameFromPeerIdentity.ValueString()) + } } - if !data.AaaDeriveNameDomainVariable.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.optionType", "variable") - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameDomainVariable.ValueString()) - } else if !data.AaaDeriveNameDomain.IsNull() { - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.optionType", "global") - body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameDomain.ValueString()) + if !data.AaaDeriveNameFromPeerDomainVariable.IsNull() { + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.optionType", "variable") + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameFromPeerDomainVariable.ValueString()) + } + } else if !data.AaaDeriveNameFromPeerDomain.IsNull() { + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.optionType", "global") + body, _ = sjson.Set(body, path+"aaaPolicy.deriveNameDomain.value", data.AaaDeriveNameFromPeerDomain.ValueString()) + } } if !data.AaaEnableAccountingVariable.IsNull() { - body, _ = sjson.Set(body, path+"enableAccounting.optionType", "variable") - body, _ = sjson.Set(body, path+"enableAccounting.value", data.AaaEnableAccountingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"enableAccounting.optionType", "variable") + body, _ = sjson.Set(body, path+"enableAccounting.value", data.AaaEnableAccountingVariable.ValueString()) + } } else if data.AaaEnableAccounting.IsNull() { - body, _ = sjson.Set(body, path+"enableAccounting.optionType", "default") - body, _ = sjson.Set(body, path+"enableAccounting.value", true) + if true { + body, _ = sjson.Set(body, path+"enableAccounting.optionType", "default") + body, _ = sjson.Set(body, path+"enableAccounting.value", true) + } } else { - body, _ = sjson.Set(body, path+"enableAccounting.optionType", "global") - body, _ = sjson.Set(body, path+"enableAccounting.value", data.AaaEnableAccounting.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enableAccounting.optionType", "global") + body, _ = sjson.Set(body, path+"enableAccounting.value", data.AaaEnableAccounting.ValueBool()) + } } if !data.Ikev2LocalIkeIdentityTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "variable") - body, _ = sjson.Set(body, path+"localIkev2IdentityType.value", data.Ikev2LocalIkeIdentityTypeVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "variable") + body, _ = sjson.Set(body, path+"localIkev2IdentityType.value", data.Ikev2LocalIkeIdentityTypeVariable.ValueString()) + } } else if data.Ikev2LocalIkeIdentityType.IsNull() { - body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "default") + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "global") - body, _ = sjson.Set(body, path+"localIkev2IdentityType.value", data.Ikev2LocalIkeIdentityType.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityType.optionType", "global") + body, _ = sjson.Set(body, path+"localIkev2IdentityType.value", data.Ikev2LocalIkeIdentityType.ValueString()) + } } if !data.Ikev2LocalIkeIdentityValueVariable.IsNull() { - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "variable") - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.value", data.Ikev2LocalIkeIdentityValueVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "variable") + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.value", data.Ikev2LocalIkeIdentityValueVariable.ValueString()) + } } else if data.Ikev2LocalIkeIdentityValue.IsNull() { - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "default") + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "global") - body, _ = sjson.Set(body, path+"localIkev2IdentityValue.value", data.Ikev2LocalIkeIdentityValue.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.optionType", "global") + body, _ = sjson.Set(body, path+"localIkev2IdentityValue.value", data.Ikev2LocalIkeIdentityValue.ValueString()) + } } if !data.Ikev2SecurityAssociationLifetimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "variable") - body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", data.Ikev2SecurityAssociationLifetimeVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "variable") + body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", data.Ikev2SecurityAssociationLifetimeVariable.ValueString()) + } } else if data.Ikev2SecurityAssociationLifetime.IsNull() { - body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "default") - body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", 86400) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "default") + body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", 86400) + } } else { - body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "global") - body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", data.Ikev2SecurityAssociationLifetime.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ikev2SaLifetime.optionType", "global") + body, _ = sjson.Set(body, path+"ikev2SaLifetime.value", data.Ikev2SecurityAssociationLifetime.ValueInt64()) + } } if !data.Ikev2AntiDosThresholdVariable.IsNull() { - body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "variable") - body, _ = sjson.Set(body, path+"antiDosThreshold.value", data.Ikev2AntiDosThresholdVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "variable") + body, _ = sjson.Set(body, path+"antiDosThreshold.value", data.Ikev2AntiDosThresholdVariable.ValueString()) + } } else if data.Ikev2AntiDosThreshold.IsNull() { - body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "default") - body, _ = sjson.Set(body, path+"antiDosThreshold.value", 100) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "default") + body, _ = sjson.Set(body, path+"antiDosThreshold.value", 100) + } } else { - body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "global") - body, _ = sjson.Set(body, path+"antiDosThreshold.value", data.Ikev2AntiDosThreshold.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"antiDosThreshold.optionType", "global") + body, _ = sjson.Set(body, path+"antiDosThreshold.value", data.Ikev2AntiDosThreshold.ValueInt64()) + } } if !data.IpsecEnableAntiReplayVariable.IsNull() { - body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "variable") - body, _ = sjson.Set(body, path+"enableAntiReplay.value", data.IpsecEnableAntiReplayVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "variable") + body, _ = sjson.Set(body, path+"enableAntiReplay.value", data.IpsecEnableAntiReplayVariable.ValueString()) + } } else if data.IpsecEnableAntiReplay.IsNull() { - body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "default") - body, _ = sjson.Set(body, path+"enableAntiReplay.value", true) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "default") + body, _ = sjson.Set(body, path+"enableAntiReplay.value", true) + } } else { - body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "global") - body, _ = sjson.Set(body, path+"enableAntiReplay.value", data.IpsecEnableAntiReplay.ValueBool()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enableAntiReplay.optionType", "global") + body, _ = sjson.Set(body, path+"enableAntiReplay.value", data.IpsecEnableAntiReplay.ValueBool()) + } } if !data.IpsecAntiReplayWindowSizeVariable.IsNull() { - body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "variable") - body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", data.IpsecAntiReplayWindowSizeVariable.ValueString()) + if true && data.IpsecEnableAntiReplay.ValueBool() == true { + body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "variable") + body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", data.IpsecAntiReplayWindowSizeVariable.ValueString()) + } } else if data.IpsecAntiReplayWindowSize.IsNull() { - body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "default") - body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", 64) + if true && data.IpsecEnableAntiReplay.ValueBool() == true { + body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "default") + body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", 64) + } } else { - body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "global") - body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", data.IpsecAntiReplayWindowSize.ValueInt64()) + if true && data.IpsecEnableAntiReplay.ValueBool() == true { + body, _ = sjson.Set(body, path+"antiReplayWindowSize.optionType", "global") + body, _ = sjson.Set(body, path+"antiReplayWindowSize.value", data.IpsecAntiReplayWindowSize.ValueInt64()) + } } if !data.IpsecSecurityAssociationLifetimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "variable") - body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", data.IpsecSecurityAssociationLifetimeVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "variable") + body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", data.IpsecSecurityAssociationLifetimeVariable.ValueString()) + } } else if data.IpsecSecurityAssociationLifetime.IsNull() { - body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "default") - body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", 3600) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "default") + body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", 3600) + } } else { - body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "global") - body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", data.IpsecSecurityAssociationLifetime.ValueInt64()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"ipSecSaLifetime.optionType", "global") + body, _ = sjson.Set(body, path+"ipSecSaLifetime.value", data.IpsecSecurityAssociationLifetime.ValueInt64()) + } } if !data.IpsecEnablePerfectFowardSecrecyVariable.IsNull() { - body, _ = sjson.Set(body, path+"enablePFS.optionType", "variable") - body, _ = sjson.Set(body, path+"enablePFS.value", data.IpsecEnablePerfectFowardSecrecyVariable.ValueString()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enablePFS.optionType", "variable") + body, _ = sjson.Set(body, path+"enablePFS.value", data.IpsecEnablePerfectFowardSecrecyVariable.ValueString()) + } } else if data.IpsecEnablePerfectFowardSecrecy.IsNull() { - body, _ = sjson.Set(body, path+"enablePFS.optionType", "default") - body, _ = sjson.Set(body, path+"enablePFS.value", false) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enablePFS.optionType", "default") + body, _ = sjson.Set(body, path+"enablePFS.value", false) + } } else { - body, _ = sjson.Set(body, path+"enablePFS.optionType", "global") - body, _ = sjson.Set(body, path+"enablePFS.value", data.IpsecEnablePerfectFowardSecrecy.ValueBool()) + if true && data.ConnectionTypeSsl.ValueBool() == false { + body, _ = sjson.Set(body, path+"enablePFS.optionType", "global") + body, _ = sjson.Set(body, path+"enablePFS.value", data.IpsecEnablePerfectFowardSecrecy.ValueBool()) + } } return body } @@ -359,26 +441,6 @@ func (data *SystemRemoteAccess) fromBody(ctx context.Context, res gjson.Result) data.AnyConnectEapAuthenticationType = types.StringValue(va.String()) } } - data.AnyConnectEapProfileDownloadStatus = types.StringNull() - data.AnyConnectEapProfileDownloadStatusVariable = types.StringNull() - if t := res.Get(path + "anyConnectProfileDownloadStatus.optionType"); t.Exists() { - va := res.Get(path + "anyConnectProfileDownloadStatus.value") - if t.String() == "variable" { - data.AnyConnectEapProfileDownloadStatusVariable = types.StringValue(va.String()) - } else if t.String() == "global" { - data.AnyConnectEapProfileDownloadStatus = types.StringValue(va.String()) - } - } - data.AnyConnectEapProfileFileName = types.StringNull() - data.AnyConnectEapProfileFileNameVariable = types.StringNull() - if t := res.Get(path + "anyConnectProfileFileName.optionType"); t.Exists() { - va := res.Get(path + "anyConnectProfileFileName.value") - if t.String() == "variable" { - data.AnyConnectEapProfileFileNameVariable = types.StringValue(va.String()) - } else if t.String() == "global" { - data.AnyConnectEapProfileFileName = types.StringValue(va.String()) - } - } data.Ipv4PoolSize = types.Int64Null() data.Ipv4PoolSizeVariable = types.StringNull() if t := res.Get(path + "ipv4PoolSize.optionType"); t.Exists() { @@ -399,14 +461,14 @@ func (data *SystemRemoteAccess) fromBody(ctx context.Context, res gjson.Result) data.Ipv6PoolSize = types.Int64Value(va.Int()) } } - data.EnableCrlCheck = types.BoolNull() - data.EnableCrlCheckVariable = types.StringNull() + data.EnableCertificateListCheck = types.BoolNull() + data.EnableCertificateListCheckVariable = types.StringNull() if t := res.Get(path + "enableCrlCheck.optionType"); t.Exists() { va := res.Get(path + "enableCrlCheck.value") if t.String() == "variable" { - data.EnableCrlCheckVariable = types.StringValue(va.String()) + data.EnableCertificateListCheckVariable = types.StringValue(va.String()) } else if t.String() == "global" { - data.EnableCrlCheck = types.BoolValue(va.Bool()) + data.EnableCertificateListCheck = types.BoolValue(va.Bool()) } } data.PskAuthenticationType = types.StringNull() @@ -459,24 +521,24 @@ func (data *SystemRemoteAccess) fromBody(ctx context.Context, res gjson.Result) data.AaaSpecifyNamePolicyPassword = types.StringValue(va.String()) } } - data.AaaDeriveNameIdentity = types.StringNull() - data.AaaDeriveNameIdentityVariable = types.StringNull() + data.AaaDeriveNameFromPeerIdentity = types.StringNull() + data.AaaDeriveNameFromPeerIdentityVariable = types.StringNull() if t := res.Get(path + "aaaPolicy.deriveNameIdentity.optionType"); t.Exists() { va := res.Get(path + "aaaPolicy.deriveNameIdentity.value") if t.String() == "variable" { - data.AaaDeriveNameIdentityVariable = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerIdentityVariable = types.StringValue(va.String()) } else if t.String() == "global" { - data.AaaDeriveNameIdentity = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerIdentity = types.StringValue(va.String()) } } - data.AaaDeriveNameDomain = types.StringNull() - data.AaaDeriveNameDomainVariable = types.StringNull() + data.AaaDeriveNameFromPeerDomain = types.StringNull() + data.AaaDeriveNameFromPeerDomainVariable = types.StringNull() if t := res.Get(path + "aaaPolicy.deriveNameDomain.optionType"); t.Exists() { va := res.Get(path + "aaaPolicy.deriveNameDomain.value") if t.String() == "variable" { - data.AaaDeriveNameDomainVariable = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerDomainVariable = types.StringValue(va.String()) } else if t.String() == "global" { - data.AaaDeriveNameDomain = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerDomain = types.StringValue(va.String()) } } data.AaaEnableAccounting = types.BoolNull() @@ -598,26 +660,6 @@ func (data *SystemRemoteAccess) updateFromBody(ctx context.Context, res gjson.Re data.AnyConnectEapAuthenticationType = types.StringValue(va.String()) } } - data.AnyConnectEapProfileDownloadStatus = types.StringNull() - data.AnyConnectEapProfileDownloadStatusVariable = types.StringNull() - if t := res.Get(path + "anyConnectProfileDownloadStatus.optionType"); t.Exists() { - va := res.Get(path + "anyConnectProfileDownloadStatus.value") - if t.String() == "variable" { - data.AnyConnectEapProfileDownloadStatusVariable = types.StringValue(va.String()) - } else if t.String() == "global" { - data.AnyConnectEapProfileDownloadStatus = types.StringValue(va.String()) - } - } - data.AnyConnectEapProfileFileName = types.StringNull() - data.AnyConnectEapProfileFileNameVariable = types.StringNull() - if t := res.Get(path + "anyConnectProfileFileName.optionType"); t.Exists() { - va := res.Get(path + "anyConnectProfileFileName.value") - if t.String() == "variable" { - data.AnyConnectEapProfileFileNameVariable = types.StringValue(va.String()) - } else if t.String() == "global" { - data.AnyConnectEapProfileFileName = types.StringValue(va.String()) - } - } data.Ipv4PoolSize = types.Int64Null() data.Ipv4PoolSizeVariable = types.StringNull() if t := res.Get(path + "ipv4PoolSize.optionType"); t.Exists() { @@ -638,14 +680,14 @@ func (data *SystemRemoteAccess) updateFromBody(ctx context.Context, res gjson.Re data.Ipv6PoolSize = types.Int64Value(va.Int()) } } - data.EnableCrlCheck = types.BoolNull() - data.EnableCrlCheckVariable = types.StringNull() + data.EnableCertificateListCheck = types.BoolNull() + data.EnableCertificateListCheckVariable = types.StringNull() if t := res.Get(path + "enableCrlCheck.optionType"); t.Exists() { va := res.Get(path + "enableCrlCheck.value") if t.String() == "variable" { - data.EnableCrlCheckVariable = types.StringValue(va.String()) + data.EnableCertificateListCheckVariable = types.StringValue(va.String()) } else if t.String() == "global" { - data.EnableCrlCheck = types.BoolValue(va.Bool()) + data.EnableCertificateListCheck = types.BoolValue(va.Bool()) } } data.PskAuthenticationType = types.StringNull() @@ -698,24 +740,24 @@ func (data *SystemRemoteAccess) updateFromBody(ctx context.Context, res gjson.Re data.AaaSpecifyNamePolicyPassword = types.StringValue(va.String()) } } - data.AaaDeriveNameIdentity = types.StringNull() - data.AaaDeriveNameIdentityVariable = types.StringNull() + data.AaaDeriveNameFromPeerIdentity = types.StringNull() + data.AaaDeriveNameFromPeerIdentityVariable = types.StringNull() if t := res.Get(path + "aaaPolicy.deriveNameIdentity.optionType"); t.Exists() { va := res.Get(path + "aaaPolicy.deriveNameIdentity.value") if t.String() == "variable" { - data.AaaDeriveNameIdentityVariable = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerIdentityVariable = types.StringValue(va.String()) } else if t.String() == "global" { - data.AaaDeriveNameIdentity = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerIdentity = types.StringValue(va.String()) } } - data.AaaDeriveNameDomain = types.StringNull() - data.AaaDeriveNameDomainVariable = types.StringNull() + data.AaaDeriveNameFromPeerDomain = types.StringNull() + data.AaaDeriveNameFromPeerDomainVariable = types.StringNull() if t := res.Get(path + "aaaPolicy.deriveNameDomain.optionType"); t.Exists() { va := res.Get(path + "aaaPolicy.deriveNameDomain.value") if t.String() == "variable" { - data.AaaDeriveNameDomainVariable = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerDomainVariable = types.StringValue(va.String()) } else if t.String() == "global" { - data.AaaDeriveNameDomain = types.StringValue(va.String()) + data.AaaDeriveNameFromPeerDomain = types.StringValue(va.String()) } } data.AaaEnableAccounting = types.BoolNull() @@ -823,18 +865,6 @@ func (data *SystemRemoteAccess) isNull(ctx context.Context, res gjson.Result) bo if !data.AnyConnectEapAuthenticationType.IsNull() { return false } - if !data.AnyConnectEapProfileDownloadStatus.IsNull() { - return false - } - if !data.AnyConnectEapProfileDownloadStatusVariable.IsNull() { - return false - } - if !data.AnyConnectEapProfileFileName.IsNull() { - return false - } - if !data.AnyConnectEapProfileFileNameVariable.IsNull() { - return false - } if !data.Ipv4PoolSize.IsNull() { return false } @@ -847,10 +877,10 @@ func (data *SystemRemoteAccess) isNull(ctx context.Context, res gjson.Result) bo if !data.Ipv6PoolSizeVariable.IsNull() { return false } - if !data.EnableCrlCheck.IsNull() { + if !data.EnableCertificateListCheck.IsNull() { return false } - if !data.EnableCrlCheckVariable.IsNull() { + if !data.EnableCertificateListCheckVariable.IsNull() { return false } if !data.PskAuthenticationType.IsNull() { @@ -883,16 +913,16 @@ func (data *SystemRemoteAccess) isNull(ctx context.Context, res gjson.Result) bo if !data.AaaSpecifyNamePolicyPasswordVariable.IsNull() { return false } - if !data.AaaDeriveNameIdentity.IsNull() { + if !data.AaaDeriveNameFromPeerIdentity.IsNull() { return false } - if !data.AaaDeriveNameIdentityVariable.IsNull() { + if !data.AaaDeriveNameFromPeerIdentityVariable.IsNull() { return false } - if !data.AaaDeriveNameDomain.IsNull() { + if !data.AaaDeriveNameFromPeerDomain.IsNull() { return false } - if !data.AaaDeriveNameDomainVariable.IsNull() { + if !data.AaaDeriveNameFromPeerDomainVariable.IsNull() { return false } if !data.AaaEnableAccounting.IsNull() { diff --git a/internal/provider/model_sdwan_system_security_profile_parcel.go b/internal/provider/model_sdwan_system_security_profile_parcel.go index 46e78e30..b33895e2 100644 --- a/internal/provider/model_sdwan_system_security_profile_parcel.go +++ b/internal/provider/model_sdwan_system_security_profile_parcel.go @@ -114,203 +114,305 @@ func (data SystemSecurity) toBody(ctx context.Context) string { path := "data." if !data.RekeyVariable.IsNull() { - body, _ = sjson.Set(body, path+"rekey.optionType", "variable") - body, _ = sjson.Set(body, path+"rekey.value", data.RekeyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"rekey.optionType", "variable") + body, _ = sjson.Set(body, path+"rekey.value", data.RekeyVariable.ValueString()) + } } else if data.Rekey.IsNull() { - body, _ = sjson.Set(body, path+"rekey.optionType", "default") - body, _ = sjson.Set(body, path+"rekey.value", 86400) + if true { + body, _ = sjson.Set(body, path+"rekey.optionType", "default") + body, _ = sjson.Set(body, path+"rekey.value", 86400) + } } else { - body, _ = sjson.Set(body, path+"rekey.optionType", "global") - body, _ = sjson.Set(body, path+"rekey.value", data.Rekey.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"rekey.optionType", "global") + body, _ = sjson.Set(body, path+"rekey.value", data.Rekey.ValueInt64()) + } } if !data.AntiReplayWindowVariable.IsNull() { - body, _ = sjson.Set(body, path+"replayWindow.optionType", "variable") - body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindowVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"replayWindow.optionType", "variable") + body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindowVariable.ValueString()) + } } else if data.AntiReplayWindow.IsNull() { - body, _ = sjson.Set(body, path+"replayWindow.optionType", "default") - body, _ = sjson.Set(body, path+"replayWindow.value", "512") + if true { + body, _ = sjson.Set(body, path+"replayWindow.optionType", "default") + body, _ = sjson.Set(body, path+"replayWindow.value", "512") + } } else { - body, _ = sjson.Set(body, path+"replayWindow.optionType", "global") - body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindow.ValueString()) + if true { + body, _ = sjson.Set(body, path+"replayWindow.optionType", "global") + body, _ = sjson.Set(body, path+"replayWindow.value", data.AntiReplayWindow.ValueString()) + } } if !data.ExtendedAntiReplayWindowVariable.IsNull() { - body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "variable") - body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindowVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "variable") + body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindowVariable.ValueString()) + } } else if data.ExtendedAntiReplayWindow.IsNull() { - body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "default") - body, _ = sjson.Set(body, path+"extendedArWindow.value", 256) + if true { + body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "default") + body, _ = sjson.Set(body, path+"extendedArWindow.value", 256) + } } else { - body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "global") - body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindow.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"extendedArWindow.optionType", "global") + body, _ = sjson.Set(body, path+"extendedArWindow.value", data.ExtendedAntiReplayWindow.ValueInt64()) + } } if !data.IpsecPairwiseKeyingVariable.IsNull() { - body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "variable") - body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeyingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "variable") + body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeyingVariable.ValueString()) + } } else if data.IpsecPairwiseKeying.IsNull() { - body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "default") - body, _ = sjson.Set(body, path+"pairwiseKeying.value", false) + if true { + body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "default") + body, _ = sjson.Set(body, path+"pairwiseKeying.value", false) + } } else { - body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "global") - body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeying.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"pairwiseKeying.optionType", "global") + body, _ = sjson.Set(body, path+"pairwiseKeying.value", data.IpsecPairwiseKeying.ValueBool()) + } } if !data.IntegrityTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"integrityType.optionType", "variable") - body, _ = sjson.Set(body, path+"integrityType.value", data.IntegrityTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"integrityType.optionType", "variable") + body, _ = sjson.Set(body, path+"integrityType.value", data.IntegrityTypeVariable.ValueString()) + } } else if !data.IntegrityType.IsNull() { - body, _ = sjson.Set(body, path+"integrityType.optionType", "global") - var values []string - data.IntegrityType.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"integrityType.value", values) - } - body, _ = sjson.Set(body, path+"keychain", []interface{}{}) - for _, item := range data.Keychains { - itemBody := "" - if !item.KeyChainName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.KeyChainName.ValueString()) - } - if !item.KeyId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "id.value", item.KeyId.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"keychain.-1", itemBody) - } - body, _ = sjson.Set(body, path+"key", []interface{}{}) - for _, item := range data.Keys { - itemBody := "" - if !item.Id.IsNull() { - itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "id.value", item.Id.ValueInt64()) - } - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) - } - - if !item.SendIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendIdVariable.ValueString()) - } else if !item.SendId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendId.ValueInt64()) - } - - if !item.ReceiverIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverIdVariable.ValueString()) - } else if !item.ReceiverId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverId.ValueInt64()) - } - - if !item.IncludeTcpOptionsVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptionsVariable.ValueString()) - } else if item.IncludeTcpOptions.IsNull() { - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptions.ValueBool()) - } - - if !item.AcceptAoMismatchVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatchVariable.ValueString()) - } else if item.AcceptAoMismatch.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatch.ValueBool()) - } - if !item.CryptoAlgorithm.IsNull() { - itemBody, _ = sjson.Set(itemBody, "tcp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "tcp.value", item.CryptoAlgorithm.ValueString()) - } - - if !item.KeyStringVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyStringVariable.ValueString()) - } else if !item.KeyString.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyString.ValueString()) - } - - if !item.SendLifeTimeLocalVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocalVariable.ValueString()) - } else if item.SendLifeTimeLocal.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocal.ValueBool()) - } - if !item.SendLifeTimeStartEpoch.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.value", item.SendLifeTimeStartEpoch.ValueInt64()) - } - - if !item.SendLifeTimeInfiniteVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfiniteVariable.ValueString()) - } else if !item.SendLifeTimeInfinite.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfinite.ValueBool()) - } - - if !item.SendLifeTimeDurationVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDurationVariable.ValueString()) - } else if !item.SendLifeTimeDuration.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDuration.ValueInt64()) - } - if !item.SendLifeTimeExact.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.value", item.SendLifeTimeExact.ValueInt64()) - } - - if !item.AcceptLifeTimeLocalVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocalVariable.ValueString()) - } else if item.AcceptLifeTimeLocal.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocal.ValueBool()) - } - if !item.AcceptLifeTimeStartEpoch.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.value", item.AcceptLifeTimeStartEpoch.ValueInt64()) - } - - if !item.AcceptLifeTimeInfiniteVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfiniteVariable.ValueString()) - } else if !item.AcceptLifeTimeInfinite.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfinite.ValueBool()) - } - - if !item.AcceptLifeTimeDurationVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDurationVariable.ValueString()) - } else if !item.AcceptLifeTimeDuration.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDuration.ValueInt64()) - } - if !item.AcceptLifeTimeExact.IsNull() { - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.value", item.AcceptLifeTimeExact.ValueInt64()) - } - body, _ = sjson.SetRaw(body, path+"key.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"integrityType.optionType", "global") + var values []string + data.IntegrityType.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"integrityType.value", values) + } + } + if true { + body, _ = sjson.Set(body, path+"keychain", []interface{}{}) + for _, item := range data.Keychains { + itemBody := "" + if !item.KeyChainName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.KeyChainName.ValueString()) + } + } + if !item.KeyId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "id.value", item.KeyId.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"keychain.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"key", []interface{}{}) + for _, item := range data.Keys { + itemBody := "" + if !item.Id.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "id.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "id.value", item.Id.ValueInt64()) + } + } + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } + } + + if !item.SendIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendIdVariable.ValueString()) + } + } else if !item.SendId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendId.value", item.SendId.ValueInt64()) + } + } + + if !item.ReceiverIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverIdVariable.ValueString()) + } + } else if !item.ReceiverId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "recvId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "recvId.value", item.ReceiverId.ValueInt64()) + } + } + + if !item.IncludeTcpOptionsVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptionsVariable.ValueString()) + } + } else if item.IncludeTcpOptions.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "includeTcpOptions.value", item.IncludeTcpOptions.ValueBool()) + } + } + + if !item.AcceptAoMismatchVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatchVariable.ValueString()) + } + } else if item.AcceptAoMismatch.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptAoMismatch.value", item.AcceptAoMismatch.ValueBool()) + } + } + if !item.CryptoAlgorithm.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "tcp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "tcp.value", item.CryptoAlgorithm.ValueString()) + } + } + + if !item.KeyStringVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyStringVariable.ValueString()) + } + } else if !item.KeyString.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keyString.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keyString.value", item.KeyString.ValueString()) + } + } + + if !item.SendLifeTimeLocalVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocalVariable.ValueString()) + } + } else if item.SendLifeTimeLocal.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.local.value", item.SendLifeTimeLocal.ValueBool()) + } + } + if !item.SendLifeTimeStartEpoch.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.startEpoch.value", item.SendLifeTimeStartEpoch.ValueInt64()) + } + } + + if !item.SendLifeTimeInfiniteVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfiniteVariable.ValueString()) + } + } else if !item.SendLifeTimeInfinite.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.infinite.value", item.SendLifeTimeInfinite.ValueBool()) + } + } + + if !item.SendLifeTimeDurationVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDurationVariable.ValueString()) + } + } else if !item.SendLifeTimeDuration.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.duration.value", item.SendLifeTimeDuration.ValueInt64()) + } + } + if !item.SendLifeTimeExact.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLifetime.oneOfendChoice.exact.value", item.SendLifeTimeExact.ValueInt64()) + } + } + + if !item.AcceptLifeTimeLocalVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocalVariable.ValueString()) + } + } else if item.AcceptLifeTimeLocal.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.local.value", item.AcceptLifeTimeLocal.ValueBool()) + } + } + if !item.AcceptLifeTimeStartEpoch.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.startEpoch.value", item.AcceptLifeTimeStartEpoch.ValueInt64()) + } + } + + if !item.AcceptLifeTimeInfiniteVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfiniteVariable.ValueString()) + } + } else if !item.AcceptLifeTimeInfinite.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.infinite.value", item.AcceptLifeTimeInfinite.ValueBool()) + } + } + + if !item.AcceptLifeTimeDurationVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDurationVariable.ValueString()) + } + } else if !item.AcceptLifeTimeDuration.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.duration.value", item.AcceptLifeTimeDuration.ValueInt64()) + } + } + if !item.AcceptLifeTimeExact.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "acceptLifetime.oneOfendChoice.exact.value", item.AcceptLifeTimeExact.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"key.-1", itemBody) + } } return body } diff --git a/internal/provider/model_sdwan_system_snmp_profile_parcel.go b/internal/provider/model_sdwan_system_snmp_profile_parcel.go index b357cc32..f6a53f24 100644 --- a/internal/provider/model_sdwan_system_snmp_profile_parcel.go +++ b/internal/provider/model_sdwan_system_snmp_profile_parcel.go @@ -131,229 +131,343 @@ func (data SystemSNMP) toBody(ctx context.Context) string { path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", false) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", false) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.ContactPersonVariable.IsNull() { - body, _ = sjson.Set(body, path+"contact.optionType", "variable") - body, _ = sjson.Set(body, path+"contact.value", data.ContactPersonVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"contact.optionType", "variable") + body, _ = sjson.Set(body, path+"contact.value", data.ContactPersonVariable.ValueString()) + } } else if data.ContactPerson.IsNull() { - body, _ = sjson.Set(body, path+"contact.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"contact.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"contact.optionType", "global") - body, _ = sjson.Set(body, path+"contact.value", data.ContactPerson.ValueString()) + if true { + body, _ = sjson.Set(body, path+"contact.optionType", "global") + body, _ = sjson.Set(body, path+"contact.value", data.ContactPerson.ValueString()) + } } if !data.LocationOfDeviceVariable.IsNull() { - body, _ = sjson.Set(body, path+"location.optionType", "variable") - body, _ = sjson.Set(body, path+"location.value", data.LocationOfDeviceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"location.optionType", "variable") + body, _ = sjson.Set(body, path+"location.value", data.LocationOfDeviceVariable.ValueString()) + } } else if data.LocationOfDevice.IsNull() { - body, _ = sjson.Set(body, path+"location.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"location.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"location.optionType", "global") - body, _ = sjson.Set(body, path+"location.value", data.LocationOfDevice.ValueString()) - } - body, _ = sjson.Set(body, path+"view", []interface{}{}) - for _, item := range data.Views { - itemBody := "" - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + if true { + body, _ = sjson.Set(body, path+"location.optionType", "global") + body, _ = sjson.Set(body, path+"location.value", data.LocationOfDevice.ValueString()) } - itemBody, _ = sjson.Set(itemBody, "oid", []interface{}{}) - for _, childItem := range item.Oids { - itemChildBody := "" - - if !childItem.IdVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.IdVariable.ValueString()) - } else if !childItem.Id.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.Id.ValueString()) + } + if true { + body, _ = sjson.Set(body, path+"view", []interface{}{}) + for _, item := range data.Views { + itemBody := "" + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } } + if true { + itemBody, _ = sjson.Set(itemBody, "oid", []interface{}{}) + for _, childItem := range item.Oids { + itemChildBody := "" + + if !childItem.IdVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.IdVariable.ValueString()) + } + } else if !childItem.Id.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "id.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "id.value", childItem.Id.ValueString()) + } + } - if !childItem.ExcludeVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.ExcludeVariable.ValueString()) - } else if childItem.Exclude.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", false) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.Exclude.ValueBool()) + if !childItem.ExcludeVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.ExcludeVariable.ValueString()) + } + } else if childItem.Exclude.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", false) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "exclude.value", childItem.Exclude.ValueBool()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "oid.-1", itemChildBody) + } } - itemBody, _ = sjson.SetRaw(itemBody, "oid.-1", itemChildBody) + body, _ = sjson.SetRaw(body, path+"view.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"view.-1", itemBody) } - body, _ = sjson.Set(body, path+"community", []interface{}{}) - for _, item := range data.Communities { - itemBody := "" - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) - } - if !item.UserLabel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) - } + if true { + body, _ = sjson.Set(body, path+"community", []interface{}{}) + for _, item := range data.Communities { + itemBody := "" + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } + } + if !item.UserLabel.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) + } + } - if !item.ViewVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString()) - } else if !item.View.IsNull() { - itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) - } + if !item.ViewVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString()) + } + } else if !item.View.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + } + } - if !item.AuthorizationVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "authorization.value", item.AuthorizationVariable.ValueString()) - } else if !item.Authorization.IsNull() { - itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "authorization.value", item.Authorization.ValueString()) + if !item.AuthorizationVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "authorization.value", item.AuthorizationVariable.ValueString()) + } + } else if !item.Authorization.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "authorization.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "authorization.value", item.Authorization.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"community.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"community.-1", itemBody) } - body, _ = sjson.Set(body, path+"group", []interface{}{}) - for _, item := range data.Groups { - itemBody := "" - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) - } - if !item.SecurityLevel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "securityLevel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "securityLevel.value", item.SecurityLevel.ValueString()) - } + if true { + body, _ = sjson.Set(body, path+"group", []interface{}{}) + for _, item := range data.Groups { + itemBody := "" + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } + } + if !item.SecurityLevel.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "securityLevel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "securityLevel.value", item.SecurityLevel.ValueString()) + } + } - if !item.ViewVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString()) - } else if !item.View.IsNull() { - itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + if !item.ViewVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "view.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "view.value", item.ViewVariable.ValueString()) + } + } else if !item.View.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "view.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "view.value", item.View.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"group.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"group.-1", itemBody) } - body, _ = sjson.Set(body, path+"user", []interface{}{}) - for _, item := range data.Users { - itemBody := "" - if !item.Name.IsNull() { - itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) - } + if true { + body, _ = sjson.Set(body, path+"user", []interface{}{}) + for _, item := range data.Users { + itemBody := "" + if !item.Name.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "name.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "name.value", item.Name.ValueString()) + } + } - if !item.AuthenticationProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "auth.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocolVariable.ValueString()) - } else if item.AuthenticationProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "auth.optionType", "default") + if !item.AuthenticationProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "auth.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocolVariable.ValueString()) + } + } else if item.AuthenticationProtocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "auth.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "auth.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocol.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "auth.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "auth.value", item.AuthenticationProtocol.ValueString()) + } + } - if !item.AuthenticationPasswordVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPasswordVariable.ValueString()) - } else if item.AuthenticationPassword.IsNull() { - itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "default") + if !item.AuthenticationPasswordVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPasswordVariable.ValueString()) + } + } else if item.AuthenticationPassword.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPassword.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "authPassword.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "authPassword.value", item.AuthenticationPassword.ValueString()) + } + } - if !item.PrivacyProtocolVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priv.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocolVariable.ValueString()) - } else if item.PrivacyProtocol.IsNull() { - itemBody, _ = sjson.Set(itemBody, "priv.optionType", "default") + if !item.PrivacyProtocolVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priv.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocolVariable.ValueString()) + } + } else if item.PrivacyProtocol.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "priv.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "priv.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocol.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "priv.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "priv.value", item.PrivacyProtocol.ValueString()) + } + } - if !item.PrivacyPasswordVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPasswordVariable.ValueString()) - } else if item.PrivacyPassword.IsNull() { - itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "default") + if !item.PrivacyPasswordVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPasswordVariable.ValueString()) + } + } else if item.PrivacyPassword.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPassword.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "privPassword.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "privPassword.value", item.PrivacyPassword.ValueString()) + } + } - if !item.GroupVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "group.value", item.GroupVariable.ValueString()) - } else if !item.Group.IsNull() { - itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "group.value", item.Group.ValueString()) + if !item.GroupVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "group.value", item.GroupVariable.ValueString()) + } + } else if !item.Group.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "group.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "group.value", item.Group.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"user.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"user.-1", itemBody) } - body, _ = sjson.Set(body, path+"target", []interface{}{}) - for _, item := range data.TrapTargetServers { - itemBody := "" - - if !item.VpnIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnIdVariable.ValueString()) - } else if !item.VpnId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnId.ValueInt64()) - } + if true { + body, _ = sjson.Set(body, path+"target", []interface{}{}) + for _, item := range data.TrapTargetServers { + itemBody := "" + + if !item.VpnIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnIdVariable.ValueString()) + } + } else if !item.VpnId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "vpnId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "vpnId.value", item.VpnId.ValueInt64()) + } + } - if !item.IpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ip.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ip.value", item.IpVariable.ValueString()) - } else if !item.Ip.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ip.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ip.value", item.Ip.ValueString()) - } + if !item.IpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ip.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ip.value", item.IpVariable.ValueString()) + } + } else if !item.Ip.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ip.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ip.value", item.Ip.ValueString()) + } + } - if !item.PortVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "port.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "port.value", item.PortVariable.ValueString()) - } else if !item.Port.IsNull() { - itemBody, _ = sjson.Set(itemBody, "port.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueInt64()) - } - if !item.UserLabel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) - } + if !item.PortVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "port.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "port.value", item.PortVariable.ValueString()) + } + } else if !item.Port.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "port.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "port.value", item.Port.ValueInt64()) + } + } + if !item.UserLabel.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "userLabel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "userLabel.value", item.UserLabel.ValueString()) + } + } - if !item.UserVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "user.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "user.value", item.UserVariable.ValueString()) - } else if !item.User.IsNull() { - itemBody, _ = sjson.Set(itemBody, "user.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString()) - } + if !item.UserVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "user.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "user.value", item.UserVariable.ValueString()) + } + } else if !item.User.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "user.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "user.value", item.User.ValueString()) + } + } - if !item.SourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) - } else if !item.SourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + if !item.SourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterfaceVariable.ValueString()) + } + } else if !item.SourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceInterface.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceInterface.value", item.SourceInterface.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"target.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"target.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_transport_ipv6_tracker_group_profile_parcel.go b/internal/provider/model_sdwan_transport_ipv6_tracker_group_profile_parcel.go index fb73d4f0..fafe385c 100644 --- a/internal/provider/model_sdwan_transport_ipv6_tracker_group_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_ipv6_tracker_group_profile_parcel.go @@ -72,31 +72,45 @@ func (data TransportIPv6TrackerGroup) toBody(ctx context.Context) string { path := "data." if !data.TrackerNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerGroupName.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerGroupName.value", data.TrackerNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerGroupName.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerGroupName.value", data.TrackerNameVariable.ValueString()) + } } else if !data.TrackerName.IsNull() { - body, _ = sjson.Set(body, path+"trackerGroupName.optionType", "global") - body, _ = sjson.Set(body, path+"trackerGroupName.value", data.TrackerName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerGroupName.optionType", "global") + body, _ = sjson.Set(body, path+"trackerGroupName.value", data.TrackerName.ValueString()) + } } + if true { - for _, item := range data.TrackerElements { - itemBody := "" - if !item.TrackerId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString()) + for _, item := range data.TrackerElements { + itemBody := "" + if !item.TrackerId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } if !data.TrackerBooleanVariable.IsNull() { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable") - body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable") + body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString()) + } } else if data.TrackerBoolean.IsNull() { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default") - body, _ = sjson.Set(body, path+"combineBoolean.value", "or") + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default") + body, _ = sjson.Set(body, path+"combineBoolean.value", "or") + } } else { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global") - body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString()) + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global") + body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go b/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go index b6a0fda8..7a0a0241 100644 --- a/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_ipv6_tracker_profile_parcel.go @@ -81,90 +81,136 @@ func (data TransportIPv6Tracker) toBody(ctx context.Context) string { path := "data." if !data.TrackerNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) + } } else if !data.TrackerName.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "global") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "global") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + } } if !data.EndpointApiUrlVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) + } } else if !data.EndpointApiUrl.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + } } if !data.EndpointDnsNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) + } } else if !data.EndpointDnsName.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + } } if !data.EndpointIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) + } } else if !data.EndpointIp.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + } } if !data.IntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"interval.optionType", "variable") - body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "variable") + body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString()) + } } else if data.Interval.IsNull() { - body, _ = sjson.Set(body, path+"interval.optionType", "default") - body, _ = sjson.Set(body, path+"interval.value", 60) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "default") + body, _ = sjson.Set(body, path+"interval.value", 60) + } } else { - body, _ = sjson.Set(body, path+"interval.optionType", "global") - body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "global") + body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + } } if !data.MultiplierVariable.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") - body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") + body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + } } else if data.Multiplier.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "default") - body, _ = sjson.Set(body, path+"multiplier.value", 3) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "default") + body, _ = sjson.Set(body, path+"multiplier.value", 3) + } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.ThresholdVariable.IsNull() { - body, _ = sjson.Set(body, path+"threshold.optionType", "variable") - body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "variable") + body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString()) + } } else if data.Threshold.IsNull() { - body, _ = sjson.Set(body, path+"threshold.optionType", "default") - body, _ = sjson.Set(body, path+"threshold.value", 300) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "default") + body, _ = sjson.Set(body, path+"threshold.value", 300) + } } else { - body, _ = sjson.Set(body, path+"threshold.optionType", "global") - body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "global") + body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + } } if !data.EndpointTrackerTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString()) + } } else if data.EndpointTrackerType.IsNull() { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", "ipv6-interface") + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", "ipv6-interface") + } } else { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + } } if !data.TrackerTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerType.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString()) + } } else if data.TrackerType.IsNull() { - body, _ = sjson.Set(body, path+"trackerType.optionType", "default") - body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "default") + body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") + } } else { - body, _ = sjson.Set(body, path+"trackerType.optionType", "global") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "global") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go index d83fe397..5d467d2e 100644 --- a/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_management_vpn_interface_ethernet_profile_parcel.go @@ -126,278 +126,422 @@ func (data TransportManagementVPNInterfaceEthernet) toBody(ctx context.Context) path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpDistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) + } } else if !data.Ipv4DhcpDistance.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } + if true { - for _, item := range data.Ipv4SecondaryAddresses { - itemBody := "" + for _, item := range data.Ipv4SecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } if !data.Ipv4DhcpHelperVariable.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") - body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") + body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + } } else if data.Ipv4DhcpHelper.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.Ipv4IperfServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable") - body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable") + body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServerVariable.ValueString()) + } } else if data.Ipv4IperfServer.IsNull() { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") - body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServer.ValueString()) + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") + body, _ = sjson.Set(body, path+"iperfServer.value", data.Ipv4IperfServer.ValueString()) + } } if !data.Ipv4AutoDetectBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidthVariable.ValueString()) + } } else if data.Ipv4AutoDetectBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false) + } } else { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidth.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.Ipv4AutoDetectBandwidth.ValueBool()) + } } if !data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + } } if !data.Ipv6AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) + } } else if !data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + } } - body, _ = sjson.Set(body, path+"arp", []interface{}{}) - for _, item := range data.ArpEntries { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"arp", []interface{}{}) + for _, item := range data.ArpEntries { + itemBody := "" - if !item.IpAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) - } else if !item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) - } + if !item.IpAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) + } + } else if !item.IpAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } + } - if !item.MacAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) - } else if !item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + if !item.MacAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) + } + } else if !item.MacAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } if !data.DuplexVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString()) + } } else if data.Duplex.IsNull() { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + } } if !data.MacAddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString()) + } } else if data.MacAddress.IsNull() { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + } } else if data.InterfaceMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.SpeedVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString()) + } } else if data.Speed.IsNull() { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + } } if !data.ArpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + } } else if data.ArpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.AutonegotiateVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString()) + } } else if data.Autonegotiate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + } } if !data.MediaTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString()) + } } else if data.MediaType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + } } if !data.LoadIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString()) + } } else if data.LoadInterval.IsNull() { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) + } } else { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + } } if !data.IcmpRedirectDisableVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + } } else if data.IcmpRedirectDisable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + } } else if data.IpDirectedBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go b/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go index a847a884..f3716690 100644 --- a/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_management_vpn_profile_parcel.go @@ -116,194 +116,290 @@ func (data TransportManagementVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." - body, _ = sjson.Set(body, path+"vpnId.optionType", "default") - body, _ = sjson.Set(body, path+"vpnId.value", 512) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "default") + body, _ = sjson.Set(body, path+"vpnId.value", 512) + } if !data.VpnDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"name.optionType", "variable") - body, _ = sjson.Set(body, path+"name.value", data.VpnDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"name.optionType", "variable") + body, _ = sjson.Set(body, path+"name.value", data.VpnDescriptionVariable.ValueString()) + } } else if data.VpnDescription.IsNull() { - body, _ = sjson.Set(body, path+"name.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"name.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"name.optionType", "global") - body, _ = sjson.Set(body, path+"name.value", data.VpnDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"name.optionType", "global") + body, _ = sjson.Set(body, path+"name.value", data.VpnDescription.ValueString()) + } } if !data.PrimaryDnsAddressIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) + } } else if data.PrimaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + } } if !data.SecondaryDnsAddressIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) + } } else if data.SecondaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + } } if !data.PrimaryDnsAddressIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) + } } else if data.PrimaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + } } if !data.SecondaryDnsAddressIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) + } } else if data.SecondaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) - } - body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) - for _, item := range data.NewHostMappings { - itemBody := "" - - if !item.HostNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) - } else if !item.HostName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) - } - - if !item.ListOfIpAddressesVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString()) - } else if !item.ListOfIpAddresses.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") - var values []string - item.ListOfIpAddresses.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) - } - body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{}) - for _, item := range data.Ipv4StaticRoutes { - itemBody := "" - - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) - } - - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) - } - if item.Gateway.IsNull() { - itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop") - } else { - itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{}) - for _, childItem := range item.NextHops { - itemChildBody := "" - - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) - } - - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) - } else { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) - } - itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) } + } + if true { + body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) + for _, item := range data.NewHostMappings { + itemBody := "" - if !item.AdministrativeDistanceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString()) - } else if item.AdministrativeDistance.IsNull() { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "distance.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + if !item.HostNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) + } + } else if !item.HostName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + } + } + + if !item.ListOfIpAddressesVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString()) + } + } else if !item.ListOfIpAddresses.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") + var values []string + item.ListOfIpAddresses.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } - body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{}) - for _, item := range data.Ipv6StaticRoutes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{}) + for _, item := range data.Ipv4StaticRoutes { + itemBody := "" - if !item.PrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) - } else if !item.Prefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) - } + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } + } - for _, childItem := range item.NextHops { - itemChildBody := "" + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } + } + if item.Gateway.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) + } + } + if true && item.Gateway.ValueString() == "nextHop" { + itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{}) + for _, childItem := range item.NextHops { + itemChildBody := "" + + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody) + } } - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if !item.AdministrativeDistanceVariable.IsNull() { + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString()) + } + } else if item.AdministrativeDistance.IsNull() { + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "distance.value", 1) + } + } else { + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) - } - if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{}) + for _, item := range data.Ipv6StaticRoutes { + itemBody := "" - if !item.NatVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) - } else if !item.Nat.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + if !item.PrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) + } + } else if !item.Prefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } + } + if true { + + for _, childItem := range item.NextHops { + itemChildBody := "" + + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } + + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if !childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) + } + } + if !item.Null0.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } + } + + if !item.NatVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) + } + } else if !item.Nat.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } return body } diff --git a/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go b/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go index 60395747..95e33f82 100644 --- a/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_routing_bgp_profile_parcel.go @@ -260,833 +260,1267 @@ func (data TransportRoutingBGP) toBody(ctx context.Context) string { path := "data." if !data.AsNumberVariable.IsNull() { - body, _ = sjson.Set(body, path+"asNum.optionType", "variable") - body, _ = sjson.Set(body, path+"asNum.value", data.AsNumberVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"asNum.optionType", "variable") + body, _ = sjson.Set(body, path+"asNum.value", data.AsNumberVariable.ValueString()) + } } else if !data.AsNumber.IsNull() { - body, _ = sjson.Set(body, path+"asNum.optionType", "global") - body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"asNum.optionType", "global") + body, _ = sjson.Set(body, path+"asNum.value", data.AsNumber.ValueInt64()) + } } if !data.RouterIdVariable.IsNull() { - 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.PropagateAsPathVariable.IsNull() { - body, _ = sjson.Set(body, path+"propagateAspath.optionType", "variable") - body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPathVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"propagateAspath.optionType", "variable") + body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPathVariable.ValueString()) + } } else if data.PropagateAsPath.IsNull() { - body, _ = sjson.Set(body, path+"propagateAspath.optionType", "default") - body, _ = sjson.Set(body, path+"propagateAspath.value", false) + if true { + body, _ = sjson.Set(body, path+"propagateAspath.optionType", "default") + body, _ = sjson.Set(body, path+"propagateAspath.value", false) + } } else { - body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global") - body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"propagateAspath.optionType", "global") + body, _ = sjson.Set(body, path+"propagateAspath.value", data.PropagateAsPath.ValueBool()) + } } if !data.PropagateCommunityVariable.IsNull() { - body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "variable") - body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunityVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "variable") + body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunityVariable.ValueString()) + } } else if data.PropagateCommunity.IsNull() { - body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "default") - body, _ = sjson.Set(body, path+"propagateCommunity.value", false) + if true { + body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "default") + body, _ = sjson.Set(body, path+"propagateCommunity.value", false) + } } else { - body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global") - body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"propagateCommunity.optionType", "global") + body, _ = sjson.Set(body, path+"propagateCommunity.value", data.PropagateCommunity.ValueBool()) + } } if !data.ExternalRoutesDistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"external.optionType", "variable") - body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "variable") + body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistanceVariable.ValueString()) + } } else if data.ExternalRoutesDistance.IsNull() { - body, _ = sjson.Set(body, path+"external.optionType", "default") - body, _ = sjson.Set(body, path+"external.value", 20) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "default") + body, _ = sjson.Set(body, path+"external.value", 20) + } } else { - body, _ = sjson.Set(body, path+"external.optionType", "global") - body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"external.optionType", "global") + body, _ = sjson.Set(body, path+"external.value", data.ExternalRoutesDistance.ValueInt64()) + } } if !data.InternalRoutesDistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"internal.optionType", "variable") - body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"internal.optionType", "variable") + body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistanceVariable.ValueString()) + } } else if data.InternalRoutesDistance.IsNull() { - body, _ = sjson.Set(body, path+"internal.optionType", "default") - body, _ = sjson.Set(body, path+"internal.value", 200) + if true { + body, _ = sjson.Set(body, path+"internal.optionType", "default") + body, _ = sjson.Set(body, path+"internal.value", 200) + } } else { - body, _ = sjson.Set(body, path+"internal.optionType", "global") - body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"internal.optionType", "global") + body, _ = sjson.Set(body, path+"internal.value", data.InternalRoutesDistance.ValueInt64()) + } } if !data.LocalRoutesDistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"local.optionType", "variable") - body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"local.optionType", "variable") + body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistanceVariable.ValueString()) + } } else if data.LocalRoutesDistance.IsNull() { - body, _ = sjson.Set(body, path+"local.optionType", "default") - body, _ = sjson.Set(body, path+"local.value", 20) + if true { + body, _ = sjson.Set(body, path+"local.optionType", "default") + body, _ = sjson.Set(body, path+"local.value", 20) + } } else { - body, _ = sjson.Set(body, path+"local.optionType", "global") - body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"local.optionType", "global") + body, _ = sjson.Set(body, path+"local.value", data.LocalRoutesDistance.ValueInt64()) + } } if !data.KeepaliveTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"keepalive.optionType", "variable") - body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"keepalive.optionType", "variable") + body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTimeVariable.ValueString()) + } } else if data.KeepaliveTime.IsNull() { - body, _ = sjson.Set(body, path+"keepalive.optionType", "default") - body, _ = sjson.Set(body, path+"keepalive.value", 60) + if true { + body, _ = sjson.Set(body, path+"keepalive.optionType", "default") + body, _ = sjson.Set(body, path+"keepalive.value", 60) + } } else { - body, _ = sjson.Set(body, path+"keepalive.optionType", "global") - body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"keepalive.optionType", "global") + body, _ = sjson.Set(body, path+"keepalive.value", data.KeepaliveTime.ValueInt64()) + } } if !data.HoldTimeVariable.IsNull() { - body, _ = sjson.Set(body, path+"holdtime.optionType", "variable") - body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTimeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "variable") + body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTimeVariable.ValueString()) + } } else if data.HoldTime.IsNull() { - body, _ = sjson.Set(body, path+"holdtime.optionType", "default") - body, _ = sjson.Set(body, path+"holdtime.value", 180) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "default") + body, _ = sjson.Set(body, path+"holdtime.value", 180) + } } else { - body, _ = sjson.Set(body, path+"holdtime.optionType", "global") - body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"holdtime.optionType", "global") + body, _ = sjson.Set(body, path+"holdtime.value", data.HoldTime.ValueInt64()) + } } if !data.AlwaysCompareMedVariable.IsNull() { - body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "variable") - body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "variable") + body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMedVariable.ValueString()) + } } else if data.AlwaysCompareMed.IsNull() { - body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "default") - body, _ = sjson.Set(body, path+"alwaysCompare.value", false) + if true { + body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "default") + body, _ = sjson.Set(body, path+"alwaysCompare.value", false) + } } else { - body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global") - body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"alwaysCompare.optionType", "global") + body, _ = sjson.Set(body, path+"alwaysCompare.value", data.AlwaysCompareMed.ValueBool()) + } } if !data.DeterministicMedVariable.IsNull() { - body, _ = sjson.Set(body, path+"deterministic.optionType", "variable") - body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"deterministic.optionType", "variable") + body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMedVariable.ValueString()) + } } else if data.DeterministicMed.IsNull() { - body, _ = sjson.Set(body, path+"deterministic.optionType", "default") - body, _ = sjson.Set(body, path+"deterministic.value", false) + if true { + body, _ = sjson.Set(body, path+"deterministic.optionType", "default") + body, _ = sjson.Set(body, path+"deterministic.value", false) + } } else { - body, _ = sjson.Set(body, path+"deterministic.optionType", "global") - body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"deterministic.optionType", "global") + body, _ = sjson.Set(body, path+"deterministic.value", data.DeterministicMed.ValueBool()) + } } if !data.MissingMedAsWorstVariable.IsNull() { - body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "variable") - body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorstVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "variable") + body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorstVariable.ValueString()) + } } else if data.MissingMedAsWorst.IsNull() { - body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "default") - body, _ = sjson.Set(body, path+"missingAsWorst.value", false) + if true { + body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "default") + body, _ = sjson.Set(body, path+"missingAsWorst.value", false) + } } else { - body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global") - body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"missingAsWorst.optionType", "global") + body, _ = sjson.Set(body, path+"missingAsWorst.value", data.MissingMedAsWorst.ValueBool()) + } } if !data.CompareRouterIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"compareRouterId.optionType", "variable") - body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"compareRouterId.optionType", "variable") + body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterIdVariable.ValueString()) + } } else if data.CompareRouterId.IsNull() { - body, _ = sjson.Set(body, path+"compareRouterId.optionType", "default") - body, _ = sjson.Set(body, path+"compareRouterId.value", false) + if true { + body, _ = sjson.Set(body, path+"compareRouterId.optionType", "default") + body, _ = sjson.Set(body, path+"compareRouterId.value", false) + } } else { - body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global") - body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"compareRouterId.optionType", "global") + body, _ = sjson.Set(body, path+"compareRouterId.value", data.CompareRouterId.ValueBool()) + } } if !data.MultipathRelaxVariable.IsNull() { - body, _ = sjson.Set(body, path+"multipathRelax.optionType", "variable") - body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelaxVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"multipathRelax.optionType", "variable") + body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelaxVariable.ValueString()) + } } else if data.MultipathRelax.IsNull() { - body, _ = sjson.Set(body, path+"multipathRelax.optionType", "default") - body, _ = sjson.Set(body, path+"multipathRelax.value", false) + if true { + body, _ = sjson.Set(body, path+"multipathRelax.optionType", "default") + body, _ = sjson.Set(body, path+"multipathRelax.value", false) + } } else { - body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global") - body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool()) - } - body, _ = sjson.Set(body, path+"neighbor", []interface{}{}) - for _, item := range data.Ipv4Neighbors { - itemBody := "" - - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) - } - - if !item.DescriptionVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString()) - } else if item.Description.IsNull() { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) - } - - if !item.ShutdownVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString()) - } else if item.Shutdown.IsNull() { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) - } - - if !item.RemoteAsVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString()) - } else if !item.RemoteAs.IsNull() { - itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) - } - - if !item.LocalAsVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString()) - } else if item.LocalAs.IsNull() { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) - } - - if !item.KeepaliveTimeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString()) - } else if item.KeepaliveTime.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60) - } else { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) - } - - if !item.HoldTimeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString()) - } else if item.HoldTime.IsNull() { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180) - } else { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) - } - - if !item.UpdateSourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString()) - } else if item.UpdateSourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) - } - - if !item.NextHopSelfVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString()) - } else if item.NextHopSelf.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) - } - - if !item.SendCommunityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString()) - } else if item.SendCommunity.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) - } - - if !item.SendExtendedCommunityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString()) - } else if item.SendExtendedCommunity.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) - } - - if !item.EbgpMultihopVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString()) - } else if item.EbgpMultihop.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) - } - - if !item.PasswordVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) - } else if item.Password.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) - } - if item.SendLabel.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendLabel.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool()) - } - - if !item.ExplicitNullVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNullVariable.ValueString()) - } else if item.ExplicitNull.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNull.ValueBool()) - } - - if !item.AsOverrideVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString()) - } else if item.AsOverride.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) - } - - if !item.AllowasInNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString()) - } else if item.AllowasInNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) - } - itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{}) - for _, childItem := range item.AddressFamilies { - itemChildBody := "" - if !childItem.FamilyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) - } - - if !childItem.MaxNumberOfPrefixesVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString()) - } else if !childItem.MaxNumberOfPrefixes.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) - } - - if !childItem.ThresholdVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString()) - } else if childItem.Threshold.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75) + if true { + body, _ = sjson.Set(body, path+"multipathRelax.optionType", "global") + body, _ = sjson.Set(body, path+"multipathRelax.value", data.MultipathRelax.ValueBool()) + } + } + if true { + body, _ = sjson.Set(body, path+"neighbor", []interface{}{}) + for _, item := range data.Ipv4Neighbors { + itemBody := "" + + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + + if !item.DescriptionVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString()) + } + } else if item.Description.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "default") + + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) + } } - if !childItem.PolicyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) - } - - if !childItem.RestartIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString()) - } else if !childItem.RestartInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + + if !item.ShutdownVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString()) + } + } else if item.Shutdown.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) + } } - if !childItem.InRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) - } - if !childItem.OutRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) - } - itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody) - } - body, _ = sjson.SetRaw(body, path+"neighbor.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ipv6Neighbor", []interface{}{}) - for _, item := range data.Ipv6Neighbors { - itemBody := "" - - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) - } - - if !item.DescriptionVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString()) - } else if item.Description.IsNull() { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) - } - - if !item.ShutdownVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString()) - } else if item.Shutdown.IsNull() { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) - } - - if !item.RemoteAsVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString()) - } else if !item.RemoteAs.IsNull() { - itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) - } - - if !item.LocalAsVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString()) - } else if item.LocalAs.IsNull() { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) - } - - if !item.KeepaliveTimeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString()) - } else if item.KeepaliveTime.IsNull() { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60) - } else { - itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) - } - - if !item.HoldTimeVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString()) - } else if item.HoldTime.IsNull() { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180) - } else { - itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) - } - - if !item.UpdateSourceInterfaceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString()) - } else if item.UpdateSourceInterface.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) - } - - if !item.NextHopSelfVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString()) - } else if item.NextHopSelf.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) - } - - if !item.SendCommunityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString()) - } else if item.SendCommunity.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) - } - - if !item.SendExtendedCommunityVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString()) - } else if item.SendExtendedCommunity.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true) - } else { - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) - } - - if !item.EbgpMultihopVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString()) - } else if item.EbgpMultihop.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) - } - - if !item.PasswordVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) - } else if item.Password.IsNull() { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) - } - - if !item.AsOverrideVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString()) - } else if item.AsOverride.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) - } - - if !item.AllowasInNumberVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString()) - } else if item.AllowasInNumber.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default") - - } else { - itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) - } - itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{}) - for _, childItem := range item.AddressFamilies { - itemChildBody := "" - if !childItem.FamilyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) - } - - if !childItem.MaxNumberOfPrefixesVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString()) - } else if !childItem.MaxNumberOfPrefixes.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) - } - - if !childItem.ThresholdVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString()) - } else if childItem.Threshold.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75) + + if !item.RemoteAsVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString()) + } + } else if !item.RemoteAs.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) + } + } + + if !item.LocalAsVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString()) + } + } else if item.LocalAs.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default") + + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) + } } - if !childItem.PolicyType.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + + if !item.KeepaliveTimeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString()) + } + } else if item.KeepaliveTime.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) + } } - if !childItem.RestartIntervalVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString()) - } else if !childItem.RestartInterval.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + if !item.HoldTimeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString()) + } + } else if item.HoldTime.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) + } } - if !childItem.InRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + + if !item.UpdateSourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString()) + } + } else if item.UpdateSourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) + } } - if !childItem.OutRoutePolicyId.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + + if !item.NextHopSelfVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString()) + } + } else if item.NextHopSelf.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody) + + if !item.SendCommunityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString()) + } + } else if item.SendCommunity.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) + } + } + + if !item.SendExtendedCommunityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString()) + } + } else if item.SendExtendedCommunity.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) + } + } + + if !item.EbgpMultihopVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString()) + } + } else if item.EbgpMultihop.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) + } + } + + if !item.PasswordVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) + } + } else if item.Password.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + } + } + if item.SendLabel.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendLabel.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabel.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLabel.value", item.SendLabel.ValueBool()) + } + } + + if !item.ExplicitNullVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNullVariable.ValueString()) + } + } else if item.ExplicitNull.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendLabelExplicit.value", item.ExplicitNull.ValueBool()) + } + } + + if !item.AsOverrideVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString()) + } + } else if item.AsOverride.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) + } + } + + if !item.AllowasInNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString()) + } + } else if item.AllowasInNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{}) + for _, childItem := range item.AddressFamilies { + itemChildBody := "" + if !childItem.FamilyType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) + } + } + + if !childItem.MaxNumberOfPrefixesVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString()) + } + } else if !childItem.MaxNumberOfPrefixes.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) + } + } + + if !childItem.ThresholdVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString()) + } + } else if childItem.Threshold.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + } + } + if !childItem.PolicyType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + } + } + + if !childItem.RestartIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString()) + } + } else if !childItem.RestartInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + } + } + if !childItem.InRoutePolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + } + } + if !childItem.OutRoutePolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"neighbor.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv6Neighbor.-1", itemBody) } - body, _ = sjson.Set(body, path+"addressFamily.aggregateAddress", []interface{}{}) - for _, item := range data.Ipv4AggregateAddresses { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"ipv6Neighbor", []interface{}{}) + for _, item := range data.Ipv6Neighbors { + itemBody := "" - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) - } + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) - } + if !item.DescriptionVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "description.value", item.DescriptionVariable.ValueString()) + } + } else if item.Description.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "default") - if !item.AsSetPathVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString()) - } else if item.AsSetPath.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "asSet.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "description.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "description.value", item.Description.ValueString()) + } + } + + if !item.ShutdownVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.ShutdownVariable.ValueString()) + } + } else if item.Shutdown.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "shutdown.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "shutdown.value", item.Shutdown.ValueBool()) + } + } + + if !item.RemoteAsVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAsVariable.ValueString()) + } + } else if !item.RemoteAs.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "remoteAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "remoteAs.value", item.RemoteAs.ValueInt64()) + } + } + + if !item.LocalAsVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAsVariable.ValueString()) + } + } else if item.LocalAs.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "localAs.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "localAs.value", item.LocalAs.ValueInt64()) + } + } + + if !item.KeepaliveTimeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTimeVariable.ValueString()) + } + } else if item.KeepaliveTime.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", 60) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "keepalive.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "keepalive.value", item.KeepaliveTime.ValueInt64()) + } + } + + if !item.HoldTimeVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTimeVariable.ValueString()) + } + } else if item.HoldTime.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", 180) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "holdtime.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "holdtime.value", item.HoldTime.ValueInt64()) + } + } + + if !item.UpdateSourceInterfaceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterfaceVariable.ValueString()) + } + } else if item.UpdateSourceInterface.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.UpdateSourceInterface.ValueString()) + } + } + + if !item.NextHopSelfVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelfVariable.ValueString()) + } + } else if item.NextHopSelf.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nextHopSelf.value", item.NextHopSelf.ValueBool()) + } + } + + if !item.SendCommunityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunityVariable.ValueString()) + } + } else if item.SendCommunity.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendCommunity.value", item.SendCommunity.ValueBool()) + } + } + + if !item.SendExtendedCommunityVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunityVariable.ValueString()) + } + } else if item.SendExtendedCommunity.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", true) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sendExtCommunity.value", item.SendExtendedCommunity.ValueBool()) + } + } + + if !item.EbgpMultihopVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihopVariable.ValueString()) + } + } else if item.EbgpMultihop.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", 1) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ebgpMultihop.value", item.EbgpMultihop.ValueInt64()) + } + } + + if !item.PasswordVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "password.value", item.PasswordVariable.ValueString()) + } + } else if item.Password.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "password.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "password.value", item.Password.ValueString()) + } + } - if !item.SummaryOnlyVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString()) - } else if item.SummaryOnly.IsNull() { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + if !item.AsOverrideVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverrideVariable.ValueString()) + } + } else if item.AsOverride.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "asOverride.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asOverride.value", item.AsOverride.ValueBool()) + } + } + + if !item.AllowasInNumberVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumberVariable.ValueString()) + } + } else if item.AllowasInNumber.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "default") + + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "asNumber.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asNumber.value", item.AllowasInNumber.ValueInt64()) + } + } + if true { + itemBody, _ = sjson.Set(itemBody, "addressFamily", []interface{}{}) + for _, childItem := range item.AddressFamilies { + itemChildBody := "" + if !childItem.FamilyType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "familyType.value", childItem.FamilyType.ValueString()) + } + } + + if !childItem.MaxNumberOfPrefixesVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixesVariable.ValueString()) + } + } else if !childItem.MaxNumberOfPrefixes.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.prefixNum.value", childItem.MaxNumberOfPrefixes.ValueInt64()) + } + } + + if !childItem.ThresholdVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.ThresholdVariable.ValueString()) + } + } else if childItem.Threshold.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", 75) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.threshold.value", childItem.Threshold.ValueInt64()) + } + } + if !childItem.PolicyType.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.policyType.value", childItem.PolicyType.ValueString()) + } + } + + if !childItem.RestartIntervalVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartIntervalVariable.ValueString()) + } + } else if !childItem.RestartInterval.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "maxPrefixConfig.restartInterval.value", childItem.RestartInterval.ValueInt64()) + } + } + if !childItem.InRoutePolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "inRoutePolicy.refId.value", childItem.InRoutePolicyId.ValueString()) + } + } + if !childItem.OutRoutePolicyId.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "outRoutePolicy.refId.value", childItem.OutRoutePolicyId.ValueString()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "addressFamily.-1", itemChildBody) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6Neighbor.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"addressFamily.aggregateAddress.-1", itemBody) } - body, _ = sjson.Set(body, path+"addressFamily.network", []interface{}{}) - for _, item := range data.Ipv4Networks { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"addressFamily.aggregateAddress", []interface{}{}) + for _, item := range data.Ipv4AggregateAddresses { + itemBody := "" + + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + } + } - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + } + } + + if !item.AsSetPathVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString()) + } + } else if item.AsSetPath.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "asSet.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) + } + } + + if !item.SummaryOnlyVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString()) + } + } else if item.SummaryOnly.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"addressFamily.aggregateAddress.-1", itemBody) } + } + if true { + body, _ = sjson.Set(body, path+"addressFamily.network", []interface{}{}) + for _, item := range data.Ipv4Networks { + itemBody := "" - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.address.value", item.NetworkAddress.ValueString()) + } + } + + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.mask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.mask.value", item.SubnetMask.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"addressFamily.network.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"addressFamily.network.-1", itemBody) } if !data.Ipv4EibgpMaximumPathsVariable.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "variable") - body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPathsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "variable") + body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPathsVariable.ValueString()) + } } else if data.Ipv4EibgpMaximumPaths.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.paths.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.paths.value", data.Ipv4EibgpMaximumPaths.ValueInt64()) + } } if !data.Ipv4OriginateVariable.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "variable") - body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4OriginateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "variable") + body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4OriginateVariable.ValueString()) + } } else if data.Ipv4Originate.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "default") - body, _ = sjson.Set(body, path+"addressFamily.originate.value", false) + if true { + body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "default") + body, _ = sjson.Set(body, path+"addressFamily.originate.value", false) + } } else { - body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.originate.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.originate.value", data.Ipv4Originate.ValueBool()) + } } if data.Ipv4TableMapRoutePolicyId.IsNull() { body, _ = sjson.Set(body, path+"addressFamily.name.optionType", "default") } else { - body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.name.refId.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.name.refId.value", data.Ipv4TableMapRoutePolicyId.ValueString()) + } } if !data.Ipv4TableMapFilterVariable.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "variable") - body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilterVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "variable") + body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilterVariable.ValueString()) + } } else if data.Ipv4TableMapFilter.IsNull() { - body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "default") - body, _ = sjson.Set(body, path+"addressFamily.filter.value", false) + if true { + body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "default") + body, _ = sjson.Set(body, path+"addressFamily.filter.value", false) + } } else { - body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global") - body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool()) - } - body, _ = sjson.Set(body, path+"addressFamily.redistribute", []interface{}{}) - for _, item := range data.Ipv4Redistributes { - 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()) - } - body, _ = sjson.SetRaw(body, path+"addressFamily.redistribute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6AggregateAddress", []interface{}{}) - for _, item := range data.Ipv6AggregateAddresses { - itemBody := "" - - if !item.AggregatePrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefixVariable.ValueString()) - } else if !item.AggregatePrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString()) - } - - if !item.AsSetPathVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString()) - } else if item.AsSetPath.IsNull() { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "asSet.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) - } - - if !item.SummaryOnlyVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString()) - } else if item.SummaryOnly.IsNull() { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) - } - body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6AggregateAddress.-1", itemBody) - } - body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6Network", []interface{}{}) - for _, item := range data.Ipv6Networks { - itemBody := "" - - if !item.NetworkPrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefixVariable.ValueString()) - } else if !item.NetworkPrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6Network.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"addressFamily.filter.optionType", "global") + body, _ = sjson.Set(body, path+"addressFamily.filter.value", data.Ipv4TableMapFilter.ValueBool()) + } + } + if true { + body, _ = sjson.Set(body, path+"addressFamily.redistribute", []interface{}{}) + for _, item := range data.Ipv4Redistributes { + itemBody := "" + + 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+"addressFamily.redistribute.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6AggregateAddress", []interface{}{}) + for _, item := range data.Ipv6AggregateAddresses { + itemBody := "" + + if !item.AggregatePrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefixVariable.ValueString()) + } + } else if !item.AggregatePrefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.AggregatePrefix.ValueString()) + } + } + + if !item.AsSetPathVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPathVariable.ValueString()) + } + } else if item.AsSetPath.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "asSet.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "asSet.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "asSet.value", item.AsSetPath.ValueBool()) + } + } + + if !item.SummaryOnlyVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnlyVariable.ValueString()) + } + } else if item.SummaryOnly.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "summaryOnly.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "summaryOnly.value", item.SummaryOnly.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6AggregateAddress.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.ipv6Network", []interface{}{}) + for _, item := range data.Ipv6Networks { + itemBody := "" + + if !item.NetworkPrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefixVariable.ValueString()) + } + } else if !item.NetworkPrefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.NetworkPrefix.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.ipv6Network.-1", itemBody) + } } if !data.Ipv6EibgpMaximumPathsVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPathsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPathsVariable.ValueString()) + } } else if data.Ipv6EibgpMaximumPaths.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.paths.value", data.Ipv6EibgpMaximumPaths.ValueInt64()) + } } if !data.Ipv6OriginateVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6OriginateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6OriginateVariable.ValueString()) + } } else if data.Ipv6Originate.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "default") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", false) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "default") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", false) + } } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.originate.value", data.Ipv6Originate.ValueBool()) + } } if data.Ipv6TableMapRoutePolicyId.IsNull() { body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.optionType", "default") } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.name.refId.value", data.Ipv6TableMapRoutePolicyId.ValueString()) + } } if !data.Ipv6TableMapFilterVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "variable") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilterVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "variable") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilterVariable.ValueString()) + } } else if data.Ipv6TableMapFilter.IsNull() { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "default") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", false) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "default") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", false) + } } else { - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global") - body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool()) - } - body, _ = sjson.Set(body, path+"ipv6AddressFamily.redistribute", []interface{}{}) - for _, item := range data.Ipv6Redistributes { - 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()) - } - body, _ = sjson.SetRaw(body, path+"ipv6AddressFamily.redistribute.-1", itemBody) - } - body, _ = sjson.Set(body, path+"mplsInterface", []interface{}{}) - for _, item := range data.MplsInterfaces { - itemBody := "" - - if !item.InterfaceNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString()) - } else if !item.InterfaceName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString()) - } - body, _ = sjson.SetRaw(body, path+"mplsInterface.-1", itemBody) + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.optionType", "global") + body, _ = sjson.Set(body, path+"ipv6AddressFamily.filter.value", data.Ipv6TableMapFilter.ValueBool()) + } + } + if true { + body, _ = sjson.Set(body, path+"ipv6AddressFamily.redistribute", []interface{}{}) + for _, item := range data.Ipv6Redistributes { + itemBody := "" + + 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+"ipv6AddressFamily.redistribute.-1", itemBody) + } + } + if true { + body, _ = sjson.Set(body, path+"mplsInterface", []interface{}{}) + for _, item := range data.MplsInterfaces { + itemBody := "" + + if !item.InterfaceNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceNameVariable.ValueString()) + } + } else if !item.InterfaceName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ifName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ifName.value", item.InterfaceName.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"mplsInterface.-1", itemBody) + } } return body } diff --git a/internal/provider/model_sdwan_transport_tracker_group_profile_parcel.go b/internal/provider/model_sdwan_transport_tracker_group_profile_parcel.go index 277679ca..d5e4b388 100644 --- a/internal/provider/model_sdwan_transport_tracker_group_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_tracker_group_profile_parcel.go @@ -68,25 +68,35 @@ func (data TransportTrackerGroup) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." - - for _, item := range data.TrackerElements { - itemBody := "" - if !item.TrackerId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString()) + if true { + + for _, item := range data.TrackerElements { + itemBody := "" + if !item.TrackerId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "trackerRef.refId.value", item.TrackerId.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"trackerRefs.-1", itemBody) } if !data.TrackerBooleanVariable.IsNull() { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable") - body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "variable") + body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBooleanVariable.ValueString()) + } } else if data.TrackerBoolean.IsNull() { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default") - body, _ = sjson.Set(body, path+"combineBoolean.value", "or") + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "default") + body, _ = sjson.Set(body, path+"combineBoolean.value", "or") + } } else { - body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global") - body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString()) + if true { + body, _ = sjson.Set(body, path+"combineBoolean.optionType", "global") + body, _ = sjson.Set(body, path+"combineBoolean.value", data.TrackerBoolean.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_tracker_profile_parcel.go b/internal/provider/model_sdwan_transport_tracker_profile_parcel.go index 47f0e65a..79c7ae08 100644 --- a/internal/provider/model_sdwan_transport_tracker_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_tracker_profile_parcel.go @@ -81,90 +81,136 @@ func (data TransportTracker) toBody(ctx context.Context) string { path := "data." if !data.TrackerNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerNameVariable.ValueString()) + } } else if !data.TrackerName.IsNull() { - body, _ = sjson.Set(body, path+"trackerName.optionType", "global") - body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerName.optionType", "global") + body, _ = sjson.Set(body, path+"trackerName.value", data.TrackerName.ValueString()) + } } if !data.EndpointApiUrlVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrlVariable.ValueString()) + } } else if !data.EndpointApiUrl.IsNull() { - body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") - body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointApiUrl.optionType", "global") + body, _ = sjson.Set(body, path+"endpointApiUrl.value", data.EndpointApiUrl.ValueString()) + } } if !data.EndpointDnsNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsNameVariable.ValueString()) + } } else if !data.EndpointDnsName.IsNull() { - body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") - body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointDnsName.optionType", "global") + body, _ = sjson.Set(body, path+"endpointDnsName.value", data.EndpointDnsName.ValueString()) + } } if !data.EndpointIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIpVariable.ValueString()) + } } else if !data.EndpointIp.IsNull() { - body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") - body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointIp.optionType", "global") + body, _ = sjson.Set(body, path+"endpointIp.value", data.EndpointIp.ValueString()) + } } if !data.IntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"interval.optionType", "variable") - body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "variable") + body, _ = sjson.Set(body, path+"interval.value", data.IntervalVariable.ValueString()) + } } else if data.Interval.IsNull() { - body, _ = sjson.Set(body, path+"interval.optionType", "default") - body, _ = sjson.Set(body, path+"interval.value", 60) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "default") + body, _ = sjson.Set(body, path+"interval.value", 60) + } } else { - body, _ = sjson.Set(body, path+"interval.optionType", "global") - body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"interval.optionType", "global") + body, _ = sjson.Set(body, path+"interval.value", data.Interval.ValueInt64()) + } } if !data.MultiplierVariable.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") - body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "variable") + body, _ = sjson.Set(body, path+"multiplier.value", data.MultiplierVariable.ValueString()) + } } else if data.Multiplier.IsNull() { - body, _ = sjson.Set(body, path+"multiplier.optionType", "default") - body, _ = sjson.Set(body, path+"multiplier.value", 3) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "default") + body, _ = sjson.Set(body, path+"multiplier.value", 3) + } } else { - body, _ = sjson.Set(body, path+"multiplier.optionType", "global") - body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"multiplier.optionType", "global") + body, _ = sjson.Set(body, path+"multiplier.value", data.Multiplier.ValueInt64()) + } } if !data.ThresholdVariable.IsNull() { - body, _ = sjson.Set(body, path+"threshold.optionType", "variable") - body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "variable") + body, _ = sjson.Set(body, path+"threshold.value", data.ThresholdVariable.ValueString()) + } } else if data.Threshold.IsNull() { - body, _ = sjson.Set(body, path+"threshold.optionType", "default") - body, _ = sjson.Set(body, path+"threshold.value", 300) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "default") + body, _ = sjson.Set(body, path+"threshold.value", 300) + } } else { - body, _ = sjson.Set(body, path+"threshold.optionType", "global") - body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"threshold.optionType", "global") + body, _ = sjson.Set(body, path+"threshold.value", data.Threshold.ValueInt64()) + } } if !data.EndpointTrackerTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "variable") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerTypeVariable.ValueString()) + } } else if data.EndpointTrackerType.IsNull() { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", "interface") + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "default") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", "interface") + } } else { - body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") - body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"endpointTrackerType.optionType", "global") + body, _ = sjson.Set(body, path+"endpointTrackerType.value", data.EndpointTrackerType.ValueString()) + } } if !data.TrackerTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"trackerType.optionType", "variable") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "variable") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerTypeVariable.ValueString()) + } } else if data.TrackerType.IsNull() { - body, _ = sjson.Set(body, path+"trackerType.optionType", "default") - body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "default") + body, _ = sjson.Set(body, path+"trackerType.value", "endpoint") + } } else { - body, _ = sjson.Set(body, path+"trackerType.optionType", "global") - body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"trackerType.optionType", "global") + body, _ = sjson.Set(body, path+"trackerType.value", data.TrackerType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go index 98fd68ed..191f75a4 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_cellular_profile_parcel.go @@ -204,697 +204,1067 @@ func (data TransportWANVPNInterfaceCellular) toBody(ctx context.Context) string path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpHelperVariable.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") - body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") + body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + } } else if data.Ipv4DhcpHelper.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.ServiceProviderVariable.IsNull() { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable") - body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable") + body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString()) + } } else if data.ServiceProvider.IsNull() { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") - body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") + body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + } } if !data.BandwidthUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString()) + } } else if data.BandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + } } if !data.BandwidthDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString()) + } } else if data.BandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + } } if data.TunnelInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default") - body, _ = sjson.Set(body, path+"tunnelInterface.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default") + body, _ = sjson.Set(body, path+"tunnelInterface.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + } } if !data.PerTunnelQosVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString()) + } } else if data.PerTunnelQos.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + } } if !data.TunnelQosModeVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) + } } else if !data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + } } if !data.TunnelBandwidthPercentVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString()) + } } else if data.TunnelBandwidthPercent.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50) + } } else { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + } } if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString()) + } } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + } } if !data.TunnelInterfaceCarrierVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString()) + } } else if data.TunnelInterfaceCarrier.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + } } if !data.TunnelInterfaceColorVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString()) + } } else if data.TunnelInterfaceColor.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls") + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls") + } } else { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + } } if !data.TunnelInterfaceHelloIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString()) + } } else if data.TunnelInterfaceHelloInterval.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloToleranceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString()) + } } else if data.TunnelInterfaceHelloTolerance.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) + } } else { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + } } if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString()) + } } else if data.TunnelInterfaceLastResortCircuit.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + } } if !data.TunnelInterfaceColorRestrictVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString()) + } } else if data.TunnelInterfaceColorRestrict.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + } } if !data.TunnelInterfaceGroupsVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString()) + } } else if data.TunnelInterfaceGroups.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + } } if !data.TunnelInterfaceBorderVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString()) + } } else if data.TunnelInterfaceBorder.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.border.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.border.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + } } if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString()) + } } else if data.TunnelInterfaceMaxControlConnections.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + } } if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString()) + } } else if data.TunnelInterfaceNatRefreshInterval.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) + } } else { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + } } if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString()) + } } else if data.TunnelInterfaceVbondAsStunServer.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + } } if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString()) + } } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") - var values []int64 - data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") + var values []int64 + data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + } } if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString()) + } } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5) + } } else { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + } } if !data.TunnelInterfacePortHopVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString()) + } } else if data.TunnelInterfacePortHop.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) + } } else { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + } } if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString()) + } } else if data.TunnelInterfaceLowBandwidthLink.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + } } if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString()) + } } else if data.TunnelInterfaceTunnelTcpMss.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + } } if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString()) + } } else if data.TunnelInterfaceClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + } } if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString()) + } } else if data.TunnelInterfaceNetworkBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + } } if !data.TunnelInterfaceAllowAllVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString()) + } } else if data.TunnelInterfaceAllowAll.IsNull() { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.all.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.all.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + } } if !data.TunnelInterfaceAllowBgpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowBgp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.bgp.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.bgp.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + } } if !data.TunnelInterfaceAllowDhcpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowDhcp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + } } if !data.TunnelInterfaceAllowNtpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) + } } else if !data.TunnelInterfaceAllowNtp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + } } if !data.TunnelInterfaceAllowSshVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString()) + } } else if !data.TunnelInterfaceAllowSsh.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + } } if !data.TunnelInterfaceAllowDnsVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString()) + } } else if data.TunnelInterfaceAllowDns.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.dns.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.dns.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + } } if !data.TunnelInterfaceAllowIcmpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowIcmp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.icmp.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.icmp.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + } } if !data.TunnelInterfaceAllowHttpsVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString()) + } } else if data.TunnelInterfaceAllowHttps.IsNull() { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.https.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.https.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + } } if !data.TunnelInterfaceAllowOspfVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString()) + } } else if data.TunnelInterfaceAllowOspf.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.ospf.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.ospf.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + } } if !data.TunnelInterfaceAllowStunVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString()) + } } else if data.TunnelInterfaceAllowStun.IsNull() { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.stun.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.stun.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + } } if !data.TunnelInterfaceAllowSnmpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowSnmp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.snmp.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.snmp.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + } } if !data.TunnelInterfaceAllowNetconfVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString()) + } } else if data.TunnelInterfaceAllowNetconf.IsNull() { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.netconf.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.netconf.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + } } if !data.TunnelInterfaceAllowBfdVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString()) + } } else if data.TunnelInterfaceAllowBfd.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.bfd.value", false) - } else { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) - } - body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) - for _, item := range data.TunnelInterfaceEncapsulations { - itemBody := "" - if !item.Encapsulation.IsNull() { - itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.bfd.value", false) } + } else { + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + } + } + if true { + body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) + for _, item := range data.TunnelInterfaceEncapsulations { + itemBody := "" + if !item.Encapsulation.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + } + } - if !item.PreferenceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString()) - } else if item.Preference.IsNull() { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default") + if !item.PreferenceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString()) + } + } else if item.Preference.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + } + } - if !item.WeightVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString()) - } else if item.Weight.IsNull() { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "weight.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + if !item.WeightVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString()) + } + } else if item.Weight.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "weight.value", 1) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } if !data.NatIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"nat.optionType", "variable") - body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "variable") + body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString()) + } } else if data.NatIpv4.IsNull() { - body, _ = sjson.Set(body, path+"nat.optionType", "default") - body, _ = sjson.Set(body, path+"nat.value", false) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "default") + body, _ = sjson.Set(body, path+"nat.value", false) + } } else { - body, _ = sjson.Set(body, path+"nat.optionType", "global") - body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "global") + body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + } } if !data.NatUdpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString()) + } } else if data.NatUdpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + } } if !data.NatTcpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString()) + } } else if data.NatTcpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + } } if !data.QosAdaptive.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + } } if !data.QosAdaptivePeriodVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString()) + } } else if !data.QosAdaptivePeriod.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + } } if !data.QosAdaptiveBandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + } } if !data.QosAdaptiveMinUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMinUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + } } if !data.QosAdaptiveMaxUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMaxUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString()) + } } else if !data.QosAdaptiveDefaultUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + } } if !data.QosAdaptiveBandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + } } if !data.QosAdaptiveMinDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMinDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + } } if !data.QosAdaptiveMaxDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMaxDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString()) + } } else if !data.QosAdaptiveDefaultDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + } } if !data.QosShapingRateVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) + } } else if !data.QosShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + } } - body, _ = sjson.Set(body, path+"arp", []interface{}{}) - for _, item := range data.Arps { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"arp", []interface{}{}) + for _, item := range data.Arps { + itemBody := "" - if !item.IpAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) - } else if item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default") + if !item.IpAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) + } + } else if item.IpAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } + } - if !item.MacAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) - } else if item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default") + if !item.MacAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) + } + } else if item.MacAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + } } else if data.InterfaceMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.TlocExtensionVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString()) + } } else if data.TlocExtension.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + } } if !data.TrackerVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString()) + } } else if data.Tracker.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + } } else if data.IpDirectedBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go index 52cf3823..05b7b269 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ethernet_profile_parcel.go @@ -300,1086 +300,1658 @@ func (data TransportWANVPNInterfaceEthernet) toBody(ctx context.Context) string path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4DhcpDistanceVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistanceVariable.ValueString()) + } } else if !data.Ipv4DhcpDistance.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.dynamic.dynamicDhcpDistance.value", data.Ipv4DhcpDistance.ValueInt64()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.ipAddress.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpAddress.static.staticIpV4AddressPrimary.subnetMask.value", data.Ipv4SubnetMask.ValueString()) + } } + if true { - for _, item := range data.Ipv4SecondaryAddresses { - itemBody := "" + for _, item := range data.Ipv4SecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) - } + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.Address.ValueString()) + } + } - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "subnetMask.value", item.SubnetMask.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpAddress.static.staticIpV4AddressSecondary.-1", itemBody) } if !data.Ipv4DhcpHelperVariable.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") - body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "variable") + body, _ = sjson.Set(body, path+"dhcpHelper.value", data.Ipv4DhcpHelperVariable.ValueString()) + } } else if data.Ipv4DhcpHelper.IsNull() { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") - var values []string - data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + if true { + body, _ = sjson.Set(body, path+"dhcpHelper.optionType", "global") + var values []string + data.Ipv4DhcpHelper.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"dhcpHelper.value", values) + } } if !data.EnableDhcpv6.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.dynamic.dhcpClient.value", data.EnableDhcpv6.ValueBool()) + } } + if true { - for _, item := range data.Ipv6DhcpSecondaryAddress { - itemBody := "" + for _, item := range data.Ipv6DhcpSecondaryAddress { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpV6Address.dynamic.secondaryIpV6Address.-1", itemBody) } if !data.Ipv6AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6AddressVariable.ValueString()) + } } else if !data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") - body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.optionType", "global") + body, _ = sjson.Set(body, path+"intfIpV6Address.static.primaryIpV6Address.address.value", data.Ipv6Address.ValueString()) + } } + if true { - for _, item := range data.Ipv6SecondaryAddresses { - itemBody := "" + for _, item := range data.Ipv6SecondaryAddresses { + itemBody := "" - if !item.AddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) - } else if !item.Address.IsNull() { - itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + if !item.AddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "address.value", item.AddressVariable.ValueString()) + } + } else if !item.Address.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "address.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "address.value", item.Address.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"intfIpV6Address.static.secondaryIpV6Address.-1", itemBody) } if !data.IperfServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable") - body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "variable") + body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServerVariable.ValueString()) + } } else if data.IperfServer.IsNull() { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") - body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServer.ValueString()) + if true { + body, _ = sjson.Set(body, path+"iperfServer.optionType", "global") + body, _ = sjson.Set(body, path+"iperfServer.value", data.IperfServer.ValueString()) + } } if !data.BlockNonSourceIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "variable") - body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "variable") + body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIpVariable.ValueString()) + } } else if data.BlockNonSourceIp.IsNull() { - body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "default") - body, _ = sjson.Set(body, path+"blockNonSourceIp.value", false) + if true { + body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "default") + body, _ = sjson.Set(body, path+"blockNonSourceIp.value", false) + } } else { - body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "global") - body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"blockNonSourceIp.optionType", "global") + body, _ = sjson.Set(body, path+"blockNonSourceIp.value", data.BlockNonSourceIp.ValueBool()) + } } if !data.ServiceProviderVariable.IsNull() { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable") - body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "variable") + body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProviderVariable.ValueString()) + } } else if data.ServiceProvider.IsNull() { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") - body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + if true { + body, _ = sjson.Set(body, path+"serviceProvider.optionType", "global") + body, _ = sjson.Set(body, path+"serviceProvider.value", data.ServiceProvider.ValueString()) + } } if !data.BandwidthUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstreamVariable.ValueString()) + } } else if data.BandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthUpstream.value", data.BandwidthUpstream.ValueInt64()) + } } if !data.BandwidthDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString()) + } } else if data.BandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + } } if !data.AutoDetectBandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidthVariable.ValueString()) + } } else if data.AutoDetectBandwidth.IsNull() { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "default") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", false) + } } else { - body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidth.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"autoDetectBandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"autoDetectBandwidth.value", data.AutoDetectBandwidth.ValueBool()) + } } if data.TunnelInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default") - body, _ = sjson.Set(body, path+"tunnelInterface.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default") + body, _ = sjson.Set(body, path+"tunnelInterface.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + } } if !data.PerTunnelQosVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString()) + } } else if data.PerTunnelQos.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + } } if !data.TunnelQosModeVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) + } } else if !data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + } } if !data.TunnelBandwidthPercentVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercentVariable.ValueString()) + } } else if data.TunnelBandwidthPercent.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", 50) + } } else { - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bandwidthPercent.value", data.TunnelBandwidthPercent.ValueInt64()) + } } if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString()) + } } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + } } if !data.TunnelInterfaceCarrierVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString()) + } } else if data.TunnelInterfaceCarrier.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + } } if !data.TunnelInterfaceColorVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString()) + } } else if data.TunnelInterfaceColor.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls") + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.color.value", "mpls") + } } else { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + } } if !data.TunnelInterfaceHelloIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString()) + } } else if data.TunnelInterfaceHelloInterval.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloToleranceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString()) + } } else if data.TunnelInterfaceHelloTolerance.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) + } } else { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + } } if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString()) + } } else if data.TunnelInterfaceLastResortCircuit.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + } } if !data.TunnelInterfaceGreTunnelDestinationIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIpVariable.ValueString()) + } } else if data.TunnelInterfaceGreTunnelDestinationIp.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tlocExtensionGreTo.value", data.TunnelInterfaceGreTunnelDestinationIp.ValueString()) + } } if !data.TunnelInterfaceColorRestrictVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrictVariable.ValueString()) + } } else if data.TunnelInterfaceColorRestrict.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceColorRestrict.ValueBool()) + } } if !data.TunnelInterfaceGroupsVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString()) + } } else if data.TunnelInterfaceGroups.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + } } if !data.TunnelInterfaceBorderVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString()) + } } else if data.TunnelInterfaceBorder.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.border.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.border.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + } } if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString()) + } } else if data.TunnelInterfaceMaxControlConnections.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + } } if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString()) + } } else if data.TunnelInterfaceNatRefreshInterval.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) + } } else { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + } } if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString()) + } } else if data.TunnelInterfaceVbondAsStunServer.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vBondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + } } if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString()) + } } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") - var values []int64 - data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") + var values []int64 + data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + } } if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString()) + } } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", 5) + } } else { - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vManageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + } } if !data.TunnelInterfacePortHopVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString()) + } } else if data.TunnelInterfacePortHop.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) + } } else { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + } } if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString()) + } } else if data.TunnelInterfaceLowBandwidthLink.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + } } if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString()) + } } else if data.TunnelInterfaceTunnelTcpMss.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMss.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + } } if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString()) + } } else if data.TunnelInterfaceClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + } } if !data.TunnelInterfaceCtsSgtPropagationVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagationVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagationVariable.ValueString()) + } } else if data.TunnelInterfaceCtsSgtPropagation.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagation.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.ctsSgtPropagation.value", data.TunnelInterfaceCtsSgtPropagation.ValueBool()) + } } if !data.TunnelInterfaceNetworkBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcastVariable.ValueString()) + } } else if data.TunnelInterfaceNetworkBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceNetworkBroadcast.ValueBool()) + } } if !data.TunnelInterfaceAllowAllVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString()) + } } else if data.TunnelInterfaceAllowAll.IsNull() { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.all.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.all.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + } } if !data.TunnelInterfaceAllowBgpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowBgp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.bgp.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.bgp.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + } } if !data.TunnelInterfaceAllowDhcpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowDhcp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + } } if !data.TunnelInterfaceAllowNtpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) + } } else if !data.TunnelInterfaceAllowNtp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + } } if !data.TunnelInterfaceAllowSshVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSshVariable.ValueString()) + } } else if !data.TunnelInterfaceAllowSsh.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ssh.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ssh.value", data.TunnelInterfaceAllowSsh.ValueBool()) + } } if !data.TunnelInterfaceAllowDnsVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString()) + } } else if data.TunnelInterfaceAllowDns.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.dns.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.dns.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + } } if !data.TunnelInterfaceAllowIcmpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowIcmp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.icmp.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.icmp.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + } } if !data.TunnelInterfaceAllowHttpsVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString()) + } } else if data.TunnelInterfaceAllowHttps.IsNull() { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.https.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.https.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + } } if !data.TunnelInterfaceAllowOspfVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString()) + } } else if data.TunnelInterfaceAllowOspf.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.ospf.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.ospf.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + } } if !data.TunnelInterfaceAllowStunVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString()) + } } else if data.TunnelInterfaceAllowStun.IsNull() { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.stun.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.stun.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + } } if !data.TunnelInterfaceAllowSnmpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowSnmp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.snmp.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.snmp.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + } } if !data.TunnelInterfaceAllowNetconfVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString()) + } } else if data.TunnelInterfaceAllowNetconf.IsNull() { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.netconf.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.netconf.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + } } if !data.TunnelInterfaceAllowBfdVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString()) + } } else if data.TunnelInterfaceAllowBfd.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.bfd.value", false) - } else { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) - } - body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) - for _, item := range data.TunnelInterfaceEncapsulations { - itemBody := "" - if !item.Encapsulation.IsNull() { - itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.bfd.value", false) } + } else { + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + } + } + if true { + body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) + for _, item := range data.TunnelInterfaceEncapsulations { + itemBody := "" + if !item.Encapsulation.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + } + } - if !item.PreferenceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString()) - } else if item.Preference.IsNull() { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default") + if !item.PreferenceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString()) + } + } else if item.Preference.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + } + } - if !item.WeightVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString()) - } else if item.Weight.IsNull() { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "weight.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + if !item.WeightVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString()) + } + } else if item.Weight.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "weight.value", 1) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } if !data.NatIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"nat.optionType", "variable") - body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "variable") + body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4Variable.ValueString()) + } } else if data.NatIpv4.IsNull() { - body, _ = sjson.Set(body, path+"nat.optionType", "default") - body, _ = sjson.Set(body, path+"nat.value", false) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "default") + body, _ = sjson.Set(body, path+"nat.value", false) + } } else { - body, _ = sjson.Set(body, path+"nat.optionType", "global") - body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"nat.optionType", "global") + body, _ = sjson.Set(body, path+"nat.value", data.NatIpv4.ValueBool()) + } } if !data.NatTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatTypeVariable.ValueString()) + } } else if data.NatType.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", "interface") + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", "interface") + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natType.value", data.NatType.ValueString()) + } } if !data.NatRangeStartVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStartVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStartVariable.ValueString()) + } } else if !data.NatRangeStart.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeStart.value", data.NatRangeStart.ValueString()) + } } if !data.NatRangeEndVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEndVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEndVariable.ValueString()) + } } else if !data.NatRangeEnd.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.rangeEnd.value", data.NatRangeEnd.ValueString()) + } } if !data.NatPrefixLengthVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLengthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLengthVariable.ValueString()) + } } else if !data.NatPrefixLength.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.prefixLength.value", data.NatPrefixLength.ValueInt64()) + } } if !data.NatOverloadVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverloadVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverloadVariable.ValueString()) + } } else if !data.NatOverload.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natPool.overload.value", data.NatOverload.ValueBool()) + } } if !data.NatLoopbackVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopbackVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopbackVariable.ValueString()) + } } else if !data.NatLoopback.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.natLookback.value", data.NatLoopback.ValueString()) + } } if !data.NatUdpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeoutVariable.ValueString()) + } } else if data.NatUdpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", 1) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.udpTimeout.value", data.NatUdpTimeout.ValueInt64()) + } } if !data.NatTcpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeoutVariable.ValueString()) + } } else if data.NatTcpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", 60) + } } else { - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv4.tcpTimeout.value", data.NatTcpTimeout.ValueInt64()) + } } - body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{}) - for _, item := range data.NewStaticNats { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv4.newStaticNat", []interface{}{}) + for _, item := range data.NewStaticNats { + itemBody := "" - if !item.SourceIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) - } else if !item.SourceIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) - } + if !item.SourceIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIpVariable.ValueString()) + } + } else if !item.SourceIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceIp.value", item.SourceIp.ValueString()) + } + } - if !item.TranslatedIpVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIpVariable.ValueString()) - } else if !item.TranslatedIp.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIp.ValueString()) - } - if item.Direction.IsNull() { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside") - } else { - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) - } + if !item.TranslatedIpVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIpVariable.ValueString()) + } + } else if !item.TranslatedIp.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translateIp.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translateIp.value", item.TranslatedIp.ValueString()) + } + } + if item.Direction.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", "inside") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "staticNatDirection.value", item.Direction.ValueString()) + } + } - if !item.SourceVpnVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) - } else if item.SourceVpn.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0) - } else { - itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + if !item.SourceVpnVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpnVariable.ValueString()) + } + } else if item.SourceVpn.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", 0) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpn.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpn.value", item.SourceVpn.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"natAttributesIpv4.newStaticNat.-1", itemBody) } if !data.NatIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6Variable.ValueString()) + } } else if data.NatIpv6.IsNull() { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "default") - body, _ = sjson.Set(body, path+"natIpv6.value", false) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "default") + body, _ = sjson.Set(body, path+"natIpv6.value", false) + } } else { - body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"natIpv6.value", data.NatIpv6.ValueBool()) + } } if !data.Nat64.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat64.value", data.Nat64.ValueBool()) + } } if !data.Nat66.IsNull() { - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global") - body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.optionType", "global") + body, _ = sjson.Set(body, path+"natAttributesIpv6.nat66.value", data.Nat66.ValueBool()) + } } + if true { - for _, item := range data.StaticNat66 { - itemBody := "" + for _, item := range data.StaticNat66 { + itemBody := "" - if !item.SourcePrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefixVariable.ValueString()) - } else if !item.SourcePrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefix.ValueString()) - } + if !item.SourcePrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefixVariable.ValueString()) + } + } else if !item.SourcePrefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourcePrefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourcePrefix.value", item.SourcePrefix.ValueString()) + } + } - if !item.TranslatedSourcePrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefixVariable.ValueString()) - } else if !item.TranslatedSourcePrefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefix.ValueString()) - } + if !item.TranslatedSourcePrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefixVariable.ValueString()) + } + } else if !item.TranslatedSourcePrefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "translatedSourcePrefix.value", item.TranslatedSourcePrefix.ValueString()) + } + } - if !item.SourceVpnIdVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnIdVariable.ValueString()) - } else if item.SourceVpnId.IsNull() { - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "default") + if !item.SourceVpnIdVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnIdVariable.ValueString()) + } + } else if item.SourceVpnId.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnId.ValueInt64()) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "sourceVpnId.value", item.SourceVpnId.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"natAttributesIpv6.staticNat66.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"natAttributesIpv6.staticNat66.-1", itemBody) } if !data.QosAdaptive.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptiveQoS.value", data.QosAdaptive.ValueBool()) + } } if !data.QosAdaptivePeriodVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriodVariable.ValueString()) + } } else if !data.QosAdaptivePeriod.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.adaptPeriod.value", data.QosAdaptivePeriod.ValueInt64()) + } } if !data.QosAdaptiveBandwidthUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstream.value", data.QosAdaptiveBandwidthUpstream.ValueBool()) + } } if !data.QosAdaptiveMinUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMinUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.minShapingRateUpstream.value", data.QosAdaptiveMinUpstream.ValueInt64()) + } } if !data.QosAdaptiveMaxUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMaxUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.maxShapingRateUpstream.value", data.QosAdaptiveMaxUpstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultUpstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstreamVariable.ValueString()) + } } else if !data.QosAdaptiveDefaultUpstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateUpstreamConfig.defaultShapingRateUpstream.value", data.QosAdaptiveDefaultUpstream.ValueInt64()) + } } if !data.QosAdaptiveBandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstream.value", data.QosAdaptiveBandwidthDownstream.ValueBool()) + } } if !data.QosAdaptiveMinDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMinDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.minShapingRateDownstream.value", data.QosAdaptiveMinDownstream.ValueInt64()) + } } if !data.QosAdaptiveMaxDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstreamVariable.ValueString()) + } } else if !data.QosAdaptiveMaxDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.maxShapingRateDownstream.value", data.QosAdaptiveMaxDownstream.ValueInt64()) + } } if !data.QosAdaptiveDefaultDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstreamVariable.ValueString()) + } } else if !data.QosAdaptiveDefaultDownstream.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRateDownstreamConfig.defaultShapingRateDownstream.value", data.QosAdaptiveDefaultDownstream.ValueInt64()) + } } if !data.QosShapingRateVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) + } } else if !data.QosShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + } } - body, _ = sjson.Set(body, path+"arp", []interface{}{}) - for _, item := range data.Arps { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"arp", []interface{}{}) + for _, item := range data.Arps { + itemBody := "" - if !item.IpAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) - } else if item.IpAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default") + if !item.IpAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddressVariable.ValueString()) + } + } else if item.IpAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "ipAddress.value", item.IpAddress.ValueString()) + } + } - if !item.MacAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) - } else if item.MacAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default") + if !item.MacAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddressVariable.ValueString()) + } + } else if item.MacAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "macAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "macAddress.value", item.MacAddress.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"arp.-1", itemBody) } if !data.IcmpRedirectDisableVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisableVariable.ValueString()) + } } else if data.IcmpRedirectDisable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", true) + } } else { - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.icmpRedirectDisable.value", data.IcmpRedirectDisable.ValueBool()) + } } if !data.DuplexVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.DuplexVariable.ValueString()) + } } else if data.Duplex.IsNull() { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.duplex.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.duplex.value", data.Duplex.ValueString()) + } } if !data.MacAddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddressVariable.ValueString()) + } } else if data.MacAddress.IsNull() { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.macAddress.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.macAddress.value", data.MacAddress.ValueString()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.InterfaceMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtuVariable.ValueString()) + } } else if data.InterfaceMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.intrfMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.intrfMtu.value", data.InterfaceMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMss.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMss.value", data.TcpMss.ValueInt64()) + } } if !data.SpeedVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.SpeedVariable.ValueString()) + } } else if data.Speed.IsNull() { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.speed.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.speed.value", data.Speed.ValueString()) + } } if !data.ArpTimeoutVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeoutVariable.ValueString()) + } } else if data.ArpTimeout.IsNull() { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", 1200) + } } else { - body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.arpTimeout.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.arpTimeout.value", data.ArpTimeout.ValueInt64()) + } } if !data.AutonegotiateVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.AutonegotiateVariable.ValueString()) + } } else if data.Autonegotiate.IsNull() { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.autonegotiate.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.autonegotiate.value", data.Autonegotiate.ValueBool()) + } } if !data.MediaTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaTypeVariable.ValueString()) + } } else if data.MediaType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mediaType.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mediaType.value", data.MediaType.ValueString()) + } } if !data.TlocExtensionVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString()) + } } else if data.TlocExtension.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + } } if !data.GreTunnelSourceIpVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIpVariable.ValueString()) + } } else if data.GreTunnelSourceIp.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIp.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.sourceIp.value", data.GreTunnelSourceIp.ValueString()) + } } if !data.XconnectVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.XconnectVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.XconnectVariable.ValueString()) + } } else if data.Xconnect.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.Xconnect.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtensionGreFrom.xconnect.value", data.Xconnect.ValueString()) + } } if !data.LoadIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadIntervalVariable.ValueString()) + } } else if data.LoadInterval.IsNull() { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", 30) + } } else { - body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.loadInterval.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.loadInterval.value", data.LoadInterval.ValueInt64()) + } } if !data.TrackerVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.TrackerVariable.ValueString()) + } } else if data.Tracker.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tracker.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tracker.value", data.Tracker.ValueString()) + } } if !data.IpDirectedBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcastVariable.ValueString()) + } } else if data.IpDirectedBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipDirectedBroadcast.value", data.IpDirectedBroadcast.ValueBool()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go index 44a182d4..c3b69c66 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_gre_profile_parcel.go @@ -92,130 +92,196 @@ func (data TransportWANVPNInterfaceGRE) toBody(ctx context.Context) string { path := "data." if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.ifName.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") - body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.ifName.optionType", "global") + body, _ = sjson.Set(body, path+"basic.ifName.value", data.InterfaceName.ValueString()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.description.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"basic.description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.description.optionType", "global") - body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.description.optionType", "global") + body, _ = sjson.Set(body, path+"basic.description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.address.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"basic.address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"basic.shutdown.value", false) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"basic.shutdown.value", false) + } } else { - body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"basic.shutdown.value", data.Shutdown.ValueBool()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceIp.tunnelSource.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceNotLoopback.tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelSourceInterfaceLoopbackVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopbackVariable.ValueString()) + } } else if !data.TunnelSourceInterfaceLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelSourceInterface.value", data.TunnelSourceInterfaceLoopback.ValueString()) + } } if !data.TunnelRouteViaLoopbackVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopbackVariable.ValueString()) + } } else if !data.TunnelRouteViaLoopback.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelSourceType.sourceLoopback.tunnelRouteVia.value", data.TunnelRouteViaLoopback.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tunnelDestination.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tunnelDestination.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default") - body, _ = sjson.Set(body, path+"basic.mtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "default") + body, _ = sjson.Set(body, path+"basic.mtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") - body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.mtu.optionType", "global") + body, _ = sjson.Set(body, path+"basic.mtu.value", data.IpMtu.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"basic.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + } } else if data.ClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"basic.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"basic.clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.application.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelTypeVariable.ValueString()) + } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.application.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.application.value", data.ApplicationTunnelType.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go index 2124592c..09b05535 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_ipsec_profile_parcel.go @@ -123,299 +123,457 @@ func (data TransportWANVPNInterfaceIPSEC) toBody(ctx context.Context) string { path := "data." if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"ifName.optionType", "variable") - body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifName.optionType", "variable") + body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"ifName.optionType", "global") - body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ifName.optionType", "global") + body, _ = sjson.Set(body, path+"ifName.value", data.InterfaceName.ValueString()) + } } if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceDescriptionVariable.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "variable") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "variable") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescriptionVariable.ValueString()) + } } else if data.InterfaceDescription.IsNull() { - body, _ = sjson.Set(body, path+"description.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"description.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"description.optionType", "global") - body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + if true { + body, _ = sjson.Set(body, path+"description.optionType", "global") + body, _ = sjson.Set(body, path+"description.value", data.InterfaceDescription.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"address.address.optionType", "variable") - body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.address.optionType", "variable") + body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4AddressVariable.ValueString()) + } } else if !data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"address.address.optionType", "global") - body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.address.optionType", "global") + body, _ = sjson.Set(body, path+"address.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"address.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"address.mask.optionType", "global") - body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"address.mask.optionType", "global") + body, _ = sjson.Set(body, path+"address.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.TunnelSourceIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4AddressVariable.ValueString()) + } } else if !data.TunnelSourceIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.address.value", data.TunnelSourceIpv4Address.ValueString()) + } } if !data.TunnelSourceIpv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMaskVariable.ValueString()) + } } else if !data.TunnelSourceIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSource.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSource.mask.value", data.TunnelSourceIpv4SubnetMask.ValueString()) + } } if !data.TunnelSourceInterfaceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterfaceVariable.ValueString()) + } } else if !data.TunnelSourceInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelSourceInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelSourceInterface.value", data.TunnelSourceInterface.ValueString()) + } } if !data.TunnelDestinationIpv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4AddressVariable.ValueString()) + } } else if !data.TunnelDestinationIpv4Address.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.address.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.address.value", data.TunnelDestinationIpv4Address.ValueString()) + } } if !data.TunnelDestinationIpv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMaskVariable.ValueString()) + } } else if !data.TunnelDestinationIpv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelDestination.mask.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelDestination.mask.value", data.TunnelDestinationIpv4SubnetMask.ValueString()) + } } if !data.ApplicationTunnelTypeVariable.IsNull() { - body, _ = sjson.Set(body, path+"application.optionType", "variable") - body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"application.optionType", "variable") + body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelTypeVariable.ValueString()) + } } else if !data.ApplicationTunnelType.IsNull() { - body, _ = sjson.Set(body, path+"application.optionType", "global") - body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"application.optionType", "global") + body, _ = sjson.Set(body, path+"application.value", data.ApplicationTunnelType.ValueString()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable") - body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "variable") + body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.ClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragmentVariable.ValueString()) + } } else if data.ClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"clearDontFragment.value", data.ClearDontFragment.ValueBool()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"mtu.optionType", "variable") - body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "variable") + body, _ = sjson.Set(body, path+"mtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"mtu.optionType", "default") - body, _ = sjson.Set(body, path+"mtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "default") + body, _ = sjson.Set(body, path+"mtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"mtu.optionType", "global") - body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"mtu.optionType", "global") + body, _ = sjson.Set(body, path+"mtu.value", data.IpMtu.ValueInt64()) + } } if !data.DpdIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdIntervalVariable.ValueString()) + } } else if data.DpdInterval.IsNull() { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default") - body, _ = sjson.Set(body, path+"dpdInterval.value", 10) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "default") + body, _ = sjson.Set(body, path+"dpdInterval.value", 10) + } } else { - body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") - body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdInterval.optionType", "global") + body, _ = sjson.Set(body, path+"dpdInterval.value", data.DpdInterval.ValueInt64()) + } } if !data.DpdRetriesVariable.IsNull() { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable") - body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "variable") + body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetriesVariable.ValueString()) + } } else if data.DpdRetries.IsNull() { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default") - body, _ = sjson.Set(body, path+"dpdRetries.value", 3) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "default") + body, _ = sjson.Set(body, path+"dpdRetries.value", 3) + } } else { - body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") - body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"dpdRetries.optionType", "global") + body, _ = sjson.Set(body, path+"dpdRetries.value", data.DpdRetries.ValueInt64()) + } } if !data.IkePresharedKeyVariable.IsNull() { - body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable") - body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "variable") + body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKeyVariable.ValueString()) + } } else if !data.IkePresharedKey.IsNull() { - body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") - body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + if true { + body, _ = sjson.Set(body, path+"preSharedSecret.optionType", "global") + body, _ = sjson.Set(body, path+"preSharedSecret.value", data.IkePresharedKey.ValueString()) + } } if data.IkeVersion.IsNull() { - body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default") - body, _ = sjson.Set(body, path+"ikeVersion.value", 1) + if true { + body, _ = sjson.Set(body, path+"ikeVersion.optionType", "default") + body, _ = sjson.Set(body, path+"ikeVersion.value", 1) + } } else { - body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") - body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeVersion.optionType", "global") + body, _ = sjson.Set(body, path+"ikeVersion.value", data.IkeVersion.ValueInt64()) + } } if !data.IkeIntegrityProtocolVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocolVariable.ValueString()) + } } else if data.IkeIntegrityProtocol.IsNull() { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "default") - body, _ = sjson.Set(body, path+"ikeMode.value", "main") + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "default") + body, _ = sjson.Set(body, path+"ikeMode.value", "main") + } } else { - body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") - body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeMode.optionType", "global") + body, _ = sjson.Set(body, path+"ikeMode.value", data.IkeIntegrityProtocol.ValueString()) + } } if !data.IkeRekeyIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyIntervalVariable.ValueString()) + } } else if data.IkeRekeyInterval.IsNull() { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "default") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", 14400) + } } else { - body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ikeRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRekeyInterval.value", data.IkeRekeyInterval.ValueInt64()) + } } if !data.IkeCiphersuiteVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuiteVariable.ValueString()) + } } else if data.IkeCiphersuite.IsNull() { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1") + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "default") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", "aes256-cbc-sha1") + } } else { - body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ikeCiphersuite.value", data.IkeCiphersuite.ValueString()) + } } if !data.IkeDiffieHellmanGroupVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroupVariable.ValueString()) + } } else if data.IkeDiffieHellmanGroup.IsNull() { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default") - body, _ = sjson.Set(body, path+"ikeGroup.value", "16") + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "default") + body, _ = sjson.Set(body, path+"ikeGroup.value", "16") + } } else { - body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") - body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeGroup.optionType", "global") + body, _ = sjson.Set(body, path+"ikeGroup.value", data.IkeDiffieHellmanGroup.ValueString()) + } } if !data.IkeIdLocalEndPointVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPointVariable.ValueString()) + } } else if data.IkeIdLocalEndPoint.IsNull() { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeLocalId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeLocalId.value", data.IkeIdLocalEndPoint.ValueString()) + } } if !data.IkeIdRemoteEndPointVariable.IsNull() { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable") - body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "variable") + body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPointVariable.ValueString()) + } } else if data.IkeIdRemoteEndPoint.IsNull() { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") - body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ikeRemoteId.optionType", "global") + body, _ = sjson.Set(body, path+"ikeRemoteId.value", data.IkeIdRemoteEndPoint.ValueString()) + } } if !data.IpsecRekeyIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyIntervalVariable.ValueString()) + } } else if data.IpsecRekeyInterval.IsNull() { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "default") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", 3600) + } } else { - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecRekeyInterval.value", data.IpsecRekeyInterval.ValueInt64()) + } } if !data.IpsecReplayWindowVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "variable") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindowVariable.ValueString()) + } } else if data.IpsecReplayWindow.IsNull() { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "default") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", 512) + } } else { - body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"ipsecReplayWindow.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecReplayWindow.value", data.IpsecReplayWindow.ValueInt64()) + } } if !data.IpsecCiphersuiteVariable.IsNull() { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "variable") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuiteVariable.ValueString()) + } } else if data.IpsecCiphersuite.IsNull() { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm") + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "default") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", "aes256-gcm") + } } else { - body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") - body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + if true { + body, _ = sjson.Set(body, path+"ipsecCiphersuite.optionType", "global") + body, _ = sjson.Set(body, path+"ipsecCiphersuite.value", data.IpsecCiphersuite.ValueString()) + } } if !data.PerfectForwardSecrecyVariable.IsNull() { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "variable") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecyVariable.ValueString()) + } } else if data.PerfectForwardSecrecy.IsNull() { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16") + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "default") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", "group-16") + } } else { - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") - body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + if true { + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.optionType", "global") + body, _ = sjson.Set(body, path+"perfectForwardSecrecy.value", data.PerfectForwardSecrecy.ValueString()) + } } if !data.TrackerIdVariable.IsNull() { - body, _ = sjson.Set(body, path+"tracker.optionType", "variable") - body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "variable") + body, _ = sjson.Set(body, path+"tracker.value", data.TrackerIdVariable.ValueString()) + } } else if data.TrackerId.IsNull() { - body, _ = sjson.Set(body, path+"tracker.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tracker.optionType", "global") - body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tracker.optionType", "global") + body, _ = sjson.Set(body, path+"tracker.value", data.TrackerId.ValueString()) + } } if !data.TunnelRouteViaVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteViaVariable.ValueString()) + } } else if data.TunnelRouteVia.IsNull() { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnelRouteVia.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelRouteVia.value", data.TunnelRouteVia.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go index dc172d2e..18a65630 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_interface_t1_e1_serial_profile_parcel.go @@ -174,564 +174,866 @@ func (data TransportWANVPNInterfaceT1E1Serial) toBody(ctx context.Context) strin path := "data." if !data.ShutdownVariable.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") - body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "variable") + body, _ = sjson.Set(body, path+"shutdown.value", data.ShutdownVariable.ValueString()) + } } else if data.Shutdown.IsNull() { - body, _ = sjson.Set(body, path+"shutdown.optionType", "default") - body, _ = sjson.Set(body, path+"shutdown.value", true) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "default") + body, _ = sjson.Set(body, path+"shutdown.value", true) + } } else { - body, _ = sjson.Set(body, path+"shutdown.optionType", "global") - body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"shutdown.optionType", "global") + body, _ = sjson.Set(body, path+"shutdown.value", data.Shutdown.ValueBool()) + } } if !data.InterfaceNameVariable.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "variable") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceNameVariable.ValueString()) + } } else if !data.InterfaceName.IsNull() { - body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") - body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + if true { + body, _ = sjson.Set(body, path+"interfaceName.optionType", "global") + body, _ = sjson.Set(body, path+"interfaceName.value", data.InterfaceName.ValueString()) + } } if !data.Ipv4AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"addressV4.address.optionType", "variable") - body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV4.address.optionType", "variable") + body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4AddressVariable.ValueString()) + } } else if data.Ipv4Address.IsNull() { - body, _ = sjson.Set(body, path+"addressV4.address.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"addressV4.address.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"addressV4.address.optionType", "global") - body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV4.address.optionType", "global") + body, _ = sjson.Set(body, path+"addressV4.address.value", data.Ipv4Address.ValueString()) + } } if !data.Ipv4SubnetMaskVariable.IsNull() { - body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "variable") - body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "variable") + body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMaskVariable.ValueString()) + } } else if !data.Ipv4SubnetMask.IsNull() { - body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "global") - body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMask.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV4.mask.optionType", "global") + body, _ = sjson.Set(body, path+"addressV4.mask.value", data.Ipv4SubnetMask.ValueString()) + } } if !data.Ipv6AddressVariable.IsNull() { - body, _ = sjson.Set(body, path+"addressV6.optionType", "variable") - body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6AddressVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV6.optionType", "variable") + body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6AddressVariable.ValueString()) + } } else if data.Ipv6Address.IsNull() { - body, _ = sjson.Set(body, path+"addressV6.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"addressV6.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"addressV6.optionType", "global") - body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6Address.ValueString()) + if true { + body, _ = sjson.Set(body, path+"addressV6.optionType", "global") + body, _ = sjson.Set(body, path+"addressV6.value", data.Ipv6Address.ValueString()) + } } if !data.BandwidthVariable.IsNull() { - body, _ = sjson.Set(body, path+"bandwidth.optionType", "variable") - body, _ = sjson.Set(body, path+"bandwidth.value", data.BandwidthVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"bandwidth.optionType", "variable") + body, _ = sjson.Set(body, path+"bandwidth.value", data.BandwidthVariable.ValueString()) + } } else if data.Bandwidth.IsNull() { - body, _ = sjson.Set(body, path+"bandwidth.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"bandwidth.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"bandwidth.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidth.value", data.Bandwidth.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidth.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidth.value", data.Bandwidth.ValueInt64()) + } } if !data.BandwidthDownstreamVariable.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "variable") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstreamVariable.ValueString()) + } } else if data.BandwidthDownstream.IsNull() { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") - body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"bandwidthDownstream.optionType", "global") + body, _ = sjson.Set(body, path+"bandwidthDownstream.value", data.BandwidthDownstream.ValueInt64()) + } } if !data.ClockRateVariable.IsNull() { - body, _ = sjson.Set(body, path+"clockRate.optionType", "variable") - body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clockRate.optionType", "variable") + body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRateVariable.ValueString()) + } } else if data.ClockRate.IsNull() { - body, _ = sjson.Set(body, path+"clockRate.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"clockRate.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"clockRate.optionType", "global") - body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRate.ValueString()) + if true { + body, _ = sjson.Set(body, path+"clockRate.optionType", "global") + body, _ = sjson.Set(body, path+"clockRate.value", data.ClockRate.ValueString()) + } } if !data.EncapsulationVariable.IsNull() { - body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "variable") - body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.EncapsulationVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "variable") + body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.EncapsulationVariable.ValueString()) + } } else if data.Encapsulation.IsNull() { - body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "global") - body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.Encapsulation.ValueString()) + if true { + body, _ = sjson.Set(body, path+"encapsulationSerial.optionType", "global") + body, _ = sjson.Set(body, path+"encapsulationSerial.value", data.Encapsulation.ValueString()) + } } if data.TunnelInterface.IsNull() { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default") - body, _ = sjson.Set(body, path+"tunnelInterface.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "default") + body, _ = sjson.Set(body, path+"tunnelInterface.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") - body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnelInterface.optionType", "global") + body, _ = sjson.Set(body, path+"tunnelInterface.value", data.TunnelInterface.ValueBool()) + } } if !data.PerTunnelQosVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQosVariable.ValueString()) + } } else if data.PerTunnelQos.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQos.value", data.PerTunnelQos.ValueBool()) + } } if !data.PerTunnelQosAggregatorVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregatorVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregatorVariable.ValueString()) + } } else if data.PerTunnelQosAggregator.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregator.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.perTunnelQosAggregator.value", data.PerTunnelQosAggregator.ValueBool()) + } } if !data.TunnelQosModeVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosModeVariable.ValueString()) + } } else if !data.TunnelQosMode.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.mode.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.mode.value", data.TunnelQosMode.ValueString()) + } } if !data.TunnelInterfaceColorVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColorVariable.ValueString()) + } } else if data.TunnelInterfaceColor.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.color.value", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.color.value", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.color.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.color.value", data.TunnelInterfaceColor.ValueString()) + } } if !data.TunnelInterfaceRestrictVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrictVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrictVariable.ValueString()) + } } else if data.TunnelInterfaceRestrict.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrict.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.restrict.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.restrict.value", data.TunnelInterfaceRestrict.ValueBool()) + } } if !data.TunnelInterfaceGroupsVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroupsVariable.ValueString()) + } } else if data.TunnelInterfaceGroups.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.group.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.group.value", data.TunnelInterfaceGroups.ValueInt64()) + } } if !data.TunnelInterfaceBorderVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorderVariable.ValueString()) + } } else if data.TunnelInterfaceBorder.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.border.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.border.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.border.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.border.value", data.TunnelInterfaceBorder.ValueBool()) + } } if !data.TunnelInterfaceMaxControlConnectionsVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnectionsVariable.ValueString()) + } } else if data.TunnelInterfaceMaxControlConnections.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.maxControlConnections.value", data.TunnelInterfaceMaxControlConnections.ValueInt64()) + } } if !data.TunnelInterfaceVbondAsStunServerVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServerVariable.ValueString()) + } } else if data.TunnelInterfaceVbondAsStunServer.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vbondAsStunServer.value", data.TunnelInterfaceVbondAsStunServer.ValueBool()) + } } if !data.TunnelInterfaceExcludeControllerGroupListVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", data.TunnelInterfaceExcludeControllerGroupListVariable.ValueString()) + } } else if data.TunnelInterfaceExcludeControllerGroupList.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") - var values []int64 - data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) - body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + if true { + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.optionType", "global") + var values []int64 + data.TunnelInterfaceExcludeControllerGroupList.ElementsAs(ctx, &values, false) + body, _ = sjson.Set(body, path+"tunnel.excludeControllerGroupList.value", values) + } } if !data.TunnelInterfaceVmanageConnectionPreferenceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreferenceVariable.ValueString()) + } } else if data.TunnelInterfaceVmanageConnectionPreference.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", 5) + if true { + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", 5) + } } else { - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.vmanageConnectionPreference.value", data.TunnelInterfaceVmanageConnectionPreference.ValueInt64()) + } } if !data.TunnelInterfacePortHopVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHopVariable.ValueString()) + } } else if data.TunnelInterfacePortHop.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", true) + } } else { - body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.portHop.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.portHop.value", data.TunnelInterfacePortHop.ValueBool()) + } } if !data.TunnelInterfaceLowBandwidthLinkVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLinkVariable.ValueString()) + } } else if data.TunnelInterfaceLowBandwidthLink.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lowBandwidthLink.value", data.TunnelInterfaceLowBandwidthLink.ValueBool()) + } } if !data.TunnelInterfaceTunnelTcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMssVariable.ValueString()) + } } else if data.TunnelInterfaceTunnelTcpMss.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.tunnelTcpMssAdjust.value", data.TunnelInterfaceTunnelTcpMss.ValueInt64()) + } } if !data.TunnelInterfaceClearDontFragmentVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragmentVariable.ValueString()) + } } else if data.TunnelInterfaceClearDontFragment.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.clearDontFragment.value", data.TunnelInterfaceClearDontFragment.ValueBool()) + } } if !data.TunnelInterfaceClearNetworkBroadcastVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcastVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcastVariable.ValueString()) + } } else if data.TunnelInterfaceClearNetworkBroadcast.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcast.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.networkBroadcast.value", data.TunnelInterfaceClearNetworkBroadcast.ValueBool()) + } } if !data.TunnelInterfaceCarrierVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrierVariable.ValueString()) + } } else if data.TunnelInterfaceCarrier.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.carrier.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.carrier.value", data.TunnelInterfaceCarrier.ValueString()) + } } if !data.TunnelInterfaceBindLoopbackTunnelVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnelVariable.ValueString()) + } } else if data.TunnelInterfaceBindLoopbackTunnel.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.bind.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.bind.value", data.TunnelInterfaceBindLoopbackTunnel.ValueString()) + } } if !data.TunnelInterfaceLastResortCircuitVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuitVariable.ValueString()) + } } else if data.TunnelInterfaceLastResortCircuit.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", false) + } } else { - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.lastResortCircuit.value", data.TunnelInterfaceLastResortCircuit.ValueBool()) + } } if !data.TunnelInterfaceNatRefreshIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshIntervalVariable.ValueString()) + } } else if data.TunnelInterfaceNatRefreshInterval.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", 5) + } } else { - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.natRefreshInterval.value", data.TunnelInterfaceNatRefreshInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloIntervalVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloIntervalVariable.ValueString()) + } } else if data.TunnelInterfaceHelloInterval.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", 1000) + } } else { - body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloInterval.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloInterval.value", data.TunnelInterfaceHelloInterval.ValueInt64()) + } } if !data.TunnelInterfaceHelloToleranceVariable.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "variable") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloToleranceVariable.ValueString()) + } } else if data.TunnelInterfaceHelloTolerance.IsNull() { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "default") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", 12) + } } else { - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") - body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.optionType", "global") + body, _ = sjson.Set(body, path+"tunnel.helloTolerance.value", data.TunnelInterfaceHelloTolerance.ValueInt64()) + } } if !data.TunnelInterfaceAllowAllVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAllVariable.ValueString()) + } } else if data.TunnelInterfaceAllowAll.IsNull() { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.all.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.all.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.all.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.all.value", data.TunnelInterfaceAllowAll.ValueBool()) + } } if !data.TunnelInterfaceAllowBgpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowBgp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.bgp.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.bgp.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.bgp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bgp.value", data.TunnelInterfaceAllowBgp.ValueBool()) + } } if !data.TunnelInterfaceAllowDhcpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowDhcp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dhcp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dhcp.value", data.TunnelInterfaceAllowDhcp.ValueBool()) + } } if !data.TunnelInterfaceAllowDnsVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDnsVariable.ValueString()) + } } else if data.TunnelInterfaceAllowDns.IsNull() { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.dns.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.dns.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.dns.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.dns.value", data.TunnelInterfaceAllowDns.ValueBool()) + } } if !data.TunnelInterfaceAllowIcmpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowIcmp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.icmp.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.icmp.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.icmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.icmp.value", data.TunnelInterfaceAllowIcmp.ValueBool()) + } } if !data.TunnelInterfaceAllowNetconfVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconfVariable.ValueString()) + } } else if data.TunnelInterfaceAllowNetconf.IsNull() { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.netconf.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.netconf.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.netconf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.netconf.value", data.TunnelInterfaceAllowNetconf.ValueBool()) + } } if !data.TunnelInterfaceAllowNtpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtpVariable.ValueString()) + } } else if !data.TunnelInterfaceAllowNtp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ntp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ntp.value", data.TunnelInterfaceAllowNtp.ValueBool()) + } } if !data.TunnelInterfaceAllowOspfVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspfVariable.ValueString()) + } } else if data.TunnelInterfaceAllowOspf.IsNull() { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.ospf.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.ospf.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.ospf.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.ospf.value", data.TunnelInterfaceAllowOspf.ValueBool()) + } } if !data.TunnelInterfaceAllowSshVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSshVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSshVariable.ValueString()) + } } else if !data.TunnelInterfaceAllowSsh.IsNull() { - body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSsh.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.sshd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.sshd.value", data.TunnelInterfaceAllowSsh.ValueBool()) + } } if !data.TunnelInterfaceAllowStunVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStunVariable.ValueString()) + } } else if data.TunnelInterfaceAllowStun.IsNull() { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.stun.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.stun.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.stun.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.stun.value", data.TunnelInterfaceAllowStun.ValueBool()) + } } if !data.TunnelInterfaceAllowHttpsVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttpsVariable.ValueString()) + } } else if data.TunnelInterfaceAllowHttps.IsNull() { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.https.value", true) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.https.value", true) + } } else { - body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.https.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.https.value", data.TunnelInterfaceAllowHttps.ValueBool()) + } } if !data.TunnelInterfaceAllowSnmpVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmpVariable.ValueString()) + } } else if data.TunnelInterfaceAllowSnmp.IsNull() { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.snmp.value", false) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.snmp.value", false) + } } else { - body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"allowService.snmp.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.snmp.value", data.TunnelInterfaceAllowSnmp.ValueBool()) + } } if !data.TunnelInterfaceAllowBfdVariable.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "variable") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfdVariable.ValueString()) + } } else if data.TunnelInterfaceAllowBfd.IsNull() { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default") - body, _ = sjson.Set(body, path+"allowService.bfd.value", false) - } else { - body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") - body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) - } - body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) - for _, item := range data.TunnelInterfaceEncapsulations { - itemBody := "" - if !item.Encapsulation.IsNull() { - itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "default") + body, _ = sjson.Set(body, path+"allowService.bfd.value", false) } + } else { + if true { + body, _ = sjson.Set(body, path+"allowService.bfd.optionType", "global") + body, _ = sjson.Set(body, path+"allowService.bfd.value", data.TunnelInterfaceAllowBfd.ValueBool()) + } + } + if true { + body, _ = sjson.Set(body, path+"encapsulation", []interface{}{}) + for _, item := range data.TunnelInterfaceEncapsulations { + itemBody := "" + if !item.Encapsulation.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "encap.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "encap.value", item.Encapsulation.ValueString()) + } + } - if !item.PreferenceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString()) - } else if item.Preference.IsNull() { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default") + if !item.PreferenceVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.PreferenceVariable.ValueString()) + } + } else if item.Preference.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "default") - } else { - itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) - } + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "preference.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "preference.value", item.Preference.ValueInt64()) + } + } - if !item.WeightVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString()) - } else if item.Weight.IsNull() { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "weight.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + if !item.WeightVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.WeightVariable.ValueString()) + } + } else if item.Weight.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "weight.value", 1) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "weight.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "weight.value", item.Weight.ValueInt64()) + } + } + body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"encapsulation.-1", itemBody) } if !data.QosShapingRateVariable.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "variable") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRateVariable.ValueString()) + } } else if !data.QosShapingRate.IsNull() { - body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") - body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"aclQos.shapingRate.optionType", "global") + body, _ = sjson.Set(body, path+"aclQos.shapingRate.value", data.QosShapingRate.ValueInt64()) + } } if !data.TcpMssVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMssVariable.ValueString()) + } } else if data.TcpMss.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tcpMssAdjust.value", data.TcpMss.ValueInt64()) + } } if !data.MtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.mtu.value", data.MtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.mtu.value", data.MtuVariable.ValueString()) + } } else if data.Mtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.mtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.mtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.mtu.value", data.Mtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.mtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.mtu.value", data.Mtu.ValueInt64()) + } } if !data.IpMtuVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtuVariable.ValueString()) + } } else if data.IpMtu.IsNull() { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "default") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", 1500) + } } else { - body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"advanced.ipMtu.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.ipMtu.value", data.IpMtu.ValueInt64()) + } } if !data.TlocExtensionVariable.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "variable") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtensionVariable.ValueString()) + } } else if data.TlocExtension.IsNull() { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default") + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "default") + } } else { - body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") - body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + if true { + body, _ = sjson.Set(body, path+"advanced.tlocExtension.optionType", "global") + body, _ = sjson.Set(body, path+"advanced.tlocExtension.value", data.TlocExtension.ValueString()) + } } return body } diff --git a/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go b/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go index e02bf66b..5d2bec62 100644 --- a/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go +++ b/internal/provider/model_sdwan_transport_wan_vpn_profile_parcel.go @@ -135,235 +135,349 @@ func (data TransportWANVPN) toBody(ctx context.Context) string { body, _ = sjson.Set(body, "description", data.Description.ValueString()) path := "data." if data.Vpn.IsNull() { - body, _ = sjson.Set(body, path+"vpnId.optionType", "default") - body, _ = sjson.Set(body, path+"vpnId.value", 0) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "default") + body, _ = sjson.Set(body, path+"vpnId.value", 0) + } } else { - body, _ = sjson.Set(body, path+"vpnId.optionType", "global") - body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + if true { + body, _ = sjson.Set(body, path+"vpnId.optionType", "global") + body, _ = sjson.Set(body, path+"vpnId.value", data.Vpn.ValueInt64()) + } } if !data.EnhanceEcmpKeyingVariable.IsNull() { - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "variable") - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeyingVariable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "variable") + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeyingVariable.ValueString()) + } } else if data.EnhanceEcmpKeying.IsNull() { - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "default") - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", false) + if true { + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "default") + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", false) + } } else { - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "global") - body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeying.ValueBool()) + if true { + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.optionType", "global") + body, _ = sjson.Set(body, path+"enhanceEcmpKeying.value", data.EnhanceEcmpKeying.ValueBool()) + } } if !data.PrimaryDnsAddressIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4Variable.ValueString()) + } } else if !data.PrimaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.primaryDnsAddressIpv4.value", data.PrimaryDnsAddressIpv4.ValueString()) + } } if !data.SecondaryDnsAddressIpv4Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4Variable.ValueString()) + } } else if !data.SecondaryDnsAddressIpv4.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv4.secondaryDnsAddressIpv4.value", data.SecondaryDnsAddressIpv4.ValueString()) + } } if !data.PrimaryDnsAddressIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6Variable.ValueString()) + } } else if !data.PrimaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.primaryDnsAddressIpv6.value", data.PrimaryDnsAddressIpv6.ValueString()) + } } if !data.SecondaryDnsAddressIpv6Variable.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "variable") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6Variable.ValueString()) + } } else if !data.SecondaryDnsAddressIpv6.IsNull() { - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") - body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + if true { + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.optionType", "global") + body, _ = sjson.Set(body, path+"dnsIpv6.secondaryDnsAddressIpv6.value", data.SecondaryDnsAddressIpv6.ValueString()) + } } - body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) - for _, item := range data.NewHostMappings { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"newHostMapping", []interface{}{}) + for _, item := range data.NewHostMappings { + itemBody := "" - if !item.HostNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) - } else if !item.HostName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) - } + if !item.HostNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostNameVariable.ValueString()) + } + } else if !item.HostName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "hostName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "hostName.value", item.HostName.ValueString()) + } + } - if !item.ListOfIpAddressesVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString()) - } else if !item.ListOfIpAddresses.IsNull() { - itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") - var values []string - item.ListOfIpAddresses.ElementsAs(ctx, &values, false) - itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + if !item.ListOfIpAddressesVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", item.ListOfIpAddressesVariable.ValueString()) + } + } else if !item.ListOfIpAddresses.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "listOfIp.optionType", "global") + var values []string + item.ListOfIpAddresses.ElementsAs(ctx, &values, false) + itemBody, _ = sjson.Set(itemBody, "listOfIp.value", values) + } + } + body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"newHostMapping.-1", itemBody) } - body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{}) - for _, item := range data.Ipv4StaticRoutes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"ipv4Route", []interface{}{}) + for _, item := range data.Ipv4StaticRoutes { + itemBody := "" - if !item.NetworkAddressVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) - } else if !item.NetworkAddress.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) - } + if !item.NetworkAddressVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddressVariable.ValueString()) + } + } else if !item.NetworkAddress.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.ipAddress.value", item.NetworkAddress.ValueString()) + } + } - if !item.SubnetMaskVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) - } else if !item.SubnetMask.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) - } - if item.Gateway.IsNull() { - itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop") - } else { - itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) - } - itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{}) - for _, childItem := range item.NextHops { - itemChildBody := "" + if !item.SubnetMaskVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMaskVariable.ValueString()) + } + } else if !item.SubnetMask.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.subnetMask.value", item.SubnetMask.ValueString()) + } + } + if item.Gateway.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "gateway.value", "nextHop") + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "gateway.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "gateway.value", item.Gateway.ValueString()) + } + } + if true && item.Gateway.ValueString() == "nextHop" { + itemBody, _ = sjson.Set(itemBody, "nextHop", []interface{}{}) + for _, childItem := range item.NextHops { + itemChildBody := "" - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } + + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) + } + } else { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody) + } } - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "default") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", 1) + if !item.AdministrativeDistanceVariable.IsNull() { + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString()) + } + } else if item.AdministrativeDistance.IsNull() { + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "distance.value", 1) + } } else { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if true && item.Gateway.ValueString() == "null0" { + itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "nextHop.-1", itemChildBody) - } - - if !item.AdministrativeDistanceVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistanceVariable.ValueString()) - } else if item.AdministrativeDistance.IsNull() { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "distance.value", 1) - } else { - itemBody, _ = sjson.Set(itemBody, "distance.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "distance.value", item.AdministrativeDistance.ValueInt64()) + body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv4Route.-1", itemBody) } - body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{}) - for _, item := range data.Ipv6StaticRoutes { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"ipv6Route", []interface{}{}) + for _, item := range data.Ipv6StaticRoutes { + itemBody := "" - if !item.PrefixVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) - } else if !item.Prefix.IsNull() { - itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) - } + if !item.PrefixVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.PrefixVariable.ValueString()) + } + } else if !item.Prefix.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "prefix.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "prefix.value", item.Prefix.ValueString()) + } + } + if true { - for _, childItem := range item.NextHops { - itemChildBody := "" + for _, childItem := range item.NextHops { + itemChildBody := "" - if !childItem.AddressVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) - } else if !childItem.Address.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) - } + if !childItem.AddressVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.AddressVariable.ValueString()) + } + } else if !childItem.Address.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "address.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "address.value", childItem.Address.ValueString()) + } + } - if !childItem.AdministrativeDistanceVariable.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) - } else if !childItem.AdministrativeDistance.IsNull() { - itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") - itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + if !childItem.AdministrativeDistanceVariable.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "variable") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistanceVariable.ValueString()) + } + } else if !childItem.AdministrativeDistance.IsNull() { + if true { + itemChildBody, _ = sjson.Set(itemChildBody, "distance.optionType", "global") + itemChildBody, _ = sjson.Set(itemChildBody, "distance.value", childItem.AdministrativeDistance.ValueInt64()) + } + } + itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) + } + } + if !item.Null0.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) + } } - itemBody, _ = sjson.SetRaw(itemBody, "oneOfIpRoute.nextHopContainer.nextHop.-1", itemChildBody) - } - if !item.Null0.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.null0.value", item.Null0.ValueBool()) - } - if !item.NatVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) - } else if !item.Nat.IsNull() { - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + if !item.NatVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.NatVariable.ValueString()) + } + } else if !item.Nat.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "oneOfIpRoute.nat.value", item.Nat.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"ipv6Route.-1", itemBody) } - body, _ = sjson.Set(body, path+"service", []interface{}{}) - for _, item := range data.Services { - itemBody := "" - if !item.ServiceType.IsNull() { - itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + if true { + body, _ = sjson.Set(body, path+"service", []interface{}{}) + for _, item := range data.Services { + itemBody := "" + if !item.ServiceType.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "serviceType.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "serviceType.value", item.ServiceType.ValueString()) + } + } + body, _ = sjson.SetRaw(body, path+"service.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"service.-1", itemBody) } - body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{}) - for _, item := range data.Nat64V4Pools { - itemBody := "" + if true { + body, _ = sjson.Set(body, path+"nat64V4Pool", []interface{}{}) + for _, item := range data.Nat64V4Pools { + itemBody := "" - if !item.Nat64V4PoolNameVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolNameVariable.ValueString()) - } else if !item.Nat64V4PoolName.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolName.ValueString()) - } + if !item.Nat64V4PoolNameVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolNameVariable.ValueString()) + } + } else if !item.Nat64V4PoolName.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolName.value", item.Nat64V4PoolName.ValueString()) + } + } - if !item.Nat64V4PoolRangeStartVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStartVariable.ValueString()) - } else if !item.Nat64V4PoolRangeStart.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStart.ValueString()) - } + if !item.Nat64V4PoolRangeStartVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStartVariable.ValueString()) + } + } else if !item.Nat64V4PoolRangeStart.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeStart.value", item.Nat64V4PoolRangeStart.ValueString()) + } + } - if !item.Nat64V4PoolRangeEndVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEndVariable.ValueString()) - } else if !item.Nat64V4PoolRangeEnd.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEnd.ValueString()) - } + if !item.Nat64V4PoolRangeEndVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEndVariable.ValueString()) + } + } else if !item.Nat64V4PoolRangeEnd.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolRangeEnd.value", item.Nat64V4PoolRangeEnd.ValueString()) + } + } - if !item.Nat64V4PoolOverloadVariable.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverloadVariable.ValueString()) - } else if item.Nat64V4PoolOverload.IsNull() { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false) - } else { - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverload.ValueBool()) + if !item.Nat64V4PoolOverloadVariable.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "variable") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverloadVariable.ValueString()) + } + } else if item.Nat64V4PoolOverload.IsNull() { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "default") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", false) + } + } else { + if true { + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.optionType", "global") + itemBody, _ = sjson.Set(itemBody, "nat64V4PoolOverload.value", item.Nat64V4PoolOverload.ValueBool()) + } + } + body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody) } - body, _ = sjson.SetRaw(body, path+"nat64V4Pool.-1", itemBody) } return body } diff --git a/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go b/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go index a535247f..85a51a95 100644 --- a/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go +++ b/internal/provider/resource_sdwan_system_remote_access_profile_parcel.go @@ -93,34 +93,12 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "any_connect_eap_authentication_type": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("user", "device").String, + MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("user", "device").String, Required: true, Validators: []validator.String{ stringvalidator.OneOf("user", "device"), }, }, - "any_connect_eap_profile_download_status": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("NONE", "INITIALIZED", "INITIALIZED_ERROR", "COMPLETE", "COMPLETE_ERROR").AddDefaultValueDescription("NONE").String, - Optional: true, - Validators: []validator.String{ - stringvalidator.OneOf("NONE", "INITIALIZED", "INITIALIZED_ERROR", "COMPLETE", "COMPLETE_ERROR"), - }, - }, - "any_connect_eap_profile_download_status_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Optional: true, - }, - "any_connect_eap_profile_file_name": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, - Optional: true, - Validators: []validator.String{ - stringvalidator.LengthAtLeast(1), - }, - }, - "any_connect_eap_profile_file_name_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, - Optional: true, - }, "ipv4_pool_size": schema.Int64Attribute{ MarkdownDescription: helpers.NewAttributeDescription("IPv4 Pool Size").AddDefaultValueDescription("1000").String, Optional: true, @@ -137,16 +115,16 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, - "enable_crl_check": schema.BoolAttribute{ + "enable_certificate_list_check": schema.BoolAttribute{ MarkdownDescription: helpers.NewAttributeDescription("").AddDefaultValueDescription("false").String, Optional: true, }, - "enable_crl_check_variable": schema.StringAttribute{ + "enable_certificate_list_check_variable": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, "psk_authentication_type": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("PSK Selection").AddStringEnumDescription("aaa", "group").String, + MarkdownDescription: helpers.NewAttributeDescription("PSK Selection, Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("aaa", "group").String, Optional: true, Validators: []validator.String{ stringvalidator.OneOf("aaa", "group"), @@ -157,7 +135,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "psk_authentication_pre_shared_key": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("PSK Pre Shared Key").String, + MarkdownDescription: helpers.NewAttributeDescription("PSK Pre Shared Key, Attribute conditional on `psk_authentication_type` being equal to `group`").String, Optional: true, Validators: []validator.String{ stringvalidator.LengthBetween(1, 25), @@ -200,25 +178,25 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, - "aaa_derive_name_identity": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, + "aaa_derive_name_from_peer_identity": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String, Optional: true, Validators: []validator.String{ stringvalidator.LengthBetween(1, 25), }, }, - "aaa_derive_name_identity_variable": schema.StringAttribute{ + "aaa_derive_name_from_peer_identity_variable": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, - "aaa_derive_name_domain": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, + "aaa_derive_name_from_peer_domain": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String, Optional: true, Validators: []validator.String{ stringvalidator.LengthBetween(1, 25), }, }, - "aaa_derive_name_domain_variable": schema.StringAttribute{ + "aaa_derive_name_from_peer_domain_variable": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, Optional: true, }, @@ -231,7 +209,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ikev2_local_ike_identity_type": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").AddStringEnumDescription("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS").String, + MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").AddStringEnumDescription("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS").String, Optional: true, Validators: []validator.String{ stringvalidator.OneOf("EMAIL", "FQDN", "KEYID", "IPv4 ADDRESS", "IPv6 ADDRESS"), @@ -242,7 +220,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ikev2_local_ike_identity_value": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, + MarkdownDescription: helpers.NewAttributeDescription(", Attribute conditional on `connection_type_ssl` being equal to `false`").String, Optional: true, Validators: []validator.String{ stringvalidator.LengthAtLeast(1), @@ -253,7 +231,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ikev2_security_association_lifetime": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("86400").String, + MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("86400").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(3600, 86400), @@ -264,7 +242,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ikev2_anti_dos_threshold": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Anti-DOS Threshold").AddIntegerRangeDescription(10, 1000).AddDefaultValueDescription("100").String, + MarkdownDescription: helpers.NewAttributeDescription("Anti-DOS Threshold, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(10, 1000).AddDefaultValueDescription("100").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(10, 1000), @@ -275,7 +253,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ipsec_enable_anti_replay": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Enable Anti-Replay").AddDefaultValueDescription("true").String, + MarkdownDescription: helpers.NewAttributeDescription("Enable Anti-Replay, Attribute conditional on `connection_type_ssl` being equal to `false`").AddDefaultValueDescription("true").String, Optional: true, }, "ipsec_enable_anti_replay_variable": schema.StringAttribute{ @@ -283,7 +261,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ipsec_anti_replay_window_size": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime").AddDefaultValueDescription("64").String, + MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime, Attribute conditional on `ipsec_enable_anti_replay` being equal to `true`").AddDefaultValueDescription("64").String, Optional: true, }, "ipsec_anti_replay_window_size_variable": schema.StringAttribute{ @@ -291,7 +269,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ipsec_security_association_lifetime": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("3600").String, + MarkdownDescription: helpers.NewAttributeDescription("Security Association Lifetime in Seconds, Attribute conditional on `connection_type_ssl` being equal to `false`").AddIntegerRangeDescription(3600, 86400).AddDefaultValueDescription("3600").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(3600, 86400), @@ -302,7 +280,7 @@ func (r *SystemRemoteAccessProfileParcelResource) Schema(ctx context.Context, re Optional: true, }, "ipsec_enable_perfect_foward_secrecy": schema.BoolAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime").AddDefaultValueDescription("false").String, + MarkdownDescription: helpers.NewAttributeDescription("security Association Lifetime, Attribute conditional on `connection_type_ssl` being equal to `false`").AddDefaultValueDescription("false").String, Optional: true, }, "ipsec_enable_perfect_foward_secrecy_variable": schema.StringAttribute{ diff --git a/internal/provider/resource_sdwan_system_remote_access_profile_parcel_test.go b/internal/provider/resource_sdwan_system_remote_access_profile_parcel_test.go index cad4766e..10e0a656 100644 --- a/internal/provider/resource_sdwan_system_remote_access_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_system_remote_access_profile_parcel_test.go @@ -35,15 +35,13 @@ func TestAccSdwanSystemRemoteAccessProfileParcel(t *testing.T) { var checks []resource.TestCheckFunc checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "connection_type_ssl", "false")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_authentication_type", "user")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_profile_download_status", "INITIALIZED")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "any_connect_eap_profile_file_name", "")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipv4_pool_size", "50")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ipv6_pool_size", "1024")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "enable_crl_check", "false")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "enable_certificate_list_check", "false")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "psk_authentication_type", "aaa")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "psk_authentication_pre_shared_key", "Cisco123")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "radius_group_name", "radius-1")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "aaa_derive_name_identity", "MyPassword")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "aaa_derive_name_from_peer_identity", "MyPassword")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "aaa_enable_accounting", "false")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_type", "EMAIL")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_system_remote_access_profile_parcel.test", "ikev2_local_ike_identity_value", "abc@xyz.com")) @@ -76,7 +74,6 @@ resource "sdwan_system_feature_profile" "test" { name = "TF_TEST" description = "Terraform test" } - ` // End of section. //template:end testPrerequisites @@ -103,15 +100,13 @@ func testAccSdwanSystemRemoteAccessProfileParcelConfig_all() string { config += ` feature_profile_id = sdwan_system_feature_profile.test.id` + "\n" config += ` connection_type_ssl = false` + "\n" config += ` any_connect_eap_authentication_type = "user"` + "\n" - config += ` any_connect_eap_profile_download_status = "INITIALIZED"` + "\n" - config += ` any_connect_eap_profile_file_name = ""` + "\n" config += ` ipv4_pool_size = 50` + "\n" config += ` ipv6_pool_size = 1024` + "\n" - config += ` enable_crl_check = false` + "\n" + config += ` enable_certificate_list_check = false` + "\n" config += ` psk_authentication_type = "aaa"` + "\n" config += ` psk_authentication_pre_shared_key = "Cisco123"` + "\n" config += ` radius_group_name = "radius-1"` + "\n" - config += ` aaa_derive_name_identity = "MyPassword"` + "\n" + config += ` aaa_derive_name_from_peer_identity = "MyPassword"` + "\n" config += ` aaa_enable_accounting = false` + "\n" config += ` ikev2_local_ike_identity_type = "EMAIL"` + "\n" config += ` ikev2_local_ike_identity_value = "abc@xyz.com"` + "\n" diff --git a/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go b/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go index 916d21b0..a7a84964 100644 --- a/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go +++ b/internal/provider/resource_sdwan_transport_management_vpn_profile_parcel.go @@ -192,7 +192,7 @@ func (r *TransportManagementVPNProfileParcelResource) Schema(ctx context.Context }, }, "next_hops": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ @@ -219,7 +219,7 @@ func (r *TransportManagementVPNProfileParcelResource) Schema(ctx context.Context }, }, "administrative_distance": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String, + MarkdownDescription: helpers.NewAttributeDescription("Administrative distance, Attribute conditional on `gateway` being equal to `null0`").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(1, 255), diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go b/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go index 702c10c2..49f57543 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_profile_parcel.go @@ -193,7 +193,7 @@ func (r *TransportWANVPNProfileParcelResource) Schema(ctx context.Context, req r }, }, "next_hops": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop").String, + MarkdownDescription: helpers.NewAttributeDescription("IPv4 Route Gateway Next Hop, Attribute conditional on `gateway` being equal to `nextHop`").String, Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ @@ -220,7 +220,7 @@ func (r *TransportWANVPNProfileParcelResource) Schema(ctx context.Context, req r }, }, "administrative_distance": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Administrative distance").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String, + MarkdownDescription: helpers.NewAttributeDescription("Administrative distance, Attribute conditional on `gateway` being equal to `null0`").AddIntegerRangeDescription(1, 255).AddDefaultValueDescription("1").String, Optional: true, Validators: []validator.Int64{ int64validator.Between(1, 255), diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 4b6b93d8..9fc4e20f 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -16,6 +16,11 @@ description: |- - Add `sdwan_transport_ipv6_tracker_group_profile_parcel` resource and data source - Add `sdwan_service_object_tracker_profile_parcel` resource and data source - Add `sdwan_service_object_tracker_group_profile_parcel` resource and data source +- BREAKING CHANGE: Rename `enable_crl_check` attribute of `sdwan_system_remote_access_profile_parcel,` resource to `enable_certificate_list_check` +- 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 ## 0.3.13