Skip to content

Commit

Permalink
org_inventory ds fix for #51
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Nov 4, 2024
1 parent bee3fae commit b21ea52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
11 changes: 0 additions & 11 deletions internal/datasource_org_inventory/sdk_to_terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package datasource_org_inventory

import (
"context"
"math/big"

"github.com/tmunzer/mistapi-go/mistapi/models"

Expand All @@ -27,15 +26,13 @@ func inventorySdkToTerraform(ctx context.Context, diags *diag.Diagnostics, d mod
var adopted basetypes.BoolValue
var claim_code basetypes.StringValue
var connected basetypes.BoolValue
var created_time basetypes.NumberValue
var deviceprofile_id basetypes.StringValue
var hostname basetypes.StringValue
var hw_rev basetypes.StringValue
var id basetypes.StringValue
var jsi basetypes.BoolValue
var mac basetypes.StringValue
var model basetypes.StringValue
var modified_time basetypes.NumberValue
var name basetypes.StringValue
var org_id basetypes.StringValue
var serial basetypes.StringValue
Expand All @@ -50,9 +47,6 @@ func inventorySdkToTerraform(ctx context.Context, diags *diag.Diagnostics, d mod
if d.Connected != nil {
connected = types.BoolValue(*d.Connected)
}
if d.CreatedTime != nil {
created_time = types.NumberValue(big.NewFloat(*d.CreatedTime))
}
if d.DeviceprofileId.Value() != nil {
deviceprofile_id = types.StringValue(*d.DeviceprofileId.Value())
}
Expand All @@ -77,9 +71,6 @@ func inventorySdkToTerraform(ctx context.Context, diags *diag.Diagnostics, d mod
if d.Model != nil {
model = types.StringValue(*d.Model)
}
if d.ModifiedTime != nil {
modified_time = types.NumberValue(big.NewFloat(*d.ModifiedTime))
}
if d.Name != nil {
name = types.StringValue(*d.Name)
}
Expand Down Expand Up @@ -107,15 +98,13 @@ func inventorySdkToTerraform(ctx context.Context, diags *diag.Diagnostics, d mod
"adopted": adopted,
"claim_code": claim_code,
"connected": connected,
"created_time": created_time,
"deviceprofile_id": deviceprofile_id,
"hostname": hostname,
"hw_rev": hw_rev,
"id": id,
"jsi": jsi,
"mac": mac,
"model": model,
"modified_time": modified_time,
"name": name,
"org_id": org_id,
"serial": serial,
Expand Down
8 changes: 4 additions & 4 deletions internal/resource_org_inventory/sdk_to_terraform_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ func legacyProcessMistInventory(

data_map_attr_type := DevicesValue{}.AttributeTypes(ctx)
data_map_value := map[string]attr.Value{
"claim_code": claim_code,
"deviceprofile_id": deviceprofile_id,
"hostname": hostname,
"id": id,
"mac": mac,
"claim_code": claim_code,
"model": model,
"org_id": org_id,
"serial": serial,
"site_id": site_id,
"type": device_type,
"vc_mac": vc_mac,
"hostname": hostname,
"unclaim_when_destroyed": unclaim_when_destroyed,
"id": id,
"vc_mac": vc_mac,
}
newDevice, e := NewDevicesValue(data_map_attr_type, data_map_value)
diags.Append(e...)
Expand Down

0 comments on commit b21ea52

Please sign in to comment.