// 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 License struct {
	Device                          types.String `tfsdk:"device"`
	Id                              types.String `tfsdk:"id"`
	DeleteMode                      types.String `tfsdk:"delete_mode"`
	BootLevelNetworkAdvantage       types.Bool   `tfsdk:"boot_level_network_advantage"`
	BootLevelNetworkAdvantageAddon  types.String `tfsdk:"boot_level_network_advantage_addon"`
	BootLevelNetworkEssentials      types.Bool   `tfsdk:"boot_level_network_essentials"`
	BootLevelNetworkEssentialsAddon types.String `tfsdk:"boot_level_network_essentials_addon"`
	SmartTransportType              types.String `tfsdk:"smart_transport_type"`
	SmartUrlCslu                    types.String `tfsdk:"smart_url_cslu"`
	AcceptAgreement                 types.Bool   `tfsdk:"accept_agreement"`
	AcceptEnd                       types.Bool   `tfsdk:"accept_end"`
	AcceptUser                      types.Bool   `tfsdk:"accept_user"`
	UdiPid                          types.String `tfsdk:"udi_pid"`
	UdiSn                           types.String `tfsdk:"udi_sn"`
	FeatureName                     types.String `tfsdk:"feature_name"`
	FeaturePortBulk                 types.Bool   `tfsdk:"feature_port_bulk"`
	FeaturePortOnegig               types.Int64  `tfsdk:"feature_port_onegig"`
	FeaturePortB6xonegig            types.Int64  `tfsdk:"feature_port_b_6xonegig"`
	FeaturePortTengig               types.Int64  `tfsdk:"feature_port_tengig"`
}

type LicenseData struct {
	Device                          types.String `tfsdk:"device"`
	Id                              types.String `tfsdk:"id"`
	BootLevelNetworkAdvantage       types.Bool   `tfsdk:"boot_level_network_advantage"`
	BootLevelNetworkAdvantageAddon  types.String `tfsdk:"boot_level_network_advantage_addon"`
	BootLevelNetworkEssentials      types.Bool   `tfsdk:"boot_level_network_essentials"`
	BootLevelNetworkEssentialsAddon types.String `tfsdk:"boot_level_network_essentials_addon"`
	SmartTransportType              types.String `tfsdk:"smart_transport_type"`
	SmartUrlCslu                    types.String `tfsdk:"smart_url_cslu"`
	AcceptAgreement                 types.Bool   `tfsdk:"accept_agreement"`
	AcceptEnd                       types.Bool   `tfsdk:"accept_end"`
	AcceptUser                      types.Bool   `tfsdk:"accept_user"`
	UdiPid                          types.String `tfsdk:"udi_pid"`
	UdiSn                           types.String `tfsdk:"udi_sn"`
	FeatureName                     types.String `tfsdk:"feature_name"`
	FeaturePortBulk                 types.Bool   `tfsdk:"feature_port_bulk"`
	FeaturePortOnegig               types.Int64  `tfsdk:"feature_port_onegig"`
	FeaturePortB6xonegig            types.Int64  `tfsdk:"feature_port_b_6xonegig"`
	FeaturePortTengig               types.Int64  `tfsdk:"feature_port_tengig"`
}

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

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

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

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

// if last path element has a key -> remove it
func (data License) 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 License) toBody(ctx context.Context) string {
	body := `{"` + helpers.LastElement(data.getPath()) + `":{}}`
	if !data.BootLevelNetworkAdvantage.IsNull() && !data.BootLevelNetworkAdvantage.IsUnknown() {
		if data.BootLevelNetworkAdvantage.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"boot.level.network-advantage", map[string]string{})
		}
	}
	if !data.BootLevelNetworkAdvantageAddon.IsNull() && !data.BootLevelNetworkAdvantageAddon.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"boot.level.network-advantage.addon", data.BootLevelNetworkAdvantageAddon.ValueString())
	}
	if !data.BootLevelNetworkEssentials.IsNull() && !data.BootLevelNetworkEssentials.IsUnknown() {
		if data.BootLevelNetworkEssentials.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"boot.level.network-essentials", map[string]string{})
		}
	}
	if !data.BootLevelNetworkEssentialsAddon.IsNull() && !data.BootLevelNetworkEssentialsAddon.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"boot.level.network-essentials.addon", data.BootLevelNetworkEssentialsAddon.ValueString())
	}
	if !data.SmartTransportType.IsNull() && !data.SmartTransportType.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"smart.transport-type", data.SmartTransportType.ValueString())
	}
	if !data.SmartUrlCslu.IsNull() && !data.SmartUrlCslu.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"smart.url.cslu", data.SmartUrlCslu.ValueString())
	}
	if !data.AcceptAgreement.IsNull() && !data.AcceptAgreement.IsUnknown() {
		if data.AcceptAgreement.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"accept.agreement", map[string]string{})
		}
	}
	if !data.AcceptEnd.IsNull() && !data.AcceptEnd.IsUnknown() {
		if data.AcceptEnd.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"accept.end", map[string]string{})
		}
	}
	if !data.AcceptUser.IsNull() && !data.AcceptUser.IsUnknown() {
		if data.AcceptUser.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"accept.user", map[string]string{})
		}
	}
	if !data.UdiPid.IsNull() && !data.UdiPid.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"udi.pid", data.UdiPid.ValueString())
	}
	if !data.UdiSn.IsNull() && !data.UdiSn.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"udi.sn", data.UdiSn.ValueString())
	}
	if !data.FeatureName.IsNull() && !data.FeatureName.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"feature.name", data.FeatureName.ValueString())
	}
	if !data.FeaturePortBulk.IsNull() && !data.FeaturePortBulk.IsUnknown() {
		if data.FeaturePortBulk.ValueBool() {
			body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"feature.port.bulk", map[string]string{})
		}
	}
	if !data.FeaturePortOnegig.IsNull() && !data.FeaturePortOnegig.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"feature.port.onegig", strconv.FormatInt(data.FeaturePortOnegig.ValueInt64(), 10))
	}
	if !data.FeaturePortB6xonegig.IsNull() && !data.FeaturePortB6xonegig.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"feature.port.b-6xonegig", strconv.FormatInt(data.FeaturePortB6xonegig.ValueInt64(), 10))
	}
	if !data.FeaturePortTengig.IsNull() && !data.FeaturePortTengig.IsUnknown() {
		body, _ = sjson.Set(body, helpers.LastElement(data.getPath())+"."+"feature.port.tengig", strconv.FormatInt(data.FeaturePortTengig.ValueInt64(), 10))
	}
	return body
}

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

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

func (data *License) 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 + "boot.level.network-advantage"); !data.BootLevelNetworkAdvantage.IsNull() {
		if value.Exists() {
			data.BootLevelNetworkAdvantage = types.BoolValue(true)
		} else {
			data.BootLevelNetworkAdvantage = types.BoolValue(false)
		}
	} else {
		data.BootLevelNetworkAdvantage = types.BoolNull()
	}
	if value := res.Get(prefix + "boot.level.network-advantage.addon"); value.Exists() && !data.BootLevelNetworkAdvantageAddon.IsNull() {
		data.BootLevelNetworkAdvantageAddon = types.StringValue(value.String())
	} else {
		data.BootLevelNetworkAdvantageAddon = types.StringNull()
	}
	if value := res.Get(prefix + "boot.level.network-essentials"); !data.BootLevelNetworkEssentials.IsNull() {
		if value.Exists() {
			data.BootLevelNetworkEssentials = types.BoolValue(true)
		} else {
			data.BootLevelNetworkEssentials = types.BoolValue(false)
		}
	} else {
		data.BootLevelNetworkEssentials = types.BoolNull()
	}
	if value := res.Get(prefix + "boot.level.network-essentials.addon"); value.Exists() && !data.BootLevelNetworkEssentialsAddon.IsNull() {
		data.BootLevelNetworkEssentialsAddon = types.StringValue(value.String())
	} else {
		data.BootLevelNetworkEssentialsAddon = types.StringNull()
	}
	if value := res.Get(prefix + "smart.transport-type"); value.Exists() && !data.SmartTransportType.IsNull() {
		data.SmartTransportType = types.StringValue(value.String())
	} else {
		data.SmartTransportType = types.StringNull()
	}
	if value := res.Get(prefix + "smart.url.cslu"); value.Exists() && !data.SmartUrlCslu.IsNull() {
		data.SmartUrlCslu = types.StringValue(value.String())
	} else {
		data.SmartUrlCslu = types.StringNull()
	}
	if value := res.Get(prefix + "accept.agreement"); !data.AcceptAgreement.IsNull() {
		if value.Exists() {
			data.AcceptAgreement = types.BoolValue(true)
		} else {
			data.AcceptAgreement = types.BoolValue(false)
		}
	} else {
		data.AcceptAgreement = types.BoolNull()
	}
	if value := res.Get(prefix + "accept.end"); !data.AcceptEnd.IsNull() {
		if value.Exists() {
			data.AcceptEnd = types.BoolValue(true)
		} else {
			data.AcceptEnd = types.BoolValue(false)
		}
	} else {
		data.AcceptEnd = types.BoolNull()
	}
	if value := res.Get(prefix + "accept.user"); !data.AcceptUser.IsNull() {
		if value.Exists() {
			data.AcceptUser = types.BoolValue(true)
		} else {
			data.AcceptUser = types.BoolValue(false)
		}
	} else {
		data.AcceptUser = types.BoolNull()
	}
	if value := res.Get(prefix + "udi.pid"); value.Exists() && !data.UdiPid.IsNull() {
		data.UdiPid = types.StringValue(value.String())
	} else {
		data.UdiPid = types.StringNull()
	}
	if value := res.Get(prefix + "udi.sn"); value.Exists() && !data.UdiSn.IsNull() {
		data.UdiSn = types.StringValue(value.String())
	} else {
		data.UdiSn = types.StringNull()
	}
	if value := res.Get(prefix + "feature.name"); value.Exists() && !data.FeatureName.IsNull() {
		data.FeatureName = types.StringValue(value.String())
	} else {
		data.FeatureName = types.StringNull()
	}
	if value := res.Get(prefix + "feature.port.bulk"); !data.FeaturePortBulk.IsNull() {
		if value.Exists() {
			data.FeaturePortBulk = types.BoolValue(true)
		} else {
			data.FeaturePortBulk = types.BoolValue(false)
		}
	} else {
		data.FeaturePortBulk = types.BoolNull()
	}
	if value := res.Get(prefix + "feature.port.onegig"); value.Exists() && !data.FeaturePortOnegig.IsNull() {
		data.FeaturePortOnegig = types.Int64Value(value.Int())
	} else {
		data.FeaturePortOnegig = types.Int64Null()
	}
	if value := res.Get(prefix + "feature.port.b-6xonegig"); value.Exists() && !data.FeaturePortB6xonegig.IsNull() {
		data.FeaturePortB6xonegig = types.Int64Value(value.Int())
	} else {
		data.FeaturePortB6xonegig = types.Int64Null()
	}
	if value := res.Get(prefix + "feature.port.tengig"); value.Exists() && !data.FeaturePortTengig.IsNull() {
		data.FeaturePortTengig = types.Int64Value(value.Int())
	} else {
		data.FeaturePortTengig = types.Int64Null()
	}
}

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

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

func (data *License) 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 + "boot.level.network-advantage"); value.Exists() {
		data.BootLevelNetworkAdvantage = types.BoolValue(true)
	} else {
		data.BootLevelNetworkAdvantage = types.BoolValue(false)
	}
	if value := res.Get(prefix + "boot.level.network-advantage.addon"); value.Exists() {
		data.BootLevelNetworkAdvantageAddon = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "boot.level.network-essentials"); value.Exists() {
		data.BootLevelNetworkEssentials = types.BoolValue(true)
	} else {
		data.BootLevelNetworkEssentials = types.BoolValue(false)
	}
	if value := res.Get(prefix + "boot.level.network-essentials.addon"); value.Exists() {
		data.BootLevelNetworkEssentialsAddon = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "smart.transport-type"); value.Exists() {
		data.SmartTransportType = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "smart.url.cslu"); value.Exists() {
		data.SmartUrlCslu = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "accept.agreement"); value.Exists() {
		data.AcceptAgreement = types.BoolValue(true)
	} else {
		data.AcceptAgreement = types.BoolValue(false)
	}
	if value := res.Get(prefix + "accept.end"); value.Exists() {
		data.AcceptEnd = types.BoolValue(true)
	} else {
		data.AcceptEnd = types.BoolValue(false)
	}
	if value := res.Get(prefix + "accept.user"); value.Exists() {
		data.AcceptUser = types.BoolValue(true)
	} else {
		data.AcceptUser = types.BoolValue(false)
	}
	if value := res.Get(prefix + "udi.pid"); value.Exists() {
		data.UdiPid = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "udi.sn"); value.Exists() {
		data.UdiSn = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "feature.name"); value.Exists() {
		data.FeatureName = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "feature.port.bulk"); value.Exists() {
		data.FeaturePortBulk = types.BoolValue(true)
	} else {
		data.FeaturePortBulk = types.BoolValue(false)
	}
	if value := res.Get(prefix + "feature.port.onegig"); value.Exists() {
		data.FeaturePortOnegig = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "feature.port.b-6xonegig"); value.Exists() {
		data.FeaturePortB6xonegig = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "feature.port.tengig"); value.Exists() {
		data.FeaturePortTengig = types.Int64Value(value.Int())
	}
}

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

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

func (data *LicenseData) 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 + "boot.level.network-advantage"); value.Exists() {
		data.BootLevelNetworkAdvantage = types.BoolValue(true)
	} else {
		data.BootLevelNetworkAdvantage = types.BoolValue(false)
	}
	if value := res.Get(prefix + "boot.level.network-advantage.addon"); value.Exists() {
		data.BootLevelNetworkAdvantageAddon = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "boot.level.network-essentials"); value.Exists() {
		data.BootLevelNetworkEssentials = types.BoolValue(true)
	} else {
		data.BootLevelNetworkEssentials = types.BoolValue(false)
	}
	if value := res.Get(prefix + "boot.level.network-essentials.addon"); value.Exists() {
		data.BootLevelNetworkEssentialsAddon = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "smart.transport-type"); value.Exists() {
		data.SmartTransportType = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "smart.url.cslu"); value.Exists() {
		data.SmartUrlCslu = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "accept.agreement"); value.Exists() {
		data.AcceptAgreement = types.BoolValue(true)
	} else {
		data.AcceptAgreement = types.BoolValue(false)
	}
	if value := res.Get(prefix + "accept.end"); value.Exists() {
		data.AcceptEnd = types.BoolValue(true)
	} else {
		data.AcceptEnd = types.BoolValue(false)
	}
	if value := res.Get(prefix + "accept.user"); value.Exists() {
		data.AcceptUser = types.BoolValue(true)
	} else {
		data.AcceptUser = types.BoolValue(false)
	}
	if value := res.Get(prefix + "udi.pid"); value.Exists() {
		data.UdiPid = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "udi.sn"); value.Exists() {
		data.UdiSn = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "feature.name"); value.Exists() {
		data.FeatureName = types.StringValue(value.String())
	}
	if value := res.Get(prefix + "feature.port.bulk"); value.Exists() {
		data.FeaturePortBulk = types.BoolValue(true)
	} else {
		data.FeaturePortBulk = types.BoolValue(false)
	}
	if value := res.Get(prefix + "feature.port.onegig"); value.Exists() {
		data.FeaturePortOnegig = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "feature.port.b-6xonegig"); value.Exists() {
		data.FeaturePortB6xonegig = types.Int64Value(value.Int())
	}
	if value := res.Get(prefix + "feature.port.tengig"); value.Exists() {
		data.FeaturePortTengig = types.Int64Value(value.Int())
	}
}

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

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

func (data *License) getDeletedItems(ctx context.Context, state License) []string {
	deletedItems := make([]string, 0)
	if !state.FeaturePortTengig.IsNull() && data.FeaturePortTengig.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/feature/port/tengig", state.getPath()))
	}
	if !state.FeaturePortB6xonegig.IsNull() && data.FeaturePortB6xonegig.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/feature/port/b-6xonegig", state.getPath()))
	}
	if !state.FeaturePortOnegig.IsNull() && data.FeaturePortOnegig.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/feature/port/onegig", state.getPath()))
	}
	if !state.FeaturePortBulk.IsNull() && data.FeaturePortBulk.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/feature/port/bulk", state.getPath()))
	}
	if !state.FeatureName.IsNull() && data.FeatureName.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/feature/name", state.getPath()))
	}
	if !state.UdiSn.IsNull() && data.UdiSn.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/udi/sn", state.getPath()))
	}
	if !state.UdiPid.IsNull() && data.UdiPid.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/udi/pid", state.getPath()))
	}
	if !state.AcceptUser.IsNull() && data.AcceptUser.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/accept/user", state.getPath()))
	}
	if !state.AcceptEnd.IsNull() && data.AcceptEnd.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/accept/end", state.getPath()))
	}
	if !state.AcceptAgreement.IsNull() && data.AcceptAgreement.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/accept/agreement", state.getPath()))
	}
	if !state.SmartUrlCslu.IsNull() && data.SmartUrlCslu.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/smart/url/cslu", state.getPath()))
	}
	if !state.SmartTransportType.IsNull() && data.SmartTransportType.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/smart/transport-type", state.getPath()))
	}
	if !state.BootLevelNetworkEssentialsAddon.IsNull() && data.BootLevelNetworkEssentialsAddon.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/boot/level/network-essentials/addon", state.getPath()))
	}
	if !state.BootLevelNetworkEssentials.IsNull() && data.BootLevelNetworkEssentials.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/boot/level/network-essentials", state.getPath()))
	}
	if !state.BootLevelNetworkAdvantageAddon.IsNull() && data.BootLevelNetworkAdvantageAddon.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/boot/level/network-advantage/addon", state.getPath()))
	}
	if !state.BootLevelNetworkAdvantage.IsNull() && data.BootLevelNetworkAdvantage.IsNull() {
		deletedItems = append(deletedItems, fmt.Sprintf("%v/boot/level/network-advantage", state.getPath()))
	}

	return deletedItems
}

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

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

func (data *License) getEmptyLeafsDelete(ctx context.Context) []string {
	emptyLeafsDelete := make([]string, 0)
	if !data.FeaturePortBulk.IsNull() && !data.FeaturePortBulk.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/feature/port/bulk", data.getPath()))
	}
	if !data.AcceptUser.IsNull() && !data.AcceptUser.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/accept/user", data.getPath()))
	}
	if !data.AcceptEnd.IsNull() && !data.AcceptEnd.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/accept/end", data.getPath()))
	}
	if !data.AcceptAgreement.IsNull() && !data.AcceptAgreement.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/accept/agreement", data.getPath()))
	}
	if !data.BootLevelNetworkEssentials.IsNull() && !data.BootLevelNetworkEssentials.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/boot/level/network-essentials", data.getPath()))
	}
	if !data.BootLevelNetworkAdvantage.IsNull() && !data.BootLevelNetworkAdvantage.ValueBool() {
		emptyLeafsDelete = append(emptyLeafsDelete, fmt.Sprintf("%v/boot/level/network-advantage", data.getPath()))
	}

	return emptyLeafsDelete
}

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

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

func (data *License) getDeletePaths(ctx context.Context) []string {
	var deletePaths []string
	if !data.FeaturePortTengig.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/feature/port/tengig", data.getPath()))
	}
	if !data.FeaturePortB6xonegig.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/feature/port/b-6xonegig", data.getPath()))
	}
	if !data.FeaturePortOnegig.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/feature/port/onegig", data.getPath()))
	}
	if !data.FeaturePortBulk.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/feature/port/bulk", data.getPath()))
	}
	if !data.FeatureName.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/feature/name", data.getPath()))
	}
	if !data.UdiSn.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/udi/sn", data.getPath()))
	}
	if !data.UdiPid.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/udi/pid", data.getPath()))
	}
	if !data.AcceptUser.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/accept/user", data.getPath()))
	}
	if !data.AcceptEnd.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/accept/end", data.getPath()))
	}
	if !data.AcceptAgreement.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/accept/agreement", data.getPath()))
	}
	if !data.SmartUrlCslu.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/smart/url/cslu", data.getPath()))
	}
	if !data.SmartTransportType.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/smart/transport-type", data.getPath()))
	}
	if !data.BootLevelNetworkEssentialsAddon.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/boot/level/network-essentials/addon", data.getPath()))
	}
	if !data.BootLevelNetworkEssentials.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/boot/level/network-essentials", data.getPath()))
	}
	if !data.BootLevelNetworkAdvantageAddon.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/boot/level/network-advantage/addon", data.getPath()))
	}
	if !data.BootLevelNetworkAdvantage.IsNull() {
		deletePaths = append(deletePaths, fmt.Sprintf("%v/boot/level/network-advantage", data.getPath()))
	}

	return deletePaths
}

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