From 23fdb252a660efd426e2ca8c7fe8e8ecb623614a Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Tue, 29 Jul 2025 18:02:34 +0100 Subject: [PATCH 1/8] Resolve import issue --- CHANGELOG.md | 7 ++ ...ication_aware_routing_policy_definition.md | 4 +- .../tls_ssl_decryption_policy_definition.md | 2 +- .../traffic_data_policy_definition.md | 2 +- docs/guides/changelog.md | 7 ++ ...ication_aware_routing_policy_definition.md | 4 +- .../tls_ssl_decryption_policy_definition.md | 2 +- .../traffic_data_policy_definition.md | 2 +- ...ation_aware_routing_policy_definition.yaml | 4 +- .../tls_ssl_decryption_policy_definition.yml | 2 +- .../traffic_data_policy_definition.yaml | 2 +- gen/generator.go | 31 +++++++ gen/templates/generic/model.go | 83 +++++++++++++++++-- gen/templates/generic/resource.go | 12 ++- ...ication_aware_routing_policy_definition.go | 4 +- ...an_tls_ssl_decryption_policy_definition.go | 2 +- ...ce_sdwan_traffic_data_policy_definition.go | 2 +- ...model_sdwan_activate_centralized_policy.go | 4 + ...ed_inspection_profile_policy_definition.go | 21 +++++ ...ed_malware_protection_policy_definition.go | 9 ++ ...odel_sdwan_allow_url_list_policy_object.go | 9 ++ ...del_sdwan_app_probe_class_policy_object.go | 9 ++ ...ication_aware_routing_policy_definition.go | 58 ++++++++++--- ...el_sdwan_application_list_policy_object.go | 9 ++ ...an_application_priority_feature_profile.go | 6 ++ .../model_sdwan_as_path_list_policy_object.go | 9 ++ ...el_sdwan_attach_feature_device_template.go | 4 + ...odel_sdwan_block_url_list_policy_object.go | 9 ++ .../model_sdwan_centralized_policy.go | 25 ++++++ .../model_sdwan_cflowd_policy_definition.go | 8 ++ .../model_sdwan_class_map_policy_object.go | 9 ++ .../model_sdwan_cli_device_template.go | 11 +++ .../model_sdwan_color_list_policy_object.go | 9 ++ ...stom_control_topology_policy_definition.go | 47 +++++++++++ ...wan_data_fqdn_prefix_list_policy_object.go | 9 ++ ...wan_data_ipv4_prefix_list_policy_object.go | 9 ++ ...wan_data_ipv6_prefix_list_policy_object.go | 9 ++ ...el_sdwan_dns_security_policy_definition.go | 15 ++++ .../model_sdwan_domain_list_policy_object.go | 9 ++ ...n_expanded_community_list_policy_object.go | 9 ++ ...n_extended_community_list_policy_object.go | 9 ++ .../model_sdwan_feature_device_template.go | 56 ++++++++++--- ...l_sdwan_geo_location_list_policy_object.go | 9 ++ ...ub_and_spoke_topology_policy_definition.go | 23 +++++ ..._intrusion_prevention_policy_definition.go | 12 +++ ..._sdwan_ips_signature_list_policy_object.go | 9 ++ .../model_sdwan_ipv4_acl_policy_definition.go | 32 +++++++ ...sdwan_ipv4_device_acl_policy_definition.go | 18 ++++ ...el_sdwan_ipv4_prefix_list_policy_object.go | 9 ++ .../model_sdwan_ipv6_acl_policy_definition.go | 32 +++++++ ...sdwan_ipv6_device_acl_policy_definition.go | 18 ++++ ...el_sdwan_ipv6_prefix_list_policy_object.go | 9 ++ ...an_local_application_list_policy_object.go | 9 ++ .../provider/model_sdwan_localized_policy.go | 14 ++++ ...l_sdwan_mesh_topology_policy_definition.go | 16 ++++ .../model_sdwan_mirror_policy_object.go | 9 ++ ...el_sdwan_object_group_policy_definition.go | 21 +++++ .../model_sdwan_other_feature_profile.go | 6 ++ .../model_sdwan_policer_policy_object.go | 9 ++ .../model_sdwan_port_list_policy_object.go | 9 ++ ...wan_preferred_color_group_policy_object.go | 9 ++ ...model_sdwan_protocol_list_policy_object.go | 9 ++ .../model_sdwan_qos_map_policy_definition.go | 13 +++ .../model_sdwan_region_list_policy_object.go | 9 ++ ...el_sdwan_rewrite_rule_policy_definition.go | 13 +++ .../model_sdwan_route_policy_definition.go | 30 +++++++ .../model_sdwan_rule_set_policy_definition.go | 44 ++++++++++ .../provider/model_sdwan_security_policy.go | 14 ++++ .../model_sdwan_site_list_policy_object.go | 9 ++ .../model_sdwan_sla_class_policy_object.go | 12 +++ ...n_standard_community_list_policy_object.go | 9 ++ .../model_sdwan_tloc_list_policy_object.go | 9 ++ ...an_tls_ssl_decryption_policy_definition.go | 26 ++++-- ...sdwan_tls_ssl_profile_policy_definition.go | 15 ++++ ...el_sdwan_traffic_data_policy_definition.go | 52 ++++++++++-- ...l_sdwan_url_filtering_policy_definition.go | 15 ++++ .../model_sdwan_vpn_list_policy_object.go | 9 ++ ..._sdwan_vpn_membership_policy_definition.go | 16 ++++ ...n_zone_based_firewall_policy_definition.go | 9 ++ .../model_sdwan_zone_list_policy_object.go | 9 ++ ...ed_inspection_profile_policy_definition.go | 9 +- ...ed_malware_protection_policy_definition.go | 9 +- ...urce_sdwan_allow_url_list_policy_object.go | 9 +- ...rce_sdwan_app_probe_class_policy_object.go | 9 +- ...ication_aware_routing_policy_definition.go | 13 ++- ...ce_sdwan_application_list_policy_object.go | 9 +- ...source_sdwan_as_path_list_policy_object.go | 9 +- ...urce_sdwan_block_url_list_policy_object.go | 9 +- .../resource_sdwan_centralized_policy.go | 9 +- ...resource_sdwan_cflowd_policy_definition.go | 9 +- .../resource_sdwan_class_map_policy_object.go | 9 +- .../resource_sdwan_cli_config_feature.go | 3 - .../resource_sdwan_cli_device_template.go | 9 +- ...resource_sdwan_color_list_policy_object.go | 9 +- ...stom_control_topology_policy_definition.go | 9 +- ...wan_data_fqdn_prefix_list_policy_object.go | 9 +- ...wan_data_ipv4_prefix_list_policy_object.go | 9 +- ...wan_data_ipv6_prefix_list_policy_object.go | 9 +- ...ce_sdwan_dns_security_policy_definition.go | 9 +- ...esource_sdwan_domain_list_policy_object.go | 9 +- ...n_expanded_community_list_policy_object.go | 9 +- ...n_extended_community_list_policy_object.go | 9 +- .../resource_sdwan_feature_device_template.go | 9 +- ...e_sdwan_geo_location_list_policy_object.go | 9 +- ...ub_and_spoke_topology_policy_definition.go | 9 +- ..._intrusion_prevention_policy_definition.go | 9 +- ..._sdwan_ips_signature_list_policy_object.go | 9 +- ...source_sdwan_ipv4_acl_policy_definition.go | 9 +- ...sdwan_ipv4_device_acl_policy_definition.go | 9 +- ...ce_sdwan_ipv4_prefix_list_policy_object.go | 9 +- ...source_sdwan_ipv6_acl_policy_definition.go | 9 +- ...sdwan_ipv6_device_acl_policy_definition.go | 9 +- ...ce_sdwan_ipv6_prefix_list_policy_object.go | 9 +- ...an_local_application_list_policy_object.go | 9 +- .../resource_sdwan_localized_policy.go | 9 +- ...e_sdwan_mesh_topology_policy_definition.go | 9 +- .../resource_sdwan_mirror_policy_object.go | 9 +- ...ce_sdwan_object_group_policy_definition.go | 9 +- .../resource_sdwan_policer_policy_object.go | 9 +- .../resource_sdwan_port_list_policy_object.go | 9 +- ...wan_preferred_color_group_policy_object.go | 9 +- ...ource_sdwan_protocol_list_policy_object.go | 9 +- ...esource_sdwan_qos_map_policy_definition.go | 9 +- ...esource_sdwan_region_list_policy_object.go | 9 +- ...ce_sdwan_rewrite_rule_policy_definition.go | 9 +- .../resource_sdwan_route_policy_definition.go | 9 +- ...source_sdwan_rule_set_policy_definition.go | 9 +- .../resource_sdwan_security_policy.go | 9 +- ...vpn_feature_associate_multicast_feature.go | 3 - ...n_feature_associate_routing_bgp_feature.go | 3 - ...feature_associate_routing_eigrp_feature.go | 3 - ..._feature_associate_routing_ospf_feature.go | 3 - ...e_associate_routing_ospfv3_ipv4_feature.go | 3 - ...e_associate_routing_ospfv3_ipv6_feature.go | 3 - ...t_feature_associate_dhcp_server_feature.go | 3 - ...ernet_feature_associate_tracker_feature.go | 3 - ...feature_associate_tracker_group_feature.go | 3 - ...c_feature_associate_dhcp_server_feature.go | 3 - ...i_feature_associate_dhcp_server_feature.go | 3 - .../resource_sdwan_site_list_policy_object.go | 9 +- .../resource_sdwan_sla_class_policy_object.go | 9 +- ...n_standard_community_list_policy_object.go | 9 +- .../resource_sdwan_tloc_list_policy_object.go | 9 +- ...an_tls_ssl_decryption_policy_definition.go | 11 ++- ...sdwan_tls_ssl_profile_policy_definition.go | 9 +- ...ce_sdwan_traffic_data_policy_definition.go | 11 ++- ...n_feature_associate_routing_bgp_feature.go | 3 - ..._feature_associate_routing_ospf_feature.go | 3 - ...e_associate_routing_ospfv3_ipv4_feature.go | 3 - ...e_associate_routing_ospfv3_ipv6_feature.go | 3 - ...lular_feature_associate_tracker_feature.go | 3 - ...feature_associate_tracker_group_feature.go | 3 - ..._feature_associate_ipv6_tracker_feature.go | 3 - ...re_associate_ipv6_tracker_group_feature.go | 3 - ...ernet_feature_associate_tracker_feature.go | 3 - ...feature_associate_tracker_group_feature.go | 3 - ...e_gre_feature_associate_tracker_feature.go | 3 - ...ipsec_feature_associate_tracker_feature.go | 3 - ...e_sdwan_url_filtering_policy_definition.go | 9 +- .../resource_sdwan_vpn_list_policy_object.go | 9 +- ..._sdwan_vpn_membership_policy_definition.go | 9 +- ...n_zone_based_firewall_policy_definition.go | 9 +- .../resource_sdwan_zone_list_policy_object.go | 9 +- templates/guides/changelog.md.tmpl | 7 ++ 164 files changed, 1509 insertions(+), 257 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b2b49d57..286e68cc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.6.3 (unreleased) + +- BREAKING CHANGE: Rename `tls_ssl_profile_version` attribute of `sdwan_tls_ssl_decryption_policy_definition` resource to `tls_ssl_profile_policy_version` +- BREAKING CHANGE: Rename `sla_class_list` attribute of `sdwan_application_aware_routing_policy_definition` resource to `sla_class_list_id` +- BREAKING CHANGE: Rename `preferred_color_group_list` attribute of `sdwan_application_aware_routing_policy_definition` resource to `preferred_color_group_list_id` +- BREAKING CHANGE: Rename `preferred_color_group_list` attribute of `sdwan_traffic_data_policy_definition` resource to `preferred_color_group_list_id` + ## 0.6.2 - Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417) diff --git a/docs/data-sources/application_aware_routing_policy_definition.md b/docs/data-sources/application_aware_routing_policy_definition.md index a79ce23ce..2d6d19aa7 100644 --- a/docs/data-sources/application_aware_routing_policy_definition.md +++ b/docs/data-sources/application_aware_routing_policy_definition.md @@ -62,9 +62,9 @@ Read-Only: Read-Only: - `preferred_color` (String) preferred color (Single value or multiple values separated by spaces) -- `preferred_color_group_list` (String) Preferred color group list ID +- `preferred_color_group_list_id` (String) Preferred color group list ID - `preferred_color_group_list_version` (Number) Preferred color group list version -- `sla_class_list` (String) SLA class list ID +- `sla_class_list_id` (String) SLA class list ID - `sla_class_list_version` (Number) SLA class list version - `type` (String) Type of SLA class parameter diff --git a/docs/data-sources/tls_ssl_decryption_policy_definition.md b/docs/data-sources/tls_ssl_decryption_policy_definition.md index 0130acde0..4bf85e18b 100644 --- a/docs/data-sources/tls_ssl_decryption_policy_definition.md +++ b/docs/data-sources/tls_ssl_decryption_policy_definition.md @@ -77,4 +77,4 @@ Read-Only: - `rule_name` (String) Country - `target_vpns` (Set of String) List of VPN IDs - `tls_ssl_profile_policy_id` (String) TLS SSL Profile Policy ID -- `tls_ssl_profile_version` (Number) TLS SSL Profile Policy version +- `tls_ssl_profile_policy_version` (Number) TLS SSL Profile Policy version diff --git a/docs/data-sources/traffic_data_policy_definition.md b/docs/data-sources/traffic_data_policy_definition.md index fb93d2701..60b096073 100644 --- a/docs/data-sources/traffic_data_policy_definition.md +++ b/docs/data-sources/traffic_data_policy_definition.md @@ -97,7 +97,7 @@ Read-Only: - `next_hop_loose` (Boolean) Use routing table entry to forward the packet in case Next-hop is not available - `policer_list_id` (String) Policer list ID - `policer_list_version` (Number) Policer list version -- `preferred_color_group_list` (String) Preferred color group list ID +- `preferred_color_group_list_id` (String) Preferred color group list ID - `preferred_color_group_list_version` (Number) Preferred color group list version - `service_tloc_color` (String) Service TLOC color - `service_tloc_encapsulation` (String) Service TLOC encapsulation diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 3805e503e..852218fb2 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -7,6 +7,13 @@ description: |- # Changelog +## 0.6.3 (unreleased) + +- BREAKING CHANGE: Rename `tls_ssl_profile_version` attribute of `sdwan_tls_ssl_decryption_policy_definition` resource to `tls_ssl_profile_policy_version` +- BREAKING CHANGE: Rename `sla_class_list` attribute of `sdwan_application_aware_routing_policy_definition` resource to `sla_class_list_id` +- BREAKING CHANGE: Rename `preferred_color_group_list` attribute of `sdwan_application_aware_routing_policy_definition` resource to `preferred_color_group_list_id` +- BREAKING CHANGE: Rename `preferred_color_group_list` attribute of `sdwan_traffic_data_policy_definition` resource to `preferred_color_group_list_id` + ## 0.6.2 - Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417) diff --git a/docs/resources/application_aware_routing_policy_definition.md b/docs/resources/application_aware_routing_policy_definition.md index f8b4481ae..a91fc24c6 100644 --- a/docs/resources/application_aware_routing_policy_definition.md +++ b/docs/resources/application_aware_routing_policy_definition.md @@ -95,9 +95,9 @@ Required: Optional: - `preferred_color` (String) preferred color (Single value or multiple values separated by spaces), Attribute conditional on `type` being equal to `preferredColor` -- `preferred_color_group_list` (String) Preferred color group list ID, Attribute conditional on `type` being equal to `preferredColorGroup` +- `preferred_color_group_list_id` (String) Preferred color group list ID, Attribute conditional on `type` being equal to `preferredColorGroup` - `preferred_color_group_list_version` (Number) Preferred color group list version -- `sla_class_list` (String) SLA class list ID, Attribute conditional on `type` being equal to `name` +- `sla_class_list_id` (String) SLA class list ID, Attribute conditional on `type` being equal to `name` - `sla_class_list_version` (Number) SLA class list version diff --git a/docs/resources/tls_ssl_decryption_policy_definition.md b/docs/resources/tls_ssl_decryption_policy_definition.md index 3927754d5..52fe916ce 100644 --- a/docs/resources/tls_ssl_decryption_policy_definition.md +++ b/docs/resources/tls_ssl_decryption_policy_definition.md @@ -124,7 +124,7 @@ Optional: - `rule_name` (String) Country - `target_vpns` (Set of String) List of VPN IDs - `tls_ssl_profile_policy_id` (String) TLS SSL Profile Policy ID -- `tls_ssl_profile_version` (Number) TLS SSL Profile Policy version +- `tls_ssl_profile_policy_version` (Number) TLS SSL Profile Policy version ## Import diff --git a/docs/resources/traffic_data_policy_definition.md b/docs/resources/traffic_data_policy_definition.md index e7fd2badc..36db07fb7 100644 --- a/docs/resources/traffic_data_policy_definition.md +++ b/docs/resources/traffic_data_policy_definition.md @@ -152,7 +152,7 @@ Optional: - `next_hop_loose` (Boolean) Use routing table entry to forward the packet in case Next-hop is not available, Attribute conditional on `type` being equal to `nextHopLoose` - `policer_list_id` (String) Policer list ID, Attribute conditional on `type` being equal to `policer` - `policer_list_version` (Number) Policer list version -- `preferred_color_group_list` (String) Preferred color group list ID, Attribute conditional on `type` being equal to `preferredColorGroup` +- `preferred_color_group_list_id` (String) Preferred color group list ID, Attribute conditional on `type` being equal to `preferredColorGroup` - `preferred_color_group_list_version` (Number) Preferred color group list version - `service_tloc_color` (String) Service TLOC color, Attribute conditional on `type` being equal to `service` - `service_tloc_encapsulation` (String) Service TLOC encapsulation, Attribute conditional on `type` being equal to `service` diff --git a/gen/definitions/generic/application_aware_routing_policy_definition.yaml b/gen/definitions/generic/application_aware_routing_policy_definition.yaml index 5bac1b45c..2ddf72c05 100644 --- a/gen/definitions/generic/application_aware_routing_policy_definition.yaml +++ b/gen/definitions/generic/application_aware_routing_policy_definition.yaml @@ -317,7 +317,7 @@ attributes: description: Type of SLA class parameter example: name - model_name: ref - tf_name: sla_class_list + tf_name: sla_class_list_id conditional_attribute: name: type value: name @@ -331,7 +331,7 @@ attributes: description: SLA class list version exclude_test: true - model_name: ref - tf_name: preferred_color_group_list + tf_name: preferred_color_group_list_id conditional_attribute: name: type value: preferredColorGroup diff --git a/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml b/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml index 55f221bc1..6ae00ff52 100644 --- a/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml +++ b/gen/definitions/generic/tls_ssl_decryption_policy_definition.yml @@ -107,7 +107,7 @@ attributes: type: String description: TLS SSL Profile Policy ID example: 2d8cbc1b-f969-4999-a0bd-f77a070ba5f7 - - tf_name: tls_ssl_profile_version + - tf_name: tls_ssl_profile_policy_version tf_only: true type: Version description: TLS SSL Profile Policy version diff --git a/gen/definitions/generic/traffic_data_policy_definition.yaml b/gen/definitions/generic/traffic_data_policy_definition.yaml index 135500687..3a0689dd1 100644 --- a/gen/definitions/generic/traffic_data_policy_definition.yaml +++ b/gen/definitions/generic/traffic_data_policy_definition.yaml @@ -601,7 +601,7 @@ attributes: description: Policer list version exclude_test: true - model_name: ref - tf_name: preferred_color_group_list + tf_name: preferred_color_group_list_id conditional_attribute: name: type value: preferredColorGroup diff --git a/gen/generator.go b/gen/generator.go index 5198476d7..92eab8130 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -293,6 +293,13 @@ func ToGoName(s string) string { return s } +func ToVersionName(s string) string { + s = ToGoName(s) + m := strings.ReplaceAll(s, "Versions", "Ids") + m = strings.ReplaceAll(m, "Version", "Id") + return m +} + // Templating helper function to convert string to camel case func CamelCase(s string) string { var g []string @@ -397,6 +404,27 @@ func HasReference(attributes []YamlConfigAttribute) bool { return false } +// Templating helper function to return true if reference included in attributes +func HasVersion(attributes []YamlConfigAttribute) bool { + for _, attr := range attributes { + if attr.Type == "Version" { + // if attr.Type == "Version" || attr.Type == "Versions" { + return true + } + } + return false +} + +// Templating helper function to return true if reference included in attributes +func HasStaticValue(attributes []YamlConfigAttribute) bool { + for _, attr := range attributes { + if attr.Value != "" { + return true + } + } + return false +} + // Templating helper function to return number of reference included in attributes func CountReferences(attributes []YamlConfigAttribute) int { count := 0 @@ -547,6 +575,7 @@ func contains(s []string, str string) bool { // Map of templating functions var functions = template.FuncMap{ "toGoName": ToGoName, + "toVersionName": ToVersionName, "camelCase": CamelCase, "snakeCase": SnakeCase, "sprintf": fmt.Sprintf, @@ -557,6 +586,8 @@ var functions = template.FuncMap{ "hasVersionAttribute": HasVersionAttribute, "getResponseModelPath": GetResponseModelPath, "hasReference": HasReference, + "hasVersion": HasVersion, + "hasStaticValue": HasStaticValue, "countReferences": CountReferences, "add": Add, "getGjsonType": GetGjsonType, diff --git a/gen/templates/generic/model.go b/gen/templates/generic/model.go index 92eabfe24..56d8cd3f7 100644 --- a/gen/templates/generic/model.go +++ b/gen/templates/generic/model.go @@ -41,13 +41,13 @@ type {{camelCase .Name}} struct { {{- if .HasVersion}} Version types.Int64 `tfsdk:"version"` {{- end}} -{{- if .TypeValue}} -Type types.String `tfsdk:"type"` -{{- end}} {{- range .Attributes}} -{{- if not .Value}} {{- if isNestedListSet .}} +{{- if not .Value}} {{toGoName .TfName}} []{{$name}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` +{{- else}} + {{toGoName .TfName}} []interface{} `tfsdk:"{{.TfName}}"` +{{- end}} {{- else if eq .Type "Versions"}} {{toGoName .TfName}} types.List `tfsdk:"{{.TfName}}"` {{- else if eq .Type "Version"}} @@ -56,7 +56,6 @@ Type types.String `tfsdk:"type"` {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- end}} {{- end}} -{{- end}} } {{ range .Attributes}} @@ -92,7 +91,6 @@ type {{$name}}{{toGoName .TfName}} struct { {{- if isNestedListSet .}} type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{- range .Attributes}} -{{- if not .Value}} {{- if isNestedListSet .}} {{toGoName .TfName}} []{{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` {{- else if eq .Type "Versions"}} @@ -103,7 +101,6 @@ type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- end}} {{- end}} -{{- end}} } {{- end}} {{- end}} @@ -125,7 +122,6 @@ type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{- if isNestedListSet .}} type {{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} struct { {{- range .Attributes}} -{{- if not .Value}} {{- if eq .Type "Versions"}} {{toGoName .TfName}} types.List `tfsdk:"{{.TfName}}"` {{- else if eq .Type "Version"}} @@ -134,7 +130,6 @@ type {{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} struct { {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- end}} {{- end}} -{{- end}} } {{- end}} {{- end}} @@ -676,3 +671,73 @@ func (data *{{camelCase .Name}}) updateVersions(ctx context.Context, state *{{ca } {{end}} // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *{{camelCase .Name}}) processImport(ctx context.Context) { + {{- if .HasVersion}} + data.Version = types.Int64Value(0) + {{- end}} + {{- range .Attributes}} + {{- $name := toGoName .TfName}} + {{- if .Value}} + data.{{toGoName .TfName}} = {{if eq .Type "String"}}types.StringValue("{{ .Value }}"){{else if eq .Type "Bool"}}types.BoolValue({{ .Value }}){{else if eq .Type "List"}}{{ .Value }}{{else}}types.ListNull({{ .Value }}){{end}} + {{- end}} + {{- if eq .Type "Version"}} + if data.{{toVersionName .TfName}} != types.StringNull() { + data.{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{toVersionName .TfName}}.IsNull() { + data.{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} + for i := range data.{{toGoName .TfName}} { + + {{- range .Attributes}} + {{- $cname := toGoName .TfName}} + {{- if eq .Type "Version"}} + if data.{{$name}}[i].{{toVersionName .TfName}} != types.StringNull() { + data.{{$name}}[i].{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{$name}}[i].{{toVersionName .TfName}}.IsNull() { + data.{{$name}}[i].{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} + for ii := range data.{{$name}}[i].{{toGoName .TfName}} { + + {{- range .Attributes}} + {{- $ccname := toGoName .TfName}} + {{- if eq .Type "Version"}} + if data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}} != types.StringNull() { + data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}}.IsNull() { + data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} + for iii := range data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} { + + {{- range .Attributes}} + {{- if eq .Type "Version"}} + if data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toVersionName .TfName}} != types.StringNull() { + data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toVersionName .TfName}}.IsNull() { + data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} +} +// End of section. //template:end processImport \ No newline at end of file diff --git a/gen/templates/generic/resource.go b/gen/templates/generic/resource.go index e01286f1a..05f9b9202 100644 --- a/gen/templates/generic/resource.go +++ b/gen/templates/generic/resource.go @@ -497,9 +497,15 @@ func (r *{{camelCase .Name}}Resource) Read(ctx context.Context, req resource.Rea } state.fromBody(ctx, res) - {{- if .HasVersion}} - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + + {{- if and (not .NoImport) (or (hasVersionAttribute .Attributes) (hasStaticValue .Attributes))}} + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } {{- end}} diff --git a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go index cd96bf209..48e7aa509 100644 --- a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go +++ b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition.go @@ -217,7 +217,7 @@ func (d *ApplicationAwareRoutingPolicyDefinitionDataSource) Schema(ctx context.C MarkdownDescription: "Type of SLA class parameter", Computed: true, }, - "sla_class_list": schema.StringAttribute{ + "sla_class_list_id": schema.StringAttribute{ MarkdownDescription: "SLA class list ID", Computed: true, }, @@ -225,7 +225,7 @@ func (d *ApplicationAwareRoutingPolicyDefinitionDataSource) Schema(ctx context.C MarkdownDescription: "SLA class list version", Computed: true, }, - "preferred_color_group_list": schema.StringAttribute{ + "preferred_color_group_list_id": schema.StringAttribute{ MarkdownDescription: "Preferred color group list ID", Computed: true, }, diff --git a/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition.go b/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition.go index 327d7c838..b8adcfb80 100644 --- a/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition.go +++ b/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition.go @@ -140,7 +140,7 @@ func (d *TLSSSLDecryptionPolicyDefinitionDataSource) Schema(ctx context.Context, MarkdownDescription: "TLS SSL Profile Policy ID", Computed: true, }, - "tls_ssl_profile_version": schema.Int64Attribute{ + "tls_ssl_profile_policy_version": schema.Int64Attribute{ MarkdownDescription: "TLS SSL Profile Policy version", Computed: true, }, diff --git a/internal/provider/data_source_sdwan_traffic_data_policy_definition.go b/internal/provider/data_source_sdwan_traffic_data_policy_definition.go index 876d3126b..86e309ac9 100644 --- a/internal/provider/data_source_sdwan_traffic_data_policy_definition.go +++ b/internal/provider/data_source_sdwan_traffic_data_policy_definition.go @@ -325,7 +325,7 @@ func (d *TrafficDataPolicyDefinitionDataSource) Schema(ctx context.Context, req MarkdownDescription: "Policer list version", Computed: true, }, - "preferred_color_group_list": schema.StringAttribute{ + "preferred_color_group_list_id": schema.StringAttribute{ MarkdownDescription: "Preferred color group list ID", Computed: true, }, diff --git a/internal/provider/model_sdwan_activate_centralized_policy.go b/internal/provider/model_sdwan_activate_centralized_policy.go index 547236ea6..d8917d811 100644 --- a/internal/provider/model_sdwan_activate_centralized_policy.go +++ b/internal/provider/model_sdwan_activate_centralized_policy.go @@ -116,3 +116,7 @@ func (data ActivateCentralizedPolicy) getPushBody(ctx context.Context, client *s attachPayload, _ := sjson.Set("", "deviceTemplateList", deviceTemplateList) return attachPayload, nil } + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go b/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go index a57463839..093980066 100644 --- a/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go +++ b/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go @@ -32,6 +32,7 @@ import ( type AdvancedInspectionProfilePolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` TlsAction types.String `tfsdk:"tls_action"` @@ -168,3 +169,23 @@ func (data *AdvancedInspectionProfilePolicyDefinition) updateVersions(ctx contex } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *AdvancedInspectionProfilePolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("advancedInspectionProfile") + if data.IntrusionPreventionId != types.StringNull() { + data.IntrusionPreventionVersion = types.Int64Value(0) + } + if data.UrlFilteringId != types.StringNull() { + data.UrlFilteringVersion = types.Int64Value(0) + } + if data.AdvancedMalwareProtectionId != types.StringNull() { + data.AdvancedMalwareProtectionVersion = types.Int64Value(0) + } + if data.TlsSslDecryptionId != types.StringNull() { + data.TlsSslDecryptionVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go b/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go index a538af089..fc4e192a3 100644 --- a/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go +++ b/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go @@ -33,6 +33,7 @@ import ( type AdvancedMalwareProtectionPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -236,3 +237,11 @@ func (data *AdvancedMalwareProtectionPolicyDefinition) hasChanges(ctx context.Co // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *AdvancedMalwareProtectionPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("advancedMalwareProtection") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_allow_url_list_policy_object.go b/internal/provider/model_sdwan_allow_url_list_policy_object.go index 4e114fb84..430fb6154 100644 --- a/internal/provider/model_sdwan_allow_url_list_policy_object.go +++ b/internal/provider/model_sdwan_allow_url_list_policy_object.go @@ -32,6 +32,7 @@ import ( type AllowURLListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []AllowURLListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *AllowURLListPolicyObject) hasChanges(ctx context.Context, state *All // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *AllowURLListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("urlwhitelist") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_app_probe_class_policy_object.go b/internal/provider/model_sdwan_app_probe_class_policy_object.go index e4421c953..acc87bf76 100644 --- a/internal/provider/model_sdwan_app_probe_class_policy_object.go +++ b/internal/provider/model_sdwan_app_probe_class_policy_object.go @@ -32,6 +32,7 @@ import ( type AppProbeClassPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` ForwardingClass types.String `tfsdk:"forwarding_class"` Mappings []AppProbeClassPolicyObjectMappings `tfsdk:"mappings"` @@ -148,3 +149,11 @@ func (data *AppProbeClassPolicyObject) hasChanges(ctx context.Context, state *Ap // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *AppProbeClassPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("appProbe") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go index e59622657..47781d087 100644 --- a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go +++ b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go @@ -80,9 +80,9 @@ type ApplicationAwareRoutingPolicyDefinitionSequencesActionEntries struct { type ApplicationAwareRoutingPolicyDefinitionSequencesActionEntriesSlaClassParameters struct { Type types.String `tfsdk:"type"` - SlaClassList types.String `tfsdk:"sla_class_list"` + SlaClassListId types.String `tfsdk:"sla_class_list_id"` SlaClassListVersion types.Int64 `tfsdk:"sla_class_list_version"` - PreferredColorGroupList types.String `tfsdk:"preferred_color_group_list"` + PreferredColorGroupListId types.String `tfsdk:"preferred_color_group_list_id"` PreferredColorGroupListVersion types.Int64 `tfsdk:"preferred_color_group_list_version"` PreferredColor types.String `tfsdk:"preferred_color"` } @@ -209,11 +209,11 @@ func (data ApplicationAwareRoutingPolicyDefinition) toBody(ctx context.Context) if !childChildItem.Type.IsNull() { itemChildChildBody, _ = sjson.Set(itemChildChildBody, "field", childChildItem.Type.ValueString()) } - if !childChildItem.SlaClassList.IsNull() && childChildItem.Type.ValueString() == "name" { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.SlaClassList.ValueString()) + if !childChildItem.SlaClassListId.IsNull() && childChildItem.Type.ValueString() == "name" { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.SlaClassListId.ValueString()) } - if !childChildItem.PreferredColorGroupList.IsNull() && childChildItem.Type.ValueString() == "preferredColorGroup" { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.PreferredColorGroupList.ValueString()) + if !childChildItem.PreferredColorGroupListId.IsNull() && childChildItem.Type.ValueString() == "preferredColorGroup" { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.PreferredColorGroupListId.ValueString()) } if !childChildItem.PreferredColor.IsNull() && childChildItem.Type.ValueString() == "preferredColor" { itemChildChildBody, _ = sjson.Set(itemChildChildBody, "value", childChildItem.PreferredColor.ValueString()) @@ -399,14 +399,14 @@ func (data *ApplicationAwareRoutingPolicyDefinition) fromBody(ctx context.Contex ccItem.Type = types.StringNull() } if cccValue := ccv.Get("ref"); cccValue.Exists() && ccItem.Type.ValueString() == "name" { - ccItem.SlaClassList = types.StringValue(cccValue.String()) + ccItem.SlaClassListId = types.StringValue(cccValue.String()) } else { - ccItem.SlaClassList = types.StringNull() + ccItem.SlaClassListId = types.StringNull() } if cccValue := ccv.Get("ref"); cccValue.Exists() && ccItem.Type.ValueString() == "preferredColorGroup" { - ccItem.PreferredColorGroupList = types.StringValue(cccValue.String()) + ccItem.PreferredColorGroupListId = types.StringValue(cccValue.String()) } else { - ccItem.PreferredColorGroupList = types.StringNull() + ccItem.PreferredColorGroupListId = types.StringNull() } if cccValue := ccv.Get("value"); cccValue.Exists() && ccItem.Type.ValueString() == "preferredColor" { ccItem.PreferredColor = types.StringValue(cccValue.String()) @@ -544,10 +544,10 @@ func (data *ApplicationAwareRoutingPolicyDefinition) hasChanges(ctx context.Cont if !data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].Type.Equal(state.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].Type) { hasChanges = true } - if !data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].SlaClassList.Equal(state.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].SlaClassList) { + if !data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].SlaClassListId.Equal(state.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].SlaClassListId) { hasChanges = true } - if !data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColorGroupList.Equal(state.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColorGroupList) { + if !data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColorGroupListId.Equal(state.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColorGroupListId) { hasChanges = true } if !data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColor.Equal(state.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColor) { @@ -650,3 +650,37 @@ func (data *ApplicationAwareRoutingPolicyDefinition) updateVersions(ctx context. } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ApplicationAwareRoutingPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("appRoute") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].ApplicationListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ApplicationListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DnsApplicationListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DnsApplicationListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].SourceDataPrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SourceDataPrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListVersion = types.Int64Value(0) + } + } + for ii := range data.Sequences[i].ActionEntries { + for iii := range data.Sequences[i].ActionEntries[ii].SlaClassParameters { + if data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].SlaClassListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].SlaClassListVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColorGroupListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SlaClassParameters[iii].PreferredColorGroupListVersion = types.Int64Value(0) + } + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_application_list_policy_object.go b/internal/provider/model_sdwan_application_list_policy_object.go index c89604a9d..23fad27c9 100644 --- a/internal/provider/model_sdwan_application_list_policy_object.go +++ b/internal/provider/model_sdwan_application_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ApplicationListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ApplicationListPolicyObjectEntries `tfsdk:"entries"` } @@ -136,3 +137,11 @@ func (data *ApplicationListPolicyObject) hasChanges(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ApplicationListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("app") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_application_priority_feature_profile.go b/internal/provider/model_sdwan_application_priority_feature_profile.go index 6217dafcd..9e23b597c 100644 --- a/internal/provider/model_sdwan_application_priority_feature_profile.go +++ b/internal/provider/model_sdwan_application_priority_feature_profile.go @@ -91,3 +91,9 @@ func (data *ApplicationPriorityFeatureProfile) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ApplicationPriorityFeatureProfile) processImport(ctx context.Context) { +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_as_path_list_policy_object.go b/internal/provider/model_sdwan_as_path_list_policy_object.go index f72198197..2cafd132b 100644 --- a/internal/provider/model_sdwan_as_path_list_policy_object.go +++ b/internal/provider/model_sdwan_as_path_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ASPathListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ASPathListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *ASPathListPolicyObject) hasChanges(ctx context.Context, state *ASPat // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ASPathListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("asPath") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_attach_feature_device_template.go b/internal/provider/model_sdwan_attach_feature_device_template.go index 77870619c..b9b7b60d3 100644 --- a/internal/provider/model_sdwan_attach_feature_device_template.go +++ b/internal/provider/model_sdwan_attach_feature_device_template.go @@ -326,3 +326,7 @@ func (data *AttachFeatureDeviceTemplate) getUpdatedDevices(ctx context.Context, } return updatedDevices } + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_block_url_list_policy_object.go b/internal/provider/model_sdwan_block_url_list_policy_object.go index daa916b32..138683335 100644 --- a/internal/provider/model_sdwan_block_url_list_policy_object.go +++ b/internal/provider/model_sdwan_block_url_list_policy_object.go @@ -32,6 +32,7 @@ import ( type BlockURLListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []BlockURLListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *BlockURLListPolicyObject) hasChanges(ctx context.Context, state *Blo // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *BlockURLListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("urlblacklist") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_centralized_policy.go b/internal/provider/model_sdwan_centralized_policy.go index de66c32ba..be9c3171e 100644 --- a/internal/provider/model_sdwan_centralized_policy.go +++ b/internal/provider/model_sdwan_centralized_policy.go @@ -34,6 +34,7 @@ import ( type CentralizedPolicy struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + PolicyType types.String `tfsdk:"policy_type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Definitions []CentralizedPolicyDefinitions `tfsdk:"definitions"` @@ -300,3 +301,27 @@ func (data *CentralizedPolicy) updateVersions(ctx context.Context, state *Centra } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *CentralizedPolicy) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.PolicyType = types.StringValue("feature") + for i := range data.Definitions { + if data.Definitions[i].Id != types.StringNull() { + data.Definitions[i].Version = types.Int64Value(0) + } + for ii := range data.Definitions[i].Entries { + if !data.Definitions[i].Entries[ii].SiteListIds.IsNull() { + data.Definitions[i].Entries[ii].SiteListVersions = types.ListNull(types.StringType) + } + if !data.Definitions[i].Entries[ii].VpnListIds.IsNull() { + data.Definitions[i].Entries[ii].VpnListVersions = types.ListNull(types.StringType) + } + if !data.Definitions[i].Entries[ii].RegionListIds.IsNull() { + data.Definitions[i].Entries[ii].RegionListVersions = types.ListNull(types.StringType) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_cflowd_policy_definition.go b/internal/provider/model_sdwan_cflowd_policy_definition.go index 358f24ba5..363dcc15e 100644 --- a/internal/provider/model_sdwan_cflowd_policy_definition.go +++ b/internal/provider/model_sdwan_cflowd_policy_definition.go @@ -330,3 +330,11 @@ func (data *CflowdPolicyDefinition) hasChanges(ctx context.Context, state *Cflow // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *CflowdPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("cflowd") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_class_map_policy_object.go b/internal/provider/model_sdwan_class_map_policy_object.go index 502144545..04436af4e 100644 --- a/internal/provider/model_sdwan_class_map_policy_object.go +++ b/internal/provider/model_sdwan_class_map_policy_object.go @@ -33,6 +33,7 @@ import ( type ClassMapPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Queue types.Int64 `tfsdk:"queue"` } @@ -96,3 +97,11 @@ func (data *ClassMapPolicyObject) hasChanges(ctx context.Context, state *ClassMa // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ClassMapPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("class") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_cli_device_template.go b/internal/provider/model_sdwan_cli_device_template.go index 66663cc6b..04eefbcd6 100644 --- a/internal/provider/model_sdwan_cli_device_template.go +++ b/internal/provider/model_sdwan_cli_device_template.go @@ -32,6 +32,8 @@ import ( type CLIDeviceTemplate struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + ConfigType types.String `tfsdk:"config_type"` + FactoryDefault types.Bool `tfsdk:"factory_default"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` DeviceType types.String `tfsdk:"device_type"` @@ -134,3 +136,12 @@ func (data *CLIDeviceTemplate) hasChanges(ctx context.Context, state *CLIDeviceT // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *CLIDeviceTemplate) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.ConfigType = types.StringValue("file") + data.FactoryDefault = types.BoolValue(false) +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_color_list_policy_object.go b/internal/provider/model_sdwan_color_list_policy_object.go index dded11d08..b019bdf2b 100644 --- a/internal/provider/model_sdwan_color_list_policy_object.go +++ b/internal/provider/model_sdwan_color_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ColorListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ColorListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *ColorListPolicyObject) hasChanges(ctx context.Context, state *ColorL // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ColorListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("color") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_custom_control_topology_policy_definition.go b/internal/provider/model_sdwan_custom_control_topology_policy_definition.go index af177fb37..b6734a18c 100644 --- a/internal/provider/model_sdwan_custom_control_topology_policy_definition.go +++ b/internal/provider/model_sdwan_custom_control_topology_policy_definition.go @@ -83,6 +83,7 @@ type CustomControlTopologyPolicyDefinitionSequencesMatchEntries struct { type CustomControlTopologyPolicyDefinitionSequencesActionEntries struct { Type types.String `tfsdk:"type"` SetParameters []CustomControlTopologyPolicyDefinitionSequencesActionEntriesSetParameters `tfsdk:"set_parameters"` + Field types.String `tfsdk:"field"` ExportToVpnListId types.String `tfsdk:"export_to_vpn_list_id"` ExportToVpnListVersion types.Int64 `tfsdk:"export_to_vpn_list_version"` } @@ -878,3 +879,49 @@ func (data *CustomControlTopologyPolicyDefinition) updateVersions(ctx context.Co } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *CustomControlTopologyPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("control") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].ColorListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ColorListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].CommunityListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].CommunityListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].ExpandedCommunityListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ExpandedCommunityListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].SiteListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SiteListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].TlocListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].TlocListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].VpnListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].VpnListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].PrefixListVersion = types.Int64Value(0) + } + } + for ii := range data.Sequences[i].ActionEntries { + for iii := range data.Sequences[i].ActionEntries[ii].SetParameters { + if data.Sequences[i].ActionEntries[ii].SetParameters[iii].TlocListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SetParameters[iii].TlocListVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].SetParameters[iii].ServiceTlocListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SetParameters[iii].ServiceTlocListVersion = types.Int64Value(0) + } + } + if data.Sequences[i].ActionEntries[ii].ExportToVpnListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].ExportToVpnListVersion = types.Int64Value(0) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go b/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go index 1a6be6507..9bc051e9a 100644 --- a/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go @@ -32,6 +32,7 @@ import ( type DataFQDNPrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DataFQDNPrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *DataFQDNPrefixListPolicyObject) hasChanges(ctx context.Context, stat // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *DataFQDNPrefixListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("fqdn") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go b/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go index 7a659fa23..bf9c1c203 100644 --- a/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go @@ -32,6 +32,7 @@ import ( type DataIPv4PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DataIPv4PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *DataIPv4PrefixListPolicyObject) hasChanges(ctx context.Context, stat // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *DataIPv4PrefixListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("dataPrefix") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go b/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go index 3a03f1619..928546d84 100644 --- a/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go @@ -32,6 +32,7 @@ import ( type DataIPv6PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DataIPv6PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *DataIPv6PrefixListPolicyObject) hasChanges(ctx context.Context, stat // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *DataIPv6PrefixListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("dataipv6prefix") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_dns_security_policy_definition.go b/internal/provider/model_sdwan_dns_security_policy_definition.go index 13a71415d..bc125d50b 100644 --- a/internal/provider/model_sdwan_dns_security_policy_definition.go +++ b/internal/provider/model_sdwan_dns_security_policy_definition.go @@ -33,6 +33,7 @@ import ( type DNSSecurityPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` DomainListId types.String `tfsdk:"domain_list_id"` @@ -316,3 +317,17 @@ func (data *DNSSecurityPolicyDefinition) updateVersions(ctx context.Context, sta } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *DNSSecurityPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("DNSSecurity") + if data.DomainListId != types.StringNull() { + data.DomainListVersion = types.Int64Value(0) + } + if data.CiscoSigCredentialsFeatureTemplateId != types.StringNull() { + data.CiscoSigCredentialsFeatureTemplateVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_domain_list_policy_object.go b/internal/provider/model_sdwan_domain_list_policy_object.go index 9a160a948..852e56e60 100644 --- a/internal/provider/model_sdwan_domain_list_policy_object.go +++ b/internal/provider/model_sdwan_domain_list_policy_object.go @@ -32,6 +32,7 @@ import ( type DomainListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DomainListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *DomainListPolicyObject) hasChanges(ctx context.Context, state *Domai // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *DomainListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("localdomain") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_expanded_community_list_policy_object.go b/internal/provider/model_sdwan_expanded_community_list_policy_object.go index 867719742..6662621eb 100644 --- a/internal/provider/model_sdwan_expanded_community_list_policy_object.go +++ b/internal/provider/model_sdwan_expanded_community_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ExpandedCommunityListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ExpandedCommunityListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *ExpandedCommunityListPolicyObject) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ExpandedCommunityListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("expandedCommunity") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_extended_community_list_policy_object.go b/internal/provider/model_sdwan_extended_community_list_policy_object.go index d09175c4f..ce55e5c25 100644 --- a/internal/provider/model_sdwan_extended_community_list_policy_object.go +++ b/internal/provider/model_sdwan_extended_community_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ExtendedCommunityListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ExtendedCommunityListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *ExtendedCommunityListPolicyObject) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ExtendedCommunityListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("extCommunity") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_feature_device_template.go b/internal/provider/model_sdwan_feature_device_template.go index 1a123c02e..867a0cc2f 100644 --- a/internal/provider/model_sdwan_feature_device_template.go +++ b/internal/provider/model_sdwan_feature_device_template.go @@ -31,17 +31,20 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin types type FeatureDeviceTemplate struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - DeviceType types.String `tfsdk:"device_type"` - DeviceRole types.String `tfsdk:"device_role"` - PolicyId types.String `tfsdk:"policy_id"` - PolicyVersion types.Int64 `tfsdk:"policy_version"` - SecurityPolicyId types.String `tfsdk:"security_policy_id"` - SecurityPolicyVersion types.Int64 `tfsdk:"security_policy_version"` - GeneralTemplates []FeatureDeviceTemplateGeneralTemplates `tfsdk:"general_templates"` + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + ConfigType types.String `tfsdk:"config_type"` + FactoryDefault types.Bool `tfsdk:"factory_default"` + FeatureTemplateUidRange []interface{} `tfsdk:"feature_template_uid_range"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + DeviceType types.String `tfsdk:"device_type"` + DeviceRole types.String `tfsdk:"device_role"` + PolicyId types.String `tfsdk:"policy_id"` + PolicyVersion types.Int64 `tfsdk:"policy_version"` + SecurityPolicyId types.String `tfsdk:"security_policy_id"` + SecurityPolicyVersion types.Int64 `tfsdk:"security_policy_version"` + GeneralTemplates []FeatureDeviceTemplateGeneralTemplates `tfsdk:"general_templates"` } type FeatureDeviceTemplateGeneralTemplates struct { @@ -373,3 +376,34 @@ func (data *FeatureDeviceTemplate) updateVersions(ctx context.Context, state *Fe } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *FeatureDeviceTemplate) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.ConfigType = types.StringValue("template") + data.FactoryDefault = types.BoolValue(false) + data.FeatureTemplateUidRange = []interface{}{} + if data.PolicyId != types.StringNull() { + data.PolicyVersion = types.Int64Value(0) + } + if data.SecurityPolicyId != types.StringNull() { + data.SecurityPolicyVersion = types.Int64Value(0) + } + for i := range data.GeneralTemplates { + if data.GeneralTemplates[i].Id != types.StringNull() { + data.GeneralTemplates[i].Version = types.Int64Value(0) + } + for ii := range data.GeneralTemplates[i].SubTemplates { + if data.GeneralTemplates[i].SubTemplates[ii].Id != types.StringNull() { + data.GeneralTemplates[i].SubTemplates[ii].Version = types.Int64Value(0) + } + for iii := range data.GeneralTemplates[i].SubTemplates[ii].SubTemplates { + if data.GeneralTemplates[i].SubTemplates[ii].SubTemplates[iii].Id != types.StringNull() { + data.GeneralTemplates[i].SubTemplates[ii].SubTemplates[iii].Version = types.Int64Value(0) + } + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_geo_location_list_policy_object.go b/internal/provider/model_sdwan_geo_location_list_policy_object.go index 5566c6982..d36f3306e 100644 --- a/internal/provider/model_sdwan_geo_location_list_policy_object.go +++ b/internal/provider/model_sdwan_geo_location_list_policy_object.go @@ -32,6 +32,7 @@ import ( type GeoLocationListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []GeoLocationListPolicyObjectEntries `tfsdk:"entries"` } @@ -136,3 +137,11 @@ func (data *GeoLocationListPolicyObject) hasChanges(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *GeoLocationListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("geolocation") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go b/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go index ea947eea8..1bab42c2c 100644 --- a/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go +++ b/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go @@ -381,3 +381,26 @@ func (data *HubAndSpokeTopologyPolicyDefinition) updateVersions(ctx context.Cont } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *HubAndSpokeTopologyPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("hubAndSpoke") + if data.VpnListId != types.StringNull() { + data.VpnListVersion = types.Int64Value(0) + } + for i := range data.Topologies { + for ii := range data.Topologies[i].Spokes { + if data.Topologies[i].Spokes[ii].SiteListId != types.StringNull() { + data.Topologies[i].Spokes[ii].SiteListVersion = types.Int64Value(0) + } + for iii := range data.Topologies[i].Spokes[ii].Hubs { + if data.Topologies[i].Spokes[ii].Hubs[iii].SiteListId != types.StringNull() { + data.Topologies[i].Spokes[ii].Hubs[iii].SiteListVersion = types.Int64Value(0) + } + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go b/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go index 418e51535..65fa530f6 100644 --- a/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go +++ b/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go @@ -33,6 +33,7 @@ import ( type IntrusionPreventionPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -250,3 +251,14 @@ func (data *IntrusionPreventionPolicyDefinition) updateVersions(ctx context.Cont } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IntrusionPreventionPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("intrusionPrevention") + if data.IpsSignatureListId != types.StringNull() { + data.IpsSignatureListVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ips_signature_list_policy_object.go b/internal/provider/model_sdwan_ips_signature_list_policy_object.go index 4f4802b20..263f70eb3 100644 --- a/internal/provider/model_sdwan_ips_signature_list_policy_object.go +++ b/internal/provider/model_sdwan_ips_signature_list_policy_object.go @@ -33,6 +33,7 @@ import ( type IPSSignatureListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []IPSSignatureListPolicyObjectEntries `tfsdk:"entries"` } @@ -137,3 +138,11 @@ func (data *IPSSignatureListPolicyObject) hasChanges(ctx context.Context, state // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPSSignatureListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("ipssignature") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go index 800fe7c51..c9fb5ebb4 100644 --- a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go @@ -621,3 +621,35 @@ func (data *IPv4ACLPolicyDefinition) updateVersions(ctx context.Context, state * } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPv4ACLPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("acl") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].ClassMapId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ClassMapVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListVersion = types.Int64Value(0) + } + } + for ii := range data.Sequences[i].ActionEntries { + if data.Sequences[i].ActionEntries[ii].ClassMapId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].ClassMapVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].MirrorId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].MirrorVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].PolicerId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].PolicerVersion = types.Int64Value(0) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go index 6362c4d9d..c4706accf 100644 --- a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go @@ -383,3 +383,21 @@ func (data *IPv4DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPv4DeviceACLPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("deviceAccessPolicy") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListVersion = types.Int64Value(0) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go b/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go index 5e38b50b3..0f2f5baf2 100644 --- a/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go @@ -33,6 +33,7 @@ import ( type IPv4PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []IPv4PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -149,3 +150,11 @@ func (data *IPv4PrefixListPolicyObject) hasChanges(ctx context.Context, state *I // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPv4PrefixListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("prefix") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv6_acl_policy_definition.go b/internal/provider/model_sdwan_ipv6_acl_policy_definition.go index 0f09b143e..0bb32898b 100644 --- a/internal/provider/model_sdwan_ipv6_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv6_acl_policy_definition.go @@ -612,3 +612,35 @@ func (data *IPv6ACLPolicyDefinition) updateVersions(ctx context.Context, state * } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPv6ACLPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("aclv6") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].ClassMapId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ClassMapVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].SourceDataIpv6PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SourceDataIpv6PrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DestinationDataIpv6PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DestinationDataIpv6PrefixListVersion = types.Int64Value(0) + } + } + for ii := range data.Sequences[i].ActionEntries { + if data.Sequences[i].ActionEntries[ii].ClassMapId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].ClassMapVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].MirrorId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].MirrorVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].PolicerId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].PolicerVersion = types.Int64Value(0) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go index ab8482c9e..8e4e43867 100644 --- a/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go @@ -386,3 +386,21 @@ func (data *IPv6DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPv6DeviceACLPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("deviceaccesspolicyv6") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].SourceDataIpv6PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SourceDataIpv6PrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DestinationDataIpv6PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DestinationDataIpv6PrefixListVersion = types.Int64Value(0) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go b/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go index 6772b0bec..1f936afd3 100644 --- a/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go @@ -33,6 +33,7 @@ import ( type IPv6PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []IPv6PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -149,3 +150,11 @@ func (data *IPv6PrefixListPolicyObject) hasChanges(ctx context.Context, state *I // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *IPv6PrefixListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("ipv6prefix") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_local_application_list_policy_object.go b/internal/provider/model_sdwan_local_application_list_policy_object.go index 0aeba1b80..da95ce63f 100644 --- a/internal/provider/model_sdwan_local_application_list_policy_object.go +++ b/internal/provider/model_sdwan_local_application_list_policy_object.go @@ -32,6 +32,7 @@ import ( type LocalApplicationListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []LocalApplicationListPolicyObjectEntries `tfsdk:"entries"` } @@ -136,3 +137,11 @@ func (data *LocalApplicationListPolicyObject) hasChanges(ctx context.Context, st // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *LocalApplicationListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("localapp") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_localized_policy.go b/internal/provider/model_sdwan_localized_policy.go index 1a5c4ecb3..0a152e3a5 100644 --- a/internal/provider/model_sdwan_localized_policy.go +++ b/internal/provider/model_sdwan_localized_policy.go @@ -33,6 +33,7 @@ import ( type LocalizedPolicy struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + PolicyType types.String `tfsdk:"policy_type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` FlowVisibilityIpv4 types.Bool `tfsdk:"flow_visibility_ipv4"` @@ -347,3 +348,16 @@ func (data *LocalizedPolicy) updateVersions(ctx context.Context, state *Localize } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *LocalizedPolicy) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.PolicyType = types.StringValue("feature") + for i := range data.Definitions { + if data.Definitions[i].Id != types.StringNull() { + data.Definitions[i].Version = types.Int64Value(0) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_mesh_topology_policy_definition.go b/internal/provider/model_sdwan_mesh_topology_policy_definition.go index d76fe1148..ea468407a 100644 --- a/internal/provider/model_sdwan_mesh_topology_policy_definition.go +++ b/internal/provider/model_sdwan_mesh_topology_policy_definition.go @@ -189,3 +189,19 @@ func (data *MeshTopologyPolicyDefinition) updateVersions(ctx context.Context, st } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *MeshTopologyPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("mesh") + if data.VpnListId != types.StringNull() { + data.VpnListVersion = types.Int64Value(0) + } + for i := range data.Regions { + if !data.Regions[i].SiteListIds.IsNull() { + data.Regions[i].SiteListVersions = types.ListNull(types.StringType) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_mirror_policy_object.go b/internal/provider/model_sdwan_mirror_policy_object.go index 44a0a77f9..9a8620824 100644 --- a/internal/provider/model_sdwan_mirror_policy_object.go +++ b/internal/provider/model_sdwan_mirror_policy_object.go @@ -32,6 +32,7 @@ import ( type MirrorPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` RemoteDestinationIp types.String `tfsdk:"remote_destination_ip"` SourceIp types.String `tfsdk:"source_ip"` @@ -107,3 +108,11 @@ func (data *MirrorPolicyObject) hasChanges(ctx context.Context, state *MirrorPol // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *MirrorPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("mirror") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_object_group_policy_definition.go b/internal/provider/model_sdwan_object_group_policy_definition.go index d7c134daf..5fa180607 100644 --- a/internal/provider/model_sdwan_object_group_policy_definition.go +++ b/internal/provider/model_sdwan_object_group_policy_definition.go @@ -32,6 +32,7 @@ import ( type ObjectGroupPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` DataIpv4PrefixListId types.String `tfsdk:"data_ipv4_prefix_list_id"` @@ -216,3 +217,23 @@ func (data *ObjectGroupPolicyDefinition) updateVersions(ctx context.Context, sta } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ObjectGroupPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("securityGroup") + if data.DataIpv4PrefixListId != types.StringNull() { + data.DataIpv4PrefixListVersion = types.Int64Value(0) + } + if data.DataFqdnPrefixListId != types.StringNull() { + data.DataFqdnPrefixListVersion = types.Int64Value(0) + } + if data.PortListId != types.StringNull() { + data.PortListVersion = types.Int64Value(0) + } + if data.GeoLocationListId != types.StringNull() { + data.GeoLocationListVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_other_feature_profile.go b/internal/provider/model_sdwan_other_feature_profile.go index 18866e160..9ecdb9cde 100644 --- a/internal/provider/model_sdwan_other_feature_profile.go +++ b/internal/provider/model_sdwan_other_feature_profile.go @@ -91,3 +91,9 @@ func (data *OtherFeatureProfile) hasChanges(ctx context.Context, state *OtherFea // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *OtherFeatureProfile) processImport(ctx context.Context) { +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_policer_policy_object.go b/internal/provider/model_sdwan_policer_policy_object.go index 9fddb634f..34db94d8e 100644 --- a/internal/provider/model_sdwan_policer_policy_object.go +++ b/internal/provider/model_sdwan_policer_policy_object.go @@ -33,6 +33,7 @@ import ( type PolicerPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Burst types.Int64 `tfsdk:"burst"` ExceedAction types.String `tfsdk:"exceed_action"` @@ -120,3 +121,11 @@ func (data *PolicerPolicyObject) hasChanges(ctx context.Context, state *PolicerP // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *PolicerPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("policer") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_port_list_policy_object.go b/internal/provider/model_sdwan_port_list_policy_object.go index eaae4bb04..5fbed7fe1 100644 --- a/internal/provider/model_sdwan_port_list_policy_object.go +++ b/internal/provider/model_sdwan_port_list_policy_object.go @@ -33,6 +33,7 @@ import ( type PortListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []PortListPolicyObjectEntries `tfsdk:"entries"` } @@ -125,3 +126,11 @@ func (data *PortListPolicyObject) hasChanges(ctx context.Context, state *PortLis // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *PortListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("port") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_preferred_color_group_policy_object.go b/internal/provider/model_sdwan_preferred_color_group_policy_object.go index aee75650a..9de88be4b 100644 --- a/internal/provider/model_sdwan_preferred_color_group_policy_object.go +++ b/internal/provider/model_sdwan_preferred_color_group_policy_object.go @@ -32,6 +32,7 @@ import ( type PreferredColorGroupPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` PrimaryColorPreference types.String `tfsdk:"primary_color_preference"` PrimaryPathPreference types.String `tfsdk:"primary_path_preference"` @@ -155,3 +156,11 @@ func (data *PreferredColorGroupPolicyObject) hasChanges(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *PreferredColorGroupPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("preferredColorGroup") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_protocol_list_policy_object.go b/internal/provider/model_sdwan_protocol_list_policy_object.go index eacb335d8..642b51d48 100644 --- a/internal/provider/model_sdwan_protocol_list_policy_object.go +++ b/internal/provider/model_sdwan_protocol_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ProtocolListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ProtocolListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *ProtocolListPolicyObject) hasChanges(ctx context.Context, state *Pro // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ProtocolListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("protocolname") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_qos_map_policy_definition.go b/internal/provider/model_sdwan_qos_map_policy_definition.go index 99d6b76a0..e508cc1fc 100644 --- a/internal/provider/model_sdwan_qos_map_policy_definition.go +++ b/internal/provider/model_sdwan_qos_map_policy_definition.go @@ -232,3 +232,16 @@ func (data *QoSMapPolicyDefinition) updateVersions(ctx context.Context, state *Q } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *QoSMapPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("qosMap") + for i := range data.QosSchedulers { + if data.QosSchedulers[i].ClassMapId != types.StringNull() { + data.QosSchedulers[i].ClassMapVersion = types.Int64Value(0) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_region_list_policy_object.go b/internal/provider/model_sdwan_region_list_policy_object.go index 616dca0fe..cf960e8f0 100644 --- a/internal/provider/model_sdwan_region_list_policy_object.go +++ b/internal/provider/model_sdwan_region_list_policy_object.go @@ -32,6 +32,7 @@ import ( type RegionListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []RegionListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *RegionListPolicyObject) hasChanges(ctx context.Context, state *Regio // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *RegionListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("region") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_rewrite_rule_policy_definition.go b/internal/provider/model_sdwan_rewrite_rule_policy_definition.go index c2e824f16..5fc40fbe9 100644 --- a/internal/provider/model_sdwan_rewrite_rule_policy_definition.go +++ b/internal/provider/model_sdwan_rewrite_rule_policy_definition.go @@ -196,3 +196,16 @@ func (data *RewriteRulePolicyDefinition) updateVersions(ctx context.Context, sta } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *RewriteRulePolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("rewriteRule") + for i := range data.Rules { + if data.Rules[i].ClassMapId != types.StringNull() { + data.Rules[i].ClassMapVersion = types.Int64Value(0) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_route_policy_definition.go b/internal/provider/model_sdwan_route_policy_definition.go index 5002b0343..c7d67ac25 100644 --- a/internal/provider/model_sdwan_route_policy_definition.go +++ b/internal/provider/model_sdwan_route_policy_definition.go @@ -705,3 +705,33 @@ func (data *RoutePolicyDefinition) updateVersions(ctx context.Context, state *Ro } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *RoutePolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("vedgeRoute") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].PrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].PrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].AsPathListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].AsPathListVersion = types.Int64Value(0) + } + if !data.Sequences[i].MatchEntries[ii].CommunityListIds.IsNull() { + data.Sequences[i].MatchEntries[ii].CommunityListVersions = types.ListNull(types.StringType) + } + if data.Sequences[i].MatchEntries[ii].ExpandedCommunityListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ExpandedCommunityListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].ExtendedCommunityListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ExtendedCommunityListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].NextHopPrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].NextHopPrefixListVersion = types.Int64Value(0) + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_rule_set_policy_definition.go b/internal/provider/model_sdwan_rule_set_policy_definition.go index a30b55d95..15e610d33 100644 --- a/internal/provider/model_sdwan_rule_set_policy_definition.go +++ b/internal/provider/model_sdwan_rule_set_policy_definition.go @@ -33,6 +33,7 @@ import ( type RuleSetPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Rules []RuleSetPolicyDefinitionRules `tfsdk:"rules"` @@ -510,3 +511,46 @@ func (data *RuleSetPolicyDefinition) updateVersions(ctx context.Context, state * } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *RuleSetPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("ruleSet") + for i := range data.Rules { + if data.Rules[i].SourceObjectGroupId != types.StringNull() { + data.Rules[i].SourceObjectGroupVersion = types.Int64Value(0) + } + if data.Rules[i].SourceDataIpv4PrefixListId != types.StringNull() { + data.Rules[i].SourceDataIpv4PrefixListVersion = types.Int64Value(0) + } + if data.Rules[i].SourceDataFqdnPrefixListId != types.StringNull() { + data.Rules[i].SourceDataFqdnPrefixListVersion = types.Int64Value(0) + } + if data.Rules[i].SourcePortListId != types.StringNull() { + data.Rules[i].SourcePortListVersion = types.Int64Value(0) + } + if data.Rules[i].SourceGeoLocationListId != types.StringNull() { + data.Rules[i].SourceGeoLocationListVersion = types.Int64Value(0) + } + if data.Rules[i].DestinationObjectGroupId != types.StringNull() { + data.Rules[i].DestinationObjectGroupVersion = types.Int64Value(0) + } + if data.Rules[i].DestinationDataIpv4PrefixListId != types.StringNull() { + data.Rules[i].DestinationDataIpv4PrefixListVersion = types.Int64Value(0) + } + if data.Rules[i].DestinationDataFqdnPrefixListId != types.StringNull() { + data.Rules[i].DestinationDataFqdnPrefixListVersion = types.Int64Value(0) + } + if data.Rules[i].DestinationPortListId != types.StringNull() { + data.Rules[i].DestinationPortListVersion = types.Int64Value(0) + } + if data.Rules[i].DestinationGeoLocationListId != types.StringNull() { + data.Rules[i].DestinationGeoLocationListVersion = types.Int64Value(0) + } + if data.Rules[i].ProtocolListId != types.StringNull() { + data.Rules[i].ProtocolListVersion = types.Int64Value(0) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_security_policy.go b/internal/provider/model_sdwan_security_policy.go index 7f1635811..c1b133574 100644 --- a/internal/provider/model_sdwan_security_policy.go +++ b/internal/provider/model_sdwan_security_policy.go @@ -33,6 +33,7 @@ import ( type SecurityPolicy struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + PolicyType types.String `tfsdk:"policy_type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -488,3 +489,16 @@ func (data *SecurityPolicy) updateVersions(ctx context.Context, state *SecurityP } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *SecurityPolicy) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.PolicyType = types.StringValue("feature") + for i := range data.Definitions { + if data.Definitions[i].Id != types.StringNull() { + data.Definitions[i].Version = types.Int64Value(0) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_site_list_policy_object.go b/internal/provider/model_sdwan_site_list_policy_object.go index dacb566bc..8580670e0 100644 --- a/internal/provider/model_sdwan_site_list_policy_object.go +++ b/internal/provider/model_sdwan_site_list_policy_object.go @@ -32,6 +32,7 @@ import ( type SiteListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []SiteListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *SiteListPolicyObject) hasChanges(ctx context.Context, state *SiteLis // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *SiteListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("site") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_sla_class_policy_object.go b/internal/provider/model_sdwan_sla_class_policy_object.go index 2580fa953..dda674011 100644 --- a/internal/provider/model_sdwan_sla_class_policy_object.go +++ b/internal/provider/model_sdwan_sla_class_policy_object.go @@ -33,6 +33,7 @@ import ( type SLAClassPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` AppProbeClassId types.String `tfsdk:"app_probe_class_id"` AppProbeClassVersion types.Int64 `tfsdk:"app_probe_class_version"` @@ -187,3 +188,14 @@ func (data *SLAClassPolicyObject) updateVersions(ctx context.Context, state *SLA } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *SLAClassPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("sla") + if data.AppProbeClassId != types.StringNull() { + data.AppProbeClassVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_standard_community_list_policy_object.go b/internal/provider/model_sdwan_standard_community_list_policy_object.go index 9dfe9202f..9354ef58b 100644 --- a/internal/provider/model_sdwan_standard_community_list_policy_object.go +++ b/internal/provider/model_sdwan_standard_community_list_policy_object.go @@ -32,6 +32,7 @@ import ( type StandardCommunityListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []StandardCommunityListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *StandardCommunityListPolicyObject) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *StandardCommunityListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("community") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_tloc_list_policy_object.go b/internal/provider/model_sdwan_tloc_list_policy_object.go index e88c7ad67..907f65d3d 100644 --- a/internal/provider/model_sdwan_tloc_list_policy_object.go +++ b/internal/provider/model_sdwan_tloc_list_policy_object.go @@ -33,6 +33,7 @@ import ( type TLOCListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []TLOCListPolicyObjectEntries `tfsdk:"entries"` } @@ -161,3 +162,11 @@ func (data *TLOCListPolicyObject) hasChanges(ctx context.Context, state *TLOCLis // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *TLOCListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("tloc") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go b/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go index afd74d7af..ad866b402 100644 --- a/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go +++ b/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go @@ -33,6 +33,7 @@ import ( type TLSSSLDecryptionPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -63,10 +64,10 @@ type TLSSSLDecryptionPolicyDefinitionNetworkRules struct { } type TLSSSLDecryptionPolicyDefinitionUrlRules struct { - RuleName types.String `tfsdk:"rule_name"` - TargetVpns types.Set `tfsdk:"target_vpns"` - TlsSslProfilePolicyId types.String `tfsdk:"tls_ssl_profile_policy_id"` - TlsSslProfileVersion types.Int64 `tfsdk:"tls_ssl_profile_version"` + RuleName types.String `tfsdk:"rule_name"` + TargetVpns types.Set `tfsdk:"target_vpns"` + TlsSslProfilePolicyId types.String `tfsdk:"tls_ssl_profile_policy_id"` + TlsSslProfilePolicyVersion types.Int64 `tfsdk:"tls_ssl_profile_policy_version"` } type TLSSSLDecryptionPolicyDefinitionNetworkRulesSourceAndDestinationConfiguration struct { @@ -495,11 +496,24 @@ func (data *TLSSSLDecryptionPolicyDefinition) updateVersions(ctx context.Context } } if stateIndex > -1 { - data.UrlRules[i].TlsSslProfileVersion = state.UrlRules[stateIndex].TlsSslProfileVersion + data.UrlRules[i].TlsSslProfilePolicyVersion = state.UrlRules[stateIndex].TlsSslProfilePolicyVersion } else { - data.UrlRules[i].TlsSslProfileVersion = types.Int64Null() + data.UrlRules[i].TlsSslProfilePolicyVersion = types.Int64Null() } } } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *TLSSSLDecryptionPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("sslDecryption") + for i := range data.UrlRules { + if data.UrlRules[i].TlsSslProfilePolicyId != types.StringNull() { + data.UrlRules[i].TlsSslProfilePolicyVersion = types.Int64Value(0) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go b/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go index 09c8c4e98..794cdf292 100644 --- a/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go +++ b/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go @@ -33,6 +33,7 @@ import ( type TLSSSLProfilePolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -235,3 +236,17 @@ func (data *TLSSSLProfilePolicyDefinition) updateVersions(ctx context.Context, s } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *TLSSSLProfilePolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("sslUtdDecryptProfile") + if data.AllowUrlListId != types.StringNull() { + data.AllowUrlListVersion = types.Int64Value(0) + } + if data.BlockUrlListId != types.StringNull() { + data.BlockUrlListVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_traffic_data_policy_definition.go b/internal/provider/model_sdwan_traffic_data_policy_definition.go index 6f8718841..7a03f3ff9 100644 --- a/internal/provider/model_sdwan_traffic_data_policy_definition.go +++ b/internal/provider/model_sdwan_traffic_data_policy_definition.go @@ -108,7 +108,7 @@ type TrafficDataPolicyDefinitionSequencesActionEntriesSetParameters struct { NextHopLoose types.Bool `tfsdk:"next_hop_loose"` PolicerListId types.String `tfsdk:"policer_list_id"` PolicerListVersion types.Int64 `tfsdk:"policer_list_version"` - PreferredColorGroupList types.String `tfsdk:"preferred_color_group_list"` + PreferredColorGroupListId types.String `tfsdk:"preferred_color_group_list_id"` PreferredColorGroupListVersion types.Int64 `tfsdk:"preferred_color_group_list_version"` TlocListId types.String `tfsdk:"tloc_list_id"` TlocListVersion types.Int64 `tfsdk:"tloc_list_version"` @@ -343,8 +343,8 @@ func (data TrafficDataPolicyDefinition) toBody(ctx context.Context) string { if !childChildItem.PolicerListId.IsNull() && childChildItem.Type.ValueString() == "policer" { itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.PolicerListId.ValueString()) } - if !childChildItem.PreferredColorGroupList.IsNull() && childChildItem.Type.ValueString() == "preferredColorGroup" { - itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.PreferredColorGroupList.ValueString()) + if !childChildItem.PreferredColorGroupListId.IsNull() && childChildItem.Type.ValueString() == "preferredColorGroup" { + itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.PreferredColorGroupListId.ValueString()) } if !childChildItem.TlocListId.IsNull() && childChildItem.Type.ValueString() == "tlocList" { itemChildChildBody, _ = sjson.Set(itemChildChildBody, "ref", childChildItem.TlocListId.ValueString()) @@ -734,9 +734,9 @@ func (data *TrafficDataPolicyDefinition) fromBody(ctx context.Context, res gjson ccItem.PolicerListId = types.StringNull() } if cccValue := ccv.Get("ref"); cccValue.Exists() && ccItem.Type.ValueString() == "preferredColorGroup" { - ccItem.PreferredColorGroupList = types.StringValue(cccValue.String()) + ccItem.PreferredColorGroupListId = types.StringValue(cccValue.String()) } else { - ccItem.PreferredColorGroupList = types.StringNull() + ccItem.PreferredColorGroupListId = types.StringNull() } if cccValue := ccv.Get("ref"); cccValue.Exists() && ccItem.Type.ValueString() == "tlocList" { ccItem.TlocListId = types.StringValue(cccValue.String()) @@ -1047,7 +1047,7 @@ func (data *TrafficDataPolicyDefinition) hasChanges(ctx context.Context, state * if !data.Sequences[i].ActionEntries[ii].SetParameters[iii].PolicerListId.Equal(state.Sequences[i].ActionEntries[ii].SetParameters[iii].PolicerListId) { hasChanges = true } - if !data.Sequences[i].ActionEntries[ii].SetParameters[iii].PreferredColorGroupList.Equal(state.Sequences[i].ActionEntries[ii].SetParameters[iii].PreferredColorGroupList) { + if !data.Sequences[i].ActionEntries[ii].SetParameters[iii].PreferredColorGroupListId.Equal(state.Sequences[i].ActionEntries[ii].SetParameters[iii].PreferredColorGroupListId) { hasChanges = true } if !data.Sequences[i].ActionEntries[ii].SetParameters[iii].TlocListId.Equal(state.Sequences[i].ActionEntries[ii].SetParameters[iii].TlocListId) { @@ -1211,3 +1211,43 @@ func (data *TrafficDataPolicyDefinition) updateVersions(ctx context.Context, sta } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *TrafficDataPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("data") + for i := range data.Sequences { + for ii := range data.Sequences[i].MatchEntries { + if data.Sequences[i].MatchEntries[ii].ApplicationListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].ApplicationListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DnsApplicationListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DnsApplicationListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].SourceDataPrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].SourceDataPrefixListVersion = types.Int64Value(0) + } + if data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListId != types.StringNull() { + data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListVersion = types.Int64Value(0) + } + } + for ii := range data.Sequences[i].ActionEntries { + for iii := range data.Sequences[i].ActionEntries[ii].SetParameters { + if data.Sequences[i].ActionEntries[ii].SetParameters[iii].PolicerListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SetParameters[iii].PolicerListVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].SetParameters[iii].PreferredColorGroupListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SetParameters[iii].PreferredColorGroupListVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].SetParameters[iii].TlocListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SetParameters[iii].TlocListVersion = types.Int64Value(0) + } + if data.Sequences[i].ActionEntries[ii].SetParameters[iii].ServiceTlocListId != types.StringNull() { + data.Sequences[i].ActionEntries[ii].SetParameters[iii].ServiceTlocListVersion = types.Int64Value(0) + } + } + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_url_filtering_policy_definition.go b/internal/provider/model_sdwan_url_filtering_policy_definition.go index 750f7ac3d..6c24b24be 100644 --- a/internal/provider/model_sdwan_url_filtering_policy_definition.go +++ b/internal/provider/model_sdwan_url_filtering_policy_definition.go @@ -33,6 +33,7 @@ import ( type URLFilteringPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -284,3 +285,17 @@ func (data *URLFilteringPolicyDefinition) updateVersions(ctx context.Context, st } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *URLFilteringPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("urlFiltering") + if data.AllowUrlListId != types.StringNull() { + data.AllowUrlListVersion = types.Int64Value(0) + } + if data.BlockUrlListId != types.StringNull() { + data.BlockUrlListVersion = types.Int64Value(0) + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_vpn_list_policy_object.go b/internal/provider/model_sdwan_vpn_list_policy_object.go index 62a0763e4..e386928cb 100644 --- a/internal/provider/model_sdwan_vpn_list_policy_object.go +++ b/internal/provider/model_sdwan_vpn_list_policy_object.go @@ -32,6 +32,7 @@ import ( type VPNListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []VPNListPolicyObjectEntries `tfsdk:"entries"` } @@ -124,3 +125,11 @@ func (data *VPNListPolicyObject) hasChanges(ctx context.Context, state *VPNListP // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *VPNListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("vpn") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_vpn_membership_policy_definition.go b/internal/provider/model_sdwan_vpn_membership_policy_definition.go index d3dec0b57..746b8470b 100644 --- a/internal/provider/model_sdwan_vpn_membership_policy_definition.go +++ b/internal/provider/model_sdwan_vpn_membership_policy_definition.go @@ -181,3 +181,19 @@ func (data *VPNMembershipPolicyDefinition) updateVersions(ctx context.Context, s } // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *VPNMembershipPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("vpnMembershipGroup") + for i := range data.Sites { + if data.Sites[i].SiteListId != types.StringNull() { + data.Sites[i].SiteListVersion = types.Int64Value(0) + } + if !data.Sites[i].VpnListIds.IsNull() { + data.Sites[i].VpnListVersions = types.ListNull(types.StringType) + } + } +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go b/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go index 3a4c5df00..d1bd79295 100644 --- a/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go +++ b/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go @@ -32,6 +32,7 @@ import ( type ZoneBasedFirewallPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -369,3 +370,11 @@ func (data *ZoneBasedFirewallPolicyDefinition) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ZoneBasedFirewallPolicyDefinition) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("zoneBasedFW") +} + +// End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_zone_list_policy_object.go b/internal/provider/model_sdwan_zone_list_policy_object.go index db5011fda..363847dc2 100644 --- a/internal/provider/model_sdwan_zone_list_policy_object.go +++ b/internal/provider/model_sdwan_zone_list_policy_object.go @@ -32,6 +32,7 @@ import ( type ZoneListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` + Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ZoneListPolicyObjectEntries `tfsdk:"entries"` } @@ -136,3 +137,11 @@ func (data *ZoneListPolicyObject) hasChanges(ctx context.Context, state *ZoneLis // Section below is generated&owned by "gen/generator.go". //template:begin updateVersions // End of section. //template:end updateVersions + +// Section below is generated&owned by "gen/generator.go". //template:begin processImport +func (data *ZoneListPolicyObject) processImport(ctx context.Context) { + data.Version = types.Int64Value(0) + data.Type = types.StringValue("zone") +} + +// End of section. //template:end processImport diff --git a/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go b/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go index a988c3b10..201dad352 100644 --- a/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go +++ b/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go @@ -193,8 +193,13 @@ func (r *AdvancedInspectionProfilePolicyDefinitionResource) Read(ctx context.Con } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go b/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go index 9f99f6e7a..bfcae8912 100644 --- a/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go +++ b/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go @@ -217,8 +217,13 @@ func (r *AdvancedMalwareProtectionPolicyDefinitionResource) Read(ctx context.Con } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_allow_url_list_policy_object.go b/internal/provider/resource_sdwan_allow_url_list_policy_object.go index f4ee0b66d..696594fb2 100644 --- a/internal/provider/resource_sdwan_allow_url_list_policy_object.go +++ b/internal/provider/resource_sdwan_allow_url_list_policy_object.go @@ -165,8 +165,13 @@ func (r *AllowURLListPolicyObjectResource) Read(ctx context.Context, req resourc } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_app_probe_class_policy_object.go b/internal/provider/resource_sdwan_app_probe_class_policy_object.go index f19ebf487..ecb9f1dc7 100644 --- a/internal/provider/resource_sdwan_app_probe_class_policy_object.go +++ b/internal/provider/resource_sdwan_app_probe_class_policy_object.go @@ -177,8 +177,13 @@ func (r *AppProbeClassPolicyObjectResource) Read(ctx context.Context, req resour } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go b/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go index 1ba9b2576..c30694917 100644 --- a/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go +++ b/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go @@ -254,7 +254,7 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Schema(ctx context.Con stringvalidator.OneOf("name", "preferredColor", "preferredColorGroup", "strict", "fallbackToBestPath"), }, }, - "sla_class_list": schema.StringAttribute{ + "sla_class_list_id": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("SLA class list ID, Attribute conditional on `type` being equal to `name`").String, Optional: true, }, @@ -262,7 +262,7 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Schema(ctx context.Con MarkdownDescription: helpers.NewAttributeDescription("SLA class list version").String, Optional: true, }, - "preferred_color_group_list": schema.StringAttribute{ + "preferred_color_group_list_id": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Preferred color group list ID, Attribute conditional on `type` being equal to `preferredColorGroup`").String, Optional: true, }, @@ -354,8 +354,13 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Read(ctx context.Conte } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_application_list_policy_object.go b/internal/provider/resource_sdwan_application_list_policy_object.go index ef4134dec..835a5766c 100644 --- a/internal/provider/resource_sdwan_application_list_policy_object.go +++ b/internal/provider/resource_sdwan_application_list_policy_object.go @@ -169,8 +169,13 @@ func (r *ApplicationListPolicyObjectResource) Read(ctx context.Context, req reso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_as_path_list_policy_object.go b/internal/provider/resource_sdwan_as_path_list_policy_object.go index 271c9930f..ddada1fcb 100644 --- a/internal/provider/resource_sdwan_as_path_list_policy_object.go +++ b/internal/provider/resource_sdwan_as_path_list_policy_object.go @@ -165,8 +165,13 @@ func (r *ASPathListPolicyObjectResource) Read(ctx context.Context, req resource. } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_block_url_list_policy_object.go b/internal/provider/resource_sdwan_block_url_list_policy_object.go index 0b9f6642d..f47fb903e 100644 --- a/internal/provider/resource_sdwan_block_url_list_policy_object.go +++ b/internal/provider/resource_sdwan_block_url_list_policy_object.go @@ -165,8 +165,13 @@ func (r *BlockURLListPolicyObjectResource) Read(ctx context.Context, req resourc } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_centralized_policy.go b/internal/provider/resource_sdwan_centralized_policy.go index ce9c295fd..210272452 100644 --- a/internal/provider/resource_sdwan_centralized_policy.go +++ b/internal/provider/resource_sdwan_centralized_policy.go @@ -227,8 +227,13 @@ func (r *CentralizedPolicyResource) Read(ctx context.Context, req resource.ReadR } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_cflowd_policy_definition.go b/internal/provider/resource_sdwan_cflowd_policy_definition.go index b0e86ff1c..e4aa411a8 100644 --- a/internal/provider/resource_sdwan_cflowd_policy_definition.go +++ b/internal/provider/resource_sdwan_cflowd_policy_definition.go @@ -258,8 +258,13 @@ func (r *CflowdPolicyDefinitionResource) Read(ctx context.Context, req resource. } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_class_map_policy_object.go b/internal/provider/resource_sdwan_class_map_policy_object.go index 543c3cf0c..cda862c86 100644 --- a/internal/provider/resource_sdwan_class_map_policy_object.go +++ b/internal/provider/resource_sdwan_class_map_policy_object.go @@ -157,8 +157,13 @@ func (r *ClassMapPolicyObjectResource) Read(ctx context.Context, req resource.Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_cli_config_feature.go b/internal/provider/resource_sdwan_cli_config_feature.go index baa6afe2f..7873c1572 100644 --- a/internal/provider/resource_sdwan_cli_config_feature.go +++ b/internal/provider/resource_sdwan_cli_config_feature.go @@ -165,9 +165,6 @@ func (r *CLIConfigFeatureResource) Read(ctx context.Context, req resource.ReadRe } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_cli_device_template.go b/internal/provider/resource_sdwan_cli_device_template.go index 9698a67cd..bc9b63e2d 100644 --- a/internal/provider/resource_sdwan_cli_device_template.go +++ b/internal/provider/resource_sdwan_cli_device_template.go @@ -169,8 +169,13 @@ func (r *CLIDeviceTemplateResource) Read(ctx context.Context, req resource.ReadR } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_color_list_policy_object.go b/internal/provider/resource_sdwan_color_list_policy_object.go index fa799b308..a3e84f989 100644 --- a/internal/provider/resource_sdwan_color_list_policy_object.go +++ b/internal/provider/resource_sdwan_color_list_policy_object.go @@ -169,8 +169,13 @@ func (r *ColorListPolicyObjectResource) Read(ctx context.Context, req resource.R } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go b/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go index 5a45e5cf6..ce88371db 100644 --- a/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go +++ b/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go @@ -487,8 +487,13 @@ func (r *CustomControlTopologyPolicyDefinitionResource) Read(ctx context.Context } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go index 274b7fbfc..fb26e6393 100644 --- a/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go @@ -165,8 +165,13 @@ func (r *DataFQDNPrefixListPolicyObjectResource) Read(ctx context.Context, req r } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go index 4e7dd8ead..5a7922f04 100644 --- a/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go @@ -165,8 +165,13 @@ func (r *DataIPv4PrefixListPolicyObjectResource) Read(ctx context.Context, req r } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go index aabc11f7e..910ca74dd 100644 --- a/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go @@ -165,8 +165,13 @@ func (r *DataIPv6PrefixListPolicyObjectResource) Read(ctx context.Context, req r } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_dns_security_policy_definition.go b/internal/provider/resource_sdwan_dns_security_policy_definition.go index 5d8726ea8..ab65c791a 100644 --- a/internal/provider/resource_sdwan_dns_security_policy_definition.go +++ b/internal/provider/resource_sdwan_dns_security_policy_definition.go @@ -213,8 +213,13 @@ func (r *DNSSecurityPolicyDefinitionResource) Read(ctx context.Context, req reso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_domain_list_policy_object.go b/internal/provider/resource_sdwan_domain_list_policy_object.go index f7903fc77..d99f326a9 100644 --- a/internal/provider/resource_sdwan_domain_list_policy_object.go +++ b/internal/provider/resource_sdwan_domain_list_policy_object.go @@ -165,8 +165,13 @@ func (r *DomainListPolicyObjectResource) Read(ctx context.Context, req resource. } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_expanded_community_list_policy_object.go b/internal/provider/resource_sdwan_expanded_community_list_policy_object.go index 83bda5b4d..13345a778 100644 --- a/internal/provider/resource_sdwan_expanded_community_list_policy_object.go +++ b/internal/provider/resource_sdwan_expanded_community_list_policy_object.go @@ -165,8 +165,13 @@ func (r *ExpandedCommunityListPolicyObjectResource) Read(ctx context.Context, re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_extended_community_list_policy_object.go b/internal/provider/resource_sdwan_extended_community_list_policy_object.go index feab9b794..6baef4140 100644 --- a/internal/provider/resource_sdwan_extended_community_list_policy_object.go +++ b/internal/provider/resource_sdwan_extended_community_list_policy_object.go @@ -165,8 +165,13 @@ func (r *ExtendedCommunityListPolicyObjectResource) Read(ctx context.Context, re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_feature_device_template.go b/internal/provider/resource_sdwan_feature_device_template.go index ca273e018..fc9079200 100644 --- a/internal/provider/resource_sdwan_feature_device_template.go +++ b/internal/provider/resource_sdwan_feature_device_template.go @@ -241,8 +241,13 @@ func (r *FeatureDeviceTemplateResource) Read(ctx context.Context, req resource.R } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_geo_location_list_policy_object.go b/internal/provider/resource_sdwan_geo_location_list_policy_object.go index 9a530fdcf..aab43f308 100644 --- a/internal/provider/resource_sdwan_geo_location_list_policy_object.go +++ b/internal/provider/resource_sdwan_geo_location_list_policy_object.go @@ -173,8 +173,13 @@ func (r *GeoLocationListPolicyObjectResource) Read(ctx context.Context, req reso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go b/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go index 7cb269fab..13202573c 100644 --- a/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go +++ b/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go @@ -238,8 +238,13 @@ func (r *HubAndSpokeTopologyPolicyDefinitionResource) Read(ctx context.Context, } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go b/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go index bfd0d76c0..380d9e449 100644 --- a/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go +++ b/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go @@ -215,8 +215,13 @@ func (r *IntrusionPreventionPolicyDefinitionResource) Read(ctx context.Context, } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ips_signature_list_policy_object.go b/internal/provider/resource_sdwan_ips_signature_list_policy_object.go index 05040344f..d52a49fbc 100644 --- a/internal/provider/resource_sdwan_ips_signature_list_policy_object.go +++ b/internal/provider/resource_sdwan_ips_signature_list_policy_object.go @@ -176,8 +176,13 @@ func (r *IPSSignatureListPolicyObjectResource) Read(ctx context.Context, req res } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go index 7a39a1b4d..cee009d2d 100644 --- a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go @@ -360,8 +360,13 @@ func (r *IPv4ACLPolicyDefinitionResource) Read(ctx context.Context, req resource } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go index 1e62c2362..ae4015146 100644 --- a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go @@ -265,8 +265,13 @@ func (r *IPv4DeviceACLPolicyDefinitionResource) Read(ctx context.Context, req re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go b/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go index 6767c69a0..969c414c2 100644 --- a/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go @@ -173,8 +173,13 @@ func (r *IPv4PrefixListPolicyObjectResource) Read(ctx context.Context, req resou } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go index 137f789ad..93f3cb7d0 100644 --- a/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go @@ -359,8 +359,13 @@ func (r *IPv6ACLPolicyDefinitionResource) Read(ctx context.Context, req resource } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go index 54f708c3a..3458a9013 100644 --- a/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go @@ -265,8 +265,13 @@ func (r *IPv6DeviceACLPolicyDefinitionResource) Read(ctx context.Context, req re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go b/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go index 0f3ddaae6..6b84fa9d4 100644 --- a/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go @@ -173,8 +173,13 @@ func (r *IPv6PrefixListPolicyObjectResource) Read(ctx context.Context, req resou } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_local_application_list_policy_object.go b/internal/provider/resource_sdwan_local_application_list_policy_object.go index ee1a0d2c3..a64293ce9 100644 --- a/internal/provider/resource_sdwan_local_application_list_policy_object.go +++ b/internal/provider/resource_sdwan_local_application_list_policy_object.go @@ -169,8 +169,13 @@ func (r *LocalApplicationListPolicyObjectResource) Read(ctx context.Context, req } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_localized_policy.go b/internal/provider/resource_sdwan_localized_policy.go index f43da4157..0d0701e04 100644 --- a/internal/provider/resource_sdwan_localized_policy.go +++ b/internal/provider/resource_sdwan_localized_policy.go @@ -242,8 +242,13 @@ func (r *LocalizedPolicyResource) Read(ctx context.Context, req resource.ReadReq } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_mesh_topology_policy_definition.go b/internal/provider/resource_sdwan_mesh_topology_policy_definition.go index 67a517266..91fc66ca0 100644 --- a/internal/provider/resource_sdwan_mesh_topology_policy_definition.go +++ b/internal/provider/resource_sdwan_mesh_topology_policy_definition.go @@ -190,8 +190,13 @@ func (r *MeshTopologyPolicyDefinitionResource) Read(ctx context.Context, req res } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_mirror_policy_object.go b/internal/provider/resource_sdwan_mirror_policy_object.go index 91190b19c..acb5dce07 100644 --- a/internal/provider/resource_sdwan_mirror_policy_object.go +++ b/internal/provider/resource_sdwan_mirror_policy_object.go @@ -156,8 +156,13 @@ func (r *MirrorPolicyObjectResource) Read(ctx context.Context, req resource.Read } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_object_group_policy_definition.go b/internal/provider/resource_sdwan_object_group_policy_definition.go index b291d3b88..1ce25a791 100644 --- a/internal/provider/resource_sdwan_object_group_policy_definition.go +++ b/internal/provider/resource_sdwan_object_group_policy_definition.go @@ -204,8 +204,13 @@ func (r *ObjectGroupPolicyDefinitionResource) Read(ctx context.Context, req reso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_policer_policy_object.go b/internal/provider/resource_sdwan_policer_policy_object.go index 182c24940..e8ce09509 100644 --- a/internal/provider/resource_sdwan_policer_policy_object.go +++ b/internal/provider/resource_sdwan_policer_policy_object.go @@ -172,8 +172,13 @@ func (r *PolicerPolicyObjectResource) Read(ctx context.Context, req resource.Rea } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_port_list_policy_object.go b/internal/provider/resource_sdwan_port_list_policy_object.go index c4ca5d5b3..9ad543cd9 100644 --- a/internal/provider/resource_sdwan_port_list_policy_object.go +++ b/internal/provider/resource_sdwan_port_list_policy_object.go @@ -169,8 +169,13 @@ func (r *PortListPolicyObjectResource) Read(ctx context.Context, req resource.Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_preferred_color_group_policy_object.go b/internal/provider/resource_sdwan_preferred_color_group_policy_object.go index be33c36fd..dfd216d6e 100644 --- a/internal/provider/resource_sdwan_preferred_color_group_policy_object.go +++ b/internal/provider/resource_sdwan_preferred_color_group_policy_object.go @@ -183,8 +183,13 @@ func (r *PreferredColorGroupPolicyObjectResource) Read(ctx context.Context, req } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_protocol_list_policy_object.go b/internal/provider/resource_sdwan_protocol_list_policy_object.go index 78b781cf5..43451d10f 100644 --- a/internal/provider/resource_sdwan_protocol_list_policy_object.go +++ b/internal/provider/resource_sdwan_protocol_list_policy_object.go @@ -165,8 +165,13 @@ func (r *ProtocolListPolicyObjectResource) Read(ctx context.Context, req resourc } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_qos_map_policy_definition.go b/internal/provider/resource_sdwan_qos_map_policy_definition.go index 860bb1fad..7dcee8c20 100644 --- a/internal/provider/resource_sdwan_qos_map_policy_definition.go +++ b/internal/provider/resource_sdwan_qos_map_policy_definition.go @@ -221,8 +221,13 @@ func (r *QoSMapPolicyDefinitionResource) Read(ctx context.Context, req resource. } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_region_list_policy_object.go b/internal/provider/resource_sdwan_region_list_policy_object.go index 2f4cb3677..c302d926e 100644 --- a/internal/provider/resource_sdwan_region_list_policy_object.go +++ b/internal/provider/resource_sdwan_region_list_policy_object.go @@ -165,8 +165,13 @@ func (r *RegionListPolicyObjectResource) Read(ctx context.Context, req resource. } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go b/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go index eb379b313..087e463d0 100644 --- a/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go +++ b/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go @@ -200,8 +200,13 @@ func (r *RewriteRulePolicyDefinitionResource) Read(ctx context.Context, req reso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_route_policy_definition.go b/internal/provider/resource_sdwan_route_policy_definition.go index 5f7a6b540..12448d17d 100644 --- a/internal/provider/resource_sdwan_route_policy_definition.go +++ b/internal/provider/resource_sdwan_route_policy_definition.go @@ -417,8 +417,13 @@ func (r *RoutePolicyDefinitionResource) Read(ctx context.Context, req resource.R } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_rule_set_policy_definition.go b/internal/provider/resource_sdwan_rule_set_policy_definition.go index 0e34e2527..65a6c39a8 100644 --- a/internal/provider/resource_sdwan_rule_set_policy_definition.go +++ b/internal/provider/resource_sdwan_rule_set_policy_definition.go @@ -309,8 +309,13 @@ func (r *RuleSetPolicyDefinitionResource) Read(ctx context.Context, req resource } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_security_policy.go b/internal/provider/resource_sdwan_security_policy.go index b66e9255f..0575e68f1 100644 --- a/internal/provider/resource_sdwan_security_policy.go +++ b/internal/provider/resource_sdwan_security_policy.go @@ -305,8 +305,13 @@ func (r *SecurityPolicyResource) Read(ctx context.Context, req resource.ReadRequ } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go index b70457afc..7739431bf 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go @@ -154,9 +154,6 @@ func (r *ServiceLANVPNFeatureAssociateMulticastFeatureResource) Read(ctx context } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go index 381e0ef4a..2e39c14f6 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go @@ -154,9 +154,6 @@ func (r *ServiceLANVPNFeatureAssociateRoutingBGPFeatureResource) Read(ctx contex } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go index 5a0c98ad6..b34de41ea 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go @@ -154,9 +154,6 @@ func (r *ServiceLANVPNFeatureAssociateRoutingEIGRPFeatureResource) Read(ctx cont } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go index eac606aac..2c3549525 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go @@ -154,9 +154,6 @@ func (r *ServiceLANVPNFeatureAssociateRoutingOSPFFeatureResource) Read(ctx conte } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go index b7f1fbc10..90051f76d 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go @@ -154,9 +154,6 @@ func (r *ServiceLANVPNFeatureAssociateRoutingOSPFv3IPv4FeatureResource) Read(ctx } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go index 5c4b25eb2..816b06c6b 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go @@ -154,9 +154,6 @@ func (r *ServiceLANVPNFeatureAssociateRoutingOSPFv3IPv6FeatureResource) Read(ctx } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go index 101206648..d39b81413 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go @@ -158,9 +158,6 @@ func (r *ServiceLANVPNInterfaceEthernetFeatureAssociateDHCPServerFeatureResource } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go index 5989b1d56..9675f228b 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go @@ -158,9 +158,6 @@ func (r *ServiceLANVPNInterfaceEthernetFeatureAssociateTrackerFeatureResource) R } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go index feb842bd0..f5bbf4ea0 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go @@ -158,9 +158,6 @@ func (r *ServiceLANVPNInterfaceEthernetFeatureAssociateTrackerGroupFeatureResour } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go index 63526e628..306e815d7 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go @@ -158,9 +158,6 @@ func (r *ServiceLANVPNInterfaceIPSecFeatureAssociateDHCPServerFeatureResource) R } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go index 15887732d..9d7ed0001 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go @@ -158,9 +158,6 @@ func (r *ServiceLANVPNInterfaceSVIFeatureAssociateDHCPServerFeatureResource) Rea } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_site_list_policy_object.go b/internal/provider/resource_sdwan_site_list_policy_object.go index b0ff1664d..81940338c 100644 --- a/internal/provider/resource_sdwan_site_list_policy_object.go +++ b/internal/provider/resource_sdwan_site_list_policy_object.go @@ -165,8 +165,13 @@ func (r *SiteListPolicyObjectResource) Read(ctx context.Context, req resource.Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_sla_class_policy_object.go b/internal/provider/resource_sdwan_sla_class_policy_object.go index 3d10c42cf..d4b37c570 100644 --- a/internal/provider/resource_sdwan_sla_class_policy_object.go +++ b/internal/provider/resource_sdwan_sla_class_policy_object.go @@ -208,8 +208,13 @@ func (r *SLAClassPolicyObjectResource) Read(ctx context.Context, req resource.Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_standard_community_list_policy_object.go b/internal/provider/resource_sdwan_standard_community_list_policy_object.go index 0eed25b13..8cfedb05d 100644 --- a/internal/provider/resource_sdwan_standard_community_list_policy_object.go +++ b/internal/provider/resource_sdwan_standard_community_list_policy_object.go @@ -165,8 +165,13 @@ func (r *StandardCommunityListPolicyObjectResource) Read(ctx context.Context, re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_tloc_list_policy_object.go b/internal/provider/resource_sdwan_tloc_list_policy_object.go index 04085522b..0f56773d5 100644 --- a/internal/provider/resource_sdwan_tloc_list_policy_object.go +++ b/internal/provider/resource_sdwan_tloc_list_policy_object.go @@ -188,8 +188,13 @@ func (r *TLOCListPolicyObjectResource) Read(ctx context.Context, req resource.Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go b/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go index 648088809..9285f0b61 100644 --- a/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go +++ b/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go @@ -162,7 +162,7 @@ func (r *TLSSSLDecryptionPolicyDefinitionResource) Schema(ctx context.Context, r MarkdownDescription: helpers.NewAttributeDescription("TLS SSL Profile Policy ID").String, Optional: true, }, - "tls_ssl_profile_version": schema.Int64Attribute{ + "tls_ssl_profile_policy_version": schema.Int64Attribute{ MarkdownDescription: helpers.NewAttributeDescription("TLS SSL Profile Policy version").String, Optional: true, }, @@ -321,8 +321,13 @@ func (r *TLSSSLDecryptionPolicyDefinitionResource) Read(ctx context.Context, req } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go b/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go index 5fc7de512..37bce9caf 100644 --- a/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go +++ b/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go @@ -207,8 +207,13 @@ func (r *TLSSSLProfilePolicyDefinitionResource) Read(ctx context.Context, req re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_traffic_data_policy_definition.go b/internal/provider/resource_sdwan_traffic_data_policy_definition.go index eddef5ec4..5ba9841ea 100644 --- a/internal/provider/resource_sdwan_traffic_data_policy_definition.go +++ b/internal/provider/resource_sdwan_traffic_data_policy_definition.go @@ -405,7 +405,7 @@ func (r *TrafficDataPolicyDefinitionResource) Schema(ctx context.Context, req re MarkdownDescription: helpers.NewAttributeDescription("Policer list version").String, Optional: true, }, - "preferred_color_group_list": schema.StringAttribute{ + "preferred_color_group_list_id": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("Preferred color group list ID, Attribute conditional on `type` being equal to `preferredColorGroup`").String, Optional: true, }, @@ -591,8 +591,13 @@ func (r *TrafficDataPolicyDefinitionResource) Read(ctx context.Context, req reso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go index 6c90d22f1..324ef337e 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go @@ -154,9 +154,6 @@ func (r *TransportWANVPNFeatureAssociateRoutingBGPFeatureResource) Read(ctx cont } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go index 9d552f77e..cdbefb943 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go @@ -154,9 +154,6 @@ func (r *TransportWANVPNFeatureAssociateRoutingOSPFFeatureResource) Read(ctx con } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go index e5b1860c7..6ec8e66e7 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go @@ -154,9 +154,6 @@ func (r *TransportWANVPNFeatureAssociateRoutingOSPFv3IPv4FeatureResource) Read(c } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go index de47fde4d..d1ee85643 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go @@ -154,9 +154,6 @@ func (r *TransportWANVPNFeatureAssociateRoutingOSPFv3IPv6FeatureResource) Read(c } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go index 76579dd6f..b2d13dfc8 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceCellularFeatureAssociateTrackerFeatureResource) } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go index 4de53ee12..2b24ba6d0 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceCellularFeatureAssociateTrackerGroupFeatureReso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go index 58964c0a7..c356690c0 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateIPv6TrackerFeatureResou } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go index 55aea4319..ce0ba58c8 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateIPv6TrackerGroupFeature } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go index a8b521cb2..10ddf3d87 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateTrackerFeatureResource) } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go index 9656ed55e..cf0e7367e 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateTrackerGroupFeatureReso } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go index 667a5c0b4..48f32b7ff 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceGREFeatureAssociateTrackerFeatureResource) Read } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go index 462321dfa..9219cfb8e 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go @@ -158,9 +158,6 @@ func (r *TransportWANVPNInterfaceIPSECFeatureAssociateTrackerFeatureResource) Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) - } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Id.ValueString())) diff --git a/internal/provider/resource_sdwan_url_filtering_policy_definition.go b/internal/provider/resource_sdwan_url_filtering_policy_definition.go index fb31bed20..3a21c65a1 100644 --- a/internal/provider/resource_sdwan_url_filtering_policy_definition.go +++ b/internal/provider/resource_sdwan_url_filtering_policy_definition.go @@ -233,8 +233,13 @@ func (r *URLFilteringPolicyDefinitionResource) Read(ctx context.Context, req res } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_vpn_list_policy_object.go b/internal/provider/resource_sdwan_vpn_list_policy_object.go index 15ecfed97..41a4b6f88 100644 --- a/internal/provider/resource_sdwan_vpn_list_policy_object.go +++ b/internal/provider/resource_sdwan_vpn_list_policy_object.go @@ -165,8 +165,13 @@ func (r *VPNListPolicyObjectResource) Read(ctx context.Context, req resource.Rea } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_vpn_membership_policy_definition.go b/internal/provider/resource_sdwan_vpn_membership_policy_definition.go index b383a1519..092302b08 100644 --- a/internal/provider/resource_sdwan_vpn_membership_policy_definition.go +++ b/internal/provider/resource_sdwan_vpn_membership_policy_definition.go @@ -186,8 +186,13 @@ func (r *VPNMembershipPolicyDefinitionResource) Read(ctx context.Context, req re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go index 37ad594ca..b3e32f0af 100644 --- a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go +++ b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go @@ -263,8 +263,13 @@ func (r *ZoneBasedFirewallPolicyDefinitionResource) Read(ctx context.Context, re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/internal/provider/resource_sdwan_zone_list_policy_object.go b/internal/provider/resource_sdwan_zone_list_policy_object.go index 28bb49194..9a9ebb41c 100644 --- a/internal/provider/resource_sdwan_zone_list_policy_object.go +++ b/internal/provider/resource_sdwan_zone_list_policy_object.go @@ -169,8 +169,13 @@ func (r *ZoneListPolicyObjectResource) Read(ctx context.Context, req resource.Re } state.fromBody(ctx, res) - if state.Version.IsNull() { - state.Version = types.Int64Value(0) + imp, diags := helpers.IsFlagImporting(ctx, req) + if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { + return + } + + if imp { + state.processImport(ctx) } tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 3805e503e..852218fb2 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -7,6 +7,13 @@ description: |- # Changelog +## 0.6.3 (unreleased) + +- BREAKING CHANGE: Rename `tls_ssl_profile_version` attribute of `sdwan_tls_ssl_decryption_policy_definition` resource to `tls_ssl_profile_policy_version` +- BREAKING CHANGE: Rename `sla_class_list` attribute of `sdwan_application_aware_routing_policy_definition` resource to `sla_class_list_id` +- BREAKING CHANGE: Rename `preferred_color_group_list` attribute of `sdwan_application_aware_routing_policy_definition` resource to `preferred_color_group_list_id` +- BREAKING CHANGE: Rename `preferred_color_group_list` attribute of `sdwan_traffic_data_policy_definition` resource to `preferred_color_group_list_id` + ## 0.6.2 - Fix issue causing changes to applied feature templates to fail, [link](https://github.com/CiscoDevNet/terraform-provider-sdwan/issues/417) From 9a76a6b30b394943de92824f812b41854b975b77 Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Tue, 29 Jul 2025 18:11:45 +0100 Subject: [PATCH 2/8] Remove unused has version helper function --- gen/generator.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/gen/generator.go b/gen/generator.go index 92eab8130..d9f3e0967 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -404,17 +404,6 @@ func HasReference(attributes []YamlConfigAttribute) bool { return false } -// Templating helper function to return true if reference included in attributes -func HasVersion(attributes []YamlConfigAttribute) bool { - for _, attr := range attributes { - if attr.Type == "Version" { - // if attr.Type == "Version" || attr.Type == "Versions" { - return true - } - } - return false -} - // Templating helper function to return true if reference included in attributes func HasStaticValue(attributes []YamlConfigAttribute) bool { for _, attr := range attributes { @@ -586,7 +575,6 @@ var functions = template.FuncMap{ "hasVersionAttribute": HasVersionAttribute, "getResponseModelPath": GetResponseModelPath, "hasReference": HasReference, - "hasVersion": HasVersion, "hasStaticValue": HasStaticValue, "countReferences": CountReferences, "add": Add, From b3ad7b1dec81a8d0804c5274528c413f092338c1 Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Sat, 2 Aug 2025 20:21:50 +0100 Subject: [PATCH 3/8] Resolve mismatch between struct and object issue --- gen/templates/generic/model.go | 20 ++++++++++--- ...ed_inspection_profile_policy_definition.go | 2 -- ...ed_malware_protection_policy_definition.go | 2 -- ...odel_sdwan_allow_url_list_policy_object.go | 2 -- ...del_sdwan_app_probe_class_policy_object.go | 2 -- ...ication_aware_routing_policy_definition.go | 1 - ...el_sdwan_application_list_policy_object.go | 2 -- .../model_sdwan_as_path_list_policy_object.go | 2 -- ...odel_sdwan_block_url_list_policy_object.go | 2 -- .../model_sdwan_centralized_policy.go | 2 -- .../model_sdwan_cflowd_policy_definition.go | 1 - .../model_sdwan_class_map_policy_object.go | 2 -- .../model_sdwan_cli_device_template.go | 4 --- .../model_sdwan_color_list_policy_object.go | 2 -- ...stom_control_topology_policy_definition.go | 2 -- ...wan_data_fqdn_prefix_list_policy_object.go | 2 -- ...wan_data_ipv4_prefix_list_policy_object.go | 2 -- ...wan_data_ipv6_prefix_list_policy_object.go | 2 -- ...el_sdwan_dns_security_policy_definition.go | 2 -- .../model_sdwan_domain_list_policy_object.go | 2 -- ...n_expanded_community_list_policy_object.go | 2 -- ...n_extended_community_list_policy_object.go | 2 -- .../model_sdwan_feature_device_template.go | 28 ++++++++----------- ...l_sdwan_geo_location_list_policy_object.go | 2 -- ...ub_and_spoke_topology_policy_definition.go | 1 - ..._intrusion_prevention_policy_definition.go | 2 -- ..._sdwan_ips_signature_list_policy_object.go | 2 -- .../model_sdwan_ipv4_acl_policy_definition.go | 1 - ...sdwan_ipv4_device_acl_policy_definition.go | 1 - ...el_sdwan_ipv4_prefix_list_policy_object.go | 2 -- .../model_sdwan_ipv6_acl_policy_definition.go | 1 - ...sdwan_ipv6_device_acl_policy_definition.go | 1 - ...el_sdwan_ipv6_prefix_list_policy_object.go | 2 -- ...an_local_application_list_policy_object.go | 2 -- .../provider/model_sdwan_localized_policy.go | 2 -- ...l_sdwan_mesh_topology_policy_definition.go | 1 - .../model_sdwan_mirror_policy_object.go | 2 -- ...el_sdwan_object_group_policy_definition.go | 2 -- .../model_sdwan_policer_policy_object.go | 2 -- .../model_sdwan_port_list_policy_object.go | 2 -- ...wan_preferred_color_group_policy_object.go | 2 -- ...model_sdwan_protocol_list_policy_object.go | 2 -- .../model_sdwan_qos_map_policy_definition.go | 1 - .../model_sdwan_region_list_policy_object.go | 2 -- ...el_sdwan_rewrite_rule_policy_definition.go | 1 - .../model_sdwan_route_policy_definition.go | 1 - .../model_sdwan_rule_set_policy_definition.go | 2 -- .../provider/model_sdwan_security_policy.go | 2 -- .../model_sdwan_site_list_policy_object.go | 2 -- .../model_sdwan_sla_class_policy_object.go | 2 -- ...n_standard_community_list_policy_object.go | 2 -- .../model_sdwan_tloc_list_policy_object.go | 2 -- ...an_tls_ssl_decryption_policy_definition.go | 2 -- ...sdwan_tls_ssl_profile_policy_definition.go | 2 -- ...el_sdwan_traffic_data_policy_definition.go | 1 - ...l_sdwan_url_filtering_policy_definition.go | 2 -- .../model_sdwan_vpn_list_policy_object.go | 2 -- ..._sdwan_vpn_membership_policy_definition.go | 1 - ...n_zone_based_firewall_policy_definition.go | 2 -- .../model_sdwan_zone_list_policy_object.go | 2 -- 60 files changed, 27 insertions(+), 126 deletions(-) diff --git a/gen/templates/generic/model.go b/gen/templates/generic/model.go index 56d8cd3f7..b514f0afd 100644 --- a/gen/templates/generic/model.go +++ b/gen/templates/generic/model.go @@ -41,13 +41,13 @@ type {{camelCase .Name}} struct { {{- if .HasVersion}} Version types.Int64 `tfsdk:"version"` {{- end}} +{{- if .TypeValue}} +Type types.String `tfsdk:"type"` +{{- end}} {{- range .Attributes}} -{{- if isNestedListSet .}} {{- if not .Value}} +{{- if isNestedListSet .}} {{toGoName .TfName}} []{{$name}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` -{{- else}} - {{toGoName .TfName}} []interface{} `tfsdk:"{{.TfName}}"` -{{- end}} {{- else if eq .Type "Versions"}} {{toGoName .TfName}} types.List `tfsdk:"{{.TfName}}"` {{- else if eq .Type "Version"}} @@ -56,8 +56,10 @@ type {{camelCase .Name}} struct { {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- end}} {{- end}} +{{- end}} } + {{ range .Attributes}} {{- if not .Value}} {{- $childName := toGoName .TfName}} @@ -91,6 +93,7 @@ type {{$name}}{{toGoName .TfName}} struct { {{- if isNestedListSet .}} type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{- range .Attributes}} +{{- if not .Value}} {{- if isNestedListSet .}} {{toGoName .TfName}} []{{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} `tfsdk:"{{.TfName}}"` {{- else if eq .Type "Versions"}} @@ -101,6 +104,7 @@ type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- end}} {{- end}} +{{- end}} } {{- end}} {{- end}} @@ -122,6 +126,7 @@ type {{$name}}{{$childName}}{{toGoName .TfName}} struct { {{- if isNestedListSet .}} type {{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} struct { {{- range .Attributes}} +{{- if not .Value}} {{- if eq .Type "Versions"}} {{toGoName .TfName}} types.List `tfsdk:"{{.TfName}}"` {{- else if eq .Type "Version"}} @@ -130,6 +135,7 @@ type {{$name}}{{$childName}}{{$childChildName}}{{toGoName .TfName}} struct { {{toGoName .TfName}} types.{{.Type}} `tfsdk:"{{.TfName}}"` {{- end}} {{- end}} +{{- end}} } {{- end}} {{- end}} @@ -679,6 +685,7 @@ func (data *{{camelCase .Name}}) processImport(ctx context.Context) { {{- end}} {{- range .Attributes}} {{- $name := toGoName .TfName}} + {{- if not .Value}} {{- if .Value}} data.{{toGoName .TfName}} = {{if eq .Type "String"}}types.StringValue("{{ .Value }}"){{else if eq .Type "Bool"}}types.BoolValue({{ .Value }}){{else if eq .Type "List"}}{{ .Value }}{{else}}types.ListNull({{ .Value }}){{end}} {{- end}} @@ -695,6 +702,7 @@ func (data *{{camelCase .Name}}) processImport(ctx context.Context) { {{- range .Attributes}} {{- $cname := toGoName .TfName}} + {{- if not .Value}} {{- if eq .Type "Version"}} if data.{{$name}}[i].{{toVersionName .TfName}} != types.StringNull() { data.{{$name}}[i].{{toGoName .TfName}} = types.Int64Value(0) @@ -708,6 +716,7 @@ func (data *{{camelCase .Name}}) processImport(ctx context.Context) { {{- range .Attributes}} {{- $ccname := toGoName .TfName}} + {{- if not .Value}} {{- if eq .Type "Version"}} if data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}} != types.StringNull() { data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.Int64Value(0) @@ -733,11 +742,14 @@ func (data *{{camelCase .Name}}) processImport(ctx context.Context) { } {{- end}} {{- end}} + {{- end}} } {{- end}} {{- end}} + {{- end}} } {{- end}} {{- end}} + {{- end}} } // End of section. //template:end processImport \ No newline at end of file diff --git a/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go b/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go index 093980066..6c01d919b 100644 --- a/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go +++ b/internal/provider/model_sdwan_advanced_inspection_profile_policy_definition.go @@ -32,7 +32,6 @@ import ( type AdvancedInspectionProfilePolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` TlsAction types.String `tfsdk:"tls_action"` @@ -173,7 +172,6 @@ func (data *AdvancedInspectionProfilePolicyDefinition) updateVersions(ctx contex // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *AdvancedInspectionProfilePolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("advancedInspectionProfile") if data.IntrusionPreventionId != types.StringNull() { data.IntrusionPreventionVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go b/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go index fc4e192a3..453994d19 100644 --- a/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go +++ b/internal/provider/model_sdwan_advanced_malware_protection_policy_definition.go @@ -33,7 +33,6 @@ import ( type AdvancedMalwareProtectionPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -241,7 +240,6 @@ func (data *AdvancedMalwareProtectionPolicyDefinition) hasChanges(ctx context.Co // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *AdvancedMalwareProtectionPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("advancedMalwareProtection") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_allow_url_list_policy_object.go b/internal/provider/model_sdwan_allow_url_list_policy_object.go index 430fb6154..e43265a6e 100644 --- a/internal/provider/model_sdwan_allow_url_list_policy_object.go +++ b/internal/provider/model_sdwan_allow_url_list_policy_object.go @@ -32,7 +32,6 @@ import ( type AllowURLListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []AllowURLListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *AllowURLListPolicyObject) hasChanges(ctx context.Context, state *All // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *AllowURLListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("urlwhitelist") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_app_probe_class_policy_object.go b/internal/provider/model_sdwan_app_probe_class_policy_object.go index acc87bf76..4c70a9e98 100644 --- a/internal/provider/model_sdwan_app_probe_class_policy_object.go +++ b/internal/provider/model_sdwan_app_probe_class_policy_object.go @@ -32,7 +32,6 @@ import ( type AppProbeClassPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` ForwardingClass types.String `tfsdk:"forwarding_class"` Mappings []AppProbeClassPolicyObjectMappings `tfsdk:"mappings"` @@ -153,7 +152,6 @@ func (data *AppProbeClassPolicyObject) hasChanges(ctx context.Context, state *Ap // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *AppProbeClassPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("appProbe") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go index 47781d087..5a46c1a0d 100644 --- a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go +++ b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go @@ -654,7 +654,6 @@ func (data *ApplicationAwareRoutingPolicyDefinition) updateVersions(ctx context. // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ApplicationAwareRoutingPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("appRoute") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ApplicationListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_application_list_policy_object.go b/internal/provider/model_sdwan_application_list_policy_object.go index 23fad27c9..e4a09adcb 100644 --- a/internal/provider/model_sdwan_application_list_policy_object.go +++ b/internal/provider/model_sdwan_application_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ApplicationListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ApplicationListPolicyObjectEntries `tfsdk:"entries"` } @@ -141,7 +140,6 @@ func (data *ApplicationListPolicyObject) hasChanges(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ApplicationListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("app") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_as_path_list_policy_object.go b/internal/provider/model_sdwan_as_path_list_policy_object.go index 2cafd132b..6de58b753 100644 --- a/internal/provider/model_sdwan_as_path_list_policy_object.go +++ b/internal/provider/model_sdwan_as_path_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ASPathListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ASPathListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *ASPathListPolicyObject) hasChanges(ctx context.Context, state *ASPat // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ASPathListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("asPath") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_block_url_list_policy_object.go b/internal/provider/model_sdwan_block_url_list_policy_object.go index 138683335..f75d3c7e5 100644 --- a/internal/provider/model_sdwan_block_url_list_policy_object.go +++ b/internal/provider/model_sdwan_block_url_list_policy_object.go @@ -32,7 +32,6 @@ import ( type BlockURLListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []BlockURLListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *BlockURLListPolicyObject) hasChanges(ctx context.Context, state *Blo // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *BlockURLListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("urlblacklist") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_centralized_policy.go b/internal/provider/model_sdwan_centralized_policy.go index be9c3171e..a1d629a3a 100644 --- a/internal/provider/model_sdwan_centralized_policy.go +++ b/internal/provider/model_sdwan_centralized_policy.go @@ -34,7 +34,6 @@ import ( type CentralizedPolicy struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - PolicyType types.String `tfsdk:"policy_type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Definitions []CentralizedPolicyDefinitions `tfsdk:"definitions"` @@ -305,7 +304,6 @@ func (data *CentralizedPolicy) updateVersions(ctx context.Context, state *Centra // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *CentralizedPolicy) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.PolicyType = types.StringValue("feature") for i := range data.Definitions { if data.Definitions[i].Id != types.StringNull() { data.Definitions[i].Version = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_cflowd_policy_definition.go b/internal/provider/model_sdwan_cflowd_policy_definition.go index 363dcc15e..72838dc25 100644 --- a/internal/provider/model_sdwan_cflowd_policy_definition.go +++ b/internal/provider/model_sdwan_cflowd_policy_definition.go @@ -334,7 +334,6 @@ func (data *CflowdPolicyDefinition) hasChanges(ctx context.Context, state *Cflow // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *CflowdPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("cflowd") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_class_map_policy_object.go b/internal/provider/model_sdwan_class_map_policy_object.go index 04436af4e..4bd5fb6cc 100644 --- a/internal/provider/model_sdwan_class_map_policy_object.go +++ b/internal/provider/model_sdwan_class_map_policy_object.go @@ -33,7 +33,6 @@ import ( type ClassMapPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Queue types.Int64 `tfsdk:"queue"` } @@ -101,7 +100,6 @@ func (data *ClassMapPolicyObject) hasChanges(ctx context.Context, state *ClassMa // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ClassMapPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("class") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_cli_device_template.go b/internal/provider/model_sdwan_cli_device_template.go index 04eefbcd6..cfa8d421e 100644 --- a/internal/provider/model_sdwan_cli_device_template.go +++ b/internal/provider/model_sdwan_cli_device_template.go @@ -32,8 +32,6 @@ import ( type CLIDeviceTemplate struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - ConfigType types.String `tfsdk:"config_type"` - FactoryDefault types.Bool `tfsdk:"factory_default"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` DeviceType types.String `tfsdk:"device_type"` @@ -140,8 +138,6 @@ func (data *CLIDeviceTemplate) hasChanges(ctx context.Context, state *CLIDeviceT // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *CLIDeviceTemplate) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.ConfigType = types.StringValue("file") - data.FactoryDefault = types.BoolValue(false) } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_color_list_policy_object.go b/internal/provider/model_sdwan_color_list_policy_object.go index b019bdf2b..3f2a148cb 100644 --- a/internal/provider/model_sdwan_color_list_policy_object.go +++ b/internal/provider/model_sdwan_color_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ColorListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ColorListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *ColorListPolicyObject) hasChanges(ctx context.Context, state *ColorL // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ColorListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("color") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_custom_control_topology_policy_definition.go b/internal/provider/model_sdwan_custom_control_topology_policy_definition.go index b6734a18c..c301ec407 100644 --- a/internal/provider/model_sdwan_custom_control_topology_policy_definition.go +++ b/internal/provider/model_sdwan_custom_control_topology_policy_definition.go @@ -83,7 +83,6 @@ type CustomControlTopologyPolicyDefinitionSequencesMatchEntries struct { type CustomControlTopologyPolicyDefinitionSequencesActionEntries struct { Type types.String `tfsdk:"type"` SetParameters []CustomControlTopologyPolicyDefinitionSequencesActionEntriesSetParameters `tfsdk:"set_parameters"` - Field types.String `tfsdk:"field"` ExportToVpnListId types.String `tfsdk:"export_to_vpn_list_id"` ExportToVpnListVersion types.Int64 `tfsdk:"export_to_vpn_list_version"` } @@ -883,7 +882,6 @@ func (data *CustomControlTopologyPolicyDefinition) updateVersions(ctx context.Co // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *CustomControlTopologyPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("control") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ColorListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go b/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go index 9bc051e9a..8b800bea7 100644 --- a/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_data_fqdn_prefix_list_policy_object.go @@ -32,7 +32,6 @@ import ( type DataFQDNPrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DataFQDNPrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *DataFQDNPrefixListPolicyObject) hasChanges(ctx context.Context, stat // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *DataFQDNPrefixListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("fqdn") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go b/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go index bf9c1c203..d287e63d6 100644 --- a/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_data_ipv4_prefix_list_policy_object.go @@ -32,7 +32,6 @@ import ( type DataIPv4PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DataIPv4PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *DataIPv4PrefixListPolicyObject) hasChanges(ctx context.Context, stat // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *DataIPv4PrefixListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("dataPrefix") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go b/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go index 928546d84..019a0e60e 100644 --- a/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_data_ipv6_prefix_list_policy_object.go @@ -32,7 +32,6 @@ import ( type DataIPv6PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DataIPv6PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *DataIPv6PrefixListPolicyObject) hasChanges(ctx context.Context, stat // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *DataIPv6PrefixListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("dataipv6prefix") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_dns_security_policy_definition.go b/internal/provider/model_sdwan_dns_security_policy_definition.go index bc125d50b..1ee1bd4a1 100644 --- a/internal/provider/model_sdwan_dns_security_policy_definition.go +++ b/internal/provider/model_sdwan_dns_security_policy_definition.go @@ -33,7 +33,6 @@ import ( type DNSSecurityPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` DomainListId types.String `tfsdk:"domain_list_id"` @@ -321,7 +320,6 @@ func (data *DNSSecurityPolicyDefinition) updateVersions(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *DNSSecurityPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("DNSSecurity") if data.DomainListId != types.StringNull() { data.DomainListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_domain_list_policy_object.go b/internal/provider/model_sdwan_domain_list_policy_object.go index 852e56e60..f6c21514f 100644 --- a/internal/provider/model_sdwan_domain_list_policy_object.go +++ b/internal/provider/model_sdwan_domain_list_policy_object.go @@ -32,7 +32,6 @@ import ( type DomainListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []DomainListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *DomainListPolicyObject) hasChanges(ctx context.Context, state *Domai // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *DomainListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("localdomain") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_expanded_community_list_policy_object.go b/internal/provider/model_sdwan_expanded_community_list_policy_object.go index 6662621eb..786166cdc 100644 --- a/internal/provider/model_sdwan_expanded_community_list_policy_object.go +++ b/internal/provider/model_sdwan_expanded_community_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ExpandedCommunityListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ExpandedCommunityListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *ExpandedCommunityListPolicyObject) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ExpandedCommunityListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("expandedCommunity") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_extended_community_list_policy_object.go b/internal/provider/model_sdwan_extended_community_list_policy_object.go index ce55e5c25..2f6ad222a 100644 --- a/internal/provider/model_sdwan_extended_community_list_policy_object.go +++ b/internal/provider/model_sdwan_extended_community_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ExtendedCommunityListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ExtendedCommunityListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *ExtendedCommunityListPolicyObject) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ExtendedCommunityListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("extCommunity") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_feature_device_template.go b/internal/provider/model_sdwan_feature_device_template.go index 867a0cc2f..65feb0b12 100644 --- a/internal/provider/model_sdwan_feature_device_template.go +++ b/internal/provider/model_sdwan_feature_device_template.go @@ -31,20 +31,17 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin types type FeatureDeviceTemplate struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - ConfigType types.String `tfsdk:"config_type"` - FactoryDefault types.Bool `tfsdk:"factory_default"` - FeatureTemplateUidRange []interface{} `tfsdk:"feature_template_uid_range"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - DeviceType types.String `tfsdk:"device_type"` - DeviceRole types.String `tfsdk:"device_role"` - PolicyId types.String `tfsdk:"policy_id"` - PolicyVersion types.Int64 `tfsdk:"policy_version"` - SecurityPolicyId types.String `tfsdk:"security_policy_id"` - SecurityPolicyVersion types.Int64 `tfsdk:"security_policy_version"` - GeneralTemplates []FeatureDeviceTemplateGeneralTemplates `tfsdk:"general_templates"` + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + DeviceType types.String `tfsdk:"device_type"` + DeviceRole types.String `tfsdk:"device_role"` + PolicyId types.String `tfsdk:"policy_id"` + PolicyVersion types.Int64 `tfsdk:"policy_version"` + SecurityPolicyId types.String `tfsdk:"security_policy_id"` + SecurityPolicyVersion types.Int64 `tfsdk:"security_policy_version"` + GeneralTemplates []FeatureDeviceTemplateGeneralTemplates `tfsdk:"general_templates"` } type FeatureDeviceTemplateGeneralTemplates struct { @@ -380,9 +377,6 @@ func (data *FeatureDeviceTemplate) updateVersions(ctx context.Context, state *Fe // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *FeatureDeviceTemplate) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.ConfigType = types.StringValue("template") - data.FactoryDefault = types.BoolValue(false) - data.FeatureTemplateUidRange = []interface{}{} if data.PolicyId != types.StringNull() { data.PolicyVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_geo_location_list_policy_object.go b/internal/provider/model_sdwan_geo_location_list_policy_object.go index d36f3306e..5595e3fcd 100644 --- a/internal/provider/model_sdwan_geo_location_list_policy_object.go +++ b/internal/provider/model_sdwan_geo_location_list_policy_object.go @@ -32,7 +32,6 @@ import ( type GeoLocationListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []GeoLocationListPolicyObjectEntries `tfsdk:"entries"` } @@ -141,7 +140,6 @@ func (data *GeoLocationListPolicyObject) hasChanges(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *GeoLocationListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("geolocation") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go b/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go index 1bab42c2c..657dea04f 100644 --- a/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go +++ b/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go @@ -385,7 +385,6 @@ func (data *HubAndSpokeTopologyPolicyDefinition) updateVersions(ctx context.Cont // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *HubAndSpokeTopologyPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("hubAndSpoke") if data.VpnListId != types.StringNull() { data.VpnListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go b/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go index 65fa530f6..142b45637 100644 --- a/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go +++ b/internal/provider/model_sdwan_intrusion_prevention_policy_definition.go @@ -33,7 +33,6 @@ import ( type IntrusionPreventionPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -255,7 +254,6 @@ func (data *IntrusionPreventionPolicyDefinition) updateVersions(ctx context.Cont // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IntrusionPreventionPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("intrusionPrevention") if data.IpsSignatureListId != types.StringNull() { data.IpsSignatureListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_ips_signature_list_policy_object.go b/internal/provider/model_sdwan_ips_signature_list_policy_object.go index 263f70eb3..99211f124 100644 --- a/internal/provider/model_sdwan_ips_signature_list_policy_object.go +++ b/internal/provider/model_sdwan_ips_signature_list_policy_object.go @@ -33,7 +33,6 @@ import ( type IPSSignatureListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []IPSSignatureListPolicyObjectEntries `tfsdk:"entries"` } @@ -142,7 +141,6 @@ func (data *IPSSignatureListPolicyObject) hasChanges(ctx context.Context, state // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPSSignatureListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("ipssignature") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go index c9fb5ebb4..0701879c2 100644 --- a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go @@ -625,7 +625,6 @@ func (data *IPv4ACLPolicyDefinition) updateVersions(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv4ACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("acl") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ClassMapId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go index c4706accf..300c59cd1 100644 --- a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go @@ -387,7 +387,6 @@ func (data *IPv4DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv4DeviceACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("deviceAccessPolicy") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go b/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go index 0f2f5baf2..c7d83e480 100644 --- a/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_ipv4_prefix_list_policy_object.go @@ -33,7 +33,6 @@ import ( type IPv4PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []IPv4PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -154,7 +153,6 @@ func (data *IPv4PrefixListPolicyObject) hasChanges(ctx context.Context, state *I // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv4PrefixListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("prefix") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_ipv6_acl_policy_definition.go b/internal/provider/model_sdwan_ipv6_acl_policy_definition.go index 0bb32898b..4c6b4ece3 100644 --- a/internal/provider/model_sdwan_ipv6_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv6_acl_policy_definition.go @@ -616,7 +616,6 @@ func (data *IPv6ACLPolicyDefinition) updateVersions(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv6ACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("aclv6") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ClassMapId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go index 8e4e43867..87b354cc3 100644 --- a/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go @@ -390,7 +390,6 @@ func (data *IPv6DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv6DeviceACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("deviceaccesspolicyv6") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].SourceDataIpv6PrefixListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go b/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go index 1f936afd3..14918161d 100644 --- a/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go +++ b/internal/provider/model_sdwan_ipv6_prefix_list_policy_object.go @@ -33,7 +33,6 @@ import ( type IPv6PrefixListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []IPv6PrefixListPolicyObjectEntries `tfsdk:"entries"` } @@ -154,7 +153,6 @@ func (data *IPv6PrefixListPolicyObject) hasChanges(ctx context.Context, state *I // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv6PrefixListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("ipv6prefix") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_local_application_list_policy_object.go b/internal/provider/model_sdwan_local_application_list_policy_object.go index da95ce63f..c1663bef4 100644 --- a/internal/provider/model_sdwan_local_application_list_policy_object.go +++ b/internal/provider/model_sdwan_local_application_list_policy_object.go @@ -32,7 +32,6 @@ import ( type LocalApplicationListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []LocalApplicationListPolicyObjectEntries `tfsdk:"entries"` } @@ -141,7 +140,6 @@ func (data *LocalApplicationListPolicyObject) hasChanges(ctx context.Context, st // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *LocalApplicationListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("localapp") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_localized_policy.go b/internal/provider/model_sdwan_localized_policy.go index 0a152e3a5..b24c94340 100644 --- a/internal/provider/model_sdwan_localized_policy.go +++ b/internal/provider/model_sdwan_localized_policy.go @@ -33,7 +33,6 @@ import ( type LocalizedPolicy struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - PolicyType types.String `tfsdk:"policy_type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` FlowVisibilityIpv4 types.Bool `tfsdk:"flow_visibility_ipv4"` @@ -352,7 +351,6 @@ func (data *LocalizedPolicy) updateVersions(ctx context.Context, state *Localize // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *LocalizedPolicy) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.PolicyType = types.StringValue("feature") for i := range data.Definitions { if data.Definitions[i].Id != types.StringNull() { data.Definitions[i].Version = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_mesh_topology_policy_definition.go b/internal/provider/model_sdwan_mesh_topology_policy_definition.go index ea468407a..1817653e1 100644 --- a/internal/provider/model_sdwan_mesh_topology_policy_definition.go +++ b/internal/provider/model_sdwan_mesh_topology_policy_definition.go @@ -193,7 +193,6 @@ func (data *MeshTopologyPolicyDefinition) updateVersions(ctx context.Context, st // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *MeshTopologyPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("mesh") if data.VpnListId != types.StringNull() { data.VpnListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_mirror_policy_object.go b/internal/provider/model_sdwan_mirror_policy_object.go index 9a8620824..b510f66ad 100644 --- a/internal/provider/model_sdwan_mirror_policy_object.go +++ b/internal/provider/model_sdwan_mirror_policy_object.go @@ -32,7 +32,6 @@ import ( type MirrorPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` RemoteDestinationIp types.String `tfsdk:"remote_destination_ip"` SourceIp types.String `tfsdk:"source_ip"` @@ -112,7 +111,6 @@ func (data *MirrorPolicyObject) hasChanges(ctx context.Context, state *MirrorPol // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *MirrorPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("mirror") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_object_group_policy_definition.go b/internal/provider/model_sdwan_object_group_policy_definition.go index 5fa180607..bbae06db8 100644 --- a/internal/provider/model_sdwan_object_group_policy_definition.go +++ b/internal/provider/model_sdwan_object_group_policy_definition.go @@ -32,7 +32,6 @@ import ( type ObjectGroupPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` DataIpv4PrefixListId types.String `tfsdk:"data_ipv4_prefix_list_id"` @@ -221,7 +220,6 @@ func (data *ObjectGroupPolicyDefinition) updateVersions(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ObjectGroupPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("securityGroup") if data.DataIpv4PrefixListId != types.StringNull() { data.DataIpv4PrefixListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_policer_policy_object.go b/internal/provider/model_sdwan_policer_policy_object.go index 34db94d8e..dda9fa147 100644 --- a/internal/provider/model_sdwan_policer_policy_object.go +++ b/internal/provider/model_sdwan_policer_policy_object.go @@ -33,7 +33,6 @@ import ( type PolicerPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Burst types.Int64 `tfsdk:"burst"` ExceedAction types.String `tfsdk:"exceed_action"` @@ -125,7 +124,6 @@ func (data *PolicerPolicyObject) hasChanges(ctx context.Context, state *PolicerP // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *PolicerPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("policer") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_port_list_policy_object.go b/internal/provider/model_sdwan_port_list_policy_object.go index 5fbed7fe1..b47f75306 100644 --- a/internal/provider/model_sdwan_port_list_policy_object.go +++ b/internal/provider/model_sdwan_port_list_policy_object.go @@ -33,7 +33,6 @@ import ( type PortListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []PortListPolicyObjectEntries `tfsdk:"entries"` } @@ -130,7 +129,6 @@ func (data *PortListPolicyObject) hasChanges(ctx context.Context, state *PortLis // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *PortListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("port") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_preferred_color_group_policy_object.go b/internal/provider/model_sdwan_preferred_color_group_policy_object.go index 9de88be4b..4c01af82b 100644 --- a/internal/provider/model_sdwan_preferred_color_group_policy_object.go +++ b/internal/provider/model_sdwan_preferred_color_group_policy_object.go @@ -32,7 +32,6 @@ import ( type PreferredColorGroupPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` PrimaryColorPreference types.String `tfsdk:"primary_color_preference"` PrimaryPathPreference types.String `tfsdk:"primary_path_preference"` @@ -160,7 +159,6 @@ func (data *PreferredColorGroupPolicyObject) hasChanges(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *PreferredColorGroupPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("preferredColorGroup") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_protocol_list_policy_object.go b/internal/provider/model_sdwan_protocol_list_policy_object.go index 642b51d48..21a8d1704 100644 --- a/internal/provider/model_sdwan_protocol_list_policy_object.go +++ b/internal/provider/model_sdwan_protocol_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ProtocolListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ProtocolListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *ProtocolListPolicyObject) hasChanges(ctx context.Context, state *Pro // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ProtocolListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("protocolname") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_qos_map_policy_definition.go b/internal/provider/model_sdwan_qos_map_policy_definition.go index e508cc1fc..4062bb021 100644 --- a/internal/provider/model_sdwan_qos_map_policy_definition.go +++ b/internal/provider/model_sdwan_qos_map_policy_definition.go @@ -236,7 +236,6 @@ func (data *QoSMapPolicyDefinition) updateVersions(ctx context.Context, state *Q // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *QoSMapPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("qosMap") for i := range data.QosSchedulers { if data.QosSchedulers[i].ClassMapId != types.StringNull() { data.QosSchedulers[i].ClassMapVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_region_list_policy_object.go b/internal/provider/model_sdwan_region_list_policy_object.go index cf960e8f0..29ab66e54 100644 --- a/internal/provider/model_sdwan_region_list_policy_object.go +++ b/internal/provider/model_sdwan_region_list_policy_object.go @@ -32,7 +32,6 @@ import ( type RegionListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []RegionListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *RegionListPolicyObject) hasChanges(ctx context.Context, state *Regio // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *RegionListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("region") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_rewrite_rule_policy_definition.go b/internal/provider/model_sdwan_rewrite_rule_policy_definition.go index 5fc40fbe9..14f7c76b8 100644 --- a/internal/provider/model_sdwan_rewrite_rule_policy_definition.go +++ b/internal/provider/model_sdwan_rewrite_rule_policy_definition.go @@ -200,7 +200,6 @@ func (data *RewriteRulePolicyDefinition) updateVersions(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *RewriteRulePolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("rewriteRule") for i := range data.Rules { if data.Rules[i].ClassMapId != types.StringNull() { data.Rules[i].ClassMapVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_route_policy_definition.go b/internal/provider/model_sdwan_route_policy_definition.go index c7d67ac25..ca3a38620 100644 --- a/internal/provider/model_sdwan_route_policy_definition.go +++ b/internal/provider/model_sdwan_route_policy_definition.go @@ -709,7 +709,6 @@ func (data *RoutePolicyDefinition) updateVersions(ctx context.Context, state *Ro // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *RoutePolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("vedgeRoute") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].PrefixListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_rule_set_policy_definition.go b/internal/provider/model_sdwan_rule_set_policy_definition.go index 15e610d33..a60a1a1fa 100644 --- a/internal/provider/model_sdwan_rule_set_policy_definition.go +++ b/internal/provider/model_sdwan_rule_set_policy_definition.go @@ -33,7 +33,6 @@ import ( type RuleSetPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Rules []RuleSetPolicyDefinitionRules `tfsdk:"rules"` @@ -515,7 +514,6 @@ func (data *RuleSetPolicyDefinition) updateVersions(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *RuleSetPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("ruleSet") for i := range data.Rules { if data.Rules[i].SourceObjectGroupId != types.StringNull() { data.Rules[i].SourceObjectGroupVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_security_policy.go b/internal/provider/model_sdwan_security_policy.go index c1b133574..ceccc15d4 100644 --- a/internal/provider/model_sdwan_security_policy.go +++ b/internal/provider/model_sdwan_security_policy.go @@ -33,7 +33,6 @@ import ( type SecurityPolicy struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - PolicyType types.String `tfsdk:"policy_type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -493,7 +492,6 @@ func (data *SecurityPolicy) updateVersions(ctx context.Context, state *SecurityP // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *SecurityPolicy) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.PolicyType = types.StringValue("feature") for i := range data.Definitions { if data.Definitions[i].Id != types.StringNull() { data.Definitions[i].Version = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_site_list_policy_object.go b/internal/provider/model_sdwan_site_list_policy_object.go index 8580670e0..bd5efbf17 100644 --- a/internal/provider/model_sdwan_site_list_policy_object.go +++ b/internal/provider/model_sdwan_site_list_policy_object.go @@ -32,7 +32,6 @@ import ( type SiteListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []SiteListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *SiteListPolicyObject) hasChanges(ctx context.Context, state *SiteLis // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *SiteListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("site") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_sla_class_policy_object.go b/internal/provider/model_sdwan_sla_class_policy_object.go index dda674011..3da0dd163 100644 --- a/internal/provider/model_sdwan_sla_class_policy_object.go +++ b/internal/provider/model_sdwan_sla_class_policy_object.go @@ -33,7 +33,6 @@ import ( type SLAClassPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` AppProbeClassId types.String `tfsdk:"app_probe_class_id"` AppProbeClassVersion types.Int64 `tfsdk:"app_probe_class_version"` @@ -192,7 +191,6 @@ func (data *SLAClassPolicyObject) updateVersions(ctx context.Context, state *SLA // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *SLAClassPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("sla") if data.AppProbeClassId != types.StringNull() { data.AppProbeClassVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_standard_community_list_policy_object.go b/internal/provider/model_sdwan_standard_community_list_policy_object.go index 9354ef58b..ffb7dec09 100644 --- a/internal/provider/model_sdwan_standard_community_list_policy_object.go +++ b/internal/provider/model_sdwan_standard_community_list_policy_object.go @@ -32,7 +32,6 @@ import ( type StandardCommunityListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []StandardCommunityListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *StandardCommunityListPolicyObject) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *StandardCommunityListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("community") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_tloc_list_policy_object.go b/internal/provider/model_sdwan_tloc_list_policy_object.go index 907f65d3d..26f6c0018 100644 --- a/internal/provider/model_sdwan_tloc_list_policy_object.go +++ b/internal/provider/model_sdwan_tloc_list_policy_object.go @@ -33,7 +33,6 @@ import ( type TLOCListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []TLOCListPolicyObjectEntries `tfsdk:"entries"` } @@ -166,7 +165,6 @@ func (data *TLOCListPolicyObject) hasChanges(ctx context.Context, state *TLOCLis // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *TLOCListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("tloc") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go b/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go index ad866b402..5c351ba59 100644 --- a/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go +++ b/internal/provider/model_sdwan_tls_ssl_decryption_policy_definition.go @@ -33,7 +33,6 @@ import ( type TLSSSLDecryptionPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -508,7 +507,6 @@ func (data *TLSSSLDecryptionPolicyDefinition) updateVersions(ctx context.Context // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *TLSSSLDecryptionPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("sslDecryption") for i := range data.UrlRules { if data.UrlRules[i].TlsSslProfilePolicyId != types.StringNull() { data.UrlRules[i].TlsSslProfilePolicyVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go b/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go index 794cdf292..cc5bf2322 100644 --- a/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go +++ b/internal/provider/model_sdwan_tls_ssl_profile_policy_definition.go @@ -33,7 +33,6 @@ import ( type TLSSSLProfilePolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -240,7 +239,6 @@ func (data *TLSSSLProfilePolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *TLSSSLProfilePolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("sslUtdDecryptProfile") if data.AllowUrlListId != types.StringNull() { data.AllowUrlListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_traffic_data_policy_definition.go b/internal/provider/model_sdwan_traffic_data_policy_definition.go index 7a03f3ff9..58fde7302 100644 --- a/internal/provider/model_sdwan_traffic_data_policy_definition.go +++ b/internal/provider/model_sdwan_traffic_data_policy_definition.go @@ -1215,7 +1215,6 @@ func (data *TrafficDataPolicyDefinition) updateVersions(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *TrafficDataPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("data") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ApplicationListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_url_filtering_policy_definition.go b/internal/provider/model_sdwan_url_filtering_policy_definition.go index 6c24b24be..51a6abcd2 100644 --- a/internal/provider/model_sdwan_url_filtering_policy_definition.go +++ b/internal/provider/model_sdwan_url_filtering_policy_definition.go @@ -33,7 +33,6 @@ import ( type URLFilteringPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -289,7 +288,6 @@ func (data *URLFilteringPolicyDefinition) updateVersions(ctx context.Context, st // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *URLFilteringPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("urlFiltering") if data.AllowUrlListId != types.StringNull() { data.AllowUrlListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_vpn_list_policy_object.go b/internal/provider/model_sdwan_vpn_list_policy_object.go index e386928cb..909663cfd 100644 --- a/internal/provider/model_sdwan_vpn_list_policy_object.go +++ b/internal/provider/model_sdwan_vpn_list_policy_object.go @@ -32,7 +32,6 @@ import ( type VPNListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []VPNListPolicyObjectEntries `tfsdk:"entries"` } @@ -129,7 +128,6 @@ func (data *VPNListPolicyObject) hasChanges(ctx context.Context, state *VPNListP // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *VPNListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("vpn") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_vpn_membership_policy_definition.go b/internal/provider/model_sdwan_vpn_membership_policy_definition.go index 746b8470b..1813b7ed9 100644 --- a/internal/provider/model_sdwan_vpn_membership_policy_definition.go +++ b/internal/provider/model_sdwan_vpn_membership_policy_definition.go @@ -185,7 +185,6 @@ func (data *VPNMembershipPolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *VPNMembershipPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("vpnMembershipGroup") for i := range data.Sites { if data.Sites[i].SiteListId != types.StringNull() { data.Sites[i].SiteListVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go b/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go index d1bd79295..a3128bc6f 100644 --- a/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go +++ b/internal/provider/model_sdwan_zone_based_firewall_policy_definition.go @@ -32,7 +32,6 @@ import ( type ZoneBasedFirewallPolicyDefinition struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` Mode types.String `tfsdk:"mode"` @@ -374,7 +373,6 @@ func (data *ZoneBasedFirewallPolicyDefinition) hasChanges(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ZoneBasedFirewallPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("zoneBasedFW") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_zone_list_policy_object.go b/internal/provider/model_sdwan_zone_list_policy_object.go index 363847dc2..7028541f5 100644 --- a/internal/provider/model_sdwan_zone_list_policy_object.go +++ b/internal/provider/model_sdwan_zone_list_policy_object.go @@ -32,7 +32,6 @@ import ( type ZoneListPolicyObject struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` - Type types.String `tfsdk:"type"` Name types.String `tfsdk:"name"` Entries []ZoneListPolicyObjectEntries `tfsdk:"entries"` } @@ -141,7 +140,6 @@ func (data *ZoneListPolicyObject) hasChanges(ctx context.Context, state *ZoneLis // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ZoneListPolicyObject) processImport(ctx context.Context) { data.Version = types.Int64Value(0) - data.Type = types.StringValue("zone") } // End of section. //template:end processImport From f60326253e2db136165d81feb820f221e100b50c Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Thu, 7 Aug 2025 14:43:21 +0100 Subject: [PATCH 4/8] Set import flag --- gen/templates/generic/resource.go | 2 ++ ...ource_sdwan_advanced_inspection_profile_policy_definition.go | 2 ++ ...ource_sdwan_advanced_malware_protection_policy_definition.go | 2 ++ .../provider/resource_sdwan_allow_url_list_policy_object.go | 2 ++ .../provider/resource_sdwan_app_probe_class_policy_object.go | 2 ++ ...esource_sdwan_application_aware_routing_policy_definition.go | 2 ++ .../provider/resource_sdwan_application_list_policy_object.go | 2 ++ .../resource_sdwan_application_priority_feature_profile.go | 2 ++ internal/provider/resource_sdwan_as_path_list_policy_object.go | 2 ++ .../provider/resource_sdwan_block_url_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_centralized_policy.go | 2 ++ internal/provider/resource_sdwan_cflowd_policy_definition.go | 2 ++ internal/provider/resource_sdwan_class_map_policy_object.go | 2 ++ internal/provider/resource_sdwan_cli_config_feature.go | 2 ++ internal/provider/resource_sdwan_cli_device_template.go | 2 ++ internal/provider/resource_sdwan_cli_feature_profile.go | 2 ++ internal/provider/resource_sdwan_color_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_configuration_group.go | 2 ++ .../resource_sdwan_custom_control_topology_policy_definition.go | 2 ++ .../resource_sdwan_data_fqdn_prefix_list_policy_object.go | 2 ++ .../resource_sdwan_data_ipv4_prefix_list_policy_object.go | 2 ++ .../resource_sdwan_data_ipv6_prefix_list_policy_object.go | 2 ++ .../provider/resource_sdwan_dns_security_feature_profile.go | 2 ++ .../provider/resource_sdwan_dns_security_policy_definition.go | 2 ++ internal/provider/resource_sdwan_domain_list_policy_object.go | 2 ++ .../resource_sdwan_embedded_security_feature_profile.go | 2 ++ .../resource_sdwan_expanded_community_list_policy_object.go | 2 ++ .../resource_sdwan_extended_community_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_feature_device_template.go | 2 ++ .../provider/resource_sdwan_geo_location_list_policy_object.go | 2 ++ .../resource_sdwan_hub_and_spoke_topology_policy_definition.go | 2 ++ .../resource_sdwan_intrusion_prevention_policy_definition.go | 2 ++ .../provider/resource_sdwan_ips_signature_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_ipv4_acl_policy_definition.go | 2 ++ .../resource_sdwan_ipv4_device_acl_policy_definition.go | 2 ++ .../provider/resource_sdwan_ipv4_prefix_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_ipv6_acl_policy_definition.go | 2 ++ .../resource_sdwan_ipv6_device_acl_policy_definition.go | 2 ++ .../provider/resource_sdwan_ipv6_prefix_list_policy_object.go | 2 ++ .../resource_sdwan_local_application_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_localized_policy.go | 2 ++ .../provider/resource_sdwan_mesh_topology_policy_definition.go | 2 ++ internal/provider/resource_sdwan_mirror_policy_object.go | 2 ++ .../provider/resource_sdwan_object_group_policy_definition.go | 2 ++ internal/provider/resource_sdwan_other_feature_profile.go | 2 ++ internal/provider/resource_sdwan_policer_policy_object.go | 2 ++ .../provider/resource_sdwan_policy_object_feature_profile.go | 2 ++ internal/provider/resource_sdwan_port_list_policy_object.go | 2 ++ .../resource_sdwan_preferred_color_group_policy_object.go | 2 ++ internal/provider/resource_sdwan_protocol_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_qos_map_policy_definition.go | 2 ++ internal/provider/resource_sdwan_region_list_policy_object.go | 2 ++ .../provider/resource_sdwan_rewrite_rule_policy_definition.go | 2 ++ internal/provider/resource_sdwan_route_policy_definition.go | 2 ++ internal/provider/resource_sdwan_rule_set_policy_definition.go | 2 ++ internal/provider/resource_sdwan_security_policy.go | 2 ++ internal/provider/resource_sdwan_service_feature_profile.go | 2 ++ ...sdwan_service_lan_vpn_feature_associate_multicast_feature.go | 2 ++ ...wan_service_lan_vpn_feature_associate_routing_bgp_feature.go | 2 ++ ...n_service_lan_vpn_feature_associate_routing_eigrp_feature.go | 2 ++ ...an_service_lan_vpn_feature_associate_routing_ospf_feature.go | 2 ++ ...ice_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go | 2 ++ ...ice_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go | 2 ++ ..._interface_ethernet_feature_associate_dhcp_server_feature.go | 2 ++ ..._vpn_interface_ethernet_feature_associate_tracker_feature.go | 2 ++ ...nterface_ethernet_feature_associate_tracker_group_feature.go | 2 ++ ...vpn_interface_ipsec_feature_associate_dhcp_server_feature.go | 2 ++ ...n_vpn_interface_svi_feature_associate_dhcp_server_feature.go | 2 ++ .../provider/resource_sdwan_sig_security_feature_profile.go | 2 ++ internal/provider/resource_sdwan_site_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_sla_class_policy_object.go | 2 ++ .../resource_sdwan_standard_community_list_policy_object.go | 2 ++ internal/provider/resource_sdwan_system_feature_profile.go | 2 ++ internal/provider/resource_sdwan_tag.go | 2 ++ internal/provider/resource_sdwan_tloc_list_policy_object.go | 2 ++ .../resource_sdwan_tls_ssl_decryption_policy_definition.go | 2 ++ .../resource_sdwan_tls_ssl_profile_policy_definition.go | 2 ++ .../provider/resource_sdwan_traffic_data_policy_definition.go | 2 ++ internal/provider/resource_sdwan_transport_feature_profile.go | 2 ++ ...n_transport_wan_vpn_feature_associate_routing_bgp_feature.go | 2 ++ ..._transport_wan_vpn_feature_associate_routing_ospf_feature.go | 2 ++ ...ort_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go | 2 ++ ...ort_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go | 2 ++ ..._vpn_interface_cellular_feature_associate_tracker_feature.go | 2 ++ ...nterface_cellular_feature_associate_tracker_group_feature.go | 2 ++ ...interface_ethernet_feature_associate_ipv6_tracker_feature.go | 2 ++ ...ace_ethernet_feature_associate_ipv6_tracker_group_feature.go | 2 ++ ..._vpn_interface_ethernet_feature_associate_tracker_feature.go | 2 ++ ...nterface_ethernet_feature_associate_tracker_group_feature.go | 2 ++ ...t_wan_vpn_interface_gre_feature_associate_tracker_feature.go | 2 ++ ...wan_vpn_interface_ipsec_feature_associate_tracker_feature.go | 2 ++ .../provider/resource_sdwan_url_filtering_policy_definition.go | 2 ++ internal/provider/resource_sdwan_vpn_list_policy_object.go | 2 ++ .../provider/resource_sdwan_vpn_membership_policy_definition.go | 2 ++ .../resource_sdwan_zone_based_firewall_policy_definition.go | 2 ++ internal/provider/resource_sdwan_zone_list_policy_object.go | 2 ++ 96 files changed, 192 insertions(+) diff --git a/gen/templates/generic/resource.go b/gen/templates/generic/resource.go index 05f9b9202..edd3043c7 100644 --- a/gen/templates/generic/resource.go +++ b/gen/templates/generic/resource.go @@ -625,6 +625,8 @@ func (r *{{camelCase .Name}}Resource) ImportState(ctx context.Context, req resou {{- else}} resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) {{- end}} + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } {{- end}} // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go b/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go index 201dad352..0a6cae22e 100644 --- a/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go +++ b/internal/provider/resource_sdwan_advanced_inspection_profile_policy_definition.go @@ -287,6 +287,8 @@ func (r *AdvancedInspectionProfilePolicyDefinitionResource) Delete(ctx context.C // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *AdvancedInspectionProfilePolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go b/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go index bfcae8912..fc1f61941 100644 --- a/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go +++ b/internal/provider/resource_sdwan_advanced_malware_protection_policy_definition.go @@ -311,6 +311,8 @@ func (r *AdvancedMalwareProtectionPolicyDefinitionResource) Delete(ctx context.C // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *AdvancedMalwareProtectionPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_allow_url_list_policy_object.go b/internal/provider/resource_sdwan_allow_url_list_policy_object.go index 696594fb2..01eafd2ff 100644 --- a/internal/provider/resource_sdwan_allow_url_list_policy_object.go +++ b/internal/provider/resource_sdwan_allow_url_list_policy_object.go @@ -258,6 +258,8 @@ func (r *AllowURLListPolicyObjectResource) Delete(ctx context.Context, req resou // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *AllowURLListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_app_probe_class_policy_object.go b/internal/provider/resource_sdwan_app_probe_class_policy_object.go index ecb9f1dc7..6345f5d9b 100644 --- a/internal/provider/resource_sdwan_app_probe_class_policy_object.go +++ b/internal/provider/resource_sdwan_app_probe_class_policy_object.go @@ -270,6 +270,8 @@ func (r *AppProbeClassPolicyObjectResource) Delete(ctx context.Context, req reso // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *AppProbeClassPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go b/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go index c30694917..2cf67bde4 100644 --- a/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go +++ b/internal/provider/resource_sdwan_application_aware_routing_policy_definition.go @@ -447,6 +447,8 @@ func (r *ApplicationAwareRoutingPolicyDefinitionResource) Delete(ctx context.Con // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ApplicationAwareRoutingPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_application_list_policy_object.go b/internal/provider/resource_sdwan_application_list_policy_object.go index 835a5766c..86a1c98b2 100644 --- a/internal/provider/resource_sdwan_application_list_policy_object.go +++ b/internal/provider/resource_sdwan_application_list_policy_object.go @@ -262,6 +262,8 @@ func (r *ApplicationListPolicyObjectResource) Delete(ctx context.Context, req re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ApplicationListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_application_priority_feature_profile.go b/internal/provider/resource_sdwan_application_priority_feature_profile.go index e49a9637b..5962b836f 100644 --- a/internal/provider/resource_sdwan_application_priority_feature_profile.go +++ b/internal/provider/resource_sdwan_application_priority_feature_profile.go @@ -231,6 +231,8 @@ func (r *ApplicationPriorityFeatureProfileResource) Delete(ctx context.Context, // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ApplicationPriorityFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_as_path_list_policy_object.go b/internal/provider/resource_sdwan_as_path_list_policy_object.go index ddada1fcb..f9e7e4db3 100644 --- a/internal/provider/resource_sdwan_as_path_list_policy_object.go +++ b/internal/provider/resource_sdwan_as_path_list_policy_object.go @@ -258,6 +258,8 @@ func (r *ASPathListPolicyObjectResource) Delete(ctx context.Context, req resourc // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ASPathListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_block_url_list_policy_object.go b/internal/provider/resource_sdwan_block_url_list_policy_object.go index f47fb903e..bb146ee97 100644 --- a/internal/provider/resource_sdwan_block_url_list_policy_object.go +++ b/internal/provider/resource_sdwan_block_url_list_policy_object.go @@ -258,6 +258,8 @@ func (r *BlockURLListPolicyObjectResource) Delete(ctx context.Context, req resou // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *BlockURLListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_centralized_policy.go b/internal/provider/resource_sdwan_centralized_policy.go index 210272452..2343ab49b 100644 --- a/internal/provider/resource_sdwan_centralized_policy.go +++ b/internal/provider/resource_sdwan_centralized_policy.go @@ -320,6 +320,8 @@ func (r *CentralizedPolicyResource) Delete(ctx context.Context, req resource.Del // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *CentralizedPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_cflowd_policy_definition.go b/internal/provider/resource_sdwan_cflowd_policy_definition.go index e4aa411a8..78b3c90e8 100644 --- a/internal/provider/resource_sdwan_cflowd_policy_definition.go +++ b/internal/provider/resource_sdwan_cflowd_policy_definition.go @@ -351,6 +351,8 @@ func (r *CflowdPolicyDefinitionResource) Delete(ctx context.Context, req resourc // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *CflowdPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_class_map_policy_object.go b/internal/provider/resource_sdwan_class_map_policy_object.go index cda862c86..5accd4f2c 100644 --- a/internal/provider/resource_sdwan_class_map_policy_object.go +++ b/internal/provider/resource_sdwan_class_map_policy_object.go @@ -250,6 +250,8 @@ func (r *ClassMapPolicyObjectResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ClassMapPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_cli_config_feature.go b/internal/provider/resource_sdwan_cli_config_feature.go index 7873c1572..71a0f8dfb 100644 --- a/internal/provider/resource_sdwan_cli_config_feature.go +++ b/internal/provider/resource_sdwan_cli_config_feature.go @@ -262,6 +262,8 @@ func (r *CLIConfigFeatureResource) ImportState(ctx context.Context, req resource resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_cli_device_template.go b/internal/provider/resource_sdwan_cli_device_template.go index bc9b63e2d..6de52779a 100644 --- a/internal/provider/resource_sdwan_cli_device_template.go +++ b/internal/provider/resource_sdwan_cli_device_template.go @@ -262,6 +262,8 @@ func (r *CLIDeviceTemplateResource) Delete(ctx context.Context, req resource.Del // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *CLIDeviceTemplateResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_cli_feature_profile.go b/internal/provider/resource_sdwan_cli_feature_profile.go index 920db1f9b..7b09aa6dd 100644 --- a/internal/provider/resource_sdwan_cli_feature_profile.go +++ b/internal/provider/resource_sdwan_cli_feature_profile.go @@ -231,6 +231,8 @@ func (r *CLIFeatureProfileResource) Delete(ctx context.Context, req resource.Del // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *CLIFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_color_list_policy_object.go b/internal/provider/resource_sdwan_color_list_policy_object.go index a3e84f989..0d6bc773c 100644 --- a/internal/provider/resource_sdwan_color_list_policy_object.go +++ b/internal/provider/resource_sdwan_color_list_policy_object.go @@ -262,6 +262,8 @@ func (r *ColorListPolicyObjectResource) Delete(ctx context.Context, req resource // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ColorListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_configuration_group.go b/internal/provider/resource_sdwan_configuration_group.go index 2548351a7..c73f1d45d 100644 --- a/internal/provider/resource_sdwan_configuration_group.go +++ b/internal/provider/resource_sdwan_configuration_group.go @@ -552,6 +552,8 @@ func (r *ConfigurationGroupResource) Delete(ctx context.Context, req resource.De // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ConfigurationGroupResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go b/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go index ce88371db..e92878753 100644 --- a/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go +++ b/internal/provider/resource_sdwan_custom_control_topology_policy_definition.go @@ -580,6 +580,8 @@ func (r *CustomControlTopologyPolicyDefinitionResource) Delete(ctx context.Conte // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *CustomControlTopologyPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go index fb26e6393..a8f94143d 100644 --- a/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_data_fqdn_prefix_list_policy_object.go @@ -258,6 +258,8 @@ func (r *DataFQDNPrefixListPolicyObjectResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *DataFQDNPrefixListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go index 5a7922f04..9f64380e8 100644 --- a/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_data_ipv4_prefix_list_policy_object.go @@ -258,6 +258,8 @@ func (r *DataIPv4PrefixListPolicyObjectResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *DataIPv4PrefixListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go b/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go index 910ca74dd..01ffb4cf9 100644 --- a/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_data_ipv6_prefix_list_policy_object.go @@ -258,6 +258,8 @@ func (r *DataIPv6PrefixListPolicyObjectResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *DataIPv6PrefixListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_dns_security_feature_profile.go b/internal/provider/resource_sdwan_dns_security_feature_profile.go index 7894dcd0e..aa87ddd1a 100644 --- a/internal/provider/resource_sdwan_dns_security_feature_profile.go +++ b/internal/provider/resource_sdwan_dns_security_feature_profile.go @@ -231,6 +231,8 @@ func (r *DNSSecurityFeatureProfileResource) Delete(ctx context.Context, req reso // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *DNSSecurityFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_dns_security_policy_definition.go b/internal/provider/resource_sdwan_dns_security_policy_definition.go index ab65c791a..d3717dc1d 100644 --- a/internal/provider/resource_sdwan_dns_security_policy_definition.go +++ b/internal/provider/resource_sdwan_dns_security_policy_definition.go @@ -307,6 +307,8 @@ func (r *DNSSecurityPolicyDefinitionResource) Delete(ctx context.Context, req re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *DNSSecurityPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_domain_list_policy_object.go b/internal/provider/resource_sdwan_domain_list_policy_object.go index d99f326a9..451aee225 100644 --- a/internal/provider/resource_sdwan_domain_list_policy_object.go +++ b/internal/provider/resource_sdwan_domain_list_policy_object.go @@ -258,6 +258,8 @@ func (r *DomainListPolicyObjectResource) Delete(ctx context.Context, req resourc // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *DomainListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_embedded_security_feature_profile.go b/internal/provider/resource_sdwan_embedded_security_feature_profile.go index 8266215ba..34a28e914 100644 --- a/internal/provider/resource_sdwan_embedded_security_feature_profile.go +++ b/internal/provider/resource_sdwan_embedded_security_feature_profile.go @@ -231,6 +231,8 @@ func (r *EmbeddedSecurityFeatureProfileResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *EmbeddedSecurityFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_expanded_community_list_policy_object.go b/internal/provider/resource_sdwan_expanded_community_list_policy_object.go index 13345a778..925aab728 100644 --- a/internal/provider/resource_sdwan_expanded_community_list_policy_object.go +++ b/internal/provider/resource_sdwan_expanded_community_list_policy_object.go @@ -258,6 +258,8 @@ func (r *ExpandedCommunityListPolicyObjectResource) Delete(ctx context.Context, // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ExpandedCommunityListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_extended_community_list_policy_object.go b/internal/provider/resource_sdwan_extended_community_list_policy_object.go index 6baef4140..bff58b210 100644 --- a/internal/provider/resource_sdwan_extended_community_list_policy_object.go +++ b/internal/provider/resource_sdwan_extended_community_list_policy_object.go @@ -258,6 +258,8 @@ func (r *ExtendedCommunityListPolicyObjectResource) Delete(ctx context.Context, // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ExtendedCommunityListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_feature_device_template.go b/internal/provider/resource_sdwan_feature_device_template.go index fc9079200..c2a8609b5 100644 --- a/internal/provider/resource_sdwan_feature_device_template.go +++ b/internal/provider/resource_sdwan_feature_device_template.go @@ -334,6 +334,8 @@ func (r *FeatureDeviceTemplateResource) Delete(ctx context.Context, req resource // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *FeatureDeviceTemplateResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_geo_location_list_policy_object.go b/internal/provider/resource_sdwan_geo_location_list_policy_object.go index aab43f308..5a4acc007 100644 --- a/internal/provider/resource_sdwan_geo_location_list_policy_object.go +++ b/internal/provider/resource_sdwan_geo_location_list_policy_object.go @@ -266,6 +266,8 @@ func (r *GeoLocationListPolicyObjectResource) Delete(ctx context.Context, req re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *GeoLocationListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go b/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go index 13202573c..5a3d6df96 100644 --- a/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go +++ b/internal/provider/resource_sdwan_hub_and_spoke_topology_policy_definition.go @@ -331,6 +331,8 @@ func (r *HubAndSpokeTopologyPolicyDefinitionResource) Delete(ctx context.Context // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *HubAndSpokeTopologyPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go b/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go index 380d9e449..958660cb0 100644 --- a/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go +++ b/internal/provider/resource_sdwan_intrusion_prevention_policy_definition.go @@ -308,6 +308,8 @@ func (r *IntrusionPreventionPolicyDefinitionResource) Delete(ctx context.Context // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IntrusionPreventionPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ips_signature_list_policy_object.go b/internal/provider/resource_sdwan_ips_signature_list_policy_object.go index d52a49fbc..6c8a1055c 100644 --- a/internal/provider/resource_sdwan_ips_signature_list_policy_object.go +++ b/internal/provider/resource_sdwan_ips_signature_list_policy_object.go @@ -269,6 +269,8 @@ func (r *IPSSignatureListPolicyObjectResource) Delete(ctx context.Context, req r // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPSSignatureListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go index cee009d2d..55c2c66ce 100644 --- a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go @@ -454,6 +454,8 @@ func (r *IPv4ACLPolicyDefinitionResource) Delete(ctx context.Context, req resour // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPv4ACLPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go index ae4015146..5b2660d7e 100644 --- a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go @@ -359,6 +359,8 @@ func (r *IPv4DeviceACLPolicyDefinitionResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPv4DeviceACLPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go b/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go index 969c414c2..f1d2f69f9 100644 --- a/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_ipv4_prefix_list_policy_object.go @@ -266,6 +266,8 @@ func (r *IPv4PrefixListPolicyObjectResource) Delete(ctx context.Context, req res // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPv4PrefixListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go index 93f3cb7d0..316a741c0 100644 --- a/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv6_acl_policy_definition.go @@ -453,6 +453,8 @@ func (r *IPv6ACLPolicyDefinitionResource) Delete(ctx context.Context, req resour // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPv6ACLPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go index 3458a9013..32854885b 100644 --- a/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv6_device_acl_policy_definition.go @@ -359,6 +359,8 @@ func (r *IPv6DeviceACLPolicyDefinitionResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPv6DeviceACLPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go b/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go index 6b84fa9d4..16ff6b858 100644 --- a/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go +++ b/internal/provider/resource_sdwan_ipv6_prefix_list_policy_object.go @@ -266,6 +266,8 @@ func (r *IPv6PrefixListPolicyObjectResource) Delete(ctx context.Context, req res // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *IPv6PrefixListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_local_application_list_policy_object.go b/internal/provider/resource_sdwan_local_application_list_policy_object.go index a64293ce9..454d9c697 100644 --- a/internal/provider/resource_sdwan_local_application_list_policy_object.go +++ b/internal/provider/resource_sdwan_local_application_list_policy_object.go @@ -262,6 +262,8 @@ func (r *LocalApplicationListPolicyObjectResource) Delete(ctx context.Context, r // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *LocalApplicationListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_localized_policy.go b/internal/provider/resource_sdwan_localized_policy.go index 0d0701e04..2f1a1650e 100644 --- a/internal/provider/resource_sdwan_localized_policy.go +++ b/internal/provider/resource_sdwan_localized_policy.go @@ -338,6 +338,8 @@ func (r *LocalizedPolicyResource) Delete(ctx context.Context, req resource.Delet // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *LocalizedPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_mesh_topology_policy_definition.go b/internal/provider/resource_sdwan_mesh_topology_policy_definition.go index 91fc66ca0..6456bb21d 100644 --- a/internal/provider/resource_sdwan_mesh_topology_policy_definition.go +++ b/internal/provider/resource_sdwan_mesh_topology_policy_definition.go @@ -283,6 +283,8 @@ func (r *MeshTopologyPolicyDefinitionResource) Delete(ctx context.Context, req r // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *MeshTopologyPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_mirror_policy_object.go b/internal/provider/resource_sdwan_mirror_policy_object.go index acb5dce07..9d5b0d44c 100644 --- a/internal/provider/resource_sdwan_mirror_policy_object.go +++ b/internal/provider/resource_sdwan_mirror_policy_object.go @@ -249,6 +249,8 @@ func (r *MirrorPolicyObjectResource) Delete(ctx context.Context, req resource.De // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *MirrorPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_object_group_policy_definition.go b/internal/provider/resource_sdwan_object_group_policy_definition.go index 1ce25a791..96a696f11 100644 --- a/internal/provider/resource_sdwan_object_group_policy_definition.go +++ b/internal/provider/resource_sdwan_object_group_policy_definition.go @@ -297,6 +297,8 @@ func (r *ObjectGroupPolicyDefinitionResource) Delete(ctx context.Context, req re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ObjectGroupPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_other_feature_profile.go b/internal/provider/resource_sdwan_other_feature_profile.go index 6ed75e1b4..5df7fb6fb 100644 --- a/internal/provider/resource_sdwan_other_feature_profile.go +++ b/internal/provider/resource_sdwan_other_feature_profile.go @@ -231,6 +231,8 @@ func (r *OtherFeatureProfileResource) Delete(ctx context.Context, req resource.D // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *OtherFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_policer_policy_object.go b/internal/provider/resource_sdwan_policer_policy_object.go index e8ce09509..fcf89f118 100644 --- a/internal/provider/resource_sdwan_policer_policy_object.go +++ b/internal/provider/resource_sdwan_policer_policy_object.go @@ -265,6 +265,8 @@ func (r *PolicerPolicyObjectResource) Delete(ctx context.Context, req resource.D // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *PolicerPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_policy_object_feature_profile.go b/internal/provider/resource_sdwan_policy_object_feature_profile.go index 94ed2a264..29fc35452 100644 --- a/internal/provider/resource_sdwan_policy_object_feature_profile.go +++ b/internal/provider/resource_sdwan_policy_object_feature_profile.go @@ -233,6 +233,8 @@ func (r *PolicyObjectFeatureProfileResource) Delete(ctx context.Context, req res // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *PolicyObjectFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_port_list_policy_object.go b/internal/provider/resource_sdwan_port_list_policy_object.go index 9ad543cd9..9c974668d 100644 --- a/internal/provider/resource_sdwan_port_list_policy_object.go +++ b/internal/provider/resource_sdwan_port_list_policy_object.go @@ -262,6 +262,8 @@ func (r *PortListPolicyObjectResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *PortListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_preferred_color_group_policy_object.go b/internal/provider/resource_sdwan_preferred_color_group_policy_object.go index dfd216d6e..6f155eb23 100644 --- a/internal/provider/resource_sdwan_preferred_color_group_policy_object.go +++ b/internal/provider/resource_sdwan_preferred_color_group_policy_object.go @@ -276,6 +276,8 @@ func (r *PreferredColorGroupPolicyObjectResource) Delete(ctx context.Context, re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *PreferredColorGroupPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_protocol_list_policy_object.go b/internal/provider/resource_sdwan_protocol_list_policy_object.go index 43451d10f..ff7b32ba6 100644 --- a/internal/provider/resource_sdwan_protocol_list_policy_object.go +++ b/internal/provider/resource_sdwan_protocol_list_policy_object.go @@ -258,6 +258,8 @@ func (r *ProtocolListPolicyObjectResource) Delete(ctx context.Context, req resou // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ProtocolListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_qos_map_policy_definition.go b/internal/provider/resource_sdwan_qos_map_policy_definition.go index 7dcee8c20..49fece918 100644 --- a/internal/provider/resource_sdwan_qos_map_policy_definition.go +++ b/internal/provider/resource_sdwan_qos_map_policy_definition.go @@ -315,6 +315,8 @@ func (r *QoSMapPolicyDefinitionResource) Delete(ctx context.Context, req resourc // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *QoSMapPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_region_list_policy_object.go b/internal/provider/resource_sdwan_region_list_policy_object.go index c302d926e..cc411e636 100644 --- a/internal/provider/resource_sdwan_region_list_policy_object.go +++ b/internal/provider/resource_sdwan_region_list_policy_object.go @@ -258,6 +258,8 @@ func (r *RegionListPolicyObjectResource) Delete(ctx context.Context, req resourc // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *RegionListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go b/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go index 087e463d0..a9d698227 100644 --- a/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go +++ b/internal/provider/resource_sdwan_rewrite_rule_policy_definition.go @@ -294,6 +294,8 @@ func (r *RewriteRulePolicyDefinitionResource) Delete(ctx context.Context, req re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *RewriteRulePolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_route_policy_definition.go b/internal/provider/resource_sdwan_route_policy_definition.go index 12448d17d..f2b738cc4 100644 --- a/internal/provider/resource_sdwan_route_policy_definition.go +++ b/internal/provider/resource_sdwan_route_policy_definition.go @@ -511,6 +511,8 @@ func (r *RoutePolicyDefinitionResource) Delete(ctx context.Context, req resource // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *RoutePolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_rule_set_policy_definition.go b/internal/provider/resource_sdwan_rule_set_policy_definition.go index 65a6c39a8..ba73be846 100644 --- a/internal/provider/resource_sdwan_rule_set_policy_definition.go +++ b/internal/provider/resource_sdwan_rule_set_policy_definition.go @@ -402,6 +402,8 @@ func (r *RuleSetPolicyDefinitionResource) Delete(ctx context.Context, req resour // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *RuleSetPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_security_policy.go b/internal/provider/resource_sdwan_security_policy.go index 0575e68f1..6401c146c 100644 --- a/internal/provider/resource_sdwan_security_policy.go +++ b/internal/provider/resource_sdwan_security_policy.go @@ -401,6 +401,8 @@ func (r *SecurityPolicyResource) Delete(ctx context.Context, req resource.Delete // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *SecurityPolicyResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_feature_profile.go b/internal/provider/resource_sdwan_service_feature_profile.go index a34518d05..8cea90e4e 100644 --- a/internal/provider/resource_sdwan_service_feature_profile.go +++ b/internal/provider/resource_sdwan_service_feature_profile.go @@ -231,6 +231,8 @@ func (r *ServiceFeatureProfileResource) Delete(ctx context.Context, req resource // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ServiceFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go index 7739431bf..6b8872b7f 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_multicast_feature.go @@ -252,6 +252,8 @@ func (r *ServiceLANVPNFeatureAssociateMulticastFeatureResource) ImportState(ctx resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go index 2e39c14f6..27e458efe 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_bgp_feature.go @@ -252,6 +252,8 @@ func (r *ServiceLANVPNFeatureAssociateRoutingBGPFeatureResource) ImportState(ctx resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go index b34de41ea..86c86b0af 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_eigrp_feature.go @@ -252,6 +252,8 @@ func (r *ServiceLANVPNFeatureAssociateRoutingEIGRPFeatureResource) ImportState(c resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go index 2c3549525..460a59cd8 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospf_feature.go @@ -252,6 +252,8 @@ func (r *ServiceLANVPNFeatureAssociateRoutingOSPFFeatureResource) ImportState(ct resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go index 90051f76d..1bca4b691 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go @@ -252,6 +252,8 @@ func (r *ServiceLANVPNFeatureAssociateRoutingOSPFv3IPv4FeatureResource) ImportSt resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go index 816b06c6b..bb87a047a 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go @@ -252,6 +252,8 @@ func (r *ServiceLANVPNFeatureAssociateRoutingOSPFv3IPv6FeatureResource) ImportSt resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go index d39b81413..4e2b063d4 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_dhcp_server_feature.go @@ -257,6 +257,8 @@ func (r *ServiceLANVPNInterfaceEthernetFeatureAssociateDHCPServerFeatureResource resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go index 9675f228b..98a0c8e55 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_feature.go @@ -257,6 +257,8 @@ func (r *ServiceLANVPNInterfaceEthernetFeatureAssociateTrackerFeatureResource) I resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go index f5bbf4ea0..ede2aefaa 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go @@ -257,6 +257,8 @@ func (r *ServiceLANVPNInterfaceEthernetFeatureAssociateTrackerGroupFeatureResour resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go index 306e815d7..687a90c1a 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_ipsec_feature_associate_dhcp_server_feature.go @@ -257,6 +257,8 @@ func (r *ServiceLANVPNInterfaceIPSecFeatureAssociateDHCPServerFeatureResource) I resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_interface_ipsec_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go index 9d7ed0001..6bb1ade50 100644 --- a/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go +++ b/internal/provider/resource_sdwan_service_lan_vpn_interface_svi_feature_associate_dhcp_server_feature.go @@ -257,6 +257,8 @@ func (r *ServiceLANVPNInterfaceSVIFeatureAssociateDHCPServerFeatureResource) Imp resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("service_lan_vpn_interface_svi_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_sig_security_feature_profile.go b/internal/provider/resource_sdwan_sig_security_feature_profile.go index 6cf092834..dcb9b0352 100644 --- a/internal/provider/resource_sdwan_sig_security_feature_profile.go +++ b/internal/provider/resource_sdwan_sig_security_feature_profile.go @@ -231,6 +231,8 @@ func (r *SIGSecurityFeatureProfileResource) Delete(ctx context.Context, req reso // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *SIGSecurityFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_site_list_policy_object.go b/internal/provider/resource_sdwan_site_list_policy_object.go index 81940338c..6bc33fd0b 100644 --- a/internal/provider/resource_sdwan_site_list_policy_object.go +++ b/internal/provider/resource_sdwan_site_list_policy_object.go @@ -258,6 +258,8 @@ func (r *SiteListPolicyObjectResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *SiteListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_sla_class_policy_object.go b/internal/provider/resource_sdwan_sla_class_policy_object.go index d4b37c570..655a276f5 100644 --- a/internal/provider/resource_sdwan_sla_class_policy_object.go +++ b/internal/provider/resource_sdwan_sla_class_policy_object.go @@ -301,6 +301,8 @@ func (r *SLAClassPolicyObjectResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *SLAClassPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_standard_community_list_policy_object.go b/internal/provider/resource_sdwan_standard_community_list_policy_object.go index 8cfedb05d..b25cad7da 100644 --- a/internal/provider/resource_sdwan_standard_community_list_policy_object.go +++ b/internal/provider/resource_sdwan_standard_community_list_policy_object.go @@ -258,6 +258,8 @@ func (r *StandardCommunityListPolicyObjectResource) Delete(ctx context.Context, // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *StandardCommunityListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_system_feature_profile.go b/internal/provider/resource_sdwan_system_feature_profile.go index 55850be27..7d7b1e9f4 100644 --- a/internal/provider/resource_sdwan_system_feature_profile.go +++ b/internal/provider/resource_sdwan_system_feature_profile.go @@ -231,6 +231,8 @@ func (r *SystemFeatureProfileResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *SystemFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_tag.go b/internal/provider/resource_sdwan_tag.go index f28251f54..b448b3b50 100644 --- a/internal/provider/resource_sdwan_tag.go +++ b/internal/provider/resource_sdwan_tag.go @@ -287,6 +287,8 @@ func (r *TagResource) Delete(ctx context.Context, req resource.DeleteRequest, re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *TagResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_tloc_list_policy_object.go b/internal/provider/resource_sdwan_tloc_list_policy_object.go index 0f56773d5..beae2d726 100644 --- a/internal/provider/resource_sdwan_tloc_list_policy_object.go +++ b/internal/provider/resource_sdwan_tloc_list_policy_object.go @@ -281,6 +281,8 @@ func (r *TLOCListPolicyObjectResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *TLOCListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go b/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go index 9285f0b61..50ed3d141 100644 --- a/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go +++ b/internal/provider/resource_sdwan_tls_ssl_decryption_policy_definition.go @@ -415,6 +415,8 @@ func (r *TLSSSLDecryptionPolicyDefinitionResource) Delete(ctx context.Context, r // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *TLSSSLDecryptionPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go b/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go index 37bce9caf..eff1d3373 100644 --- a/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go +++ b/internal/provider/resource_sdwan_tls_ssl_profile_policy_definition.go @@ -301,6 +301,8 @@ func (r *TLSSSLProfilePolicyDefinitionResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *TLSSSLProfilePolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_traffic_data_policy_definition.go b/internal/provider/resource_sdwan_traffic_data_policy_definition.go index 5ba9841ea..af402f46e 100644 --- a/internal/provider/resource_sdwan_traffic_data_policy_definition.go +++ b/internal/provider/resource_sdwan_traffic_data_policy_definition.go @@ -684,6 +684,8 @@ func (r *TrafficDataPolicyDefinitionResource) Delete(ctx context.Context, req re // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *TrafficDataPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_feature_profile.go b/internal/provider/resource_sdwan_transport_feature_profile.go index ddca0bd82..ae572b824 100644 --- a/internal/provider/resource_sdwan_transport_feature_profile.go +++ b/internal/provider/resource_sdwan_transport_feature_profile.go @@ -231,6 +231,8 @@ func (r *TransportFeatureProfileResource) Delete(ctx context.Context, req resour // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *TransportFeatureProfileResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go index 324ef337e..968ddc4ef 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_bgp_feature.go @@ -252,6 +252,8 @@ func (r *TransportWANVPNFeatureAssociateRoutingBGPFeatureResource) ImportState(c resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go index cdbefb943..5dc46f5ca 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospf_feature.go @@ -252,6 +252,8 @@ func (r *TransportWANVPNFeatureAssociateRoutingOSPFFeatureResource) ImportState( resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go index 6ec8e66e7..48ca35e6d 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv4_feature.go @@ -252,6 +252,8 @@ func (r *TransportWANVPNFeatureAssociateRoutingOSPFv3IPv4FeatureResource) Import resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go index d1ee85643..dfec88d00 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_feature_associate_routing_ospfv3_ipv6_feature.go @@ -252,6 +252,8 @@ func (r *TransportWANVPNFeatureAssociateRoutingOSPFv3IPv6FeatureResource) Import resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[0])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go index b2d13dfc8..181bfde50 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceCellularFeatureAssociateTrackerFeatureResource) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_cellular_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go index 2b24ba6d0..34b659556 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_cellular_feature_associate_tracker_group_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceCellularFeatureAssociateTrackerGroupFeatureReso resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_cellular_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go index c356690c0..465eda60f 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateIPv6TrackerFeatureResou resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go index ce0ba58c8..8221d0af5 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_ipv6_tracker_group_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateIPv6TrackerGroupFeature resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go index 10ddf3d87..b8c54a967 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateTrackerFeatureResource) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go index cf0e7367e..ba72a3402 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ethernet_feature_associate_tracker_group_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceEthernetFeatureAssociateTrackerGroupFeatureReso resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_ethernet_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go index 48f32b7ff..10a4e1310 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_gre_feature_associate_tracker_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceGREFeatureAssociateTrackerFeatureResource) Impo resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_gre_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go index 9219cfb8e..f950be0be 100644 --- a/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go +++ b/internal/provider/resource_sdwan_transport_wan_vpn_interface_ipsec_feature_associate_tracker_feature.go @@ -257,6 +257,8 @@ func (r *TransportWANVPNInterfaceIPSECFeatureAssociateTrackerFeatureResource) Im resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("feature_profile_id"), parts[1])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_feature_id"), parts[2])...) resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("transport_wan_vpn_interface_ipsec_feature_id"), parts[3])...) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_url_filtering_policy_definition.go b/internal/provider/resource_sdwan_url_filtering_policy_definition.go index 3a21c65a1..8e9c84a00 100644 --- a/internal/provider/resource_sdwan_url_filtering_policy_definition.go +++ b/internal/provider/resource_sdwan_url_filtering_policy_definition.go @@ -327,6 +327,8 @@ func (r *URLFilteringPolicyDefinitionResource) Delete(ctx context.Context, req r // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *URLFilteringPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_vpn_list_policy_object.go b/internal/provider/resource_sdwan_vpn_list_policy_object.go index 41a4b6f88..14aa835a7 100644 --- a/internal/provider/resource_sdwan_vpn_list_policy_object.go +++ b/internal/provider/resource_sdwan_vpn_list_policy_object.go @@ -258,6 +258,8 @@ func (r *VPNListPolicyObjectResource) Delete(ctx context.Context, req resource.D // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *VPNListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_vpn_membership_policy_definition.go b/internal/provider/resource_sdwan_vpn_membership_policy_definition.go index 092302b08..5f9475f54 100644 --- a/internal/provider/resource_sdwan_vpn_membership_policy_definition.go +++ b/internal/provider/resource_sdwan_vpn_membership_policy_definition.go @@ -279,6 +279,8 @@ func (r *VPNMembershipPolicyDefinitionResource) Delete(ctx context.Context, req // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *VPNMembershipPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go index b3e32f0af..419fe83a4 100644 --- a/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go +++ b/internal/provider/resource_sdwan_zone_based_firewall_policy_definition.go @@ -357,6 +357,8 @@ func (r *ZoneBasedFirewallPolicyDefinitionResource) Delete(ctx context.Context, // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ZoneBasedFirewallPolicyDefinitionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import diff --git a/internal/provider/resource_sdwan_zone_list_policy_object.go b/internal/provider/resource_sdwan_zone_list_policy_object.go index 9a9ebb41c..40461dab7 100644 --- a/internal/provider/resource_sdwan_zone_list_policy_object.go +++ b/internal/provider/resource_sdwan_zone_list_policy_object.go @@ -262,6 +262,8 @@ func (r *ZoneListPolicyObjectResource) Delete(ctx context.Context, req resource. // Section below is generated&owned by "gen/generator.go". //template:begin import func (r *ZoneListPolicyObjectResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) + + helpers.SetFlagImporting(ctx, true, resp.Private, &resp.Diagnostics) } // End of section. //template:end import From 4f935993f2492a82b71f31d3dc799661988feb1f Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Thu, 7 Aug 2025 15:34:31 +0100 Subject: [PATCH 5/8] Add missing type imports --- gen/templates/generic/model.go | 3 +++ .../model_sdwan_application_aware_routing_policy_definition.go | 1 + internal/provider/model_sdwan_cflowd_policy_definition.go | 1 + .../model_sdwan_custom_control_topology_policy_definition.go | 1 + .../model_sdwan_hub_and_spoke_topology_policy_definition.go | 1 + internal/provider/model_sdwan_ipv4_acl_policy_definition.go | 1 + .../provider/model_sdwan_ipv4_device_acl_policy_definition.go | 1 + internal/provider/model_sdwan_ipv6_acl_policy_definition.go | 1 + .../provider/model_sdwan_ipv6_device_acl_policy_definition.go | 1 + .../provider/model_sdwan_mesh_topology_policy_definition.go | 1 + internal/provider/model_sdwan_qos_map_policy_definition.go | 1 + .../provider/model_sdwan_rewrite_rule_policy_definition.go | 1 + internal/provider/model_sdwan_route_policy_definition.go | 1 + .../provider/model_sdwan_traffic_data_policy_definition.go | 1 + .../provider/model_sdwan_vpn_membership_policy_definition.go | 1 + 15 files changed, 17 insertions(+) diff --git a/gen/templates/generic/model.go b/gen/templates/generic/model.go index b514f0afd..8a88574fd 100644 --- a/gen/templates/generic/model.go +++ b/gen/templates/generic/model.go @@ -683,6 +683,9 @@ func (data *{{camelCase .Name}}) processImport(ctx context.Context) { {{- if .HasVersion}} data.Version = types.Int64Value(0) {{- end}} + {{- if .TypeValue}} + data.Type = types.StringValue("{{ .TypeValue }}") + {{- end}} {{- range .Attributes}} {{- $name := toGoName .TfName}} {{- if not .Value}} diff --git a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go index 5a46c1a0d..47781d087 100644 --- a/internal/provider/model_sdwan_application_aware_routing_policy_definition.go +++ b/internal/provider/model_sdwan_application_aware_routing_policy_definition.go @@ -654,6 +654,7 @@ func (data *ApplicationAwareRoutingPolicyDefinition) updateVersions(ctx context. // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *ApplicationAwareRoutingPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("appRoute") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ApplicationListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_cflowd_policy_definition.go b/internal/provider/model_sdwan_cflowd_policy_definition.go index 72838dc25..363dcc15e 100644 --- a/internal/provider/model_sdwan_cflowd_policy_definition.go +++ b/internal/provider/model_sdwan_cflowd_policy_definition.go @@ -334,6 +334,7 @@ func (data *CflowdPolicyDefinition) hasChanges(ctx context.Context, state *Cflow // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *CflowdPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("cflowd") } // End of section. //template:end processImport diff --git a/internal/provider/model_sdwan_custom_control_topology_policy_definition.go b/internal/provider/model_sdwan_custom_control_topology_policy_definition.go index c301ec407..eb49ee628 100644 --- a/internal/provider/model_sdwan_custom_control_topology_policy_definition.go +++ b/internal/provider/model_sdwan_custom_control_topology_policy_definition.go @@ -882,6 +882,7 @@ func (data *CustomControlTopologyPolicyDefinition) updateVersions(ctx context.Co // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *CustomControlTopologyPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("control") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ColorListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go b/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go index 657dea04f..1bab42c2c 100644 --- a/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go +++ b/internal/provider/model_sdwan_hub_and_spoke_topology_policy_definition.go @@ -385,6 +385,7 @@ func (data *HubAndSpokeTopologyPolicyDefinition) updateVersions(ctx context.Cont // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *HubAndSpokeTopologyPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("hubAndSpoke") if data.VpnListId != types.StringNull() { data.VpnListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go index 0701879c2..c9fb5ebb4 100644 --- a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go @@ -625,6 +625,7 @@ func (data *IPv4ACLPolicyDefinition) updateVersions(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv4ACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("acl") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ClassMapId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go index 300c59cd1..c4706accf 100644 --- a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go @@ -387,6 +387,7 @@ func (data *IPv4DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv4DeviceACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("deviceAccessPolicy") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv6_acl_policy_definition.go b/internal/provider/model_sdwan_ipv6_acl_policy_definition.go index 4c6b4ece3..0bb32898b 100644 --- a/internal/provider/model_sdwan_ipv6_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv6_acl_policy_definition.go @@ -616,6 +616,7 @@ func (data *IPv6ACLPolicyDefinition) updateVersions(ctx context.Context, state * // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv6ACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("aclv6") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ClassMapId != types.StringNull() { diff --git a/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go index 87b354cc3..f7b657980 100644 --- a/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv6_device_acl_policy_definition.go @@ -390,6 +390,7 @@ func (data *IPv6DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *IPv6DeviceACLPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("deviceAccessPolicyv6") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].SourceDataIpv6PrefixListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_mesh_topology_policy_definition.go b/internal/provider/model_sdwan_mesh_topology_policy_definition.go index 1817653e1..ea468407a 100644 --- a/internal/provider/model_sdwan_mesh_topology_policy_definition.go +++ b/internal/provider/model_sdwan_mesh_topology_policy_definition.go @@ -193,6 +193,7 @@ func (data *MeshTopologyPolicyDefinition) updateVersions(ctx context.Context, st // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *MeshTopologyPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("mesh") if data.VpnListId != types.StringNull() { data.VpnListVersion = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_qos_map_policy_definition.go b/internal/provider/model_sdwan_qos_map_policy_definition.go index 4062bb021..e508cc1fc 100644 --- a/internal/provider/model_sdwan_qos_map_policy_definition.go +++ b/internal/provider/model_sdwan_qos_map_policy_definition.go @@ -236,6 +236,7 @@ func (data *QoSMapPolicyDefinition) updateVersions(ctx context.Context, state *Q // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *QoSMapPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("qosMap") for i := range data.QosSchedulers { if data.QosSchedulers[i].ClassMapId != types.StringNull() { data.QosSchedulers[i].ClassMapVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_rewrite_rule_policy_definition.go b/internal/provider/model_sdwan_rewrite_rule_policy_definition.go index 14f7c76b8..5fc40fbe9 100644 --- a/internal/provider/model_sdwan_rewrite_rule_policy_definition.go +++ b/internal/provider/model_sdwan_rewrite_rule_policy_definition.go @@ -200,6 +200,7 @@ func (data *RewriteRulePolicyDefinition) updateVersions(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *RewriteRulePolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("rewriteRule") for i := range data.Rules { if data.Rules[i].ClassMapId != types.StringNull() { data.Rules[i].ClassMapVersion = types.Int64Value(0) diff --git a/internal/provider/model_sdwan_route_policy_definition.go b/internal/provider/model_sdwan_route_policy_definition.go index ca3a38620..c7d67ac25 100644 --- a/internal/provider/model_sdwan_route_policy_definition.go +++ b/internal/provider/model_sdwan_route_policy_definition.go @@ -709,6 +709,7 @@ func (data *RoutePolicyDefinition) updateVersions(ctx context.Context, state *Ro // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *RoutePolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("vedgeRoute") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].PrefixListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_traffic_data_policy_definition.go b/internal/provider/model_sdwan_traffic_data_policy_definition.go index 58fde7302..7a03f3ff9 100644 --- a/internal/provider/model_sdwan_traffic_data_policy_definition.go +++ b/internal/provider/model_sdwan_traffic_data_policy_definition.go @@ -1215,6 +1215,7 @@ func (data *TrafficDataPolicyDefinition) updateVersions(ctx context.Context, sta // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *TrafficDataPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("data") for i := range data.Sequences { for ii := range data.Sequences[i].MatchEntries { if data.Sequences[i].MatchEntries[ii].ApplicationListId != types.StringNull() { diff --git a/internal/provider/model_sdwan_vpn_membership_policy_definition.go b/internal/provider/model_sdwan_vpn_membership_policy_definition.go index 1813b7ed9..746b8470b 100644 --- a/internal/provider/model_sdwan_vpn_membership_policy_definition.go +++ b/internal/provider/model_sdwan_vpn_membership_policy_definition.go @@ -185,6 +185,7 @@ func (data *VPNMembershipPolicyDefinition) updateVersions(ctx context.Context, s // Section below is generated&owned by "gen/generator.go". //template:begin processImport func (data *VPNMembershipPolicyDefinition) processImport(ctx context.Context) { data.Version = types.Int64Value(0) + data.Type = types.StringValue("vpnMembershipGroup") for i := range data.Sites { if data.Sites[i].SiteListId != types.StringNull() { data.Sites[i].SiteListVersion = types.Int64Value(0) From f1aae8cb163961145917460fc99d2dbba776fd16 Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Thu, 7 Aug 2025 16:47:53 +0100 Subject: [PATCH 6/8] Refactor import logic --- gen/generator.go | 13 ++++--------- gen/templates/generic/resource.go | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gen/generator.go b/gen/generator.go index d9f3e0967..29ee4571d 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -404,14 +404,9 @@ func HasReference(attributes []YamlConfigAttribute) bool { return false } -// Templating helper function to return true if reference included in attributes -func HasStaticValue(attributes []YamlConfigAttribute) bool { - for _, attr := range attributes { - if attr.Value != "" { - return true - } - } - return false +// Templating helper function to return true if UX 2.0 related feature +func IsUx20Feature(config YamlConfig) bool { + return !strings.HasPrefix(config.DocCategory, "(Classic)") } // Templating helper function to return number of reference included in attributes @@ -575,11 +570,11 @@ var functions = template.FuncMap{ "hasVersionAttribute": HasVersionAttribute, "getResponseModelPath": GetResponseModelPath, "hasReference": HasReference, - "hasStaticValue": HasStaticValue, "countReferences": CountReferences, "add": Add, "getGjsonType": GetGjsonType, "getId": GetId, + "isUx20Feature": IsUx20Feature, "isListSet": IsListSet, "isList": IsList, "isSet": IsSet, diff --git a/gen/templates/generic/resource.go b/gen/templates/generic/resource.go index edd3043c7..34ade1f6d 100644 --- a/gen/templates/generic/resource.go +++ b/gen/templates/generic/resource.go @@ -498,7 +498,7 @@ func (r *{{camelCase .Name}}Resource) Read(ctx context.Context, req resource.Rea state.fromBody(ctx, res) - {{- if and (not .NoImport) (or (hasVersionAttribute .Attributes) (hasStaticValue .Attributes))}} + {{- if and (not .NoImport) (not (isUx20Feature .)) (or (.HasVersion) (.TypeValue) (hasVersionAttribute .Attributes))}} imp, diags := helpers.IsFlagImporting(ctx, req) if resp.Diagnostics.Append(diags...); resp.Diagnostics.HasError() { return From 6fd484c86ec743e2e2f78fa60aea5c94292d13b4 Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Thu, 7 Aug 2025 21:25:44 +0100 Subject: [PATCH 7/8] Fix indentation --- gen/templates/generic/model.go | 130 ++++++++++++++++----------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/gen/templates/generic/model.go b/gen/templates/generic/model.go index 8a88574fd..54b1a83c1 100644 --- a/gen/templates/generic/model.go +++ b/gen/templates/generic/model.go @@ -686,73 +686,73 @@ func (data *{{camelCase .Name}}) processImport(ctx context.Context) { {{- if .TypeValue}} data.Type = types.StringValue("{{ .TypeValue }}") {{- end}} - {{- range .Attributes}} - {{- $name := toGoName .TfName}} - {{- if not .Value}} - {{- if .Value}} - data.{{toGoName .TfName}} = {{if eq .Type "String"}}types.StringValue("{{ .Value }}"){{else if eq .Type "Bool"}}types.BoolValue({{ .Value }}){{else if eq .Type "List"}}{{ .Value }}{{else}}types.ListNull({{ .Value }}){{end}} - {{- end}} - {{- if eq .Type "Version"}} - if data.{{toVersionName .TfName}} != types.StringNull() { - data.{{toGoName .TfName}} = types.Int64Value(0) - } - {{- else if eq .Type "Versions"}} - if !data.{{toVersionName .TfName}}.IsNull() { - data.{{toGoName .TfName}} = types.ListNull(types.StringType) - } - {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} - for i := range data.{{toGoName .TfName}} { + {{- range .Attributes}} + {{- $name := toGoName .TfName}} + {{- if not .Value}} + {{- if .Value}} + data.{{toGoName .TfName}} = {{if eq .Type "String"}}types.StringValue("{{ .Value }}"){{else if eq .Type "Bool"}}types.BoolValue({{ .Value }}){{else if eq .Type "List"}}{{ .Value }}{{else}}types.ListNull({{ .Value }}){{end}} + {{- end}} + {{- if eq .Type "Version"}} + if data.{{toVersionName .TfName}} != types.StringNull() { + data.{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{toVersionName .TfName}}.IsNull() { + data.{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} + for i := range data.{{toGoName .TfName}} { - {{- range .Attributes}} - {{- $cname := toGoName .TfName}} - {{- if not .Value}} - {{- if eq .Type "Version"}} - if data.{{$name}}[i].{{toVersionName .TfName}} != types.StringNull() { - data.{{$name}}[i].{{toGoName .TfName}} = types.Int64Value(0) - } - {{- else if eq .Type "Versions"}} - if !data.{{$name}}[i].{{toVersionName .TfName}}.IsNull() { - data.{{$name}}[i].{{toGoName .TfName}} = types.ListNull(types.StringType) - } - {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} - for ii := range data.{{$name}}[i].{{toGoName .TfName}} { + {{- range .Attributes}} + {{- $cname := toGoName .TfName}} + {{- if not .Value}} + {{- if eq .Type "Version"}} + if data.{{$name}}[i].{{toVersionName .TfName}} != types.StringNull() { + data.{{$name}}[i].{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{$name}}[i].{{toVersionName .TfName}}.IsNull() { + data.{{$name}}[i].{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} + for ii := range data.{{$name}}[i].{{toGoName .TfName}} { - {{- range .Attributes}} - {{- $ccname := toGoName .TfName}} - {{- if not .Value}} - {{- if eq .Type "Version"}} - if data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}} != types.StringNull() { - data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.Int64Value(0) - } - {{- else if eq .Type "Versions"}} - if !data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}}.IsNull() { - data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.ListNull(types.StringType) - } - {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} - for iii := range data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} { + {{- range .Attributes}} + {{- $ccname := toGoName .TfName}} + {{- if not .Value}} + {{- if eq .Type "Version"}} + if data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}} != types.StringNull() { + data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{$name}}[i].{{$cname}}[ii].{{toVersionName .TfName}}.IsNull() { + data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- else if and (isNestedListSet .) (hasVersionAttribute .Attributes)}} + for iii := range data.{{$name}}[i].{{$cname}}[ii].{{toGoName .TfName}} { - {{- range .Attributes}} - {{- if eq .Type "Version"}} - if data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toVersionName .TfName}} != types.StringNull() { - data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toGoName .TfName}} = types.Int64Value(0) - } - {{- else if eq .Type "Versions"}} - if !data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toVersionName .TfName}}.IsNull() { - data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toGoName .TfName}} = types.ListNull(types.StringType) - } - {{- end}} - {{- end}} - } - {{- end}} - {{- end}} - {{- end}} - } - {{- end}} - {{- end}} - {{- end}} - } - {{- end}} - {{- end}} - {{- end}} + {{- range .Attributes}} + {{- if eq .Type "Version"}} + if data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toVersionName .TfName}} != types.StringNull() { + data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toGoName .TfName}} = types.Int64Value(0) + } + {{- else if eq .Type "Versions"}} + if !data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toVersionName .TfName}}.IsNull() { + data.{{$name}}[i].{{$cname}}[ii].{{$ccname}}[iii].{{toGoName .TfName}} = types.ListNull(types.StringType) + } + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + {{- end}} + } + {{- end}} + {{- end}} + {{- end}} } // End of section. //template:end processImport \ No newline at end of file From 7918d60715089bee5dc1f6b442c796853238bf5f Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Thu, 7 Aug 2025 21:29:44 +0100 Subject: [PATCH 8/8] Update changelog --- docs/guides/changelog.md | 20 ++++++++++---------- templates/guides/changelog.md.tmpl | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 47259fdb6..9f855d3bc 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -1,12 +1,12 @@ ---- -subcategory: "Guides" -page_title: "Changelog" -description: |- - Changelog ---- - -# Changelog - +--- +subcategory: "Guides" +page_title: "Changelog" +description: |- + Changelog +--- + +# Changelog + ## 0.6.3 (unreleased) - BREAKING CHANGE: Rename `tls_ssl_profile_version` attribute of `sdwan_tls_ssl_decryption_policy_definition` resource to `tls_ssl_profile_policy_version` @@ -455,4 +455,4 @@ description: |- ## 0.1.0 (July 23, 2021) - Initial Release - + diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 47259fdb6..9f855d3bc 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -1,12 +1,12 @@ ---- -subcategory: "Guides" -page_title: "Changelog" -description: |- - Changelog ---- - -# Changelog - +--- +subcategory: "Guides" +page_title: "Changelog" +description: |- + Changelog +--- + +# Changelog + ## 0.6.3 (unreleased) - BREAKING CHANGE: Rename `tls_ssl_profile_version` attribute of `sdwan_tls_ssl_decryption_policy_definition` resource to `tls_ssl_profile_policy_version` @@ -455,4 +455,4 @@ description: |- ## 0.1.0 (July 23, 2021) - Initial Release - +