From 5b619086ed6973701fbb5b75199a7292fbe796d8 Mon Sep 17 00:00:00 2001 From: bwjuniper Date: Mon, 21 Oct 2024 14:19:38 -0700 Subject: [PATCH 1/4] rename dir apstra_validator to validator & dir apstra_plan_modifier to plan_modifier --- apstra/blueprint/blueprint.go | 4 ++-- .../primitives/bgp_peering_generic_sytem.go | 2 +- .../primitives/bgp_peering_ip_endpoint.go | 2 +- .../connectivity_templates/primitives/dynamic_bgp_peering.go | 2 +- apstra/blueprint/connectivity_templates/primitives/ip_link.go | 2 +- apstra/blueprint/datacenter_property_set.go | 2 +- apstra/blueprint/datacenter_routing_policy.go | 2 +- apstra/blueprint/datacenter_routing_zone.go | 2 +- apstra/blueprint/datacenter_security_policy_rule.go | 2 +- apstra/blueprint/datacenter_virtual_network.go | 2 +- apstra/blueprint/ip_link_addressing.go | 2 +- apstra/blueprint/nodes_system.go | 2 +- apstra/blueprint/prefix_filter.go | 2 +- apstra/blueprint/rack.go | 2 +- apstra/connectivity_template/bgp_peering_generic_system.go | 2 +- apstra/connectivity_template/bgp_peering_ip_endpoint.go | 2 +- apstra/connectivity_template/custom_static_route.go | 2 +- apstra/connectivity_template/dynamic_bgp_peering.go | 2 +- apstra/connectivity_template/ip_link.go | 2 +- apstra/connectivity_template/static_route.go | 2 +- apstra/connectivity_template/vn_multiple.go | 2 +- apstra/data_source_datacenter_external_gateways.go | 2 +- apstra/data_source_datacenter_routing_policies.go | 2 +- apstra/data_source_datacenter_routing_zones.go | 2 +- apstra/data_source_datacenter_security_policies.go | 2 +- apstra/data_source_datacenter_virtual_networks.go | 2 +- apstra/design/logical_device_panel_port_group.go | 2 +- apstra/design/property_set.go | 2 +- apstra/design/rack_type_esi_lag_info.go | 2 +- apstra/design/rack_type_leaf_switch.go | 2 +- apstra/design/rack_type_mlag_info.go | 2 +- apstra/design/spine_switch.go | 2 +- apstra/design/template_collapsed.go | 2 +- apstra/design/template_pod_based.go | 2 +- apstra/design/template_rack_based.go | 2 +- apstra/freeform/resource.go | 2 +- apstra/freeform/resource_generator.go | 2 +- apstra/freeform/system.go | 2 +- .../bool_requires_replace_when_switching_to.go | 0 .../use_null_state_for_unknown.go | 0 apstra/resources/asn_pool.go | 2 +- apstra/resources/asn_pool_range.go | 2 +- apstra/resources/integer_pool.go | 2 +- apstra/resources/integer_pool_range.go | 2 +- apstra/resources/ipv4_pool.go | 2 +- apstra/resources/ipv4_pool_subnet.go | 4 ++-- apstra/resources/ipv6_pool.go | 2 +- apstra/resources/ipv6_pool_subnet.go | 4 ++-- apstra/resources/vni_pool.go | 2 +- apstra/resources/vni_pool_range.go | 2 +- apstra/system_agents/managed_device.go | 2 +- apstra/{apstra_validator => validator}/also_requires_n_of.go | 0 apstra/{apstra_validator => validator}/at_least_product_of.go | 0 apstra/{apstra_validator => validator}/at_most_n_of.go | 0 apstra/{apstra_validator => validator}/attribute_conflict.go | 0 .../attribute_conflict_test.go | 0 apstra/{apstra_validator => validator}/constants.go | 0 apstra/{apstra_validator => validator}/different_from.go | 2 +- .../{apstra_validator => validator}/different_from_values.go | 2 +- .../exactly_one_binding_when_vn_type_vlan.go | 0 apstra/{apstra_validator => validator}/falls_within_cidr.go | 0 .../forbidden_when_value_is.go | 2 +- .../forbidden_when_value_is_test.go | 2 +- .../leaf_switch_redundancy_mode.go | 0 apstra/{apstra_validator => validator}/must_be_even_or_odd.go | 0 apstra/{apstra_validator => validator}/must_be_one_of.go | 0 apstra/{apstra_validator => validator}/must_be_one_of_test.go | 2 +- .../{apstra_validator => validator}/must_be_when_value_at.go | 0 .../{apstra_validator => validator}/object_must_have_n_of.go | 0 .../object_must_have_n_of_test.go | 0 apstra/{apstra_validator => validator}/parse_cidr.go | 0 apstra/{apstra_validator => validator}/parse_ip.go | 0 apstra/{apstra_validator => validator}/parse_ip_or_cidr.go | 0 apstra/{apstra_validator => validator}/parse_json.go | 0 apstra/{apstra_validator => validator}/parse_rt.go | 0 apstra/{apstra_validator => validator}/parse_rt_test.go | 0 apstra/{apstra_validator => validator}/parse_speed.go | 0 apstra/{apstra_validator => validator}/rack_fcd_must_be.go | 0 .../rack_fcd_must_be_when_null.go | 0 .../rack_fcd_must_be_when_value.go | 0 .../{apstra_validator => validator}/required_when_value_is.go | 2 +- .../required_when_value_null.go | 2 +- apstra/{apstra_validator => validator}/value_at_must_be.go | 0 apstra/{apstra_validator => validator}/when_value_is.go | 0 apstra/{apstra_validator => validator}/when_value_set.go | 0 85 files changed, 59 insertions(+), 59 deletions(-) rename apstra/{apstra_plan_modifier => plan_modifier}/bool_requires_replace_when_switching_to.go (100%) rename apstra/{apstra_plan_modifier => plan_modifier}/use_null_state_for_unknown.go (100%) rename apstra/{apstra_validator => validator}/also_requires_n_of.go (100%) rename apstra/{apstra_validator => validator}/at_least_product_of.go (100%) rename apstra/{apstra_validator => validator}/at_most_n_of.go (100%) rename apstra/{apstra_validator => validator}/attribute_conflict.go (100%) rename apstra/{apstra_validator => validator}/attribute_conflict_test.go (100%) rename apstra/{apstra_validator => validator}/constants.go (100%) rename apstra/{apstra_validator => validator}/different_from.go (98%) rename apstra/{apstra_validator => validator}/different_from_values.go (99%) rename apstra/{apstra_validator => validator}/exactly_one_binding_when_vn_type_vlan.go (100%) rename apstra/{apstra_validator => validator}/falls_within_cidr.go (100%) rename apstra/{apstra_validator => validator}/forbidden_when_value_is.go (98%) rename apstra/{apstra_validator => validator}/forbidden_when_value_is_test.go (99%) rename apstra/{apstra_validator => validator}/leaf_switch_redundancy_mode.go (100%) rename apstra/{apstra_validator => validator}/must_be_even_or_odd.go (100%) rename apstra/{apstra_validator => validator}/must_be_one_of.go (100%) rename apstra/{apstra_validator => validator}/must_be_one_of_test.go (99%) rename apstra/{apstra_validator => validator}/must_be_when_value_at.go (100%) rename apstra/{apstra_validator => validator}/object_must_have_n_of.go (100%) rename apstra/{apstra_validator => validator}/object_must_have_n_of_test.go (100%) rename apstra/{apstra_validator => validator}/parse_cidr.go (100%) rename apstra/{apstra_validator => validator}/parse_ip.go (100%) rename apstra/{apstra_validator => validator}/parse_ip_or_cidr.go (100%) rename apstra/{apstra_validator => validator}/parse_json.go (100%) rename apstra/{apstra_validator => validator}/parse_rt.go (100%) rename apstra/{apstra_validator => validator}/parse_rt_test.go (100%) rename apstra/{apstra_validator => validator}/parse_speed.go (100%) rename apstra/{apstra_validator => validator}/rack_fcd_must_be.go (100%) rename apstra/{apstra_validator => validator}/rack_fcd_must_be_when_null.go (100%) rename apstra/{apstra_validator => validator}/rack_fcd_must_be_when_value.go (100%) rename apstra/{apstra_validator => validator}/required_when_value_is.go (98%) rename apstra/{apstra_validator => validator}/required_when_value_null.go (98%) rename apstra/{apstra_validator => validator}/value_at_must_be.go (100%) rename apstra/{apstra_validator => validator}/when_value_is.go (100%) rename apstra/{apstra_validator => validator}/when_value_set.go (100%) diff --git a/apstra/blueprint/blueprint.go b/apstra/blueprint/blueprint.go index d398e276..9738a8d7 100644 --- a/apstra/blueprint/blueprint.go +++ b/apstra/blueprint/blueprint.go @@ -8,10 +8,10 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/blueprint/connectivity_templates/primitives/bgp_peering_generic_sytem.go b/apstra/blueprint/connectivity_templates/primitives/bgp_peering_generic_sytem.go index 3d9bd1be..780053e6 100644 --- a/apstra/blueprint/connectivity_templates/primitives/bgp_peering_generic_sytem.go +++ b/apstra/blueprint/connectivity_templates/primitives/bgp_peering_generic_sytem.go @@ -9,9 +9,9 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/blueprint/connectivity_templates/primitives/bgp_peering_ip_endpoint.go b/apstra/blueprint/connectivity_templates/primitives/bgp_peering_ip_endpoint.go index 699d7fce..6ba56fa3 100644 --- a/apstra/blueprint/connectivity_templates/primitives/bgp_peering_ip_endpoint.go +++ b/apstra/blueprint/connectivity_templates/primitives/bgp_peering_ip_endpoint.go @@ -8,9 +8,9 @@ import ( "strconv" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-nettypes/iptypes" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" diff --git a/apstra/blueprint/connectivity_templates/primitives/dynamic_bgp_peering.go b/apstra/blueprint/connectivity_templates/primitives/dynamic_bgp_peering.go index ed721d53..398b49d8 100644 --- a/apstra/blueprint/connectivity_templates/primitives/dynamic_bgp_peering.go +++ b/apstra/blueprint/connectivity_templates/primitives/dynamic_bgp_peering.go @@ -8,9 +8,9 @@ import ( "strconv" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-nettypes/cidrtypes" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" diff --git a/apstra/blueprint/connectivity_templates/primitives/ip_link.go b/apstra/blueprint/connectivity_templates/primitives/ip_link.go index b0118fe3..f783a966 100644 --- a/apstra/blueprint/connectivity_templates/primitives/ip_link.go +++ b/apstra/blueprint/connectivity_templates/primitives/ip_link.go @@ -7,9 +7,9 @@ import ( "strings" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/blueprint/datacenter_property_set.go b/apstra/blueprint/datacenter_property_set.go index ab523a26..f6d94102 100644 --- a/apstra/blueprint/datacenter_property_set.go +++ b/apstra/blueprint/datacenter_property_set.go @@ -3,8 +3,8 @@ package blueprint import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/blueprint/datacenter_routing_policy.go b/apstra/blueprint/datacenter_routing_policy.go index 0e53d080..4db54cd5 100644 --- a/apstra/blueprint/datacenter_routing_policy.go +++ b/apstra/blueprint/datacenter_routing_policy.go @@ -4,9 +4,9 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/blueprint/datacenter_routing_zone.go b/apstra/blueprint/datacenter_routing_zone.go index 925a1c74..ec52a7c8 100644 --- a/apstra/blueprint/datacenter_routing_zone.go +++ b/apstra/blueprint/datacenter_routing_zone.go @@ -8,10 +8,10 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/design" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/blueprint/datacenter_security_policy_rule.go b/apstra/blueprint/datacenter_security_policy_rule.go index c9662ed9..4c67444c 100644 --- a/apstra/blueprint/datacenter_security_policy_rule.go +++ b/apstra/blueprint/datacenter_security_policy_rule.go @@ -7,9 +7,9 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/blueprint/datacenter_virtual_network.go b/apstra/blueprint/datacenter_virtual_network.go index 40aff81d..813bf2b8 100644 --- a/apstra/blueprint/datacenter_virtual_network.go +++ b/apstra/blueprint/datacenter_virtual_network.go @@ -9,11 +9,11 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" apiversions "github.com/Juniper/terraform-provider-apstra/apstra/api_versions" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/compatibility" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/design" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/mapvalidator" diff --git a/apstra/blueprint/ip_link_addressing.go b/apstra/blueprint/ip_link_addressing.go index 6e196ee0..b5d792a9 100644 --- a/apstra/blueprint/ip_link_addressing.go +++ b/apstra/blueprint/ip_link_addressing.go @@ -9,9 +9,9 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-nettypes/cidrtypes" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/apstra/blueprint/nodes_system.go b/apstra/blueprint/nodes_system.go index 10c9ce3e..5ac3073f 100644 --- a/apstra/blueprint/nodes_system.go +++ b/apstra/blueprint/nodes_system.go @@ -3,8 +3,8 @@ package blueprint import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/blueprint/prefix_filter.go b/apstra/blueprint/prefix_filter.go index db4d7c33..54a507fc 100644 --- a/apstra/blueprint/prefix_filter.go +++ b/apstra/blueprint/prefix_filter.go @@ -4,8 +4,8 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/blueprint/rack.go b/apstra/blueprint/rack.go index 2671f797..3fc0a41f 100644 --- a/apstra/blueprint/rack.go +++ b/apstra/blueprint/rack.go @@ -3,7 +3,7 @@ package blueprint import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/connectivity_template/bgp_peering_generic_system.go b/apstra/connectivity_template/bgp_peering_generic_system.go index b97235f7..82afa043 100644 --- a/apstra/connectivity_template/bgp_peering_generic_system.go +++ b/apstra/connectivity_template/bgp_peering_generic_system.go @@ -11,8 +11,8 @@ import ( "strings" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/connectivity_template/bgp_peering_ip_endpoint.go b/apstra/connectivity_template/bgp_peering_ip_endpoint.go index 9d5df7ab..606c7dd2 100644 --- a/apstra/connectivity_template/bgp_peering_ip_endpoint.go +++ b/apstra/connectivity_template/bgp_peering_ip_endpoint.go @@ -11,8 +11,8 @@ import ( "sort" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/connectivity_template/custom_static_route.go b/apstra/connectivity_template/custom_static_route.go index 9551ce25..d9f21faa 100644 --- a/apstra/connectivity_template/custom_static_route.go +++ b/apstra/connectivity_template/custom_static_route.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/apstra/connectivity_template/dynamic_bgp_peering.go b/apstra/connectivity_template/dynamic_bgp_peering.go index 9b803a5c..0806b1c5 100644 --- a/apstra/connectivity_template/dynamic_bgp_peering.go +++ b/apstra/connectivity_template/dynamic_bgp_peering.go @@ -7,8 +7,8 @@ import ( "encoding/json" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" diff --git a/apstra/connectivity_template/ip_link.go b/apstra/connectivity_template/ip_link.go index ae9605b5..742c45c4 100644 --- a/apstra/connectivity_template/ip_link.go +++ b/apstra/connectivity_template/ip_link.go @@ -10,10 +10,10 @@ import ( "strings" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/design" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/connectivity_template/static_route.go b/apstra/connectivity_template/static_route.go index 24307789..0be8b9c6 100644 --- a/apstra/connectivity_template/static_route.go +++ b/apstra/connectivity_template/static_route.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/apstra/connectivity_template/vn_multiple.go b/apstra/connectivity_template/vn_multiple.go index aade691a..4075fcee 100644 --- a/apstra/connectivity_template/vn_multiple.go +++ b/apstra/connectivity_template/vn_multiple.go @@ -5,8 +5,8 @@ import ( "encoding/json" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/data_source_datacenter_external_gateways.go b/apstra/data_source_datacenter_external_gateways.go index 38f65567..03da7df9 100644 --- a/apstra/data_source_datacenter_external_gateways.go +++ b/apstra/data_source_datacenter_external_gateways.go @@ -4,9 +4,9 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/data_source_datacenter_routing_policies.go b/apstra/data_source_datacenter_routing_policies.go index 871a89b1..14ae2b2d 100644 --- a/apstra/data_source_datacenter_routing_policies.go +++ b/apstra/data_source_datacenter_routing_policies.go @@ -4,9 +4,9 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/data_source_datacenter_routing_zones.go b/apstra/data_source_datacenter_routing_zones.go index b80c3af1..991db232 100644 --- a/apstra/data_source_datacenter_routing_zones.go +++ b/apstra/data_source_datacenter_routing_zones.go @@ -5,9 +5,9 @@ import ( "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/data_source_datacenter_security_policies.go b/apstra/data_source_datacenter_security_policies.go index 6e0cbf51..96f8c789 100644 --- a/apstra/data_source_datacenter_security_policies.go +++ b/apstra/data_source_datacenter_security_policies.go @@ -4,9 +4,9 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/data_source_datacenter_virtual_networks.go b/apstra/data_source_datacenter_virtual_networks.go index 15bdfce5..906b05f9 100644 --- a/apstra/data_source_datacenter_virtual_networks.go +++ b/apstra/data_source_datacenter_virtual_networks.go @@ -4,9 +4,9 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/design/logical_device_panel_port_group.go b/apstra/design/logical_device_panel_port_group.go index 7bdeca74..405af626 100644 --- a/apstra/design/logical_device_panel_port_group.go +++ b/apstra/design/logical_device_panel_port_group.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/design/property_set.go b/apstra/design/property_set.go index d0eeefd7..3b61ae11 100644 --- a/apstra/design/property_set.go +++ b/apstra/design/property_set.go @@ -3,8 +3,8 @@ package design import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/apstra/design/rack_type_esi_lag_info.go b/apstra/design/rack_type_esi_lag_info.go index 148f01d5..405b20fc 100644 --- a/apstra/design/rack_type_esi_lag_info.go +++ b/apstra/design/rack_type_esi_lag_info.go @@ -3,7 +3,7 @@ package design import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/design/rack_type_leaf_switch.go b/apstra/design/rack_type_leaf_switch.go index 1a130f34..52cfbdd7 100644 --- a/apstra/design/rack_type_leaf_switch.go +++ b/apstra/design/rack_type_leaf_switch.go @@ -4,8 +4,8 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/design/rack_type_mlag_info.go b/apstra/design/rack_type_mlag_info.go index 08ac7289..4060b290 100644 --- a/apstra/design/rack_type_mlag_info.go +++ b/apstra/design/rack_type_mlag_info.go @@ -3,7 +3,7 @@ package design import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/design/spine_switch.go b/apstra/design/spine_switch.go index d81d80ae..e5a15ae0 100644 --- a/apstra/design/spine_switch.go +++ b/apstra/design/spine_switch.go @@ -4,8 +4,8 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/design/template_collapsed.go b/apstra/design/template_collapsed.go index 4786bf23..1d474587 100644 --- a/apstra/design/template_collapsed.go +++ b/apstra/design/template_collapsed.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/design/template_pod_based.go b/apstra/design/template_pod_based.go index 844f7fb6..290e2e49 100644 --- a/apstra/design/template_pod_based.go +++ b/apstra/design/template_pod_based.go @@ -4,8 +4,8 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/mapvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/design/template_rack_based.go b/apstra/design/template_rack_based.go index 55ebc311..2dc3d93d 100644 --- a/apstra/design/template_rack_based.go +++ b/apstra/design/template_rack_based.go @@ -5,8 +5,8 @@ import ( "fmt" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/mapvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/freeform/resource.go b/apstra/freeform/resource.go index 7dcbfd7c..7799a85e 100644 --- a/apstra/freeform/resource.go +++ b/apstra/freeform/resource.go @@ -9,8 +9,8 @@ import ( "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-nettypes/cidrtypes" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/freeform/resource_generator.go b/apstra/freeform/resource_generator.go index c265d4a3..4dfdd375 100644 --- a/apstra/freeform/resource_generator.go +++ b/apstra/freeform/resource_generator.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/Juniper/apstra-go-sdk/apstra/enum" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/Juniper/apstra-go-sdk/apstra" diff --git a/apstra/freeform/system.go b/apstra/freeform/system.go index 199d1155..48ed264a 100644 --- a/apstra/freeform/system.go +++ b/apstra/freeform/system.go @@ -6,8 +6,8 @@ import ( "regexp" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/apstra_plan_modifier/bool_requires_replace_when_switching_to.go b/apstra/plan_modifier/bool_requires_replace_when_switching_to.go similarity index 100% rename from apstra/apstra_plan_modifier/bool_requires_replace_when_switching_to.go rename to apstra/plan_modifier/bool_requires_replace_when_switching_to.go diff --git a/apstra/apstra_plan_modifier/use_null_state_for_unknown.go b/apstra/plan_modifier/use_null_state_for_unknown.go similarity index 100% rename from apstra/apstra_plan_modifier/use_null_state_for_unknown.go rename to apstra/plan_modifier/use_null_state_for_unknown.go diff --git a/apstra/resources/asn_pool.go b/apstra/resources/asn_pool.go index 7866986e..2615f942 100644 --- a/apstra/resources/asn_pool.go +++ b/apstra/resources/asn_pool.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/resources/asn_pool_range.go b/apstra/resources/asn_pool_range.go index 2e66650a..513d4f59 100644 --- a/apstra/resources/asn_pool_range.go +++ b/apstra/resources/asn_pool_range.go @@ -5,7 +5,7 @@ import ( "math" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/resources/integer_pool.go b/apstra/resources/integer_pool.go index 19524fe0..51e5e83e 100644 --- a/apstra/resources/integer_pool.go +++ b/apstra/resources/integer_pool.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/resources/integer_pool_range.go b/apstra/resources/integer_pool_range.go index 32a28f40..2de626da 100644 --- a/apstra/resources/integer_pool_range.go +++ b/apstra/resources/integer_pool_range.go @@ -5,7 +5,7 @@ import ( "math" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/resources/ipv4_pool.go b/apstra/resources/ipv4_pool.go index ba886f8b..6b4d85d0 100644 --- a/apstra/resources/ipv4_pool.go +++ b/apstra/resources/ipv4_pool.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/resources/ipv4_pool_subnet.go b/apstra/resources/ipv4_pool_subnet.go index 80473f04..f16d5d13 100644 --- a/apstra/resources/ipv4_pool_subnet.go +++ b/apstra/resources/ipv4_pool_subnet.go @@ -4,9 +4,9 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-nettypes/cidrtypes" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/resources/ipv6_pool.go b/apstra/resources/ipv6_pool.go index 7d89b10c..0ebb37db 100644 --- a/apstra/resources/ipv6_pool.go +++ b/apstra/resources/ipv6_pool.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/resources/ipv6_pool_subnet.go b/apstra/resources/ipv6_pool_subnet.go index 6f765860..4a5add42 100644 --- a/apstra/resources/ipv6_pool_subnet.go +++ b/apstra/resources/ipv6_pool_subnet.go @@ -4,9 +4,9 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-nettypes/cidrtypes" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/resources/vni_pool.go b/apstra/resources/vni_pool.go index 8546645e..7cf38fe4 100644 --- a/apstra/resources/vni_pool.go +++ b/apstra/resources/vni_pool.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/setvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" diff --git a/apstra/resources/vni_pool_range.go b/apstra/resources/vni_pool_range.go index 81de6fe5..9c926fa5 100644 --- a/apstra/resources/vni_pool_range.go +++ b/apstra/resources/vni_pool_range.go @@ -4,8 +4,8 @@ import ( "context" "github.com/Juniper/apstra-go-sdk/apstra" - apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/apstra_plan_modifier" "github.com/Juniper/terraform-provider-apstra/apstra/constants" + apstraplanmodifier "github.com/Juniper/terraform-provider-apstra/apstra/plan_modifier" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" "github.com/hashicorp/terraform-plugin-framework/attr" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/system_agents/managed_device.go b/apstra/system_agents/managed_device.go index 8ab3d18d..f2e73e1b 100644 --- a/apstra/system_agents/managed_device.go +++ b/apstra/system_agents/managed_device.go @@ -6,8 +6,8 @@ import ( "net" "github.com/Juniper/apstra-go-sdk/apstra" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" "github.com/Juniper/terraform-provider-apstra/apstra/utils" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" diff --git a/apstra/apstra_validator/also_requires_n_of.go b/apstra/validator/also_requires_n_of.go similarity index 100% rename from apstra/apstra_validator/also_requires_n_of.go rename to apstra/validator/also_requires_n_of.go diff --git a/apstra/apstra_validator/at_least_product_of.go b/apstra/validator/at_least_product_of.go similarity index 100% rename from apstra/apstra_validator/at_least_product_of.go rename to apstra/validator/at_least_product_of.go diff --git a/apstra/apstra_validator/at_most_n_of.go b/apstra/validator/at_most_n_of.go similarity index 100% rename from apstra/apstra_validator/at_most_n_of.go rename to apstra/validator/at_most_n_of.go diff --git a/apstra/apstra_validator/attribute_conflict.go b/apstra/validator/attribute_conflict.go similarity index 100% rename from apstra/apstra_validator/attribute_conflict.go rename to apstra/validator/attribute_conflict.go diff --git a/apstra/apstra_validator/attribute_conflict_test.go b/apstra/validator/attribute_conflict_test.go similarity index 100% rename from apstra/apstra_validator/attribute_conflict_test.go rename to apstra/validator/attribute_conflict_test.go diff --git a/apstra/apstra_validator/constants.go b/apstra/validator/constants.go similarity index 100% rename from apstra/apstra_validator/constants.go rename to apstra/validator/constants.go diff --git a/apstra/apstra_validator/different_from.go b/apstra/validator/different_from.go similarity index 98% rename from apstra/apstra_validator/different_from.go rename to apstra/validator/different_from.go index 7341bf12..86df3844 100644 --- a/apstra/apstra_validator/different_from.go +++ b/apstra/validator/different_from.go @@ -66,7 +66,7 @@ func (o DifferentFromValidator) Validate(ctx context.Context, req DifferentFromV } for _, mp := range matchedPaths { - // If the user specifies the same attribute this apstra_validator is applied to, + // If the user specifies the same attribute this validator is applied to, // also as part of the input, skip it if mp.Equal(req.Path) { continue diff --git a/apstra/apstra_validator/different_from_values.go b/apstra/validator/different_from_values.go similarity index 99% rename from apstra/apstra_validator/different_from_values.go rename to apstra/validator/different_from_values.go index c752820a..07991fd3 100644 --- a/apstra/apstra_validator/different_from_values.go +++ b/apstra/validator/different_from_values.go @@ -66,7 +66,7 @@ func (o DifferentFromValuesValidator) Validate(ctx context.Context, req Differen // loop over matched paths. Each one should be a "collection" (list/map/set) for _, mp := range matchedPaths { - // If the user specifies the same attribute this apstra_validator is applied to, + // If the user specifies the same attribute this validator is applied to, // also as part of the input, skip it if mp.Equal(req.Path) { continue diff --git a/apstra/apstra_validator/exactly_one_binding_when_vn_type_vlan.go b/apstra/validator/exactly_one_binding_when_vn_type_vlan.go similarity index 100% rename from apstra/apstra_validator/exactly_one_binding_when_vn_type_vlan.go rename to apstra/validator/exactly_one_binding_when_vn_type_vlan.go diff --git a/apstra/apstra_validator/falls_within_cidr.go b/apstra/validator/falls_within_cidr.go similarity index 100% rename from apstra/apstra_validator/falls_within_cidr.go rename to apstra/validator/falls_within_cidr.go diff --git a/apstra/apstra_validator/forbidden_when_value_is.go b/apstra/validator/forbidden_when_value_is.go similarity index 98% rename from apstra/apstra_validator/forbidden_when_value_is.go rename to apstra/validator/forbidden_when_value_is.go index 8a31a642..82ca45d3 100644 --- a/apstra/apstra_validator/forbidden_when_value_is.go +++ b/apstra/validator/forbidden_when_value_is.go @@ -59,7 +59,7 @@ func (o ForbiddenWhenValueIsValidator) Validate(ctx context.Context, req Forbidd } for _, mp := range matchedPaths { - // If the user specifies the same attribute this apstra_validator is applied to, + // If the user specifies the same attribute this validator is applied to, // also as part of the input, skip it if mp.Equal(req.Path) { continue diff --git a/apstra/apstra_validator/forbidden_when_value_is_test.go b/apstra/validator/forbidden_when_value_is_test.go similarity index 99% rename from apstra/apstra_validator/forbidden_when_value_is_test.go rename to apstra/validator/forbidden_when_value_is_test.go index 15c8107f..323b41d4 100644 --- a/apstra/apstra_validator/forbidden_when_value_is_test.go +++ b/apstra/validator/forbidden_when_value_is_test.go @@ -2,7 +2,7 @@ package apstravalidator_test import ( "context" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource/schema" diff --git a/apstra/apstra_validator/leaf_switch_redundancy_mode.go b/apstra/validator/leaf_switch_redundancy_mode.go similarity index 100% rename from apstra/apstra_validator/leaf_switch_redundancy_mode.go rename to apstra/validator/leaf_switch_redundancy_mode.go diff --git a/apstra/apstra_validator/must_be_even_or_odd.go b/apstra/validator/must_be_even_or_odd.go similarity index 100% rename from apstra/apstra_validator/must_be_even_or_odd.go rename to apstra/validator/must_be_even_or_odd.go diff --git a/apstra/apstra_validator/must_be_one_of.go b/apstra/validator/must_be_one_of.go similarity index 100% rename from apstra/apstra_validator/must_be_one_of.go rename to apstra/validator/must_be_one_of.go diff --git a/apstra/apstra_validator/must_be_one_of_test.go b/apstra/validator/must_be_one_of_test.go similarity index 99% rename from apstra/apstra_validator/must_be_one_of_test.go rename to apstra/validator/must_be_one_of_test.go index 87369816..0a7b8565 100644 --- a/apstra/apstra_validator/must_be_one_of_test.go +++ b/apstra/validator/must_be_one_of_test.go @@ -2,7 +2,7 @@ package apstravalidator_test import ( "context" - apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/apstra_validator" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" "math/big" diff --git a/apstra/apstra_validator/must_be_when_value_at.go b/apstra/validator/must_be_when_value_at.go similarity index 100% rename from apstra/apstra_validator/must_be_when_value_at.go rename to apstra/validator/must_be_when_value_at.go diff --git a/apstra/apstra_validator/object_must_have_n_of.go b/apstra/validator/object_must_have_n_of.go similarity index 100% rename from apstra/apstra_validator/object_must_have_n_of.go rename to apstra/validator/object_must_have_n_of.go diff --git a/apstra/apstra_validator/object_must_have_n_of_test.go b/apstra/validator/object_must_have_n_of_test.go similarity index 100% rename from apstra/apstra_validator/object_must_have_n_of_test.go rename to apstra/validator/object_must_have_n_of_test.go diff --git a/apstra/apstra_validator/parse_cidr.go b/apstra/validator/parse_cidr.go similarity index 100% rename from apstra/apstra_validator/parse_cidr.go rename to apstra/validator/parse_cidr.go diff --git a/apstra/apstra_validator/parse_ip.go b/apstra/validator/parse_ip.go similarity index 100% rename from apstra/apstra_validator/parse_ip.go rename to apstra/validator/parse_ip.go diff --git a/apstra/apstra_validator/parse_ip_or_cidr.go b/apstra/validator/parse_ip_or_cidr.go similarity index 100% rename from apstra/apstra_validator/parse_ip_or_cidr.go rename to apstra/validator/parse_ip_or_cidr.go diff --git a/apstra/apstra_validator/parse_json.go b/apstra/validator/parse_json.go similarity index 100% rename from apstra/apstra_validator/parse_json.go rename to apstra/validator/parse_json.go diff --git a/apstra/apstra_validator/parse_rt.go b/apstra/validator/parse_rt.go similarity index 100% rename from apstra/apstra_validator/parse_rt.go rename to apstra/validator/parse_rt.go diff --git a/apstra/apstra_validator/parse_rt_test.go b/apstra/validator/parse_rt_test.go similarity index 100% rename from apstra/apstra_validator/parse_rt_test.go rename to apstra/validator/parse_rt_test.go diff --git a/apstra/apstra_validator/parse_speed.go b/apstra/validator/parse_speed.go similarity index 100% rename from apstra/apstra_validator/parse_speed.go rename to apstra/validator/parse_speed.go diff --git a/apstra/apstra_validator/rack_fcd_must_be.go b/apstra/validator/rack_fcd_must_be.go similarity index 100% rename from apstra/apstra_validator/rack_fcd_must_be.go rename to apstra/validator/rack_fcd_must_be.go diff --git a/apstra/apstra_validator/rack_fcd_must_be_when_null.go b/apstra/validator/rack_fcd_must_be_when_null.go similarity index 100% rename from apstra/apstra_validator/rack_fcd_must_be_when_null.go rename to apstra/validator/rack_fcd_must_be_when_null.go diff --git a/apstra/apstra_validator/rack_fcd_must_be_when_value.go b/apstra/validator/rack_fcd_must_be_when_value.go similarity index 100% rename from apstra/apstra_validator/rack_fcd_must_be_when_value.go rename to apstra/validator/rack_fcd_must_be_when_value.go diff --git a/apstra/apstra_validator/required_when_value_is.go b/apstra/validator/required_when_value_is.go similarity index 98% rename from apstra/apstra_validator/required_when_value_is.go rename to apstra/validator/required_when_value_is.go index 7bae12dc..7ca9795a 100644 --- a/apstra/apstra_validator/required_when_value_is.go +++ b/apstra/validator/required_when_value_is.go @@ -58,7 +58,7 @@ func (o RequiredWhenValueIsValidator) Validate(ctx context.Context, req Required } for _, mp := range matchedPaths { - // If the user specifies the same attribute this apstra_validator is applied to, + // If the user specifies the same attribute this validator is applied to, // also as part of the input, skip it if mp.Equal(req.Path) { continue diff --git a/apstra/apstra_validator/required_when_value_null.go b/apstra/validator/required_when_value_null.go similarity index 98% rename from apstra/apstra_validator/required_when_value_null.go rename to apstra/validator/required_when_value_null.go index 31b76c9d..cf8ff321 100644 --- a/apstra/apstra_validator/required_when_value_null.go +++ b/apstra/validator/required_when_value_null.go @@ -57,7 +57,7 @@ func (o RequiredWhenValueNullValidator) Validate(ctx context.Context, req Requir } for _, mp := range matchedPaths { - // If the user specifies the same attribute this apstra_validator is applied to, + // If the user specifies the same attribute this validator is applied to, // also as part of the input, skip it if mp.Equal(req.Path) { continue diff --git a/apstra/apstra_validator/value_at_must_be.go b/apstra/validator/value_at_must_be.go similarity index 100% rename from apstra/apstra_validator/value_at_must_be.go rename to apstra/validator/value_at_must_be.go diff --git a/apstra/apstra_validator/when_value_is.go b/apstra/validator/when_value_is.go similarity index 100% rename from apstra/apstra_validator/when_value_is.go rename to apstra/validator/when_value_is.go diff --git a/apstra/apstra_validator/when_value_set.go b/apstra/validator/when_value_set.go similarity index 100% rename from apstra/apstra_validator/when_value_set.go rename to apstra/validator/when_value_set.go From 9dcdfdaf5820763fac519308d19f7269a12442b2 Mon Sep 17 00:00:00 2001 From: bwjuniper Date: Mon, 21 Oct 2024 14:29:22 -0700 Subject: [PATCH 2/4] go fumpt --- apstra/blueprint/datacenter_property_set.go | 1 + apstra/blueprint/datacenter_routing_policy.go | 7 ++++--- apstra/blueprint/nodes_system.go | 1 + apstra/blueprint/prefix_filter.go | 3 ++- apstra/blueprint/rack.go | 3 ++- apstra/connectivity_template/custom_static_route.go | 3 ++- apstra/connectivity_template/dynamic_bgp_peering.go | 7 ++++--- apstra/connectivity_template/static_route.go | 3 ++- apstra/connectivity_template/vn_multiple.go | 1 + apstra/data_source_datacenter_external_gateways.go | 7 +++++-- apstra/data_source_datacenter_routing_policies.go | 7 +++++-- apstra/data_source_datacenter_security_policies.go | 8 +++++--- apstra/data_source_datacenter_virtual_networks.go | 9 ++++++--- apstra/design/property_set.go | 1 + apstra/design/rack_type_esi_lag_info.go | 1 + apstra/design/rack_type_leaf_switch.go | 6 ++++-- apstra/design/rack_type_mlag_info.go | 4 +++- apstra/design/template_collapsed.go | 1 + .../bool_requires_replace_when_switching_to.go | 3 ++- apstra/validator/also_requires_n_of.go | 1 + apstra/validator/at_least_product_of.go | 3 ++- apstra/validator/attribute_conflict.go | 3 ++- apstra/validator/attribute_conflict_test.go | 5 +++-- apstra/validator/different_from.go | 1 + apstra/validator/different_from_values.go | 1 + .../validator/exactly_one_binding_when_vn_type_vlan.go | 1 + apstra/validator/falls_within_cidr.go | 3 ++- apstra/validator/forbidden_when_value_is_test.go | 3 ++- apstra/validator/leaf_switch_redundancy_mode.go | 1 + apstra/validator/must_be_even_or_odd.go | 1 + apstra/validator/must_be_one_of_test.go | 5 +++-- apstra/validator/must_be_when_value_at.go | 3 ++- apstra/validator/object_must_have_n_of.go | 3 ++- apstra/validator/object_must_have_n_of_test.go | 7 ++++--- apstra/validator/parse_cidr.go | 3 ++- apstra/validator/parse_ip.go | 3 ++- apstra/validator/parse_ip_or_cidr.go | 3 ++- apstra/validator/parse_json.go | 1 + apstra/validator/parse_rt.go | 5 +++-- apstra/validator/parse_rt_test.go | 3 ++- 40 files changed, 92 insertions(+), 43 deletions(-) diff --git a/apstra/blueprint/datacenter_property_set.go b/apstra/blueprint/datacenter_property_set.go index f6d94102..202de9fb 100644 --- a/apstra/blueprint/datacenter_property_set.go +++ b/apstra/blueprint/datacenter_property_set.go @@ -2,6 +2,7 @@ package blueprint import ( "context" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" diff --git a/apstra/blueprint/datacenter_routing_policy.go b/apstra/blueprint/datacenter_routing_policy.go index 4db54cd5..088fd7a7 100644 --- a/apstra/blueprint/datacenter_routing_policy.go +++ b/apstra/blueprint/datacenter_routing_policy.go @@ -3,6 +3,10 @@ package blueprint import ( "context" "fmt" + "net" + "regexp" + "strings" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/constants" "github.com/Juniper/terraform-provider-apstra/apstra/utils" @@ -21,9 +25,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "net" - "regexp" - "strings" ) type DatacenterRoutingPolicy struct { diff --git a/apstra/blueprint/nodes_system.go b/apstra/blueprint/nodes_system.go index 5ac3073f..fa0241ea 100644 --- a/apstra/blueprint/nodes_system.go +++ b/apstra/blueprint/nodes_system.go @@ -2,6 +2,7 @@ package blueprint import ( "context" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" diff --git a/apstra/blueprint/prefix_filter.go b/apstra/blueprint/prefix_filter.go index 54a507fc..b3ef46cb 100644 --- a/apstra/blueprint/prefix_filter.go +++ b/apstra/blueprint/prefix_filter.go @@ -3,6 +3,8 @@ package blueprint import ( "context" "fmt" + "net" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" @@ -15,7 +17,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "net" ) type prefixFilter struct { diff --git a/apstra/blueprint/rack.go b/apstra/blueprint/rack.go index 3fc0a41f..9a148622 100644 --- a/apstra/blueprint/rack.go +++ b/apstra/blueprint/rack.go @@ -2,6 +2,8 @@ package blueprint import ( "context" + "strings" + "github.com/Juniper/apstra-go-sdk/apstra" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator" @@ -14,7 +16,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "strings" ) type Rack struct { diff --git a/apstra/connectivity_template/custom_static_route.go b/apstra/connectivity_template/custom_static_route.go index d9f21faa..5adc4822 100644 --- a/apstra/connectivity_template/custom_static_route.go +++ b/apstra/connectivity_template/custom_static_route.go @@ -4,6 +4,8 @@ import ( "context" "encoding/json" "fmt" + "net" + "github.com/Juniper/apstra-go-sdk/apstra" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" @@ -12,7 +14,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "net" ) var _ Primitive = &CustomStaticRoute{} diff --git a/apstra/connectivity_template/dynamic_bgp_peering.go b/apstra/connectivity_template/dynamic_bgp_peering.go index 0806b1c5..88f3f04b 100644 --- a/apstra/connectivity_template/dynamic_bgp_peering.go +++ b/apstra/connectivity_template/dynamic_bgp_peering.go @@ -6,6 +6,10 @@ import ( "crypto/sha1" "encoding/json" "fmt" + "math" + "net" + "sort" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" @@ -18,9 +22,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "math" - "net" - "sort" ) var _ Primitive = &DynamicBgpPeering{} diff --git a/apstra/connectivity_template/static_route.go b/apstra/connectivity_template/static_route.go index 0be8b9c6..73f395da 100644 --- a/apstra/connectivity_template/static_route.go +++ b/apstra/connectivity_template/static_route.go @@ -4,6 +4,8 @@ import ( "context" "encoding/json" "fmt" + "net" + "github.com/Juniper/apstra-go-sdk/apstra" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" dataSourceSchema "github.com/hashicorp/terraform-plugin-framework/datasource/schema" @@ -11,7 +13,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "net" ) var _ Primitive = &StaticRoute{} diff --git a/apstra/connectivity_template/vn_multiple.go b/apstra/connectivity_template/vn_multiple.go index 4075fcee..de4bc66a 100644 --- a/apstra/connectivity_template/vn_multiple.go +++ b/apstra/connectivity_template/vn_multiple.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" diff --git a/apstra/data_source_datacenter_external_gateways.go b/apstra/data_source_datacenter_external_gateways.go index 03da7df9..14ce0e8a 100644 --- a/apstra/data_source_datacenter_external_gateways.go +++ b/apstra/data_source_datacenter_external_gateways.go @@ -3,6 +3,7 @@ package tfapstra import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" @@ -16,8 +17,10 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterExternalGateways{} -var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterExternalGateways{} +var ( + _ datasource.DataSourceWithConfigure = &dataSourceDatacenterExternalGateways{} + _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterExternalGateways{} +) type dataSourceDatacenterExternalGateways struct { getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error) diff --git a/apstra/data_source_datacenter_routing_policies.go b/apstra/data_source_datacenter_routing_policies.go index 14ae2b2d..755e47a5 100644 --- a/apstra/data_source_datacenter_routing_policies.go +++ b/apstra/data_source_datacenter_routing_policies.go @@ -3,6 +3,7 @@ package tfapstra import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" @@ -16,8 +17,10 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterRoutingPolicies{} -var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterRoutingPolicies{} +var ( + _ datasource.DataSourceWithConfigure = &dataSourceDatacenterRoutingPolicies{} + _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterRoutingPolicies{} +) type dataSourceDatacenterRoutingPolicies struct { getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error) diff --git a/apstra/data_source_datacenter_security_policies.go b/apstra/data_source_datacenter_security_policies.go index 96f8c789..17e9f3d2 100644 --- a/apstra/data_source_datacenter_security_policies.go +++ b/apstra/data_source_datacenter_security_policies.go @@ -3,6 +3,7 @@ package tfapstra import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" @@ -17,8 +18,10 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterSecurityPolicies{} -var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterSecurityPolicies{} +var ( + _ datasource.DataSourceWithConfigure = &dataSourceDatacenterSecurityPolicies{} + _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterSecurityPolicies{} +) type dataSourceDatacenterSecurityPolicies struct { getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error) @@ -125,7 +128,6 @@ func (o *dataSourceDatacenterSecurityPolicies) Read(ctx context.Context, req dat // set the state resp.Diagnostics.Append(resp.State.Set(ctx, &config)...) - } func (o *dataSourceDatacenterSecurityPolicies) getAllSpIds(ctx context.Context, bp *apstra.TwoStageL3ClosClient, diags *diag.Diagnostics) []attr.Value { diff --git a/apstra/data_source_datacenter_virtual_networks.go b/apstra/data_source_datacenter_virtual_networks.go index 906b05f9..31bf65fa 100644 --- a/apstra/data_source_datacenter_virtual_networks.go +++ b/apstra/data_source_datacenter_virtual_networks.go @@ -3,6 +3,8 @@ package tfapstra import ( "context" "fmt" + "net" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/blueprint" "github.com/Juniper/terraform-provider-apstra/apstra/utils" @@ -17,11 +19,12 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "net" ) -var _ datasource.DataSourceWithConfigure = &dataSourceDatacenterVirtualNetworks{} -var _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterVirtualNetworks{} +var ( + _ datasource.DataSourceWithConfigure = &dataSourceDatacenterVirtualNetworks{} + _ datasourceWithSetDcBpClientFunc = &dataSourceDatacenterVirtualNetworks{} +) type dataSourceDatacenterVirtualNetworks struct { getBpClientFunc func(context.Context, string) (*apstra.TwoStageL3ClosClient, error) diff --git a/apstra/design/property_set.go b/apstra/design/property_set.go index 3b61ae11..a53ce76a 100644 --- a/apstra/design/property_set.go +++ b/apstra/design/property_set.go @@ -2,6 +2,7 @@ package design import ( "context" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" diff --git a/apstra/design/rack_type_esi_lag_info.go b/apstra/design/rack_type_esi_lag_info.go index 405b20fc..f1219bfa 100644 --- a/apstra/design/rack_type_esi_lag_info.go +++ b/apstra/design/rack_type_esi_lag_info.go @@ -2,6 +2,7 @@ package design import ( "context" + "github.com/Juniper/apstra-go-sdk/apstra" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" diff --git a/apstra/design/rack_type_leaf_switch.go b/apstra/design/rack_type_leaf_switch.go index 52cfbdd7..c154e0af 100644 --- a/apstra/design/rack_type_leaf_switch.go +++ b/apstra/design/rack_type_leaf_switch.go @@ -3,6 +3,8 @@ package design import ( "context" "fmt" + "strings" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/Juniper/terraform-provider-apstra/apstra/utils" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" @@ -17,7 +19,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "strings" ) func ValidateLeafSwitch(rt *apstra.RackType, i int, diags *diag.Diagnostics) { @@ -325,5 +326,6 @@ func NewLeafSwitchMap(ctx context.Context, in []apstra.RackElementLeafSwitch, fc func LeafRedundancyModes() []string { return []string{ apstra.LeafRedundancyProtocolEsi.String(), - apstra.LeafRedundancyProtocolMlag.String()} + apstra.LeafRedundancyProtocolMlag.String(), + } } diff --git a/apstra/design/rack_type_mlag_info.go b/apstra/design/rack_type_mlag_info.go index 4060b290..71ba3e57 100644 --- a/apstra/design/rack_type_mlag_info.go +++ b/apstra/design/rack_type_mlag_info.go @@ -2,6 +2,7 @@ package design import ( "context" + "github.com/Juniper/apstra-go-sdk/apstra" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" @@ -130,7 +131,8 @@ func (o MlagInfo) AttrTypes() map[string]attr.Type { "peer_link_port_channel_id": types.Int64Type, "l3_peer_link_count": types.Int64Type, "l3_peer_link_speed": types.StringType, - "l3_peer_link_port_channel_id": types.Int64Type} + "l3_peer_link_port_channel_id": types.Int64Type, + } } func (o *MlagInfo) LoadApiData(_ context.Context, in *apstra.LeafMlagInfo, diags *diag.Diagnostics) { diff --git a/apstra/design/template_collapsed.go b/apstra/design/template_collapsed.go index 1d474587..cee6c32f 100644 --- a/apstra/design/template_collapsed.go +++ b/apstra/design/template_collapsed.go @@ -3,6 +3,7 @@ package design import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" diff --git a/apstra/plan_modifier/bool_requires_replace_when_switching_to.go b/apstra/plan_modifier/bool_requires_replace_when_switching_to.go index 71b95aec..dfd87621 100644 --- a/apstra/plan_modifier/bool_requires_replace_when_switching_to.go +++ b/apstra/plan_modifier/bool_requires_replace_when_switching_to.go @@ -2,6 +2,7 @@ package apstraplanmodifier import ( "context" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" ) @@ -26,4 +27,4 @@ func BoolRequiresReplaceWhenSwitchingTo(to bool) boolplanmodifier.RequiresReplac } } -//func requiresReplaceWhenSwitchingTo() func(context.Context, planmodifier.BoolRequest, *RequiresReplaceIfFuncResponse) +// func requiresReplaceWhenSwitchingTo() func(context.Context, planmodifier.BoolRequest, *RequiresReplaceIfFuncResponse) diff --git a/apstra/validator/also_requires_n_of.go b/apstra/validator/also_requires_n_of.go index 0d84d127..170d701e 100644 --- a/apstra/validator/also_requires_n_of.go +++ b/apstra/validator/also_requires_n_of.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/apstra/validator/at_least_product_of.go b/apstra/validator/at_least_product_of.go index 6e5d2531..9b0d1e67 100644 --- a/apstra/validator/at_least_product_of.go +++ b/apstra/validator/at_least_product_of.go @@ -3,6 +3,8 @@ package apstravalidator import ( "context" "fmt" + "math/big" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -10,7 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "math/big" ) var ( diff --git a/apstra/validator/attribute_conflict.go b/apstra/validator/attribute_conflict.go index 84b143bf..dc1085a4 100644 --- a/apstra/validator/attribute_conflict.go +++ b/apstra/validator/attribute_conflict.go @@ -4,12 +4,13 @@ import ( "context" "encoding/base64" "fmt" + "strings" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" - "strings" ) type CollectionValidator interface { diff --git a/apstra/validator/attribute_conflict_test.go b/apstra/validator/attribute_conflict_test.go index 71dba9fd..6dd417bb 100644 --- a/apstra/validator/attribute_conflict_test.go +++ b/apstra/validator/attribute_conflict_test.go @@ -2,12 +2,13 @@ package apstravalidator import ( "context" + "log" + "testing" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "log" - "testing" ) func TestAttributeConflictValidator(t *testing.T) { diff --git a/apstra/validator/different_from.go b/apstra/validator/different_from.go index 86df3844..70d20220 100644 --- a/apstra/validator/different_from.go +++ b/apstra/validator/different_from.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/apstra/validator/different_from_values.go b/apstra/validator/different_from_values.go index 07991fd3..ee65b403 100644 --- a/apstra/validator/different_from_values.go +++ b/apstra/validator/different_from_values.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/validator/exactly_one_binding_when_vn_type_vlan.go b/apstra/validator/exactly_one_binding_when_vn_type_vlan.go index 9c05534e..7cdf8819 100644 --- a/apstra/validator/exactly_one_binding_when_vn_type_vlan.go +++ b/apstra/validator/exactly_one_binding_when_vn_type_vlan.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" diff --git a/apstra/validator/falls_within_cidr.go b/apstra/validator/falls_within_cidr.go index e4231721..10188f69 100644 --- a/apstra/validator/falls_within_cidr.go +++ b/apstra/validator/falls_within_cidr.go @@ -3,13 +3,14 @@ package apstravalidator import ( "context" "fmt" + "net" + "github.com/IBM/netaddr" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "net" ) var _ validator.String = fallsWithinCidrValidator{} diff --git a/apstra/validator/forbidden_when_value_is_test.go b/apstra/validator/forbidden_when_value_is_test.go index 323b41d4..612b0bc4 100644 --- a/apstra/validator/forbidden_when_value_is_test.go +++ b/apstra/validator/forbidden_when_value_is_test.go @@ -2,6 +2,8 @@ package apstravalidator_test import ( "context" + "testing" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" @@ -9,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-go/tftypes" - "testing" ) func TestForbiddenWhenValueIsValidator(t *testing.T) { diff --git a/apstra/validator/leaf_switch_redundancy_mode.go b/apstra/validator/leaf_switch_redundancy_mode.go index 5ab07e67..5fc49278 100644 --- a/apstra/validator/leaf_switch_redundancy_mode.go +++ b/apstra/validator/leaf_switch_redundancy_mode.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" diff --git a/apstra/validator/must_be_even_or_odd.go b/apstra/validator/must_be_even_or_odd.go index 0dbbac41..be0a7010 100644 --- a/apstra/validator/must_be_even_or_odd.go +++ b/apstra/validator/must_be_even_or_odd.go @@ -2,6 +2,7 @@ package apstravalidator import ( "context" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) diff --git a/apstra/validator/must_be_one_of_test.go b/apstra/validator/must_be_one_of_test.go index 0a7b8565..ae432bc6 100644 --- a/apstra/validator/must_be_one_of_test.go +++ b/apstra/validator/must_be_one_of_test.go @@ -2,11 +2,12 @@ package apstravalidator_test import ( "context" + "math/big" + "testing" + apstravalidator "github.com/Juniper/terraform-provider-apstra/apstra/validator" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/types" - "math/big" - "testing" ) func TestMustBeOneOfValidator(t *testing.T) { diff --git a/apstra/validator/must_be_when_value_at.go b/apstra/validator/must_be_when_value_at.go index b6e049ca..db5b5ccc 100644 --- a/apstra/validator/must_be_when_value_at.go +++ b/apstra/validator/must_be_when_value_at.go @@ -3,13 +3,14 @@ package apstravalidator import ( "context" "fmt" + "strings" + "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "strings" ) var _ NineTypesValidator = whenValueAtMustBeValidator{} diff --git a/apstra/validator/object_must_have_n_of.go b/apstra/validator/object_must_have_n_of.go index f3ea97eb..83cae1dc 100644 --- a/apstra/validator/object_must_have_n_of.go +++ b/apstra/validator/object_must_have_n_of.go @@ -3,9 +3,10 @@ package apstravalidator import ( "context" "fmt" + "strings" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "strings" ) var _ validator.Object = mustHaveNOfValidator{} diff --git a/apstra/validator/object_must_have_n_of_test.go b/apstra/validator/object_must_have_n_of_test.go index cd8a9508..381b9e70 100644 --- a/apstra/validator/object_must_have_n_of_test.go +++ b/apstra/validator/object_must_have_n_of_test.go @@ -2,11 +2,12 @@ package apstravalidator import ( "context" + "testing" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "testing" ) func TestObjectMustHaveNOf(t *testing.T) { @@ -306,8 +307,8 @@ func TestObjectMustHaveNOf(t *testing.T) { t.Fatal("got no error in the 'exactly' case where one was expected") } - //atMostValidator := AtMostNAttributes(tCase.n, tCase.checkAttributes...) - //exactlyValidator := ExactlyNAttributes(tCase.n, tCase.checkAttributes...) + // atMostValidator := AtMostNAttributes(tCase.n, tCase.checkAttributes...) + // exactlyValidator := ExactlyNAttributes(tCase.n, tCase.checkAttributes...) }) } } diff --git a/apstra/validator/parse_cidr.go b/apstra/validator/parse_cidr.go index 96dbe242..10bffd99 100644 --- a/apstra/validator/parse_cidr.go +++ b/apstra/validator/parse_cidr.go @@ -3,9 +3,10 @@ package apstravalidator import ( "context" "fmt" + "net" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "net" ) var _ validator.String = ParseCidrValidator{} diff --git a/apstra/validator/parse_ip.go b/apstra/validator/parse_ip.go index 30e758fb..881d44e2 100644 --- a/apstra/validator/parse_ip.go +++ b/apstra/validator/parse_ip.go @@ -2,9 +2,10 @@ package apstravalidator import ( "context" + "net" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "net" ) var _ validator.String = ParseIpValidator{} diff --git a/apstra/validator/parse_ip_or_cidr.go b/apstra/validator/parse_ip_or_cidr.go index 115a8f2d..ade6a3a1 100644 --- a/apstra/validator/parse_ip_or_cidr.go +++ b/apstra/validator/parse_ip_or_cidr.go @@ -3,9 +3,10 @@ package apstravalidator import ( "context" "fmt" + "net" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "net" ) var _ validator.String = ParseIpOrCidrValidator{} diff --git a/apstra/validator/parse_json.go b/apstra/validator/parse_json.go index 035cf474..7ce1bd2a 100644 --- a/apstra/validator/parse_json.go +++ b/apstra/validator/parse_json.go @@ -2,6 +2,7 @@ package apstravalidator import ( "context" + "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" diff --git a/apstra/validator/parse_rt.go b/apstra/validator/parse_rt.go index 33f63637..5c9a1759 100644 --- a/apstra/validator/parse_rt.go +++ b/apstra/validator/parse_rt.go @@ -2,12 +2,13 @@ package apstravalidator import ( "context" - "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" "math" "net" "strconv" "strings" + + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" ) const ( diff --git a/apstra/validator/parse_rt_test.go b/apstra/validator/parse_rt_test.go index 668c3786..ba607979 100644 --- a/apstra/validator/parse_rt_test.go +++ b/apstra/validator/parse_rt_test.go @@ -2,10 +2,11 @@ package apstravalidator import ( "context" + "testing" + "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" - "testing" ) func TestParseRtValidator(t *testing.T) { From 5247b6e005820b07c08bd5713d7e9cef9935ae1e Mon Sep 17 00:00:00 2001 From: bwjuniper Date: Mon, 21 Oct 2024 14:33:31 -0700 Subject: [PATCH 3/4] more gofumpt --- apstra/validator/must_be_one_of.go | 4 +++- apstra/validator/parse_speed.go | 3 ++- apstra/validator/rack_fcd_must_be.go | 1 + apstra/validator/rack_fcd_must_be_when_null.go | 1 + apstra/validator/rack_fcd_must_be_when_value.go | 5 ++--- apstra/validator/when_value_set.go | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apstra/validator/must_be_one_of.go b/apstra/validator/must_be_one_of.go index 02d22571..b86af63b 100644 --- a/apstra/validator/must_be_one_of.go +++ b/apstra/validator/must_be_one_of.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -38,7 +39,8 @@ func (o MustBeOneOfValidator) MarkdownDescription(_ context.Context) string { } func (o MustBeOneOfValidator) Validate(_ context.Context, req MustBeOneOfValidatorRequest, - resp *MustBeOneOfValidatorResponse) { + resp *MustBeOneOfValidatorResponse, +) { for _, v := range o.OneOf { if req.ConfigValue.Equal(v) { return diff --git a/apstra/validator/parse_speed.go b/apstra/validator/parse_speed.go index 5acef40f..8d0f3fb0 100644 --- a/apstra/validator/parse_speed.go +++ b/apstra/validator/parse_speed.go @@ -3,9 +3,10 @@ package apstravalidator import ( "context" "fmt" + "strings" + "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "strings" ) var _ validator.String = ParseSpeedValidator{} diff --git a/apstra/validator/rack_fcd_must_be.go b/apstra/validator/rack_fcd_must_be.go index bf53bc30..6d993468 100644 --- a/apstra/validator/rack_fcd_must_be.go +++ b/apstra/validator/rack_fcd_must_be.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/validator/rack_fcd_must_be_when_null.go b/apstra/validator/rack_fcd_must_be_when_null.go index 240dff43..58be775f 100644 --- a/apstra/validator/rack_fcd_must_be_when_null.go +++ b/apstra/validator/rack_fcd_must_be_when_null.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" diff --git a/apstra/validator/rack_fcd_must_be_when_value.go b/apstra/validator/rack_fcd_must_be_when_value.go index 385ce767..04748561 100644 --- a/apstra/validator/rack_fcd_must_be_when_value.go +++ b/apstra/validator/rack_fcd_must_be_when_value.go @@ -3,6 +3,7 @@ package apstravalidator import ( "context" "fmt" + "github.com/Juniper/apstra-go-sdk/apstra" "github.com/hashicorp/terraform-plugin-framework-validators/helpers/validatordiag" "github.com/hashicorp/terraform-plugin-framework/attr" @@ -13,9 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -var ( - _ validator.String = RackFabricConnectivityDesignMustBeWhenValueValidator{} -) +var _ validator.String = RackFabricConnectivityDesignMustBeWhenValueValidator{} type RackFabricConnectivityDesignMustBeWhenValueValidator struct { fcd apstra.FabricConnectivityDesign diff --git a/apstra/validator/when_value_set.go b/apstra/validator/when_value_set.go index e93e0eb5..091486ca 100644 --- a/apstra/validator/when_value_set.go +++ b/apstra/validator/when_value_set.go @@ -3,9 +3,10 @@ package apstravalidator import ( "context" "fmt" + "strings" + "github.com/Juniper/terraform-provider-apstra/apstra/utils" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "strings" ) var _ NineTypesValidator = whenValueSetValidator{} From 850ee9076ea0f34b2e447664b984a8d3bae0e55c Mon Sep 17 00:00:00 2001 From: Chris Marget Date: Mon, 21 Oct 2024 17:41:20 -0400 Subject: [PATCH 4/4] put function signature on single line --- apstra/validator/must_be_one_of.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apstra/validator/must_be_one_of.go b/apstra/validator/must_be_one_of.go index b86af63b..f3c94a5b 100644 --- a/apstra/validator/must_be_one_of.go +++ b/apstra/validator/must_be_one_of.go @@ -38,9 +38,7 @@ func (o MustBeOneOfValidator) MarkdownDescription(_ context.Context) string { return fmt.Sprintf("Ensure that the value is one of the following : %s", o.OneOf) } -func (o MustBeOneOfValidator) Validate(_ context.Context, req MustBeOneOfValidatorRequest, - resp *MustBeOneOfValidatorResponse, -) { +func (o MustBeOneOfValidator) Validate(_ context.Context, req MustBeOneOfValidatorRequest, resp *MustBeOneOfValidatorResponse) { for _, v := range o.OneOf { if req.ConfigValue.Equal(v) { return