Skip to content

Commit

Permalink
update references to properties that were added to the Metal API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreatma committed Sep 19, 2024
1 parent c8d3253 commit 9a4164b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/resources/metal/project/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 9a4164b

Please sign in to comment.