From e833bebb536c88ac02140d88480c901b735d7648 Mon Sep 17 00:00:00 2001 From: Thomas Munzer Date: Mon, 30 Dec 2024 16:20:42 +0100 Subject: [PATCH] add `mist_device_switch.local_port_config.note` --- .../resource_device_switch/device_switch_resource_gen.go | 5 +++++ .../sdk_to_terraform_local_port_config.go | 3 +++ .../terraform_to_sdk_local_port_config.go | 3 +++ 3 files changed, 11 insertions(+) diff --git a/internal/resource_device_switch/device_switch_resource_gen.go b/internal/resource_device_switch/device_switch_resource_gen.go index 004dfef0..0f2747d0 100644 --- a/internal/resource_device_switch/device_switch_resource_gen.go +++ b/internal/resource_device_switch/device_switch_resource_gen.go @@ -1007,6 +1007,11 @@ func DeviceSwitchResourceSchema(ctx context.Context) schema.Schema { Description: "Only if `mode`==`trunk`, the list of network/vlans", MarkdownDescription: "Only if `mode`==`trunk`, the list of network/vlans", }, + "note": schema.StringAttribute{ + Optional: true, + Description: "Additional note for the port config override", + MarkdownDescription: "Additional note for the port config override", + }, "persist_mac": schema.BoolAttribute{ Optional: true, Computed: true, diff --git a/internal/resource_device_switch/sdk_to_terraform_local_port_config.go b/internal/resource_device_switch/sdk_to_terraform_local_port_config.go index b5035f04..97208307 100644 --- a/internal/resource_device_switch/sdk_to_terraform_local_port_config.go +++ b/internal/resource_device_switch/sdk_to_terraform_local_port_config.go @@ -119,6 +119,9 @@ func localPortConfigSdkToTerraform(ctx context.Context, diags *diag.Diagnostics, if d.Networks != nil { item_obj.Networks = mist_transform.ListOfStringSdkToTerraform(ctx, d.Networks) } + if d.Note != nil { + item_obj.Note = types.StringValue(*d.Note) + } if d.PersistMac != nil { item_obj.PersistMac = types.BoolValue(*d.PersistMac) } diff --git a/internal/resource_device_switch/terraform_to_sdk_local_port_config.go b/internal/resource_device_switch/terraform_to_sdk_local_port_config.go index 7c3ae7e9..9641cff2 100644 --- a/internal/resource_device_switch/terraform_to_sdk_local_port_config.go +++ b/internal/resource_device_switch/terraform_to_sdk_local_port_config.go @@ -109,6 +109,9 @@ func LocalPortConfigTerraformToSdk(ctx context.Context, diags *diag.Diagnostics, if !plan_obj.Networks.IsNull() && !plan_obj.Networks.IsUnknown() { item_obj.Networks = mist_transform.ListOfStringTerraformToSdk(ctx, plan_obj.Networks) } + if plan_obj.Note.ValueStringPointer() != nil { + item_obj.Note = plan_obj.Note.ValueStringPointer() + } if plan_obj.PersistMac.ValueBoolPointer() != nil { item_obj.PersistMac = models.ToPointer(plan_obj.PersistMac.ValueBool()) }