diff --git a/go.mod b/go.mod index a6fe9bd3f..6763c9fa5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/equinix/terraform-provider-equinix go 1.22 require ( - github.com/equinix/equinix-sdk-go v0.44.0 + github.com/equinix/equinix-sdk-go v0.45.0 github.com/equinix/ne-go v1.17.0 github.com/equinix/oauth2-go v1.0.0 github.com/equinix/rest-go v1.3.0 diff --git a/go.sum b/go.sum index 92e4da8d7..ba24b2df6 100644 --- a/go.sum +++ b/go.sum @@ -39,8 +39,8 @@ github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/equinix/equinix-sdk-go v0.44.0 h1:v4ejvEGC6TYiwQ29NW4zaq7SlnqLe9SJmfLb4aanbkQ= -github.com/equinix/equinix-sdk-go v0.44.0/go.mod h1:hEb3XLaedz7xhl/dpPIS6eOIiXNPeqNiVoyDrT6paIg= +github.com/equinix/equinix-sdk-go v0.45.0 h1:M1moRw4Zt/nkxskDqzslfBc5TgB+QbqBiqBEfPkhl/Y= +github.com/equinix/equinix-sdk-go v0.45.0/go.mod h1:hEb3XLaedz7xhl/dpPIS6eOIiXNPeqNiVoyDrT6paIg= github.com/equinix/ne-go v1.17.0 h1:+wZq0GNognpiTHTsBXtATOCphTFvnowF046NzQXj0n0= github.com/equinix/ne-go v1.17.0/go.mod h1:eHkkxM4nbTB7DZ9X9zGnwfYnxIJWIsU3aHA+FAoZ1EI= github.com/equinix/oauth2-go v1.0.0 h1:fHtAPGq82PdgtK5vEThs8Vwz6f7D/8SX4tE3NJu+KcU= diff --git a/internal/resources/metal/project/models.go b/internal/resources/metal/project/models.go index f50de7118..3fe6b9ce2 100644 --- a/internal/resources/metal/project/models.go +++ b/internal/resources/metal/project/models.go @@ -2,11 +2,12 @@ package project import ( "context" - "github.com/equinix/equinix-sdk-go/services/metalv1" "path" "strings" "time" + "github.com/equinix/equinix-sdk-go/services/metalv1" + fwtypes "github.com/equinix/terraform-provider-equinix/internal/framework/types" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/types" @@ -50,8 +51,8 @@ func (m *ResourceModel) parse(ctx context.Context, project *metalv1.Project, bgp m.Name = types.StringValue(project.GetName()) m.Created = types.StringValue(project.GetCreatedAt().Format(time.RFC3339)) m.Updated = types.StringValue(project.GetUpdatedAt().Format(time.RFC3339)) - m.BackendTransfer = types.BoolValue(project.AdditionalProperties["backend_transfer_enabled"].(bool)) // No backend_transfer_enabled property in API spec - m.OrganizationID = types.StringValue(path.Base(project.Organization.AdditionalProperties["href"].(string))) + m.BackendTransfer = types.BoolValue(project.GetBackendTransferEnabled()) + m.OrganizationID = types.StringValue(path.Base(project.Organization.GetHref())) m.PaymentMethodID = types.StringValue("") if len(project.PaymentMethod.GetHref()) != 0 { @@ -74,8 +75,8 @@ func (m *DataSourceModel) parse(ctx context.Context, project *metalv1.Project, b m.Name = types.StringValue(project.GetName()) m.Created = types.StringValue(project.GetCreatedAt().Format(time.RFC3339)) m.Updated = types.StringValue(project.GetUpdatedAt().Format(time.RFC3339)) - m.BackendTransfer = types.BoolValue(project.AdditionalProperties["backend_transfer_enabled"].(bool)) // No backend_transfer_enabled property in API spec - m.OrganizationID = types.StringValue(path.Base(project.Organization.AdditionalProperties["href"].(string))) + m.BackendTransfer = types.BoolValue(project.GetBackendTransferEnabled()) + m.OrganizationID = types.StringValue(path.Base(project.Organization.GetHref())) m.PaymentMethodID = types.StringValue("") if len(project.PaymentMethod.GetHref()) != 0 {