Skip to content

Commit

Permalink
fix alarmtemplate_id unset in mist_org resource
Browse files Browse the repository at this point in the history
fix for #74
  • Loading branch information
tmunzer committed Jan 29, 2025
1 parent a5b4256 commit 197bd39
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/resource_org/terraform_to_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ func TerraformToSdk(plan *OrgModel) (*models.Org, diag.Diagnostics) {
data := models.Org{}
unset := make(map[string]interface{})

if plan.AlarmtemplateId.IsNull() || plan.AlarmtemplateId.IsUnknown() {
unset["-alarmtemplate_id"] = ""
} else {
data.AlarmtemplateId = models.NewOptional(models.ToPointer(uuid.MustParse(plan.AlarmtemplateId.ValueString())))
var alarmtemplateId models.Optional[uuid.UUID]
alarmtemplateId.ShouldSetValue(true)
if !plan.AlarmtemplateId.IsNull() && !plan.AlarmtemplateId.IsUnknown() {
alarmtemplateId.SetValue(models.ToPointer(uuid.MustParse(plan.AlarmtemplateId.ValueString())))
}
data.AlarmtemplateId = alarmtemplateId

if plan.AllowMist.IsNull() || plan.AllowMist.IsUnknown() {
unset["-allow_mist"] = ""
Expand All @@ -32,5 +33,6 @@ func TerraformToSdk(plan *OrgModel) (*models.Org, diag.Diagnostics) {
data.SessionExpiry = models.ToPointer(int(plan.SessionExpiry.ValueInt64()))
}

data.AdditionalProperties = unset
return &data, diags
}

0 comments on commit 197bd39

Please sign in to comment.