// 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 EVPN struct {
	Device                  types.String `tfsdk:"device"`
	Id                      types.String `tfsdk:"id"`
	DeleteMode              types.String `tfsdk:"delete_mode"`
	ReplicationTypeIngress  types.Bool   `tfsdk:"replication_type_ingress"`
	ReplicationTypeStatic   types.Bool   `tfsdk:"replication_type_static"`
	ReplicationTypeP2mp     types.Bool   `tfsdk:"replication_type_p2mp"`
	ReplicationTypeMp2mp    types.Bool   `tfsdk:"replication_type_mp2mp"`
	MacDuplicationLimit     types.Int64  `tfsdk:"mac_duplication_limit"`
	MacDuplicationTime      types.Int64  `tfsdk:"mac_duplication_time"`
	IpDuplicationLimit      types.Int64  `tfsdk:"ip_duplication_limit"`
	IpDuplicationTime       types.Int64  `tfsdk:"ip_duplication_time"`
	RouterIdLoopback        types.Int64  `tfsdk:"router_id_loopback"`
	DefaultGatewayAdvertise types.Bool   `tfsdk:"default_gateway_advertise"`
	LoggingPeerState        types.Bool   `tfsdk:"logging_peer_state"`
	RouteTargetAutoVni      types.Bool   `tfsdk:"route_target_auto_vni"`
	AnycastGatewayMacAuto   types.Bool   `tfsdk:"anycast_gateway_mac_auto"`
}

type EVPNData struct {
	Device                  types.String `tfsdk:"device"`
	Id                      types.String `tfsdk:"id"`
	ReplicationTypeIngress  types.Bool   `tfsdk:"replication_type_ingress"`
	ReplicationTypeStatic   types.Bool   `tfsdk:"replication_type_static"`
	ReplicationTypeP2mp     types.Bool   `tfsdk:"replication_type_p2mp"`
	ReplicationTypeMp2mp    types.Bool   `tfsdk:"replication_type_mp2mp"`
	MacDuplicationLimit     types.Int64  `tfsdk:"mac_duplication_limit"`
	MacDuplicationTime      types.Int64  `tfsdk:"mac_duplication_time"`
	IpDuplicationLimit      types.Int64  `tfsdk:"ip_duplication_limit"`
	IpDuplicationTime       types.Int64  `tfsdk:"ip_duplication_time"`
	RouterIdLoopback        types.Int64  `tfsdk:"router_id_loopback"`
	DefaultGatewayAdvertise types.Bool   `tfsdk:"default_gateway_advertise"`
	LoggingPeerState        types.Bool   `tfsdk:"logging_peer_state"`
	RouteTargetAutoVni      types.Bool   `tfsdk:"route_target_auto_vni"`
	AnycastGatewayMacAuto   types.Bool   `tfsdk:"anycast_gateway_mac_auto"`
}

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

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

func (data EVPN) getPath() string {
	return "Cisco-IOS-XE-native:native/l2vpn/Cisco-IOS-XE-l2vpn:evpn_cont/evpn"
}

func (data EVPNData) getPath() string {
	return "Cisco-IOS-XE-native:native/l2vpn/Cisco-IOS-XE-l2vpn:evpn_cont/evpn"
}

// if last path element has a key -> remove it
func (data EVPN) 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 EVPN) toBody(ctx context.Context) string {
	body := `{"` + helpers.LastElement(data.getPath()) + `":{}}`
	if !data.ReplicationTypeIngress.IsNull() && !data.ReplicationTypeIngress.IsUnknown() {
		if data.ReplicationTypeIngress.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"replication-type.ingress", map[string]string{})
		}
	}
	if !data.ReplicationTypeStatic.IsNull() && !data.ReplicationTypeStatic.IsUnknown() {
		if data.ReplicationTypeStatic.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"replication-type.static", map[string]string{})
		}
	}
	if !data.ReplicationTypeP2mp.IsNull() && !data.ReplicationTypeP2mp.IsUnknown() {
		if data.ReplicationTypeP2mp.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"replication-type.p2mp", map[string]string{})
		}
	}
	if !data.ReplicationTypeMp2mp.IsNull() && !data.ReplicationTypeMp2mp.IsUnknown() {
		if data.ReplicationTypeMp2mp.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"replication-type.mp2mp", map[string]string{})
		}
	}
	if !data.MacDuplicationLimit.IsNull() && !data.MacDuplicationLimit.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"mac.duplication.limit", strconv.FormatInt(data.MacDuplicationLimit.ValueInt64(), 10))
	}
	if !data.MacDuplicationTime.IsNull() && !data.MacDuplicationTime.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"mac.duplication.time", strconv.FormatInt(data.MacDuplicationTime.ValueInt64(), 10))
	}
	if !data.IpDuplicationLimit.IsNull() && !data.IpDuplicationLimit.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.duplication.limit", strconv.FormatInt(data.IpDuplicationLimit.ValueInt64(), 10))
	}
	if !data.IpDuplicationTime.IsNull() && !data.IpDuplicationTime.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"ip.duplication.time", strconv.FormatInt(data.IpDuplicationTime.ValueInt64(), 10))
	}
	if !data.RouterIdLoopback.IsNull() && !data.RouterIdLoopback.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"router-id.interface.Loopback", strconv.FormatInt(data.RouterIdLoopback.ValueInt64(), 10))
	}
	if !data.DefaultGatewayAdvertise.IsNull() && !data.DefaultGatewayAdvertise.IsUnknown() {
		if data.DefaultGatewayAdvertise.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"default-gateway.advertise", map[string]string{})
		}
	}
	if !data.LoggingPeerState.IsNull() && !data.LoggingPeerState.IsUnknown() {
		if data.LoggingPeerState.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"logging.peer.state", map[string]string{})
		}
	}
	if !data.RouteTargetAutoVni.IsNull() && !data.RouteTargetAutoVni.IsUnknown() {
		if data.RouteTargetAutoVni.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"route-target.auto.vni", map[string]string{})
		}
	}
	if !data.AnycastGatewayMacAuto.IsNull() && !data.AnycastGatewayMacAuto.IsUnknown() {
		if data.AnycastGatewayMacAuto.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"anycast-gateway.mac.auto", 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 *EVPN) 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 + "replication-type.ingress"); !data.ReplicationTypeIngress.IsNull() {
		if value.Exists() {
			data.ReplicationTypeIngress = types.BoolValue(true)
		} else {
			data.ReplicationTypeIngress = types.BoolValue(false)
		}
	} else {
		data.ReplicationTypeIngress = types.BoolNull()
	}
	if value := res.Get(prefix + "replication-type.static"); !data.ReplicationTypeStatic.IsNull() {
		if value.Exists() {
			data.ReplicationTypeStatic = types.BoolValue(true)
		} else {
			data.ReplicationTypeStatic = types.BoolValue(false)
		}
	} else {
		data.ReplicationTypeStatic = types.BoolNull()
	}
	if value := res.Get(prefix + "replication-type.p2mp"); !data.ReplicationTypeP2mp.IsNull() {
		if value.Exists() {
			data.ReplicationTypeP2mp = types.BoolValue(true)
		} else {
			data.ReplicationTypeP2mp = types.BoolValue(false)
		}
	} else {
		data.ReplicationTypeP2mp = types.BoolNull()
	}
	if value := res.Get(prefix + "replication-type.mp2mp"); !data.ReplicationTypeMp2mp.IsNull() {
		if value.Exists() {
			data.ReplicationTypeMp2mp = types.BoolValue(true)
		} else {
			data.ReplicationTypeMp2mp = types.BoolValue(false)
		}
	} else {
		data.ReplicationTypeMp2mp = types.BoolNull()
	}
	if value := res.Get(prefix + "mac.duplication.limit"); value.Exists() && !data.MacDuplicationLimit.IsNull() {
		data.MacDuplicationLimit = types.Int64Value(value.Int())
	} else {
		data.MacDuplicationLimit = types.Int64Null()
	}
	if value := res.Get(prefix + "mac.duplication.time"); value.Exists() && !data.MacDuplicationTime.IsNull() {
		data.MacDuplicationTime = types.Int64Value(value.Int())
	} else {
		data.MacDuplicationTime = types.Int64Null()
	}
	if value := res.Get(prefix + "ip.duplication.limit"); value.Exists() && !data.IpDuplicationLimit.IsNull() {
		data.IpDuplicationLimit = types.Int64Value(value.Int())
	} else {
		data.IpDuplicationLimit = types.Int64Null()
	}
	if value := res.Get(prefix + "ip.duplication.time"); value.Exists() && !data.IpDuplicationTime.IsNull() {
		data.IpDuplicationTime = types.Int64Value(value.Int())
	} else {
		data.IpDuplicationTime = types.Int64Null()
	}
	if value := res.Get(prefix + "router-id.interface.Loopback"); value.Exists() && !data.RouterIdLoopback.IsNull() {
		data.RouterIdLoopback = types.Int64Value(value.Int())
	} else {
		data.RouterIdLoopback = types.Int64Null()
	}
	if value := res.Get(prefix + "default-gateway.advertise"); !data.DefaultGatewayAdvertise.IsNull() {
		if value.Exists() {
			data.DefaultGatewayAdvertise = types.BoolValue(true)
		} else {
			data.DefaultGatewayAdvertise = types.BoolValue(false)
		}
	} else {
		data.DefaultGatewayAdvertise = types.BoolNull()
	}
	if value := res.Get(prefix + "logging.peer.state"); !data.LoggingPeerState.IsNull() {
		if value.Exists() {
			data.LoggingPeerState = types.BoolValue(true)
		} else {
			data.LoggingPeerState = types.BoolValue(false)
		}
	} else {
		data.LoggingPeerState = types.BoolNull()
	}
	if value := res.Get(prefix + "route-target.auto.vni"); !data.RouteTargetAutoVni.IsNull() {
		if value.Exists() {
			data.RouteTargetAutoVni = types.BoolValue(true)
		} else {
			data.RouteTargetAutoVni = types.BoolValue(false)
		}
	} else {
		data.RouteTargetAutoVni = types.BoolNull()
	}
	if value := res.Get(prefix + "anycast-gateway.mac.auto"); !data.AnycastGatewayMacAuto.IsNull() {
		if value.Exists() {
			data.AnycastGatewayMacAuto = types.BoolValue(true)
		} else {
			data.AnycastGatewayMacAuto = types.BoolValue(false)
		}
	} else {
		data.AnycastGatewayMacAuto = types.BoolNull()
	}
}

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

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

func (data *EVPN) 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 + "replication-type.ingress"); value.Exists() {
		data.ReplicationTypeIngress = types.BoolValue(true)
	} else {
		data.ReplicationTypeIngress = types.BoolValue(false)
	}
	if value := res.Get(prefix + "replication-type.static"); value.Exists() {
		data.ReplicationTypeStatic = types.BoolValue(true)
	} else {
		data.ReplicationTypeStatic = types.BoolValue(false)
	}
	if value := res.Get(prefix + "replication-type.p2mp"); value.Exists() {
		data.ReplicationTypeP2mp = types.BoolValue(true)
	} else {
		data.ReplicationTypeP2mp = types.BoolValue(false)
	}
	if value := res.Get(prefix + "replication-type.mp2mp"); value.Exists() {
		data.ReplicationTypeMp2mp = types.BoolValue(true)
	} else {
		data.ReplicationTypeMp2mp = types.BoolValue(false)
	}
	if value := res.Get(prefix + "mac.duplication.limit"); value.Exists() {
		data.MacDuplicationLimit = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "mac.duplication.time"); value.Exists() {
		data.MacDuplicationTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "ip.duplication.limit"); value.Exists() {
		data.IpDuplicationLimit = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "ip.duplication.time"); value.Exists() {
		data.IpDuplicationTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "router-id.interface.Loopback"); value.Exists() {
		data.RouterIdLoopback = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "default-gateway.advertise"); value.Exists() {
		data.DefaultGatewayAdvertise = types.BoolValue(true)
	} else {
		data.DefaultGatewayAdvertise = types.BoolValue(false)
	}
	if value := res.Get(prefix + "logging.peer.state"); value.Exists() {
		data.LoggingPeerState = types.BoolValue(true)
	} else {
		data.LoggingPeerState = types.BoolValue(false)
	}
	if value := res.Get(prefix + "route-target.auto.vni"); value.Exists() {
		data.RouteTargetAutoVni = types.BoolValue(true)
	} else {
		data.RouteTargetAutoVni = types.BoolValue(false)
	}
	if value := res.Get(prefix + "anycast-gateway.mac.auto"); value.Exists() {
		data.AnycastGatewayMacAuto = types.BoolValue(true)
	} else {
		data.AnycastGatewayMacAuto = types.BoolValue(false)
	}
}

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

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

func (data *EVPNData) 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 + "replication-type.ingress"); value.Exists() {
		data.ReplicationTypeIngress = types.BoolValue(true)
	} else {
		data.ReplicationTypeIngress = types.BoolValue(false)
	}
	if value := res.Get(prefix + "replication-type.static"); value.Exists() {
		data.ReplicationTypeStatic = types.BoolValue(true)
	} else {
		data.ReplicationTypeStatic = types.BoolValue(false)
	}
	if value := res.Get(prefix + "replication-type.p2mp"); value.Exists() {
		data.ReplicationTypeP2mp = types.BoolValue(true)
	} else {
		data.ReplicationTypeP2mp = types.BoolValue(false)
	}
	if value := res.Get(prefix + "replication-type.mp2mp"); value.Exists() {
		data.ReplicationTypeMp2mp = types.BoolValue(true)
	} else {
		data.ReplicationTypeMp2mp = types.BoolValue(false)
	}
	if value := res.Get(prefix + "mac.duplication.limit"); value.Exists() {
		data.MacDuplicationLimit = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "mac.duplication.time"); value.Exists() {
		data.MacDuplicationTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "ip.duplication.limit"); value.Exists() {
		data.IpDuplicationLimit = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "ip.duplication.time"); value.Exists() {
		data.IpDuplicationTime = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "router-id.interface.Loopback"); value.Exists() {
		data.RouterIdLoopback = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "default-gateway.advertise"); value.Exists() {
		data.DefaultGatewayAdvertise = types.BoolValue(true)
	} else {
		data.DefaultGatewayAdvertise = types.BoolValue(false)
	}
	if value := res.Get(prefix + "logging.peer.state"); value.Exists() {
		data.LoggingPeerState = types.BoolValue(true)
	} else {
		data.LoggingPeerState = types.BoolValue(false)
	}
	if value := res.Get(prefix + "route-target.auto.vni"); value.Exists() {
		data.RouteTargetAutoVni = types.BoolValue(true)
	} else {
		data.RouteTargetAutoVni = types.BoolValue(false)
	}
	if value := res.Get(prefix + "anycast-gateway.mac.auto"); value.Exists() {
		data.AnycastGatewayMacAuto = types.BoolValue(true)
	} else {
		data.AnycastGatewayMacAuto = types.BoolValue(false)
	}
}

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

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

func (data *EVPN) getDeletedItems(ctx context.Context, state EVPN) []string {
	deletedItems := make([]string, 0)
	if !state.AnycastGatewayMacAuto.IsNull() && data.AnycastGatewayMacAuto.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/anycast-gateway/mac/auto", state.getPath()))
	}
	if !state.RouteTargetAutoVni.IsNull() && data.RouteTargetAutoVni.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/route-target/auto/vni", state.getPath()))
	}
	if !state.LoggingPeerState.IsNull() && data.LoggingPeerState.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/logging/peer/state", state.getPath()))
	}
	if !state.DefaultGatewayAdvertise.IsNull() && data.DefaultGatewayAdvertise.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/default-gateway/advertise", state.getPath()))
	}
	if !state.RouterIdLoopback.IsNull() && data.RouterIdLoopback.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/router-id/interface/Loopback", state.getPath()))
	}
	if !state.IpDuplicationTime.IsNull() && data.IpDuplicationTime.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/duplication", state.getPath()))
	}
	if !state.IpDuplicationLimit.IsNull() && data.IpDuplicationLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/ip/duplication", state.getPath()))
	}
	if !state.MacDuplicationTime.IsNull() && data.MacDuplicationTime.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/mac/duplication", state.getPath()))
	}
	if !state.MacDuplicationLimit.IsNull() && data.MacDuplicationLimit.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/mac/duplication", state.getPath()))
	}
	if !state.ReplicationTypeMp2mp.IsNull() && data.ReplicationTypeMp2mp.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/replication-type/mp2mp", state.getPath()))
	}
	if !state.ReplicationTypeP2mp.IsNull() && data.ReplicationTypeP2mp.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/replication-type/p2mp", state.getPath()))
	}
	if !state.ReplicationTypeStatic.IsNull() && data.ReplicationTypeStatic.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/replication-type/static", state.getPath()))
	}
	if !state.ReplicationTypeIngress.IsNull() && data.ReplicationTypeIngress.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/replication-type/ingress", state.getPath()))
	}

	return deletedItems
}

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

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

func (data *EVPN) getEmptyLeafsDelete(ctx context.Context) []string {
	emptyLeafsDelete := make([]string, 0)
	if !data.AnycastGatewayMacAuto.IsNull() && !data.AnycastGatewayMacAuto.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/anycast-gateway/mac/auto", data.getPath()))
	}
	if !data.RouteTargetAutoVni.IsNull() && !data.RouteTargetAutoVni.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/route-target/auto/vni", data.getPath()))
	}
	if !data.LoggingPeerState.IsNull() && !data.LoggingPeerState.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/logging/peer/state", data.getPath()))
	}
	if !data.DefaultGatewayAdvertise.IsNull() && !data.DefaultGatewayAdvertise.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/default-gateway/advertise", data.getPath()))
	}
	if !data.ReplicationTypeMp2mp.IsNull() && !data.ReplicationTypeMp2mp.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/replication-type/mp2mp", data.getPath()))
	}
	if !data.ReplicationTypeP2mp.IsNull() && !data.ReplicationTypeP2mp.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/replication-type/p2mp", data.getPath()))
	}
	if !data.ReplicationTypeStatic.IsNull() && !data.ReplicationTypeStatic.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/replication-type/static", data.getPath()))
	}
	if !data.ReplicationTypeIngress.IsNull() && !data.ReplicationTypeIngress.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/replication-type/ingress", data.getPath()))
	}

	return emptyLeafsDelete
}

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

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

func (data *EVPN) getDeletePaths(ctx context.Context) []string {
	var deletePaths []string
	if !data.AnycastGatewayMacAuto.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/anycast-gateway/mac/auto", data.getPath()))
	}
	if !data.RouteTargetAutoVni.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/route-target/auto/vni", data.getPath()))
	}
	if !data.LoggingPeerState.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/logging/peer/state", data.getPath()))
	}
	if !data.DefaultGatewayAdvertise.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/default-gateway/advertise", data.getPath()))
	}
	if !data.RouterIdLoopback.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/router-id/interface/Loopback", data.getPath()))
	}
	if !data.IpDuplicationTime.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/duplication", data.getPath()))
	}
	if !data.IpDuplicationLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/ip/duplication", data.getPath()))
	}
	if !data.MacDuplicationTime.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/mac/duplication", data.getPath()))
	}
	if !data.MacDuplicationLimit.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/mac/duplication", data.getPath()))
	}
	if !data.ReplicationTypeMp2mp.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/replication-type/mp2mp", data.getPath()))
	}
	if !data.ReplicationTypeP2mp.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/replication-type/p2mp", data.getPath()))
	}
	if !data.ReplicationTypeStatic.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/replication-type/static", data.getPath()))
	}
	if !data.ReplicationTypeIngress.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/replication-type/ingress", data.getPath()))
	}

	return deletePaths
}

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