Skip to content

Commit

Permalink
fix psk resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Aug 26, 2024
1 parent a014524 commit 5fa0e80
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/resource_org_psk/sdk_to_terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (OrgPskModel, diag.Diagn
var diags diag.Diagnostics

var email types.String
var expire_time types.Int64
var expire_time types.Int64 = types.Int64Value(0)
var expiry_notification_time types.Int64
var id types.String
var mac types.String
Expand Down
2 changes: 1 addition & 1 deletion internal/resource_org_psk/terraform_to_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TerraformToSdk(ctx context.Context, plan *OrgPskModel) (models.Psk, diag.Di
unset["-max_usage"] = ""
}

data.Name = plan.Name.String()
data.Name = plan.Name.ValueString()

if !plan.Note.IsNull() && !plan.Note.IsUnknown() {
data.Note = plan.Note.ValueStringPointer()
Expand Down
6 changes: 5 additions & 1 deletion internal/resource_site_psk/sdk_to_terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag
var diags diag.Diagnostics

var email types.String
var expire_time types.Int64
var expire_time types.Int64 = types.Int64Value(0)
var expiry_notification_time types.Int64
var id types.String
var mac types.String
Expand All @@ -30,6 +30,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag
var passphrase types.String
var role types.String
var ssid types.String
var site_id types.String
var usage types.String
var vlan_id types.String

Expand Down Expand Up @@ -78,6 +79,8 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag

ssid = types.StringValue(d.Ssid)

site_id = types.StringValue(string(d.SiteId.String()))

usage = types.StringValue(string(*d.Usage))

if d.VlanId != nil {
Expand All @@ -99,6 +102,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag
state.OrgId = org_id
state.Role = role
state.Ssid = ssid
state.SiteId = site_id
state.Usage = usage
state.VlanId = vlan_id

Expand Down
2 changes: 1 addition & 1 deletion internal/resource_site_psk/terraform_to_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TerraformToSdk(ctx context.Context, plan *SitePskModel) (models.Psk, diag.D
unset["-macs"] = ""
}

data.Name = plan.Name.String()
data.Name = plan.Name.ValueString()

if !plan.Note.IsNull() && !plan.Note.IsUnknown() {
data.Note = plan.Note.ValueStringPointer()
Expand Down

0 comments on commit 5fa0e80

Please sign in to comment.