diff --git a/internal/provider/firewall_datasource.go b/internal/provider/firewall_datasource.go index f4a898c..0ce54cc 100644 --- a/internal/provider/firewall_datasource.go +++ b/internal/provider/firewall_datasource.go @@ -102,7 +102,7 @@ func GetFirewallsState(ctx context.Context, firewalls *[]ubicloud_client.Firewal firewallsValue := datasource_vm.FirewallsValue{} var firewallsValues []datasource_vm.FirewallsValue firewallRulesValue := datasource_vm.FirewallRulesValue{} - if *firewalls != nil && len(*firewalls) > 0 { + if firewalls != nil && len(*firewalls) > 0 { for _, f := range *firewalls { fwRules, fwRulesDiag := GetFirewallRulesState(ctx, f.FirewallRules) @@ -112,10 +112,10 @@ func GetFirewallsState(ctx context.Context, firewalls *[]ubicloud_client.Firewal } fw := datasource_vm.NewFirewallsValueMust(firewallsValue.AttributeTypes(ctx), map[string]attr.Value{ - "id": types.StringValue(*f.Id), - "location": types.StringValue(*f.Location), - "name": types.StringValue(*f.Name), - "description": types.StringValue(*f.Description), + "id": types.StringPointerValue(f.Id), + "location": types.StringPointerValue(f.Location), + "name": types.StringPointerValue(f.Name), + "description": types.StringPointerValue(f.Description), "firewall_rules": fwRules, }) firewallsValues = append(firewallsValues, fw) diff --git a/internal/provider/firewall_rule_datasource.go b/internal/provider/firewall_rule_datasource.go index 8b111c2..aac7286 100644 --- a/internal/provider/firewall_rule_datasource.go +++ b/internal/provider/firewall_rule_datasource.go @@ -94,12 +94,12 @@ func GetFirewallRulesState(ctx context.Context, firewallRules *[]ubicloud_client // Firewalls var firewallRulesValues []datasource_vm.FirewallRulesValue firewallRulesValue := datasource_vm.FirewallRulesValue{} - if *firewallRules != nil && len(*firewallRules) > 0 { + if firewallRules != nil && len(*firewallRules) > 0 { for _, r := range *firewallRules { fr := datasource_vm.NewFirewallRulesValueMust(firewallRulesValue.AttributeTypes(ctx), map[string]attr.Value{ - "id": types.StringValue(*r.Id), - "cidr": types.StringValue(*r.Cidr), - "port_range": types.StringValue(*r.PortRange), + "id": types.StringPointerValue(r.Id), + "cidr": types.StringPointerValue(r.Cidr), + "port_range": types.StringPointerValue(r.PortRange), }) firewallRulesValues = append(firewallRulesValues, fr) } diff --git a/internal/provider/postgres_datasource.go b/internal/provider/postgres_datasource.go index 4a33373..0dd7c08 100644 --- a/internal/provider/postgres_datasource.go +++ b/internal/provider/postgres_datasource.go @@ -118,11 +118,11 @@ func GetPostgresFirewallRulesState(ctx context.Context, firewallRules *[]ubiclou firewallRulesValue := datasource_postgres.FirewallRulesValue{} var firewallRulesValues []datasource_postgres.FirewallRulesValue - if *firewallRules != nil && len(*firewallRules) > 0 { + if firewallRules != nil && len(*firewallRules) > 0 { for _, r := range *firewallRules { fr := datasource_postgres.NewFirewallRulesValueMust(firewallRulesValue.AttributeTypes(ctx), map[string]attr.Value{ - "id": types.StringValue(*r.Id), - "cidr": types.StringValue(*r.Cidr), + "id": types.StringPointerValue(r.Id), + "cidr": types.StringPointerValue(r.Cidr), }) firewallRulesValues = append(firewallRulesValues, fr) } diff --git a/internal/provider/private_subnet_datasource.go b/internal/provider/private_subnet_datasource.go index c3ed690..d90db96 100644 --- a/internal/provider/private_subnet_datasource.go +++ b/internal/provider/private_subnet_datasource.go @@ -115,14 +115,14 @@ func GetNicsState(ctx context.Context, nics *[]ubicloud_client.Nic) (basetypes.L var diags diag.Diagnostics nicsValue := datasource_private_subnet.NicsValue{} var nicsValues []datasource_private_subnet.NicsValue - if *nics != nil && len(*nics) > 0 { + if nics != nil && len(*nics) > 0 { for _, n := range *nics { nv := datasource_private_subnet.NewNicsValueMust(nicsValue.AttributeTypes(ctx), map[string]attr.Value{ - "id": types.StringValue(*n.Id), - "name": types.StringValue(*n.Name), - "private_ipv4": types.StringValue(*n.PrivateIpv4), - "private_ipv6": types.StringValue(*n.PrivateIpv6), - "vm_name": types.StringValue(*n.VmName), + "id": types.StringPointerValue(n.Id), + "name": types.StringPointerValue(n.Name), + "private_ipv4": types.StringPointerValue(n.PrivateIpv4), + "private_ipv6": types.StringPointerValue(n.PrivateIpv6), + "vm_name": types.StringPointerValue(n.VmName), }) nicsValues = append(nicsValues, nv) }