From 5160f3642b9d4105f2fd1d5099bd103b37f9929c Mon Sep 17 00:00:00 2001 From: danischm Date: Tue, 3 Oct 2023 13:54:54 +0200 Subject: [PATCH] Fix network device group attributes --- gen/definitions/network_device_group.yaml | 2 +- internal/provider/model_ise_network_device_group.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gen/definitions/network_device_group.yaml b/gen/definitions/network_device_group.yaml index 385053b..8f9ea01 100644 --- a/gen/definitions/network_device_group.yaml +++ b/gen/definitions/network_device_group.yaml @@ -14,7 +14,7 @@ attributes: type: String description: Description example: My network device group - - model_name: othername + - model_name: ndgtype tf_name: root_group data_path: [NetworkDeviceGroup] type: String diff --git a/internal/provider/model_ise_network_device_group.go b/internal/provider/model_ise_network_device_group.go index ed3fa1f..2ea756d 100644 --- a/internal/provider/model_ise_network_device_group.go +++ b/internal/provider/model_ise_network_device_group.go @@ -57,7 +57,7 @@ func (data NetworkDeviceGroup) toBody(ctx context.Context, state NetworkDeviceGr body, _ = sjson.Set(body, "NetworkDeviceGroup.description", data.Description.ValueString()) } if !data.RootGroup.IsNull() { - body, _ = sjson.Set(body, "NetworkDeviceGroup.othername", data.RootGroup.ValueString()) + body, _ = sjson.Set(body, "NetworkDeviceGroup.ndgtype", data.RootGroup.ValueString()) } return body } @@ -76,7 +76,7 @@ func (data *NetworkDeviceGroup) fromBody(ctx context.Context, res gjson.Result) } else { data.Description = types.StringNull() } - if value := res.Get("NetworkDeviceGroup.othername"); value.Exists() { + if value := res.Get("NetworkDeviceGroup.ndgtype"); value.Exists() { data.RootGroup = types.StringValue(value.String()) } else { data.RootGroup = types.StringNull() @@ -97,7 +97,7 @@ func (data *NetworkDeviceGroup) updateFromBody(ctx context.Context, res gjson.Re } else { data.Description = types.StringNull() } - if value := res.Get("NetworkDeviceGroup.othername"); value.Exists() && !data.RootGroup.IsNull() { + if value := res.Get("NetworkDeviceGroup.ndgtype"); value.Exists() && !data.RootGroup.IsNull() { data.RootGroup = types.StringValue(value.String()) } else { data.RootGroup = types.StringNull()