// Copyright © 2023 Cisco Systems, Inc. and its affiliates.
// All rights reserved.
//
// Licensed under the Mozilla Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://mozilla.org/MPL/2.0/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: MPL-2.0

// Code generated by "gen/generator.go"; DO NOT EDIT.

package provider

// Section below is generated&owned by "gen/generator.go". //template:begin imports
import (
	"context"
	"fmt"
	"regexp"
	"strconv"

	"github.com/CiscoDevNet/terraform-provider-iosxe/internal/provider/helpers"
	"github.com/hashicorp/terraform-plugin-framework/types"
	"github.com/tidwall/gjson"
	"github.com/tidwall/sjson"
)

// End of section. //template:end imports

// Section below is generated&owned by "gen/generator.go". //template:begin types
type Errdisable struct {
	Device                                   types.String `tfsdk:"device"`
	Id                                       types.String `tfsdk:"id"`
	DeleteMode                               types.String `tfsdk:"delete_mode"`
	DetectCauseAll                           types.Bool   `tfsdk:"detect_cause_all"`
	DetectCauseArpInspection                 types.Bool   `tfsdk:"detect_cause_arp_inspection"`
	DetectCauseBpduguard                     types.Bool   `tfsdk:"detect_cause_bpduguard"`
	DetectCauseDhcpRateLimit                 types.Bool   `tfsdk:"detect_cause_dhcp_rate_limit"`
	DetectCauseDtpFlap                       types.Bool   `tfsdk:"detect_cause_dtp_flap"`
	DetectCauseGbicInvalid                   types.Bool   `tfsdk:"detect_cause_gbic_invalid"`
	DetectCauseInlinePower                   types.Bool   `tfsdk:"detect_cause_inline_power"`
	DetectCauseL2ptguard                     types.Bool   `tfsdk:"detect_cause_l2ptguard"`
	DetectCauseLinkFlap                      types.Bool   `tfsdk:"detect_cause_link_flap"`
	DetectCauseLoopback                      types.Bool   `tfsdk:"detect_cause_loopback"`
	DetectCauseMlacpMinlink                  types.Bool   `tfsdk:"detect_cause_mlacp_minlink"`
	DetectCausePagpFlap                      types.Bool   `tfsdk:"detect_cause_pagp_flap"`
	DetectCausePppoeIaRateLimit              types.Bool   `tfsdk:"detect_cause_pppoe_ia_rate_limit"`
	DetectCauseSecurityViolationShutdownVlan types.Bool   `tfsdk:"detect_cause_security_violation_shutdown_vlan"`
	DetectCauseSfpConfigMismatch             types.Bool   `tfsdk:"detect_cause_sfp_config_mismatch"`
	DetectCauseSmallFrame                    types.Bool   `tfsdk:"detect_cause_small_frame"`
	DetectCauseLoopdetect                    types.Bool   `tfsdk:"detect_cause_loopdetect"`
	FlapSettingCauseDtpFlapMaxFlaps          types.Int64  `tfsdk:"flap_setting_cause_dtp_flap_max_flaps"`
	FlapSettingCauseDtpFlapTime              types.Int64  `tfsdk:"flap_setting_cause_dtp_flap_time"`
	FlapSettingCauseLinkFlapMaxFlaps         types.Int64  `tfsdk:"flap_setting_cause_link_flap_max_flaps"`
	FlapSettingCauseLinkFlapTime             types.Int64  `tfsdk:"flap_setting_cause_link_flap_time"`
	FlapSettingCausePagpFlapMaxFlaps         types.Int64  `tfsdk:"flap_setting_cause_pagp_flap_max_flaps"`
	FlapSettingCausePagpFlapTime             types.Int64  `tfsdk:"flap_setting_cause_pagp_flap_time"`
	RecoveryInterval                         types.Int64  `tfsdk:"recovery_interval"`
	RecoveryCauseAll                         types.Bool   `tfsdk:"recovery_cause_all"`
	RecoveryCauseArpInspection               types.Bool   `tfsdk:"recovery_cause_arp_inspection"`
	RecoveryCauseBpduguard                   types.Bool   `tfsdk:"recovery_cause_bpduguard"`
	RecoveryCauseChannelMisconfig            types.Bool   `tfsdk:"recovery_cause_channel_misconfig"`
	RecoveryCauseDhcpRateLimit               types.Bool   `tfsdk:"recovery_cause_dhcp_rate_limit"`
	RecoveryCauseDtpFlap                     types.Bool   `tfsdk:"recovery_cause_dtp_flap"`
	RecoveryCauseGbicInvalid                 types.Bool   `tfsdk:"recovery_cause_gbic_invalid"`
	RecoveryCauseInlinePower                 types.Bool   `tfsdk:"recovery_cause_inline_power"`
	RecoveryCauseL2ptguard                   types.Bool   `tfsdk:"recovery_cause_l2ptguard"`
	RecoveryCauseLinkFlap                    types.Bool   `tfsdk:"recovery_cause_link_flap"`
	RecoveryCauseLinkMonitorFailure          types.Bool   `tfsdk:"recovery_cause_link_monitor_failure"`
	RecoveryCauseLoopback                    types.Bool   `tfsdk:"recovery_cause_loopback"`
	RecoveryCauseMacLimit                    types.Bool   `tfsdk:"recovery_cause_mac_limit"`
	RecoveryCauseMlacpMinlink                types.Bool   `tfsdk:"recovery_cause_mlacp_minlink"`
	RecoveryCausePagpFlap                    types.Bool   `tfsdk:"recovery_cause_pagp_flap"`
	RecoveryCausePortModeFailure             types.Bool   `tfsdk:"recovery_cause_port_mode_failure"`
	RecoveryCausePppoeIaRateLimit            types.Bool   `tfsdk:"recovery_cause_pppoe_ia_rate_limit"`
	RecoveryCausePsp                         types.Bool   `tfsdk:"recovery_cause_psp"`
	RecoveryCausePsecureViolation            types.Bool   `tfsdk:"recovery_cause_psecure_violation"`
	RecoveryCauseSecurityViolation           types.Bool   `tfsdk:"recovery_cause_security_violation"`
	RecoveryCauseSfpConfigMismatch           types.Bool   `tfsdk:"recovery_cause_sfp_config_mismatch"`
	RecoveryCauseSmallFrame                  types.Bool   `tfsdk:"recovery_cause_small_frame"`
	RecoveryCauseStormControl                types.Bool   `tfsdk:"recovery_cause_storm_control"`
	RecoveryCauseUdld                        types.Bool   `tfsdk:"recovery_cause_udld"`
	RecoveryCauseUnicastFlood                types.Bool   `tfsdk:"recovery_cause_unicast_flood"`
	RecoveryCauseVmps                        types.Bool   `tfsdk:"recovery_cause_vmps"`
	RecoveryCauseLoopdetect                  types.Bool   `tfsdk:"recovery_cause_loopdetect"`
	RecoveryCauseOamRemoteFailure            types.Bool   `tfsdk:"recovery_cause_oam_remote_failure"`
	RecoveryCauseMrpMiscabling               types.Bool   `tfsdk:"recovery_cause_mrp_miscabling"`
}

type ErrdisableData struct {
	Device                                   types.String `tfsdk:"device"`
	Id                                       types.String `tfsdk:"id"`
	DetectCauseAll                           types.Bool   `tfsdk:"detect_cause_all"`
	DetectCauseArpInspection                 types.Bool   `tfsdk:"detect_cause_arp_inspection"`
	DetectCauseBpduguard                     types.Bool   `tfsdk:"detect_cause_bpduguard"`
	DetectCauseDhcpRateLimit                 types.Bool   `tfsdk:"detect_cause_dhcp_rate_limit"`
	DetectCauseDtpFlap                       types.Bool   `tfsdk:"detect_cause_dtp_flap"`
	DetectCauseGbicInvalid                   types.Bool   `tfsdk:"detect_cause_gbic_invalid"`
	DetectCauseInlinePower                   types.Bool   `tfsdk:"detect_cause_inline_power"`
	DetectCauseL2ptguard                     types.Bool   `tfsdk:"detect_cause_l2ptguard"`
	DetectCauseLinkFlap                      types.Bool   `tfsdk:"detect_cause_link_flap"`
	DetectCauseLoopback                      types.Bool   `tfsdk:"detect_cause_loopback"`
	DetectCauseMlacpMinlink                  types.Bool   `tfsdk:"detect_cause_mlacp_minlink"`
	DetectCausePagpFlap                      types.Bool   `tfsdk:"detect_cause_pagp_flap"`
	DetectCausePppoeIaRateLimit              types.Bool   `tfsdk:"detect_cause_pppoe_ia_rate_limit"`
	DetectCauseSecurityViolationShutdownVlan types.Bool   `tfsdk:"detect_cause_security_violation_shutdown_vlan"`
	DetectCauseSfpConfigMismatch             types.Bool   `tfsdk:"detect_cause_sfp_config_mismatch"`
	DetectCauseSmallFrame                    types.Bool   `tfsdk:"detect_cause_small_frame"`
	DetectCauseLoopdetect                    types.Bool   `tfsdk:"detect_cause_loopdetect"`
	FlapSettingCauseDtpFlapMaxFlaps          types.Int64  `tfsdk:"flap_setting_cause_dtp_flap_max_flaps"`
	FlapSettingCauseDtpFlapTime              types.Int64  `tfsdk:"flap_setting_cause_dtp_flap_time"`
	FlapSettingCauseLinkFlapMaxFlaps         types.Int64  `tfsdk:"flap_setting_cause_link_flap_max_flaps"`
	FlapSettingCauseLinkFlapTime             types.Int64  `tfsdk:"flap_setting_cause_link_flap_time"`
	FlapSettingCausePagpFlapMaxFlaps         types.Int64  `tfsdk:"flap_setting_cause_pagp_flap_max_flaps"`
	FlapSettingCausePagpFlapTime             types.Int64  `tfsdk:"flap_setting_cause_pagp_flap_time"`
	RecoveryInterval                         types.Int64  `tfsdk:"recovery_interval"`
	RecoveryCauseAll                         types.Bool   `tfsdk:"recovery_cause_all"`
	RecoveryCauseArpInspection               types.Bool   `tfsdk:"recovery_cause_arp_inspection"`
	RecoveryCauseBpduguard                   types.Bool   `tfsdk:"recovery_cause_bpduguard"`
	RecoveryCauseChannelMisconfig            types.Bool   `tfsdk:"recovery_cause_channel_misconfig"`
	RecoveryCauseDhcpRateLimit               types.Bool   `tfsdk:"recovery_cause_dhcp_rate_limit"`
	RecoveryCauseDtpFlap                     types.Bool   `tfsdk:"recovery_cause_dtp_flap"`
	RecoveryCauseGbicInvalid                 types.Bool   `tfsdk:"recovery_cause_gbic_invalid"`
	RecoveryCauseInlinePower                 types.Bool   `tfsdk:"recovery_cause_inline_power"`
	RecoveryCauseL2ptguard                   types.Bool   `tfsdk:"recovery_cause_l2ptguard"`
	RecoveryCauseLinkFlap                    types.Bool   `tfsdk:"recovery_cause_link_flap"`
	RecoveryCauseLinkMonitorFailure          types.Bool   `tfsdk:"recovery_cause_link_monitor_failure"`
	RecoveryCauseLoopback                    types.Bool   `tfsdk:"recovery_cause_loopback"`
	RecoveryCauseMacLimit                    types.Bool   `tfsdk:"recovery_cause_mac_limit"`
	RecoveryCauseMlacpMinlink                types.Bool   `tfsdk:"recovery_cause_mlacp_minlink"`
	RecoveryCausePagpFlap                    types.Bool   `tfsdk:"recovery_cause_pagp_flap"`
	RecoveryCausePortModeFailure             types.Bool   `tfsdk:"recovery_cause_port_mode_failure"`
	RecoveryCausePppoeIaRateLimit            types.Bool   `tfsdk:"recovery_cause_pppoe_ia_rate_limit"`
	RecoveryCausePsp                         types.Bool   `tfsdk:"recovery_cause_psp"`
	RecoveryCausePsecureViolation            types.Bool   `tfsdk:"recovery_cause_psecure_violation"`
	RecoveryCauseSecurityViolation           types.Bool   `tfsdk:"recovery_cause_security_violation"`
	RecoveryCauseSfpConfigMismatch           types.Bool   `tfsdk:"recovery_cause_sfp_config_mismatch"`
	RecoveryCauseSmallFrame                  types.Bool   `tfsdk:"recovery_cause_small_frame"`
	RecoveryCauseStormControl                types.Bool   `tfsdk:"recovery_cause_storm_control"`
	RecoveryCauseUdld                        types.Bool   `tfsdk:"recovery_cause_udld"`
	RecoveryCauseUnicastFlood                types.Bool   `tfsdk:"recovery_cause_unicast_flood"`
	RecoveryCauseVmps                        types.Bool   `tfsdk:"recovery_cause_vmps"`
	RecoveryCauseLoopdetect                  types.Bool   `tfsdk:"recovery_cause_loopdetect"`
	RecoveryCauseOamRemoteFailure            types.Bool   `tfsdk:"recovery_cause_oam_remote_failure"`
	RecoveryCauseMrpMiscabling               types.Bool   `tfsdk:"recovery_cause_mrp_miscabling"`
}

// End of section. //template:end types

// Section below is generated&owned by "gen/generator.go". //template:begin getPath

func (data Errdisable) getPath() string {
	return "Cisco-IOS-XE-native:native/errdisable"
}

func (data ErrdisableData) getPath() string {
	return "Cisco-IOS-XE-native:native/errdisable"
}

// if last path element has a key -> remove it
func (data Errdisable) getPathShort() string {
	path := data.getPath()
	re := regexp.MustCompile(`(.*)=[^\/]*$`)
	matches := re.FindStringSubmatch(path)
	if len(matches) <= 1 {
		return path
	}
	return matches[1]
}

// End of section. //template:end getPath

// Section below is generated&owned by "gen/generator.go". //template:begin toBody

func (data Errdisable) toBody(ctx context.Context) string {
	body := `{"` + helpers.LastElement(data.getPath()) + `":{}}`
	if !data.DetectCauseAll.IsNull() && !data.DetectCauseAll.IsUnknown() {
		if data.DetectCauseAll.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.all", map[string]string{})
		}
	}
	if !data.DetectCauseArpInspection.IsNull() && !data.DetectCauseArpInspection.IsUnknown() {
		if data.DetectCauseArpInspection.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.arp-inspection", map[string]string{})
		}
	}
	if !data.DetectCauseBpduguard.IsNull() && !data.DetectCauseBpduguard.IsUnknown() {
		if data.DetectCauseBpduguard.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.bpduguard", map[string]string{})
		}
	}
	if !data.DetectCauseDhcpRateLimit.IsNull() && !data.DetectCauseDhcpRateLimit.IsUnknown() {
		if data.DetectCauseDhcpRateLimit.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.dhcp-rate-limit", map[string]string{})
		}
	}
	if !data.DetectCauseDtpFlap.IsNull() && !data.DetectCauseDtpFlap.IsUnknown() {
		if data.DetectCauseDtpFlap.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.dtp-flap", map[string]string{})
		}
	}
	if !data.DetectCauseGbicInvalid.IsNull() && !data.DetectCauseGbicInvalid.IsUnknown() {
		if data.DetectCauseGbicInvalid.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.gbic-invalid", map[string]string{})
		}
	}
	if !data.DetectCauseInlinePower.IsNull() && !data.DetectCauseInlinePower.IsUnknown() {
		if data.DetectCauseInlinePower.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.inline-power", map[string]string{})
		}
	}
	if !data.DetectCauseL2ptguard.IsNull() && !data.DetectCauseL2ptguard.IsUnknown() {
		if data.DetectCauseL2ptguard.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.l2ptguard", map[string]string{})
		}
	}
	if !data.DetectCauseLinkFlap.IsNull() && !data.DetectCauseLinkFlap.IsUnknown() {
		if data.DetectCauseLinkFlap.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.link-flap", map[string]string{})
		}
	}
	if !data.DetectCauseLoopback.IsNull() && !data.DetectCauseLoopback.IsUnknown() {
		if data.DetectCauseLoopback.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.loopback", map[string]string{})
		}
	}
	if !data.DetectCauseMlacpMinlink.IsNull() && !data.DetectCauseMlacpMinlink.IsUnknown() {
		if data.DetectCauseMlacpMinlink.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.mlacp-minlink", map[string]string{})
		}
	}
	if !data.DetectCausePagpFlap.IsNull() && !data.DetectCausePagpFlap.IsUnknown() {
		if data.DetectCausePagpFlap.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.pagp-flap", map[string]string{})
		}
	}
	if !data.DetectCausePppoeIaRateLimit.IsNull() && !data.DetectCausePppoeIaRateLimit.IsUnknown() {
		if data.DetectCausePppoeIaRateLimit.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.pppoe-ia-rate-limit", map[string]string{})
		}
	}
	if !data.DetectCauseSecurityViolationShutdownVlan.IsNull() && !data.DetectCauseSecurityViolationShutdownVlan.IsUnknown() {
		if data.DetectCauseSecurityViolationShutdownVlan.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.security-violation.shutdown.vlan", map[string]string{})
		}
	}
	if !data.DetectCauseSfpConfigMismatch.IsNull() && !data.DetectCauseSfpConfigMismatch.IsUnknown() {
		if data.DetectCauseSfpConfigMismatch.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.sfp-config-mismatch", map[string]string{})
		}
	}
	if !data.DetectCauseSmallFrame.IsNull() && !data.DetectCauseSmallFrame.IsUnknown() {
		if data.DetectCauseSmallFrame.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.small-frame", map[string]string{})
		}
	}
	if !data.DetectCauseLoopdetect.IsNull() && !data.DetectCauseLoopdetect.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"detect.cause.loopdetect", data.DetectCauseLoopdetect.ValueBool())
	}
	if !data.FlapSettingCauseDtpFlapMaxFlaps.IsNull() && !data.FlapSettingCauseDtpFlapMaxFlaps.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"flap-setting.cause.dtp-flap.max-flaps", strconv.FormatInt(data.FlapSettingCauseDtpFlapMaxFlaps.ValueInt64(), 10))
	}
	if !data.FlapSettingCauseDtpFlapTime.IsNull() && !data.FlapSettingCauseDtpFlapTime.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"flap-setting.cause.dtp-flap.time", strconv.FormatInt(data.FlapSettingCauseDtpFlapTime.ValueInt64(), 10))
	}
	if !data.FlapSettingCauseLinkFlapMaxFlaps.IsNull() && !data.FlapSettingCauseLinkFlapMaxFlaps.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"flap-setting.cause.link-flap.max-flaps", strconv.FormatInt(data.FlapSettingCauseLinkFlapMaxFlaps.ValueInt64(), 10))
	}
	if !data.FlapSettingCauseLinkFlapTime.IsNull() && !data.FlapSettingCauseLinkFlapTime.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"flap-setting.cause.link-flap.time", strconv.FormatInt(data.FlapSettingCauseLinkFlapTime.ValueInt64(), 10))
	}
	if !data.FlapSettingCausePagpFlapMaxFlaps.IsNull() && !data.FlapSettingCausePagpFlapMaxFlaps.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"flap-setting.cause.pagp-flap.max-flaps", strconv.FormatInt(data.FlapSettingCausePagpFlapMaxFlaps.ValueInt64(), 10))
	}
	if !data.FlapSettingCausePagpFlapTime.IsNull() && !data.FlapSettingCausePagpFlapTime.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"flap-setting.cause.pagp-flap.time", strconv.FormatInt(data.FlapSettingCausePagpFlapTime.ValueInt64(), 10))
	}
	if !data.RecoveryInterval.IsNull() && !data.RecoveryInterval.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.interval", strconv.FormatInt(data.RecoveryInterval.ValueInt64(), 10))
	}
	if !data.RecoveryCauseAll.IsNull() && !data.RecoveryCauseAll.IsUnknown() {
		if data.RecoveryCauseAll.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.all", map[string]string{})
		}
	}
	if !data.RecoveryCauseArpInspection.IsNull() && !data.RecoveryCauseArpInspection.IsUnknown() {
		if data.RecoveryCauseArpInspection.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.arp-inspection", map[string]string{})
		}
	}
	if !data.RecoveryCauseBpduguard.IsNull() && !data.RecoveryCauseBpduguard.IsUnknown() {
		if data.RecoveryCauseBpduguard.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.bpduguard", map[string]string{})
		}
	}
	if !data.RecoveryCauseChannelMisconfig.IsNull() && !data.RecoveryCauseChannelMisconfig.IsUnknown() {
		if data.RecoveryCauseChannelMisconfig.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.channel-misconfig", map[string]string{})
		}
	}
	if !data.RecoveryCauseDhcpRateLimit.IsNull() && !data.RecoveryCauseDhcpRateLimit.IsUnknown() {
		if data.RecoveryCauseDhcpRateLimit.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.dhcp-rate-limit", map[string]string{})
		}
	}
	if !data.RecoveryCauseDtpFlap.IsNull() && !data.RecoveryCauseDtpFlap.IsUnknown() {
		if data.RecoveryCauseDtpFlap.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.dtp-flap", map[string]string{})
		}
	}
	if !data.RecoveryCauseGbicInvalid.IsNull() && !data.RecoveryCauseGbicInvalid.IsUnknown() {
		if data.RecoveryCauseGbicInvalid.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.gbic-invalid", map[string]string{})
		}
	}
	if !data.RecoveryCauseInlinePower.IsNull() && !data.RecoveryCauseInlinePower.IsUnknown() {
		if data.RecoveryCauseInlinePower.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.inline-power", map[string]string{})
		}
	}
	if !data.RecoveryCauseL2ptguard.IsNull() && !data.RecoveryCauseL2ptguard.IsUnknown() {
		if data.RecoveryCauseL2ptguard.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.l2ptguard", map[string]string{})
		}
	}
	if !data.RecoveryCauseLinkFlap.IsNull() && !data.RecoveryCauseLinkFlap.IsUnknown() {
		if data.RecoveryCauseLinkFlap.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.link-flap", map[string]string{})
		}
	}
	if !data.RecoveryCauseLinkMonitorFailure.IsNull() && !data.RecoveryCauseLinkMonitorFailure.IsUnknown() {
		if data.RecoveryCauseLinkMonitorFailure.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.link-monitor-failure", map[string]string{})
		}
	}
	if !data.RecoveryCauseLoopback.IsNull() && !data.RecoveryCauseLoopback.IsUnknown() {
		if data.RecoveryCauseLoopback.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.loopback", map[string]string{})
		}
	}
	if !data.RecoveryCauseMacLimit.IsNull() && !data.RecoveryCauseMacLimit.IsUnknown() {
		if data.RecoveryCauseMacLimit.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.mac-limit", map[string]string{})
		}
	}
	if !data.RecoveryCauseMlacpMinlink.IsNull() && !data.RecoveryCauseMlacpMinlink.IsUnknown() {
		if data.RecoveryCauseMlacpMinlink.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.mlacp-minlink", map[string]string{})
		}
	}
	if !data.RecoveryCausePagpFlap.IsNull() && !data.RecoveryCausePagpFlap.IsUnknown() {
		if data.RecoveryCausePagpFlap.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.pagp-flap", map[string]string{})
		}
	}
	if !data.RecoveryCausePortModeFailure.IsNull() && !data.RecoveryCausePortModeFailure.IsUnknown() {
		if data.RecoveryCausePortModeFailure.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.port-mode-failure", map[string]string{})
		}
	}
	if !data.RecoveryCausePppoeIaRateLimit.IsNull() && !data.RecoveryCausePppoeIaRateLimit.IsUnknown() {
		if data.RecoveryCausePppoeIaRateLimit.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.pppoe-ia-rate-limit", map[string]string{})
		}
	}
	if !data.RecoveryCausePsp.IsNull() && !data.RecoveryCausePsp.IsUnknown() {
		if data.RecoveryCausePsp.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.psp", map[string]string{})
		}
	}
	if !data.RecoveryCausePsecureViolation.IsNull() && !data.RecoveryCausePsecureViolation.IsUnknown() {
		if data.RecoveryCausePsecureViolation.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.psecure-violation", map[string]string{})
		}
	}
	if !data.RecoveryCauseSecurityViolation.IsNull() && !data.RecoveryCauseSecurityViolation.IsUnknown() {
		if data.RecoveryCauseSecurityViolation.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.security-violation", map[string]string{})
		}
	}
	if !data.RecoveryCauseSfpConfigMismatch.IsNull() && !data.RecoveryCauseSfpConfigMismatch.IsUnknown() {
		if data.RecoveryCauseSfpConfigMismatch.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.sfp-config-mismatch", map[string]string{})
		}
	}
	if !data.RecoveryCauseSmallFrame.IsNull() && !data.RecoveryCauseSmallFrame.IsUnknown() {
		if data.RecoveryCauseSmallFrame.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.small-frame", map[string]string{})
		}
	}
	if !data.RecoveryCauseStormControl.IsNull() && !data.RecoveryCauseStormControl.IsUnknown() {
		if data.RecoveryCauseStormControl.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.storm-control", map[string]string{})
		}
	}
	if !data.RecoveryCauseUdld.IsNull() && !data.RecoveryCauseUdld.IsUnknown() {
		if data.RecoveryCauseUdld.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.udld", map[string]string{})
		}
	}
	if !data.RecoveryCauseUnicastFlood.IsNull() && !data.RecoveryCauseUnicastFlood.IsUnknown() {
		if data.RecoveryCauseUnicastFlood.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.unicast-flood", map[string]string{})
		}
	}
	if !data.RecoveryCauseVmps.IsNull() && !data.RecoveryCauseVmps.IsUnknown() {
		if data.RecoveryCauseVmps.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.vmps", map[string]string{})
		}
	}
	if !data.RecoveryCauseLoopdetect.IsNull() && !data.RecoveryCauseLoopdetect.IsUnknown() {
		if data.RecoveryCauseLoopdetect.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.loopdetect", map[string]string{})
		}
	}
	if !data.RecoveryCauseOamRemoteFailure.IsNull() && !data.RecoveryCauseOamRemoteFailure.IsUnknown() {
		if data.RecoveryCauseOamRemoteFailure.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.oam-remote-failure", map[string]string{})
		}
	}
	if !data.RecoveryCauseMrpMiscabling.IsNull() && !data.RecoveryCauseMrpMiscabling.IsUnknown() {
		if data.RecoveryCauseMrpMiscabling.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"recovery.cause.mrp-miscabling", map[string]string{})
		}
	}
	return body
}

// End of section. //template:end toBody

// Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody

func (data *Errdisable) updateFromBody(ctx context.Context, res gjson.Result) {
	prefix := helpers.LastElement(data.getPath()) + "."
	if res.Get(helpers.LastElement(data.getPath())).IsArray() {
		prefix += "0."
	}
	if value := res.Get(prefix + "detect.cause.all"); !data.DetectCauseAll.IsNull() {
		if value.Exists() {
			data.DetectCauseAll = types.BoolValue(true)
		} else {
			data.DetectCauseAll = types.BoolValue(false)
		}
	} else {
		data.DetectCauseAll = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.arp-inspection"); !data.DetectCauseArpInspection.IsNull() {
		if value.Exists() {
			data.DetectCauseArpInspection = types.BoolValue(true)
		} else {
			data.DetectCauseArpInspection = types.BoolValue(false)
		}
	} else {
		data.DetectCauseArpInspection = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.bpduguard"); !data.DetectCauseBpduguard.IsNull() {
		if value.Exists() {
			data.DetectCauseBpduguard = types.BoolValue(true)
		} else {
			data.DetectCauseBpduguard = types.BoolValue(false)
		}
	} else {
		data.DetectCauseBpduguard = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.dhcp-rate-limit"); !data.DetectCauseDhcpRateLimit.IsNull() {
		if value.Exists() {
			data.DetectCauseDhcpRateLimit = types.BoolValue(true)
		} else {
			data.DetectCauseDhcpRateLimit = types.BoolValue(false)
		}
	} else {
		data.DetectCauseDhcpRateLimit = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.dtp-flap"); !data.DetectCauseDtpFlap.IsNull() {
		if value.Exists() {
			data.DetectCauseDtpFlap = types.BoolValue(true)
		} else {
			data.DetectCauseDtpFlap = types.BoolValue(false)
		}
	} else {
		data.DetectCauseDtpFlap = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.gbic-invalid"); !data.DetectCauseGbicInvalid.IsNull() {
		if value.Exists() {
			data.DetectCauseGbicInvalid = types.BoolValue(true)
		} else {
			data.DetectCauseGbicInvalid = types.BoolValue(false)
		}
	} else {
		data.DetectCauseGbicInvalid = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.inline-power"); !data.DetectCauseInlinePower.IsNull() {
		if value.Exists() {
			data.DetectCauseInlinePower = types.BoolValue(true)
		} else {
			data.DetectCauseInlinePower = types.BoolValue(false)
		}
	} else {
		data.DetectCauseInlinePower = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.l2ptguard"); !data.DetectCauseL2ptguard.IsNull() {
		if value.Exists() {
			data.DetectCauseL2ptguard = types.BoolValue(true)
		} else {
			data.DetectCauseL2ptguard = types.BoolValue(false)
		}
	} else {
		data.DetectCauseL2ptguard = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.link-flap"); !data.DetectCauseLinkFlap.IsNull() {
		if value.Exists() {
			data.DetectCauseLinkFlap = types.BoolValue(true)
		} else {
			data.DetectCauseLinkFlap = types.BoolValue(false)
		}
	} else {
		data.DetectCauseLinkFlap = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.loopback"); !data.DetectCauseLoopback.IsNull() {
		if value.Exists() {
			data.DetectCauseLoopback = types.BoolValue(true)
		} else {
			data.DetectCauseLoopback = types.BoolValue(false)
		}
	} else {
		data.DetectCauseLoopback = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.mlacp-minlink"); !data.DetectCauseMlacpMinlink.IsNull() {
		if value.Exists() {
			data.DetectCauseMlacpMinlink = types.BoolValue(true)
		} else {
			data.DetectCauseMlacpMinlink = types.BoolValue(false)
		}
	} else {
		data.DetectCauseMlacpMinlink = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.pagp-flap"); !data.DetectCausePagpFlap.IsNull() {
		if value.Exists() {
			data.DetectCausePagpFlap = types.BoolValue(true)
		} else {
			data.DetectCausePagpFlap = types.BoolValue(false)
		}
	} else {
		data.DetectCausePagpFlap = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.pppoe-ia-rate-limit"); !data.DetectCausePppoeIaRateLimit.IsNull() {
		if value.Exists() {
			data.DetectCausePppoeIaRateLimit = types.BoolValue(true)
		} else {
			data.DetectCausePppoeIaRateLimit = types.BoolValue(false)
		}
	} else {
		data.DetectCausePppoeIaRateLimit = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.security-violation.shutdown.vlan"); !data.DetectCauseSecurityViolationShutdownVlan.IsNull() {
		if value.Exists() {
			data.DetectCauseSecurityViolationShutdownVlan = types.BoolValue(true)
		} else {
			data.DetectCauseSecurityViolationShutdownVlan = types.BoolValue(false)
		}
	} else {
		data.DetectCauseSecurityViolationShutdownVlan = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.sfp-config-mismatch"); !data.DetectCauseSfpConfigMismatch.IsNull() {
		if value.Exists() {
			data.DetectCauseSfpConfigMismatch = types.BoolValue(true)
		} else {
			data.DetectCauseSfpConfigMismatch = types.BoolValue(false)
		}
	} else {
		data.DetectCauseSfpConfigMismatch = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.small-frame"); !data.DetectCauseSmallFrame.IsNull() {
		if value.Exists() {
			data.DetectCauseSmallFrame = types.BoolValue(true)
		} else {
			data.DetectCauseSmallFrame = types.BoolValue(false)
		}
	} else {
		data.DetectCauseSmallFrame = types.BoolNull()
	}
	if value := res.Get(prefix + "detect.cause.loopdetect"); !data.DetectCauseLoopdetect.IsNull() {
		if value.Exists() {
			data.DetectCauseLoopdetect = types.BoolValue(value.Bool())
		}
	} else {
		data.DetectCauseLoopdetect = types.BoolNull()
	}
	if value := res.Get(prefix + "flap-setting.cause.dtp-flap.max-flaps"); value.Exists() && !data.FlapSettingCauseDtpFlapMaxFlaps.IsNull() {
		data.FlapSettingCauseDtpFlapMaxFlaps = types.Int64Value(value.Int())
	} else {
		data.FlapSettingCauseDtpFlapMaxFlaps = types.Int64Null()
	}
	if value := res.Get(prefix + "flap-setting.cause.dtp-flap.time"); value.Exists() && !data.FlapSettingCauseDtpFlapTime.IsNull() {
		data.FlapSettingCauseDtpFlapTime = types.Int64Value(value.Int())
	} else {
		data.FlapSettingCauseDtpFlapTime = types.Int64Null()
	}
	if value := res.Get(prefix + "flap-setting.cause.link-flap.max-flaps"); value.Exists() && !data.FlapSettingCauseLinkFlapMaxFlaps.IsNull() {
		data.FlapSettingCauseLinkFlapMaxFlaps = types.Int64Value(value.Int())
	} else {
		data.FlapSettingCauseLinkFlapMaxFlaps = types.Int64Null()
	}
	if value := res.Get(prefix + "flap-setting.cause.link-flap.time"); value.Exists() && !data.FlapSettingCauseLinkFlapTime.IsNull() {
		data.FlapSettingCauseLinkFlapTime = types.Int64Value(value.Int())
	} else {
		data.FlapSettingCauseLinkFlapTime = types.Int64Null()
	}
	if value := res.Get(prefix + "flap-setting.cause.pagp-flap.max-flaps"); value.Exists() && !data.FlapSettingCausePagpFlapMaxFlaps.IsNull() {
		data.FlapSettingCausePagpFlapMaxFlaps = types.Int64Value(value.Int())
	} else {
		data.FlapSettingCausePagpFlapMaxFlaps = types.Int64Null()
	}
	if value := res.Get(prefix + "flap-setting.cause.pagp-flap.time"); value.Exists() && !data.FlapSettingCausePagpFlapTime.IsNull() {
		data.FlapSettingCausePagpFlapTime = types.Int64Value(value.Int())
	} else {
		data.FlapSettingCausePagpFlapTime = types.Int64Null()
	}
	if value := res.Get(prefix + "recovery.interval"); value.Exists() && !data.RecoveryInterval.IsNull() {
		data.RecoveryInterval = types.Int64Value(value.Int())
	} else {
		data.RecoveryInterval = types.Int64Null()
	}
	if value := res.Get(prefix + "recovery.cause.all"); !data.RecoveryCauseAll.IsNull() {
		if value.Exists() {
			data.RecoveryCauseAll = types.BoolValue(true)
		} else {
			data.RecoveryCauseAll = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseAll = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.arp-inspection"); !data.RecoveryCauseArpInspection.IsNull() {
		if value.Exists() {
			data.RecoveryCauseArpInspection = types.BoolValue(true)
		} else {
			data.RecoveryCauseArpInspection = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseArpInspection = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.bpduguard"); !data.RecoveryCauseBpduguard.IsNull() {
		if value.Exists() {
			data.RecoveryCauseBpduguard = types.BoolValue(true)
		} else {
			data.RecoveryCauseBpduguard = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseBpduguard = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.channel-misconfig"); !data.RecoveryCauseChannelMisconfig.IsNull() {
		if value.Exists() {
			data.RecoveryCauseChannelMisconfig = types.BoolValue(true)
		} else {
			data.RecoveryCauseChannelMisconfig = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseChannelMisconfig = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.dhcp-rate-limit"); !data.RecoveryCauseDhcpRateLimit.IsNull() {
		if value.Exists() {
			data.RecoveryCauseDhcpRateLimit = types.BoolValue(true)
		} else {
			data.RecoveryCauseDhcpRateLimit = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseDhcpRateLimit = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.dtp-flap"); !data.RecoveryCauseDtpFlap.IsNull() {
		if value.Exists() {
			data.RecoveryCauseDtpFlap = types.BoolValue(true)
		} else {
			data.RecoveryCauseDtpFlap = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseDtpFlap = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.gbic-invalid"); !data.RecoveryCauseGbicInvalid.IsNull() {
		if value.Exists() {
			data.RecoveryCauseGbicInvalid = types.BoolValue(true)
		} else {
			data.RecoveryCauseGbicInvalid = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseGbicInvalid = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.inline-power"); !data.RecoveryCauseInlinePower.IsNull() {
		if value.Exists() {
			data.RecoveryCauseInlinePower = types.BoolValue(true)
		} else {
			data.RecoveryCauseInlinePower = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseInlinePower = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.l2ptguard"); !data.RecoveryCauseL2ptguard.IsNull() {
		if value.Exists() {
			data.RecoveryCauseL2ptguard = types.BoolValue(true)
		} else {
			data.RecoveryCauseL2ptguard = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseL2ptguard = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.link-flap"); !data.RecoveryCauseLinkFlap.IsNull() {
		if value.Exists() {
			data.RecoveryCauseLinkFlap = types.BoolValue(true)
		} else {
			data.RecoveryCauseLinkFlap = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseLinkFlap = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.link-monitor-failure"); !data.RecoveryCauseLinkMonitorFailure.IsNull() {
		if value.Exists() {
			data.RecoveryCauseLinkMonitorFailure = types.BoolValue(true)
		} else {
			data.RecoveryCauseLinkMonitorFailure = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseLinkMonitorFailure = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.loopback"); !data.RecoveryCauseLoopback.IsNull() {
		if value.Exists() {
			data.RecoveryCauseLoopback = types.BoolValue(true)
		} else {
			data.RecoveryCauseLoopback = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseLoopback = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.mac-limit"); !data.RecoveryCauseMacLimit.IsNull() {
		if value.Exists() {
			data.RecoveryCauseMacLimit = types.BoolValue(true)
		} else {
			data.RecoveryCauseMacLimit = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseMacLimit = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.mlacp-minlink"); !data.RecoveryCauseMlacpMinlink.IsNull() {
		if value.Exists() {
			data.RecoveryCauseMlacpMinlink = types.BoolValue(true)
		} else {
			data.RecoveryCauseMlacpMinlink = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseMlacpMinlink = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.pagp-flap"); !data.RecoveryCausePagpFlap.IsNull() {
		if value.Exists() {
			data.RecoveryCausePagpFlap = types.BoolValue(true)
		} else {
			data.RecoveryCausePagpFlap = types.BoolValue(false)
		}
	} else {
		data.RecoveryCausePagpFlap = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.port-mode-failure"); !data.RecoveryCausePortModeFailure.IsNull() {
		if value.Exists() {
			data.RecoveryCausePortModeFailure = types.BoolValue(true)
		} else {
			data.RecoveryCausePortModeFailure = types.BoolValue(false)
		}
	} else {
		data.RecoveryCausePortModeFailure = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.pppoe-ia-rate-limit"); !data.RecoveryCausePppoeIaRateLimit.IsNull() {
		if value.Exists() {
			data.RecoveryCausePppoeIaRateLimit = types.BoolValue(true)
		} else {
			data.RecoveryCausePppoeIaRateLimit = types.BoolValue(false)
		}
	} else {
		data.RecoveryCausePppoeIaRateLimit = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.psp"); !data.RecoveryCausePsp.IsNull() {
		if value.Exists() {
			data.RecoveryCausePsp = types.BoolValue(true)
		} else {
			data.RecoveryCausePsp = types.BoolValue(false)
		}
	} else {
		data.RecoveryCausePsp = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.psecure-violation"); !data.RecoveryCausePsecureViolation.IsNull() {
		if value.Exists() {
			data.RecoveryCausePsecureViolation = types.BoolValue(true)
		} else {
			data.RecoveryCausePsecureViolation = types.BoolValue(false)
		}
	} else {
		data.RecoveryCausePsecureViolation = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.security-violation"); !data.RecoveryCauseSecurityViolation.IsNull() {
		if value.Exists() {
			data.RecoveryCauseSecurityViolation = types.BoolValue(true)
		} else {
			data.RecoveryCauseSecurityViolation = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseSecurityViolation = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.sfp-config-mismatch"); !data.RecoveryCauseSfpConfigMismatch.IsNull() {
		if value.Exists() {
			data.RecoveryCauseSfpConfigMismatch = types.BoolValue(true)
		} else {
			data.RecoveryCauseSfpConfigMismatch = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseSfpConfigMismatch = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.small-frame"); !data.RecoveryCauseSmallFrame.IsNull() {
		if value.Exists() {
			data.RecoveryCauseSmallFrame = types.BoolValue(true)
		} else {
			data.RecoveryCauseSmallFrame = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseSmallFrame = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.storm-control"); !data.RecoveryCauseStormControl.IsNull() {
		if value.Exists() {
			data.RecoveryCauseStormControl = types.BoolValue(true)
		} else {
			data.RecoveryCauseStormControl = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseStormControl = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.udld"); !data.RecoveryCauseUdld.IsNull() {
		if value.Exists() {
			data.RecoveryCauseUdld = types.BoolValue(true)
		} else {
			data.RecoveryCauseUdld = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseUdld = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.unicast-flood"); !data.RecoveryCauseUnicastFlood.IsNull() {
		if value.Exists() {
			data.RecoveryCauseUnicastFlood = types.BoolValue(true)
		} else {
			data.RecoveryCauseUnicastFlood = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseUnicastFlood = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.vmps"); !data.RecoveryCauseVmps.IsNull() {
		if value.Exists() {
			data.RecoveryCauseVmps = types.BoolValue(true)
		} else {
			data.RecoveryCauseVmps = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseVmps = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.loopdetect"); !data.RecoveryCauseLoopdetect.IsNull() {
		if value.Exists() {
			data.RecoveryCauseLoopdetect = types.BoolValue(true)
		} else {
			data.RecoveryCauseLoopdetect = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseLoopdetect = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.oam-remote-failure"); !data.RecoveryCauseOamRemoteFailure.IsNull() {
		if value.Exists() {
			data.RecoveryCauseOamRemoteFailure = types.BoolValue(true)
		} else {
			data.RecoveryCauseOamRemoteFailure = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseOamRemoteFailure = types.BoolNull()
	}
	if value := res.Get(prefix + "recovery.cause.mrp-miscabling"); !data.RecoveryCauseMrpMiscabling.IsNull() {
		if value.Exists() {
			data.RecoveryCauseMrpMiscabling = types.BoolValue(true)
		} else {
			data.RecoveryCauseMrpMiscabling = types.BoolValue(false)
		}
	} else {
		data.RecoveryCauseMrpMiscabling = types.BoolNull()
	}
}

// End of section. //template:end updateFromBody

// Section below is generated&owned by "gen/generator.go". //template:begin fromBody

func (data *Errdisable) fromBody(ctx context.Context, res gjson.Result) {
	prefix := helpers.LastElement(data.getPath()) + "."
	if res.Get(helpers.LastElement(data.getPath())).IsArray() {
		prefix += "0."
	}
	if value := res.Get(prefix + "detect.cause.all"); value.Exists() {
		data.DetectCauseAll = types.BoolValue(true)
	} else {
		data.DetectCauseAll = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.arp-inspection"); value.Exists() {
		data.DetectCauseArpInspection = types.BoolValue(true)
	} else {
		data.DetectCauseArpInspection = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.bpduguard"); value.Exists() {
		data.DetectCauseBpduguard = types.BoolValue(true)
	} else {
		data.DetectCauseBpduguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.dhcp-rate-limit"); value.Exists() {
		data.DetectCauseDhcpRateLimit = types.BoolValue(true)
	} else {
		data.DetectCauseDhcpRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.dtp-flap"); value.Exists() {
		data.DetectCauseDtpFlap = types.BoolValue(true)
	} else {
		data.DetectCauseDtpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.gbic-invalid"); value.Exists() {
		data.DetectCauseGbicInvalid = types.BoolValue(true)
	} else {
		data.DetectCauseGbicInvalid = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.inline-power"); value.Exists() {
		data.DetectCauseInlinePower = types.BoolValue(true)
	} else {
		data.DetectCauseInlinePower = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.l2ptguard"); value.Exists() {
		data.DetectCauseL2ptguard = types.BoolValue(true)
	} else {
		data.DetectCauseL2ptguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.link-flap"); value.Exists() {
		data.DetectCauseLinkFlap = types.BoolValue(true)
	} else {
		data.DetectCauseLinkFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.loopback"); value.Exists() {
		data.DetectCauseLoopback = types.BoolValue(true)
	} else {
		data.DetectCauseLoopback = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.mlacp-minlink"); value.Exists() {
		data.DetectCauseMlacpMinlink = types.BoolValue(true)
	} else {
		data.DetectCauseMlacpMinlink = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.pagp-flap"); value.Exists() {
		data.DetectCausePagpFlap = types.BoolValue(true)
	} else {
		data.DetectCausePagpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.pppoe-ia-rate-limit"); value.Exists() {
		data.DetectCausePppoeIaRateLimit = types.BoolValue(true)
	} else {
		data.DetectCausePppoeIaRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.security-violation.shutdown.vlan"); value.Exists() {
		data.DetectCauseSecurityViolationShutdownVlan = types.BoolValue(true)
	} else {
		data.DetectCauseSecurityViolationShutdownVlan = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.sfp-config-mismatch"); value.Exists() {
		data.DetectCauseSfpConfigMismatch = types.BoolValue(true)
	} else {
		data.DetectCauseSfpConfigMismatch = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.small-frame"); value.Exists() {
		data.DetectCauseSmallFrame = types.BoolValue(true)
	} else {
		data.DetectCauseSmallFrame = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.loopdetect"); value.Exists() {
		data.DetectCauseLoopdetect = types.BoolValue(value.Bool())
	} else {
		data.DetectCauseLoopdetect = types.BoolNull()
	}
	if value := res.Get(prefix + "flap-setting.cause.dtp-flap.max-flaps"); value.Exists() {
		data.FlapSettingCauseDtpFlapMaxFlaps = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.dtp-flap.time"); value.Exists() {
		data.FlapSettingCauseDtpFlapTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.link-flap.max-flaps"); value.Exists() {
		data.FlapSettingCauseLinkFlapMaxFlaps = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.link-flap.time"); value.Exists() {
		data.FlapSettingCauseLinkFlapTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.pagp-flap.max-flaps"); value.Exists() {
		data.FlapSettingCausePagpFlapMaxFlaps = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.pagp-flap.time"); value.Exists() {
		data.FlapSettingCausePagpFlapTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "recovery.interval"); value.Exists() {
		data.RecoveryInterval = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "recovery.cause.all"); value.Exists() {
		data.RecoveryCauseAll = types.BoolValue(true)
	} else {
		data.RecoveryCauseAll = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.arp-inspection"); value.Exists() {
		data.RecoveryCauseArpInspection = types.BoolValue(true)
	} else {
		data.RecoveryCauseArpInspection = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.bpduguard"); value.Exists() {
		data.RecoveryCauseBpduguard = types.BoolValue(true)
	} else {
		data.RecoveryCauseBpduguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.channel-misconfig"); value.Exists() {
		data.RecoveryCauseChannelMisconfig = types.BoolValue(true)
	} else {
		data.RecoveryCauseChannelMisconfig = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.dhcp-rate-limit"); value.Exists() {
		data.RecoveryCauseDhcpRateLimit = types.BoolValue(true)
	} else {
		data.RecoveryCauseDhcpRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.dtp-flap"); value.Exists() {
		data.RecoveryCauseDtpFlap = types.BoolValue(true)
	} else {
		data.RecoveryCauseDtpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.gbic-invalid"); value.Exists() {
		data.RecoveryCauseGbicInvalid = types.BoolValue(true)
	} else {
		data.RecoveryCauseGbicInvalid = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.inline-power"); value.Exists() {
		data.RecoveryCauseInlinePower = types.BoolValue(true)
	} else {
		data.RecoveryCauseInlinePower = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.l2ptguard"); value.Exists() {
		data.RecoveryCauseL2ptguard = types.BoolValue(true)
	} else {
		data.RecoveryCauseL2ptguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.link-flap"); value.Exists() {
		data.RecoveryCauseLinkFlap = types.BoolValue(true)
	} else {
		data.RecoveryCauseLinkFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.link-monitor-failure"); value.Exists() {
		data.RecoveryCauseLinkMonitorFailure = types.BoolValue(true)
	} else {
		data.RecoveryCauseLinkMonitorFailure = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.loopback"); value.Exists() {
		data.RecoveryCauseLoopback = types.BoolValue(true)
	} else {
		data.RecoveryCauseLoopback = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.mac-limit"); value.Exists() {
		data.RecoveryCauseMacLimit = types.BoolValue(true)
	} else {
		data.RecoveryCauseMacLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.mlacp-minlink"); value.Exists() {
		data.RecoveryCauseMlacpMinlink = types.BoolValue(true)
	} else {
		data.RecoveryCauseMlacpMinlink = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.pagp-flap"); value.Exists() {
		data.RecoveryCausePagpFlap = types.BoolValue(true)
	} else {
		data.RecoveryCausePagpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.port-mode-failure"); value.Exists() {
		data.RecoveryCausePortModeFailure = types.BoolValue(true)
	} else {
		data.RecoveryCausePortModeFailure = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.pppoe-ia-rate-limit"); value.Exists() {
		data.RecoveryCausePppoeIaRateLimit = types.BoolValue(true)
	} else {
		data.RecoveryCausePppoeIaRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.psp"); value.Exists() {
		data.RecoveryCausePsp = types.BoolValue(true)
	} else {
		data.RecoveryCausePsp = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.psecure-violation"); value.Exists() {
		data.RecoveryCausePsecureViolation = types.BoolValue(true)
	} else {
		data.RecoveryCausePsecureViolation = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.security-violation"); value.Exists() {
		data.RecoveryCauseSecurityViolation = types.BoolValue(true)
	} else {
		data.RecoveryCauseSecurityViolation = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.sfp-config-mismatch"); value.Exists() {
		data.RecoveryCauseSfpConfigMismatch = types.BoolValue(true)
	} else {
		data.RecoveryCauseSfpConfigMismatch = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.small-frame"); value.Exists() {
		data.RecoveryCauseSmallFrame = types.BoolValue(true)
	} else {
		data.RecoveryCauseSmallFrame = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.storm-control"); value.Exists() {
		data.RecoveryCauseStormControl = types.BoolValue(true)
	} else {
		data.RecoveryCauseStormControl = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.udld"); value.Exists() {
		data.RecoveryCauseUdld = types.BoolValue(true)
	} else {
		data.RecoveryCauseUdld = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.unicast-flood"); value.Exists() {
		data.RecoveryCauseUnicastFlood = types.BoolValue(true)
	} else {
		data.RecoveryCauseUnicastFlood = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.vmps"); value.Exists() {
		data.RecoveryCauseVmps = types.BoolValue(true)
	} else {
		data.RecoveryCauseVmps = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.loopdetect"); value.Exists() {
		data.RecoveryCauseLoopdetect = types.BoolValue(true)
	} else {
		data.RecoveryCauseLoopdetect = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.oam-remote-failure"); value.Exists() {
		data.RecoveryCauseOamRemoteFailure = types.BoolValue(true)
	} else {
		data.RecoveryCauseOamRemoteFailure = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.mrp-miscabling"); value.Exists() {
		data.RecoveryCauseMrpMiscabling = types.BoolValue(true)
	} else {
		data.RecoveryCauseMrpMiscabling = types.BoolValue(false)
	}
}

// End of section. //template:end fromBody

// Section below is generated&owned by "gen/generator.go". //template:begin fromBodyData

func (data *ErrdisableData) fromBody(ctx context.Context, res gjson.Result) {
	prefix := helpers.LastElement(data.getPath()) + "."
	if res.Get(helpers.LastElement(data.getPath())).IsArray() {
		prefix += "0."
	}
	if value := res.Get(prefix + "detect.cause.all"); value.Exists() {
		data.DetectCauseAll = types.BoolValue(true)
	} else {
		data.DetectCauseAll = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.arp-inspection"); value.Exists() {
		data.DetectCauseArpInspection = types.BoolValue(true)
	} else {
		data.DetectCauseArpInspection = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.bpduguard"); value.Exists() {
		data.DetectCauseBpduguard = types.BoolValue(true)
	} else {
		data.DetectCauseBpduguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.dhcp-rate-limit"); value.Exists() {
		data.DetectCauseDhcpRateLimit = types.BoolValue(true)
	} else {
		data.DetectCauseDhcpRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.dtp-flap"); value.Exists() {
		data.DetectCauseDtpFlap = types.BoolValue(true)
	} else {
		data.DetectCauseDtpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.gbic-invalid"); value.Exists() {
		data.DetectCauseGbicInvalid = types.BoolValue(true)
	} else {
		data.DetectCauseGbicInvalid = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.inline-power"); value.Exists() {
		data.DetectCauseInlinePower = types.BoolValue(true)
	} else {
		data.DetectCauseInlinePower = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.l2ptguard"); value.Exists() {
		data.DetectCauseL2ptguard = types.BoolValue(true)
	} else {
		data.DetectCauseL2ptguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.link-flap"); value.Exists() {
		data.DetectCauseLinkFlap = types.BoolValue(true)
	} else {
		data.DetectCauseLinkFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.loopback"); value.Exists() {
		data.DetectCauseLoopback = types.BoolValue(true)
	} else {
		data.DetectCauseLoopback = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.mlacp-minlink"); value.Exists() {
		data.DetectCauseMlacpMinlink = types.BoolValue(true)
	} else {
		data.DetectCauseMlacpMinlink = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.pagp-flap"); value.Exists() {
		data.DetectCausePagpFlap = types.BoolValue(true)
	} else {
		data.DetectCausePagpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.pppoe-ia-rate-limit"); value.Exists() {
		data.DetectCausePppoeIaRateLimit = types.BoolValue(true)
	} else {
		data.DetectCausePppoeIaRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.security-violation.shutdown.vlan"); value.Exists() {
		data.DetectCauseSecurityViolationShutdownVlan = types.BoolValue(true)
	} else {
		data.DetectCauseSecurityViolationShutdownVlan = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.sfp-config-mismatch"); value.Exists() {
		data.DetectCauseSfpConfigMismatch = types.BoolValue(true)
	} else {
		data.DetectCauseSfpConfigMismatch = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.small-frame"); value.Exists() {
		data.DetectCauseSmallFrame = types.BoolValue(true)
	} else {
		data.DetectCauseSmallFrame = types.BoolValue(false)
	}
	if value := res.Get(prefix + "detect.cause.loopdetect"); value.Exists() {
		data.DetectCauseLoopdetect = types.BoolValue(value.Bool())
	} else {
		data.DetectCauseLoopdetect = types.BoolNull()
	}
	if value := res.Get(prefix + "flap-setting.cause.dtp-flap.max-flaps"); value.Exists() {
		data.FlapSettingCauseDtpFlapMaxFlaps = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.dtp-flap.time"); value.Exists() {
		data.FlapSettingCauseDtpFlapTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.link-flap.max-flaps"); value.Exists() {
		data.FlapSettingCauseLinkFlapMaxFlaps = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.link-flap.time"); value.Exists() {
		data.FlapSettingCauseLinkFlapTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.pagp-flap.max-flaps"); value.Exists() {
		data.FlapSettingCausePagpFlapMaxFlaps = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "flap-setting.cause.pagp-flap.time"); value.Exists() {
		data.FlapSettingCausePagpFlapTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "recovery.interval"); value.Exists() {
		data.RecoveryInterval = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "recovery.cause.all"); value.Exists() {
		data.RecoveryCauseAll = types.BoolValue(true)
	} else {
		data.RecoveryCauseAll = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.arp-inspection"); value.Exists() {
		data.RecoveryCauseArpInspection = types.BoolValue(true)
	} else {
		data.RecoveryCauseArpInspection = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.bpduguard"); value.Exists() {
		data.RecoveryCauseBpduguard = types.BoolValue(true)
	} else {
		data.RecoveryCauseBpduguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.channel-misconfig"); value.Exists() {
		data.RecoveryCauseChannelMisconfig = types.BoolValue(true)
	} else {
		data.RecoveryCauseChannelMisconfig = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.dhcp-rate-limit"); value.Exists() {
		data.RecoveryCauseDhcpRateLimit = types.BoolValue(true)
	} else {
		data.RecoveryCauseDhcpRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.dtp-flap"); value.Exists() {
		data.RecoveryCauseDtpFlap = types.BoolValue(true)
	} else {
		data.RecoveryCauseDtpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.gbic-invalid"); value.Exists() {
		data.RecoveryCauseGbicInvalid = types.BoolValue(true)
	} else {
		data.RecoveryCauseGbicInvalid = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.inline-power"); value.Exists() {
		data.RecoveryCauseInlinePower = types.BoolValue(true)
	} else {
		data.RecoveryCauseInlinePower = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.l2ptguard"); value.Exists() {
		data.RecoveryCauseL2ptguard = types.BoolValue(true)
	} else {
		data.RecoveryCauseL2ptguard = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.link-flap"); value.Exists() {
		data.RecoveryCauseLinkFlap = types.BoolValue(true)
	} else {
		data.RecoveryCauseLinkFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.link-monitor-failure"); value.Exists() {
		data.RecoveryCauseLinkMonitorFailure = types.BoolValue(true)
	} else {
		data.RecoveryCauseLinkMonitorFailure = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.loopback"); value.Exists() {
		data.RecoveryCauseLoopback = types.BoolValue(true)
	} else {
		data.RecoveryCauseLoopback = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.mac-limit"); value.Exists() {
		data.RecoveryCauseMacLimit = types.BoolValue(true)
	} else {
		data.RecoveryCauseMacLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.mlacp-minlink"); value.Exists() {
		data.RecoveryCauseMlacpMinlink = types.BoolValue(true)
	} else {
		data.RecoveryCauseMlacpMinlink = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.pagp-flap"); value.Exists() {
		data.RecoveryCausePagpFlap = types.BoolValue(true)
	} else {
		data.RecoveryCausePagpFlap = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.port-mode-failure"); value.Exists() {
		data.RecoveryCausePortModeFailure = types.BoolValue(true)
	} else {
		data.RecoveryCausePortModeFailure = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.pppoe-ia-rate-limit"); value.Exists() {
		data.RecoveryCausePppoeIaRateLimit = types.BoolValue(true)
	} else {
		data.RecoveryCausePppoeIaRateLimit = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.psp"); value.Exists() {
		data.RecoveryCausePsp = types.BoolValue(true)
	} else {
		data.RecoveryCausePsp = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.psecure-violation"); value.Exists() {
		data.RecoveryCausePsecureViolation = types.BoolValue(true)
	} else {
		data.RecoveryCausePsecureViolation = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.security-violation"); value.Exists() {
		data.RecoveryCauseSecurityViolation = types.BoolValue(true)
	} else {
		data.RecoveryCauseSecurityViolation = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.sfp-config-mismatch"); value.Exists() {
		data.RecoveryCauseSfpConfigMismatch = types.BoolValue(true)
	} else {
		data.RecoveryCauseSfpConfigMismatch = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.small-frame"); value.Exists() {
		data.RecoveryCauseSmallFrame = types.BoolValue(true)
	} else {
		data.RecoveryCauseSmallFrame = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.storm-control"); value.Exists() {
		data.RecoveryCauseStormControl = types.BoolValue(true)
	} else {
		data.RecoveryCauseStormControl = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.udld"); value.Exists() {
		data.RecoveryCauseUdld = types.BoolValue(true)
	} else {
		data.RecoveryCauseUdld = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.unicast-flood"); value.Exists() {
		data.RecoveryCauseUnicastFlood = types.BoolValue(true)
	} else {
		data.RecoveryCauseUnicastFlood = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.vmps"); value.Exists() {
		data.RecoveryCauseVmps = types.BoolValue(true)
	} else {
		data.RecoveryCauseVmps = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.loopdetect"); value.Exists() {
		data.RecoveryCauseLoopdetect = types.BoolValue(true)
	} else {
		data.RecoveryCauseLoopdetect = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.oam-remote-failure"); value.Exists() {
		data.RecoveryCauseOamRemoteFailure = types.BoolValue(true)
	} else {
		data.RecoveryCauseOamRemoteFailure = types.BoolValue(false)
	}
	if value := res.Get(prefix + "recovery.cause.mrp-miscabling"); value.Exists() {
		data.RecoveryCauseMrpMiscabling = types.BoolValue(true)
	} else {
		data.RecoveryCauseMrpMiscabling = types.BoolValue(false)
	}
}

// End of section. //template:end fromBodyData

// Section below is generated&owned by "gen/generator.go". //template:begin getDeletedItems

func (data *Errdisable) getDeletedItems(ctx context.Context, state Errdisable) []string {
	deletedItems := make([]string, 0)
	if !state.RecoveryCauseMrpMiscabling.IsNull() && data.RecoveryCauseMrpMiscabling.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/mrp-miscabling", state.getPath()))
	}
	if !state.RecoveryCauseOamRemoteFailure.IsNull() && data.RecoveryCauseOamRemoteFailure.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/oam-remote-failure", state.getPath()))
	}
	if !state.RecoveryCauseLoopdetect.IsNull() && data.RecoveryCauseLoopdetect.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/loopdetect", state.getPath()))
	}
	if !state.RecoveryCauseVmps.IsNull() && data.RecoveryCauseVmps.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/vmps", state.getPath()))
	}
	if !state.RecoveryCauseUnicastFlood.IsNull() && data.RecoveryCauseUnicastFlood.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/unicast-flood", state.getPath()))
	}
	if !state.RecoveryCauseUdld.IsNull() && data.RecoveryCauseUdld.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/udld", state.getPath()))
	}
	if !state.RecoveryCauseStormControl.IsNull() && data.RecoveryCauseStormControl.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/storm-control", state.getPath()))
	}
	if !state.RecoveryCauseSmallFrame.IsNull() && data.RecoveryCauseSmallFrame.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/small-frame", state.getPath()))
	}
	if !state.RecoveryCauseSfpConfigMismatch.IsNull() && data.RecoveryCauseSfpConfigMismatch.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/sfp-config-mismatch", state.getPath()))
	}
	if !state.RecoveryCauseSecurityViolation.IsNull() && data.RecoveryCauseSecurityViolation.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/security-violation", state.getPath()))
	}
	if !state.RecoveryCausePsecureViolation.IsNull() && data.RecoveryCausePsecureViolation.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/psecure-violation", state.getPath()))
	}
	if !state.RecoveryCausePsp.IsNull() && data.RecoveryCausePsp.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/psp", state.getPath()))
	}
	if !state.RecoveryCausePppoeIaRateLimit.IsNull() && data.RecoveryCausePppoeIaRateLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/pppoe-ia-rate-limit", state.getPath()))
	}
	if !state.RecoveryCausePortModeFailure.IsNull() && data.RecoveryCausePortModeFailure.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/port-mode-failure", state.getPath()))
	}
	if !state.RecoveryCausePagpFlap.IsNull() && data.RecoveryCausePagpFlap.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/pagp-flap", state.getPath()))
	}
	if !state.RecoveryCauseMlacpMinlink.IsNull() && data.RecoveryCauseMlacpMinlink.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/mlacp-minlink", state.getPath()))
	}
	if !state.RecoveryCauseMacLimit.IsNull() && data.RecoveryCauseMacLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/mac-limit", state.getPath()))
	}
	if !state.RecoveryCauseLoopback.IsNull() && data.RecoveryCauseLoopback.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/loopback", state.getPath()))
	}
	if !state.RecoveryCauseLinkMonitorFailure.IsNull() && data.RecoveryCauseLinkMonitorFailure.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/link-monitor-failure", state.getPath()))
	}
	if !state.RecoveryCauseLinkFlap.IsNull() && data.RecoveryCauseLinkFlap.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/link-flap", state.getPath()))
	}
	if !state.RecoveryCauseL2ptguard.IsNull() && data.RecoveryCauseL2ptguard.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/l2ptguard", state.getPath()))
	}
	if !state.RecoveryCauseInlinePower.IsNull() && data.RecoveryCauseInlinePower.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/inline-power", state.getPath()))
	}
	if !state.RecoveryCauseGbicInvalid.IsNull() && data.RecoveryCauseGbicInvalid.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/gbic-invalid", state.getPath()))
	}
	if !state.RecoveryCauseDtpFlap.IsNull() && data.RecoveryCauseDtpFlap.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/dtp-flap", state.getPath()))
	}
	if !state.RecoveryCauseDhcpRateLimit.IsNull() && data.RecoveryCauseDhcpRateLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/dhcp-rate-limit", state.getPath()))
	}
	if !state.RecoveryCauseChannelMisconfig.IsNull() && data.RecoveryCauseChannelMisconfig.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/channel-misconfig", state.getPath()))
	}
	if !state.RecoveryCauseBpduguard.IsNull() && data.RecoveryCauseBpduguard.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/bpduguard", state.getPath()))
	}
	if !state.RecoveryCauseArpInspection.IsNull() && data.RecoveryCauseArpInspection.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/arp-inspection", state.getPath()))
	}
	if !state.RecoveryCauseAll.IsNull() && data.RecoveryCauseAll.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/cause/all", state.getPath()))
	}
	if !state.RecoveryInterval.IsNull() && data.RecoveryInterval.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/recovery/interval", state.getPath()))
	}
	if !state.FlapSettingCausePagpFlapTime.IsNull() && data.FlapSettingCausePagpFlapTime.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/flap-setting/cause/pagp-flap", state.getPath()))
	}
	if !state.FlapSettingCausePagpFlapMaxFlaps.IsNull() && data.FlapSettingCausePagpFlapMaxFlaps.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/flap-setting/cause/pagp-flap", state.getPath()))
	}
	if !state.FlapSettingCauseLinkFlapTime.IsNull() && data.FlapSettingCauseLinkFlapTime.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/flap-setting/cause/link-flap", state.getPath()))
	}
	if !state.FlapSettingCauseLinkFlapMaxFlaps.IsNull() && data.FlapSettingCauseLinkFlapMaxFlaps.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/flap-setting/cause/link-flap", state.getPath()))
	}
	if !state.FlapSettingCauseDtpFlapTime.IsNull() && data.FlapSettingCauseDtpFlapTime.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/flap-setting/cause/dtp-flap", state.getPath()))
	}
	if !state.FlapSettingCauseDtpFlapMaxFlaps.IsNull() && data.FlapSettingCauseDtpFlapMaxFlaps.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/flap-setting/cause/dtp-flap", state.getPath()))
	}
	if !state.DetectCauseLoopdetect.IsNull() && data.DetectCauseLoopdetect.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/loopdetect", state.getPath()))
	}
	if !state.DetectCauseSmallFrame.IsNull() && data.DetectCauseSmallFrame.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/small-frame", state.getPath()))
	}
	if !state.DetectCauseSfpConfigMismatch.IsNull() && data.DetectCauseSfpConfigMismatch.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/sfp-config-mismatch", state.getPath()))
	}
	if !state.DetectCauseSecurityViolationShutdownVlan.IsNull() && data.DetectCauseSecurityViolationShutdownVlan.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/security-violation/shutdown/vlan", state.getPath()))
	}
	if !state.DetectCausePppoeIaRateLimit.IsNull() && data.DetectCausePppoeIaRateLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/pppoe-ia-rate-limit", state.getPath()))
	}
	if !state.DetectCausePagpFlap.IsNull() && data.DetectCausePagpFlap.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/pagp-flap", state.getPath()))
	}
	if !state.DetectCauseMlacpMinlink.IsNull() && data.DetectCauseMlacpMinlink.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/mlacp-minlink", state.getPath()))
	}
	if !state.DetectCauseLoopback.IsNull() && data.DetectCauseLoopback.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/loopback", state.getPath()))
	}
	if !state.DetectCauseLinkFlap.IsNull() && data.DetectCauseLinkFlap.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/link-flap", state.getPath()))
	}
	if !state.DetectCauseL2ptguard.IsNull() && data.DetectCauseL2ptguard.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/l2ptguard", state.getPath()))
	}
	if !state.DetectCauseInlinePower.IsNull() && data.DetectCauseInlinePower.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/inline-power", state.getPath()))
	}
	if !state.DetectCauseGbicInvalid.IsNull() && data.DetectCauseGbicInvalid.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/gbic-invalid", state.getPath()))
	}
	if !state.DetectCauseDtpFlap.IsNull() && data.DetectCauseDtpFlap.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/dtp-flap", state.getPath()))
	}
	if !state.DetectCauseDhcpRateLimit.IsNull() && data.DetectCauseDhcpRateLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/dhcp-rate-limit", state.getPath()))
	}
	if !state.DetectCauseBpduguard.IsNull() && data.DetectCauseBpduguard.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/bpduguard", state.getPath()))
	}
	if !state.DetectCauseArpInspection.IsNull() && data.DetectCauseArpInspection.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/arp-inspection", state.getPath()))
	}
	if !state.DetectCauseAll.IsNull() && data.DetectCauseAll.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/detect/cause/all", state.getPath()))
	}

	return deletedItems
}

// End of section. //template:end getDeletedItems

// Section below is generated&owned by "gen/generator.go". //template:begin getEmptyLeafsDelete

func (data *Errdisable) getEmptyLeafsDelete(ctx context.Context) []string {
	emptyLeafsDelete := make([]string, 0)
	if !data.RecoveryCauseMrpMiscabling.IsNull() && !data.RecoveryCauseMrpMiscabling.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/mrp-miscabling", data.getPath()))
	}
	if !data.RecoveryCauseOamRemoteFailure.IsNull() && !data.RecoveryCauseOamRemoteFailure.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/oam-remote-failure", data.getPath()))
	}
	if !data.RecoveryCauseLoopdetect.IsNull() && !data.RecoveryCauseLoopdetect.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/loopdetect", data.getPath()))
	}
	if !data.RecoveryCauseVmps.IsNull() && !data.RecoveryCauseVmps.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/vmps", data.getPath()))
	}
	if !data.RecoveryCauseUnicastFlood.IsNull() && !data.RecoveryCauseUnicastFlood.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/unicast-flood", data.getPath()))
	}
	if !data.RecoveryCauseUdld.IsNull() && !data.RecoveryCauseUdld.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/udld", data.getPath()))
	}
	if !data.RecoveryCauseStormControl.IsNull() && !data.RecoveryCauseStormControl.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/storm-control", data.getPath()))
	}
	if !data.RecoveryCauseSmallFrame.IsNull() && !data.RecoveryCauseSmallFrame.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/small-frame", data.getPath()))
	}
	if !data.RecoveryCauseSfpConfigMismatch.IsNull() && !data.RecoveryCauseSfpConfigMismatch.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/sfp-config-mismatch", data.getPath()))
	}
	if !data.RecoveryCauseSecurityViolation.IsNull() && !data.RecoveryCauseSecurityViolation.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/security-violation", data.getPath()))
	}
	if !data.RecoveryCausePsecureViolation.IsNull() && !data.RecoveryCausePsecureViolation.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/psecure-violation", data.getPath()))
	}
	if !data.RecoveryCausePsp.IsNull() && !data.RecoveryCausePsp.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/psp", data.getPath()))
	}
	if !data.RecoveryCausePppoeIaRateLimit.IsNull() && !data.RecoveryCausePppoeIaRateLimit.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/pppoe-ia-rate-limit", data.getPath()))
	}
	if !data.RecoveryCausePortModeFailure.IsNull() && !data.RecoveryCausePortModeFailure.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/port-mode-failure", data.getPath()))
	}
	if !data.RecoveryCausePagpFlap.IsNull() && !data.RecoveryCausePagpFlap.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/pagp-flap", data.getPath()))
	}
	if !data.RecoveryCauseMlacpMinlink.IsNull() && !data.RecoveryCauseMlacpMinlink.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/mlacp-minlink", data.getPath()))
	}
	if !data.RecoveryCauseMacLimit.IsNull() && !data.RecoveryCauseMacLimit.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/mac-limit", data.getPath()))
	}
	if !data.RecoveryCauseLoopback.IsNull() && !data.RecoveryCauseLoopback.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/loopback", data.getPath()))
	}
	if !data.RecoveryCauseLinkMonitorFailure.IsNull() && !data.RecoveryCauseLinkMonitorFailure.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/link-monitor-failure", data.getPath()))
	}
	if !data.RecoveryCauseLinkFlap.IsNull() && !data.RecoveryCauseLinkFlap.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/link-flap", data.getPath()))
	}
	if !data.RecoveryCauseL2ptguard.IsNull() && !data.RecoveryCauseL2ptguard.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/l2ptguard", data.getPath()))
	}
	if !data.RecoveryCauseInlinePower.IsNull() && !data.RecoveryCauseInlinePower.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/inline-power", data.getPath()))
	}
	if !data.RecoveryCauseGbicInvalid.IsNull() && !data.RecoveryCauseGbicInvalid.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/gbic-invalid", data.getPath()))
	}
	if !data.RecoveryCauseDtpFlap.IsNull() && !data.RecoveryCauseDtpFlap.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/dtp-flap", data.getPath()))
	}
	if !data.RecoveryCauseDhcpRateLimit.IsNull() && !data.RecoveryCauseDhcpRateLimit.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/dhcp-rate-limit", data.getPath()))
	}
	if !data.RecoveryCauseChannelMisconfig.IsNull() && !data.RecoveryCauseChannelMisconfig.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/channel-misconfig", data.getPath()))
	}
	if !data.RecoveryCauseBpduguard.IsNull() && !data.RecoveryCauseBpduguard.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/bpduguard", data.getPath()))
	}
	if !data.RecoveryCauseArpInspection.IsNull() && !data.RecoveryCauseArpInspection.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/arp-inspection", data.getPath()))
	}
	if !data.RecoveryCauseAll.IsNull() && !data.RecoveryCauseAll.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/recovery/cause/all", data.getPath()))
	}
	if !data.DetectCauseSmallFrame.IsNull() && !data.DetectCauseSmallFrame.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/small-frame", data.getPath()))
	}
	if !data.DetectCauseSfpConfigMismatch.IsNull() && !data.DetectCauseSfpConfigMismatch.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/sfp-config-mismatch", data.getPath()))
	}
	if !data.DetectCauseSecurityViolationShutdownVlan.IsNull() && !data.DetectCauseSecurityViolationShutdownVlan.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/security-violation/shutdown/vlan", data.getPath()))
	}
	if !data.DetectCausePppoeIaRateLimit.IsNull() && !data.DetectCausePppoeIaRateLimit.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/pppoe-ia-rate-limit", data.getPath()))
	}
	if !data.DetectCausePagpFlap.IsNull() && !data.DetectCausePagpFlap.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/pagp-flap", data.getPath()))
	}
	if !data.DetectCauseMlacpMinlink.IsNull() && !data.DetectCauseMlacpMinlink.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/mlacp-minlink", data.getPath()))
	}
	if !data.DetectCauseLoopback.IsNull() && !data.DetectCauseLoopback.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/loopback", data.getPath()))
	}
	if !data.DetectCauseLinkFlap.IsNull() && !data.DetectCauseLinkFlap.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/link-flap", data.getPath()))
	}
	if !data.DetectCauseL2ptguard.IsNull() && !data.DetectCauseL2ptguard.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/l2ptguard", data.getPath()))
	}
	if !data.DetectCauseInlinePower.IsNull() && !data.DetectCauseInlinePower.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/inline-power", data.getPath()))
	}
	if !data.DetectCauseGbicInvalid.IsNull() && !data.DetectCauseGbicInvalid.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/gbic-invalid", data.getPath()))
	}
	if !data.DetectCauseDtpFlap.IsNull() && !data.DetectCauseDtpFlap.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/dtp-flap", data.getPath()))
	}
	if !data.DetectCauseDhcpRateLimit.IsNull() && !data.DetectCauseDhcpRateLimit.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/dhcp-rate-limit", data.getPath()))
	}
	if !data.DetectCauseBpduguard.IsNull() && !data.DetectCauseBpduguard.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/bpduguard", data.getPath()))
	}
	if !data.DetectCauseArpInspection.IsNull() && !data.DetectCauseArpInspection.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/arp-inspection", data.getPath()))
	}
	if !data.DetectCauseAll.IsNull() && !data.DetectCauseAll.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/detect/cause/all", data.getPath()))
	}

	return emptyLeafsDelete
}

// End of section. //template:end getEmptyLeafsDelete

// Section below is generated&owned by "gen/generator.go". //template:begin getDeletePaths

func (data *Errdisable) getDeletePaths(ctx context.Context) []string {
	var deletePaths []string
	if !data.RecoveryCauseMrpMiscabling.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/mrp-miscabling", data.getPath()))
	}
	if !data.RecoveryCauseOamRemoteFailure.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/oam-remote-failure", data.getPath()))
	}
	if !data.RecoveryCauseLoopdetect.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/loopdetect", data.getPath()))
	}
	if !data.RecoveryCauseVmps.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/vmps", data.getPath()))
	}
	if !data.RecoveryCauseUnicastFlood.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/unicast-flood", data.getPath()))
	}
	if !data.RecoveryCauseUdld.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/udld", data.getPath()))
	}
	if !data.RecoveryCauseStormControl.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/storm-control", data.getPath()))
	}
	if !data.RecoveryCauseSmallFrame.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/small-frame", data.getPath()))
	}
	if !data.RecoveryCauseSfpConfigMismatch.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/sfp-config-mismatch", data.getPath()))
	}
	if !data.RecoveryCauseSecurityViolation.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/security-violation", data.getPath()))
	}
	if !data.RecoveryCausePsecureViolation.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/psecure-violation", data.getPath()))
	}
	if !data.RecoveryCausePsp.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/psp", data.getPath()))
	}
	if !data.RecoveryCausePppoeIaRateLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/pppoe-ia-rate-limit", data.getPath()))
	}
	if !data.RecoveryCausePortModeFailure.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/port-mode-failure", data.getPath()))
	}
	if !data.RecoveryCausePagpFlap.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/pagp-flap", data.getPath()))
	}
	if !data.RecoveryCauseMlacpMinlink.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/mlacp-minlink", data.getPath()))
	}
	if !data.RecoveryCauseMacLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/mac-limit", data.getPath()))
	}
	if !data.RecoveryCauseLoopback.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/loopback", data.getPath()))
	}
	if !data.RecoveryCauseLinkMonitorFailure.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/link-monitor-failure", data.getPath()))
	}
	if !data.RecoveryCauseLinkFlap.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/link-flap", data.getPath()))
	}
	if !data.RecoveryCauseL2ptguard.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/l2ptguard", data.getPath()))
	}
	if !data.RecoveryCauseInlinePower.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/inline-power", data.getPath()))
	}
	if !data.RecoveryCauseGbicInvalid.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/gbic-invalid", data.getPath()))
	}
	if !data.RecoveryCauseDtpFlap.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/dtp-flap", data.getPath()))
	}
	if !data.RecoveryCauseDhcpRateLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/dhcp-rate-limit", data.getPath()))
	}
	if !data.RecoveryCauseChannelMisconfig.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/channel-misconfig", data.getPath()))
	}
	if !data.RecoveryCauseBpduguard.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/bpduguard", data.getPath()))
	}
	if !data.RecoveryCauseArpInspection.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/arp-inspection", data.getPath()))
	}
	if !data.RecoveryCauseAll.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/cause/all", data.getPath()))
	}
	if !data.RecoveryInterval.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/recovery/interval", data.getPath()))
	}
	if !data.FlapSettingCausePagpFlapTime.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/flap-setting/cause/pagp-flap", data.getPath()))
	}
	if !data.FlapSettingCausePagpFlapMaxFlaps.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/flap-setting/cause/pagp-flap", data.getPath()))
	}
	if !data.FlapSettingCauseLinkFlapTime.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/flap-setting/cause/link-flap", data.getPath()))
	}
	if !data.FlapSettingCauseLinkFlapMaxFlaps.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/flap-setting/cause/link-flap", data.getPath()))
	}
	if !data.FlapSettingCauseDtpFlapTime.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/flap-setting/cause/dtp-flap", data.getPath()))
	}
	if !data.FlapSettingCauseDtpFlapMaxFlaps.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/flap-setting/cause/dtp-flap", data.getPath()))
	}
	if !data.DetectCauseLoopdetect.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/loopdetect", data.getPath()))
	}
	if !data.DetectCauseSmallFrame.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/small-frame", data.getPath()))
	}
	if !data.DetectCauseSfpConfigMismatch.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/sfp-config-mismatch", data.getPath()))
	}
	if !data.DetectCauseSecurityViolationShutdownVlan.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/security-violation/shutdown/vlan", data.getPath()))
	}
	if !data.DetectCausePppoeIaRateLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/pppoe-ia-rate-limit", data.getPath()))
	}
	if !data.DetectCausePagpFlap.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/pagp-flap", data.getPath()))
	}
	if !data.DetectCauseMlacpMinlink.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/mlacp-minlink", data.getPath()))
	}
	if !data.DetectCauseLoopback.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/loopback", data.getPath()))
	}
	if !data.DetectCauseLinkFlap.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/link-flap", data.getPath()))
	}
	if !data.DetectCauseL2ptguard.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/l2ptguard", data.getPath()))
	}
	if !data.DetectCauseInlinePower.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/inline-power", data.getPath()))
	}
	if !data.DetectCauseGbicInvalid.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/gbic-invalid", data.getPath()))
	}
	if !data.DetectCauseDtpFlap.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/dtp-flap", data.getPath()))
	}
	if !data.DetectCauseDhcpRateLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/dhcp-rate-limit", data.getPath()))
	}
	if !data.DetectCauseBpduguard.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/bpduguard", data.getPath()))
	}
	if !data.DetectCauseArpInspection.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/arp-inspection", data.getPath()))
	}
	if !data.DetectCauseAll.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/detect/cause/all", data.getPath()))
	}

	return deletePaths
}

// End of section. //template:end getDeletePaths
