// Code generated by "gen/generator.go"; DO NOT EDIT.
// In order to regenerate this file execute `go generate` from the repository root.
// More details can be found in the [README](https://github.com/CiscoDevNet/terraform-provider-aci/blob/master/README.md).

package provider

import (
	"context"
	"encoding/json"
	"fmt"

	"github.com/ciscoecosystem/aci-go-client/v2/client"
	"github.com/ciscoecosystem/aci-go-client/v2/container"
	"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
	"github.com/hashicorp/terraform-plugin-framework/attr"
	"github.com/hashicorp/terraform-plugin-framework/diag"
	"github.com/hashicorp/terraform-plugin-framework/path"
	"github.com/hashicorp/terraform-plugin-framework/resource"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/setplanmodifier"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
	"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
	"github.com/hashicorp/terraform-plugin-framework/schema/validator"
	"github.com/hashicorp/terraform-plugin-framework/types"
	"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
	"github.com/hashicorp/terraform-plugin-log/tflog"
)

// Ensure provider defined types fully satisfy framework interfaces.
var _ resource.Resource = &FvCtxResource{}
var _ resource.ResourceWithImportState = &FvCtxResource{}

func NewFvCtxResource() resource.Resource {
	return &FvCtxResource{}
}

// FvCtxResource defines the resource implementation.
type FvCtxResource struct {
	client *client.Client
}

// FvCtxResourceModel describes the resource data model.
type FvCtxResourceModel struct {
	Id                                        types.String `tfsdk:"id"`
	ParentDn                                  types.String `tfsdk:"parent_dn"`
	Annotation                                types.String `tfsdk:"annotation"`
	BdEnforcedEnable                          types.String `tfsdk:"bd_enforcement"`
	Descr                                     types.String `tfsdk:"description"`
	IpDataPlaneLearning                       types.String `tfsdk:"ip_data_plane_learning"`
	Name                                      types.String `tfsdk:"name"`
	NameAlias                                 types.String `tfsdk:"name_alias"`
	OwnerKey                                  types.String `tfsdk:"owner_key"`
	OwnerTag                                  types.String `tfsdk:"owner_tag"`
	PcEnfDir                                  types.String `tfsdk:"policy_control_enforcement_direction"`
	PcEnfPref                                 types.String `tfsdk:"policy_control_enforcement_mode"`
	PcTag                                     types.String `tfsdk:"pc_tag"`
	Scope                                     types.String `tfsdk:"scope"`
	FvRsBgpCtxPol                             types.Object `tfsdk:"relation_to_bgp_timers"`
	FvRsCtxMonPol                             types.Object `tfsdk:"relation_to_monitoring_policy"`
	FvRsCtxToBgpCtxAfPol                      types.Set    `tfsdk:"relation_to_bgp_address_family_contexts"`
	FvRsCtxToEigrpCtxAfPol                    types.Set    `tfsdk:"relation_to_eigrp_address_family_contexts"`
	FvRsCtxToEpRet                            types.Object `tfsdk:"relation_to_end_point_retention_policy"`
	FvRsCtxToExtRouteTagPol                   types.Object `tfsdk:"relation_to_l3out_route_tag_policy"`
	FvRsCtxToOspfCtxPol                       types.Set    `tfsdk:"relation_to_address_family_ospf_timers"`
	FvRsCtxToSDWanVpn                         types.Object `tfsdk:"relation_to_wan_vpn"`
	FvRsOspfCtxPol                            types.Object `tfsdk:"relation_to_ospf_timers"`
	TagAnnotation                             types.Set    `tfsdk:"annotations"`
	TagTag                                    types.Set    `tfsdk:"tags"`
	DeprecatedBdEnforcedEnable                types.String `tfsdk:"bd_enforced_enable"`
	DeprecatedParentDn                        types.String `tfsdk:"tenant_dn"`
	DeprecatedPcEnfDir                        types.String `tfsdk:"pc_enf_dir"`
	DeprecatedPcEnfPref                       types.String `tfsdk:"pc_enf_pref"`
	Ignored_knw_mcast_act                     types.String `tfsdk:"knw_mcast_act"`
	DeprecatedFvRsCtxToEpRet                  types.String `tfsdk:"relation_fv_rs_ctx_to_ep_ret"`
	DeprecatedFvRsCtxToExtRouteTagPol         types.String `tfsdk:"relation_fv_rs_ctx_to_ext_route_tag_pol"`
	DeprecatedFvRsCtxMonPol                   types.String `tfsdk:"relation_fv_rs_ctx_mon_pol"`
	Ignored_relation_fv_rs_ctx_mcast_to       types.Set    `tfsdk:"relation_fv_rs_ctx_mcast_to"`
	Ignored_relation_fv_rs_vrf_validation_pol types.String `tfsdk:"relation_fv_rs_vrf_validation_pol"`
	DeprecatedFvRsBgpCtxPol                   types.String `tfsdk:"relation_fv_rs_bgp_ctx_pol"`
	DeprecatedFvRsOspfCtxPol                  types.String `tfsdk:"relation_fv_rs_ospf_ctx_pol"`
	DeprecatedFvRsCtxToBgpCtxAfPol            types.Set    `tfsdk:"relation_fv_rs_ctx_to_bgp_ctx_af_pol"`
	DeprecatedFvRsCtxToEigrpCtxAfPol          types.Set    `tfsdk:"relation_fv_rs_ctx_to_eigrp_ctx_af_pol"`
	DeprecatedFvRsCtxToOspfCtxPol             types.Set    `tfsdk:"relation_fv_rs_ctx_to_ospf_ctx_pol"`
}

func getEmptyFvCtxResourceModel() *FvCtxResourceModel {
	return &FvCtxResourceModel{
		Id:                  basetypes.NewStringNull(),
		ParentDn:            basetypes.NewStringNull(),
		Annotation:          basetypes.NewStringNull(),
		BdEnforcedEnable:    basetypes.NewStringNull(),
		Descr:               basetypes.NewStringNull(),
		IpDataPlaneLearning: basetypes.NewStringNull(),
		Name:                basetypes.NewStringNull(),
		NameAlias:           basetypes.NewStringNull(),
		OwnerKey:            basetypes.NewStringNull(),
		OwnerTag:            basetypes.NewStringNull(),
		PcEnfDir:            basetypes.NewStringNull(),
		PcEnfPref:           basetypes.NewStringNull(),
		PcTag:               basetypes.NewStringNull(),
		Scope:               basetypes.NewStringNull(),
		FvRsBgpCtxPol: types.ObjectNull(map[string]attr.Type{
			"annotation":      types.StringType,
			"bgp_timers_name": types.StringType,
			"annotations":     types.SetType{ElemType: TagAnnotationFvRsBgpCtxPolFvCtxType},
			"tags":            types.SetType{ElemType: TagTagFvRsBgpCtxPolFvCtxType},
		}),
		FvRsCtxMonPol: types.ObjectNull(map[string]attr.Type{
			"annotation":             types.StringType,
			"monitoring_policy_name": types.StringType,
			"annotations":            types.SetType{ElemType: TagAnnotationFvRsCtxMonPolFvCtxType},
			"tags":                   types.SetType{ElemType: TagTagFvRsCtxMonPolFvCtxType},
		}),
		FvRsCtxToBgpCtxAfPol: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"address_family":                  types.StringType,
				"annotation":                      types.StringType,
				"bgp_address_family_context_name": types.StringType,
				"annotations":                     types.SetType{ElemType: TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxType},
				"tags":                            types.SetType{ElemType: TagTagFvRsCtxToBgpCtxAfPolFvCtxType},
			},
		}),
		FvRsCtxToEigrpCtxAfPol: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"address_family":                    types.StringType,
				"annotation":                        types.StringType,
				"eigrp_address_family_context_name": types.StringType,
				"annotations":                       types.SetType{ElemType: TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxType},
				"tags":                              types.SetType{ElemType: TagTagFvRsCtxToEigrpCtxAfPolFvCtxType},
			},
		}),
		FvRsCtxToEpRet: types.ObjectNull(map[string]attr.Type{
			"annotation":                      types.StringType,
			"end_point_retention_policy_name": types.StringType,
			"annotations":                     types.SetType{ElemType: TagAnnotationFvRsCtxToEpRetFvCtxType},
			"tags":                            types.SetType{ElemType: TagTagFvRsCtxToEpRetFvCtxType},
		}),
		FvRsCtxToExtRouteTagPol: types.ObjectNull(map[string]attr.Type{
			"annotation":                  types.StringType,
			"l3out_route_tag_policy_name": types.StringType,
			"annotations":                 types.SetType{ElemType: TagAnnotationFvRsCtxToExtRouteTagPolFvCtxType},
			"tags":                        types.SetType{ElemType: TagTagFvRsCtxToExtRouteTagPolFvCtxType},
		}),
		FvRsCtxToOspfCtxPol: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"address_family":   types.StringType,
				"annotation":       types.StringType,
				"ospf_timers_name": types.StringType,
				"annotations":      types.SetType{ElemType: TagAnnotationFvRsCtxToOspfCtxPolFvCtxType},
				"tags":             types.SetType{ElemType: TagTagFvRsCtxToOspfCtxPolFvCtxType},
			},
		}),
		FvRsCtxToSDWanVpn: types.ObjectNull(map[string]attr.Type{
			"annotation":  types.StringType,
			"target_dn":   types.StringType,
			"annotations": types.SetType{ElemType: TagAnnotationFvRsCtxToSDWanVpnFvCtxType},
			"tags":        types.SetType{ElemType: TagTagFvRsCtxToSDWanVpnFvCtxType},
		}),
		FvRsOspfCtxPol: types.ObjectNull(map[string]attr.Type{
			"annotation":       types.StringType,
			"ospf_timers_name": types.StringType,
			"annotations":      types.SetType{ElemType: TagAnnotationFvRsOspfCtxPolFvCtxType},
			"tags":             types.SetType{ElemType: TagTagFvRsOspfCtxPolFvCtxType},
		}),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		DeprecatedBdEnforcedEnable:                types.String{},
		DeprecatedParentDn:                        types.String{},
		DeprecatedPcEnfDir:                        types.String{},
		DeprecatedPcEnfPref:                       types.String{},
		Ignored_knw_mcast_act:                     types.String{},
		DeprecatedFvRsCtxToEpRet:                  types.String{},
		DeprecatedFvRsCtxToExtRouteTagPol:         types.String{},
		DeprecatedFvRsCtxMonPol:                   types.String{},
		Ignored_relation_fv_rs_ctx_mcast_to:       types.SetNull(types.StringType),
		Ignored_relation_fv_rs_vrf_validation_pol: types.String{},
		DeprecatedFvRsBgpCtxPol:                   types.String{},
		DeprecatedFvRsOspfCtxPol:                  types.String{},
		DeprecatedFvRsCtxToBgpCtxAfPol:            types.SetNull(deprecatedFvRsCtxToBgpCtxAfPolType),
		DeprecatedFvRsCtxToEigrpCtxAfPol:          types.SetNull(deprecatedFvRsCtxToEigrpCtxAfPolType),
		DeprecatedFvRsCtxToOspfCtxPol:             types.SetNull(deprecatedFvRsCtxToOspfCtxPolType),
	}
}

// FvRsBgpCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsBgpCtxPolFvCtxResourceModel struct {
	Annotation      types.String `tfsdk:"annotation"`
	TnBgpCtxPolName types.String `tfsdk:"bgp_timers_name"`
	TagAnnotation   types.Set    `tfsdk:"annotations"`
	TagTag          types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsBgpCtxPolFvCtxResourceModel() FvRsBgpCtxPolFvCtxResourceModel {
	return FvRsBgpCtxPolFvCtxResourceModel{
		Annotation:      basetypes.NewStringNull(),
		TnBgpCtxPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsBgpCtxPolFvCtxType = map[string]attr.Type{
	"annotation":      types.StringType,
	"bgp_timers_name": types.StringType,
	"annotations":     types.SetType{ElemType: TagAnnotationFvRsBgpCtxPolFvCtxType},
	"tags":            types.SetType{ElemType: TagTagFvRsBgpCtxPolFvCtxType},
}

// TagAnnotationFvRsBgpCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsBgpCtxPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsBgpCtxPolFvCtxResourceModel() TagAnnotationFvRsBgpCtxPolFvCtxResourceModel {
	return TagAnnotationFvRsBgpCtxPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsBgpCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsBgpCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsBgpCtxPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsBgpCtxPolFvCtxResourceModel() TagTagFvRsBgpCtxPolFvCtxResourceModel {
	return TagTagFvRsBgpCtxPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsBgpCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxMonPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxMonPolFvCtxResourceModel struct {
	Annotation      types.String `tfsdk:"annotation"`
	TnMonEPGPolName types.String `tfsdk:"monitoring_policy_name"`
	TagAnnotation   types.Set    `tfsdk:"annotations"`
	TagTag          types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxMonPolFvCtxResourceModel() FvRsCtxMonPolFvCtxResourceModel {
	return FvRsCtxMonPolFvCtxResourceModel{
		Annotation:      basetypes.NewStringNull(),
		TnMonEPGPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxMonPolFvCtxType = map[string]attr.Type{
	"annotation":             types.StringType,
	"monitoring_policy_name": types.StringType,
	"annotations":            types.SetType{ElemType: TagAnnotationFvRsCtxMonPolFvCtxType},
	"tags":                   types.SetType{ElemType: TagTagFvRsCtxMonPolFvCtxType},
}

// TagAnnotationFvRsCtxMonPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxMonPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxMonPolFvCtxResourceModel() TagAnnotationFvRsCtxMonPolFvCtxResourceModel {
	return TagAnnotationFvRsCtxMonPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxMonPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxMonPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxMonPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxMonPolFvCtxResourceModel() TagTagFvRsCtxMonPolFvCtxResourceModel {
	return TagTagFvRsCtxMonPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxMonPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxToBgpCtxAfPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxToBgpCtxAfPolFvCtxResourceModel struct {
	Af                types.String `tfsdk:"address_family"`
	Annotation        types.String `tfsdk:"annotation"`
	TnBgpCtxAfPolName types.String `tfsdk:"bgp_address_family_context_name"`
	TagAnnotation     types.Set    `tfsdk:"annotations"`
	TagTag            types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxToBgpCtxAfPolFvCtxResourceModel() FvRsCtxToBgpCtxAfPolFvCtxResourceModel {
	return FvRsCtxToBgpCtxAfPolFvCtxResourceModel{
		Af:                basetypes.NewStringNull(),
		Annotation:        basetypes.NewStringNull(),
		TnBgpCtxAfPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxToBgpCtxAfPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"address_family":                  types.StringType,
		"annotation":                      types.StringType,
		"bgp_address_family_context_name": types.StringType,
		"annotations":                     types.SetType{ElemType: TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxType},
		"tags":                            types.SetType{ElemType: TagTagFvRsCtxToBgpCtxAfPolFvCtxType},
	},
}

func FvRsCtxToBgpCtxAfPolFvCtxSetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(ctx context.Context, planValue, stateValue types.Set) basetypes.SetValue {
	//  Function is needed to handle the case that an attribute is not yet supported in a version and gets set to null during read
	var planSetValues, stateSetValues []FvRsCtxToBgpCtxAfPolFvCtxResourceModel
	stateValue.ElementsAs(ctx, &stateSetValues, false)
	planValue.ElementsAs(ctx, &planSetValues, false)

	// If the length of the state and plan values are different a change is already detected the loop can be skipped
	if len(stateSetValues) == len(planSetValues) {
		for index, stateValue := range stateSetValues {
			nullInStateFound := false
			if stateValue.Af.IsNull() {
				nullInStateFound = true
				planSetValues[index].Af = basetypes.NewStringNull()
			}
			if stateValue.Annotation.IsNull() {
				nullInStateFound = true
				planSetValues[index].Annotation = basetypes.NewStringNull()
			}
			if stateValue.TnBgpCtxAfPolName.IsNull() {
				nullInStateFound = true
				planSetValues[index].TnBgpCtxAfPolName = basetypes.NewStringNull()
			}
			if !nullInStateFound {
				// when there are no null fields we can conclude the version supports all attributes in set
				break
			}
		}
	}
	planSet, _ := types.SetValueFrom(ctx, FvRsCtxToBgpCtxAfPolFvCtxType, planSetValues)
	return planSet

}

// TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel() TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel {
	return TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel() TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel {
	return TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxToBgpCtxAfPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxToEigrpCtxAfPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxToEigrpCtxAfPolFvCtxResourceModel struct {
	Af                  types.String `tfsdk:"address_family"`
	Annotation          types.String `tfsdk:"annotation"`
	TnEigrpCtxAfPolName types.String `tfsdk:"eigrp_address_family_context_name"`
	TagAnnotation       types.Set    `tfsdk:"annotations"`
	TagTag              types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxToEigrpCtxAfPolFvCtxResourceModel() FvRsCtxToEigrpCtxAfPolFvCtxResourceModel {
	return FvRsCtxToEigrpCtxAfPolFvCtxResourceModel{
		Af:                  basetypes.NewStringNull(),
		Annotation:          basetypes.NewStringNull(),
		TnEigrpCtxAfPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxToEigrpCtxAfPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"address_family":                    types.StringType,
		"annotation":                        types.StringType,
		"eigrp_address_family_context_name": types.StringType,
		"annotations":                       types.SetType{ElemType: TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxType},
		"tags":                              types.SetType{ElemType: TagTagFvRsCtxToEigrpCtxAfPolFvCtxType},
	},
}

func FvRsCtxToEigrpCtxAfPolFvCtxSetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(ctx context.Context, planValue, stateValue types.Set) basetypes.SetValue {
	//  Function is needed to handle the case that an attribute is not yet supported in a version and gets set to null during read
	var planSetValues, stateSetValues []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel
	stateValue.ElementsAs(ctx, &stateSetValues, false)
	planValue.ElementsAs(ctx, &planSetValues, false)

	// If the length of the state and plan values are different a change is already detected the loop can be skipped
	if len(stateSetValues) == len(planSetValues) {
		for index, stateValue := range stateSetValues {
			nullInStateFound := false
			if stateValue.Af.IsNull() {
				nullInStateFound = true
				planSetValues[index].Af = basetypes.NewStringNull()
			}
			if stateValue.Annotation.IsNull() {
				nullInStateFound = true
				planSetValues[index].Annotation = basetypes.NewStringNull()
			}
			if stateValue.TnEigrpCtxAfPolName.IsNull() {
				nullInStateFound = true
				planSetValues[index].TnEigrpCtxAfPolName = basetypes.NewStringNull()
			}
			if !nullInStateFound {
				// when there are no null fields we can conclude the version supports all attributes in set
				break
			}
		}
	}
	planSet, _ := types.SetValueFrom(ctx, FvRsCtxToEigrpCtxAfPolFvCtxType, planSetValues)
	return planSet

}

// TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel() TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel {
	return TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel() TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel {
	return TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxToEigrpCtxAfPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxToEpRetFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxToEpRetFvCtxResourceModel struct {
	Annotation       types.String `tfsdk:"annotation"`
	TnFvEpRetPolName types.String `tfsdk:"end_point_retention_policy_name"`
	TagAnnotation    types.Set    `tfsdk:"annotations"`
	TagTag           types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxToEpRetFvCtxResourceModel() FvRsCtxToEpRetFvCtxResourceModel {
	return FvRsCtxToEpRetFvCtxResourceModel{
		Annotation:       basetypes.NewStringNull(),
		TnFvEpRetPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxToEpRetFvCtxType = map[string]attr.Type{
	"annotation":                      types.StringType,
	"end_point_retention_policy_name": types.StringType,
	"annotations":                     types.SetType{ElemType: TagAnnotationFvRsCtxToEpRetFvCtxType},
	"tags":                            types.SetType{ElemType: TagTagFvRsCtxToEpRetFvCtxType},
}

// TagAnnotationFvRsCtxToEpRetFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxToEpRetFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxToEpRetFvCtxResourceModel() TagAnnotationFvRsCtxToEpRetFvCtxResourceModel {
	return TagAnnotationFvRsCtxToEpRetFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxToEpRetFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxToEpRetFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxToEpRetFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxToEpRetFvCtxResourceModel() TagTagFvRsCtxToEpRetFvCtxResourceModel {
	return TagTagFvRsCtxToEpRetFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxToEpRetFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxToExtRouteTagPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxToExtRouteTagPolFvCtxResourceModel struct {
	Annotation             types.String `tfsdk:"annotation"`
	TnL3extRouteTagPolName types.String `tfsdk:"l3out_route_tag_policy_name"`
	TagAnnotation          types.Set    `tfsdk:"annotations"`
	TagTag                 types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxToExtRouteTagPolFvCtxResourceModel() FvRsCtxToExtRouteTagPolFvCtxResourceModel {
	return FvRsCtxToExtRouteTagPolFvCtxResourceModel{
		Annotation:             basetypes.NewStringNull(),
		TnL3extRouteTagPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxToExtRouteTagPolFvCtxType = map[string]attr.Type{
	"annotation":                  types.StringType,
	"l3out_route_tag_policy_name": types.StringType,
	"annotations":                 types.SetType{ElemType: TagAnnotationFvRsCtxToExtRouteTagPolFvCtxType},
	"tags":                        types.SetType{ElemType: TagTagFvRsCtxToExtRouteTagPolFvCtxType},
}

// TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel() TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel {
	return TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxToExtRouteTagPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel() TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel {
	return TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxToExtRouteTagPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxToOspfCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxToOspfCtxPolFvCtxResourceModel struct {
	Af               types.String `tfsdk:"address_family"`
	Annotation       types.String `tfsdk:"annotation"`
	TnOspfCtxPolName types.String `tfsdk:"ospf_timers_name"`
	TagAnnotation    types.Set    `tfsdk:"annotations"`
	TagTag           types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxToOspfCtxPolFvCtxResourceModel() FvRsCtxToOspfCtxPolFvCtxResourceModel {
	return FvRsCtxToOspfCtxPolFvCtxResourceModel{
		Af:               basetypes.NewStringNull(),
		Annotation:       basetypes.NewStringNull(),
		TnOspfCtxPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxToOspfCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"address_family":   types.StringType,
		"annotation":       types.StringType,
		"ospf_timers_name": types.StringType,
		"annotations":      types.SetType{ElemType: TagAnnotationFvRsCtxToOspfCtxPolFvCtxType},
		"tags":             types.SetType{ElemType: TagTagFvRsCtxToOspfCtxPolFvCtxType},
	},
}

func FvRsCtxToOspfCtxPolFvCtxSetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(ctx context.Context, planValue, stateValue types.Set) basetypes.SetValue {
	//  Function is needed to handle the case that an attribute is not yet supported in a version and gets set to null during read
	var planSetValues, stateSetValues []FvRsCtxToOspfCtxPolFvCtxResourceModel
	stateValue.ElementsAs(ctx, &stateSetValues, false)
	planValue.ElementsAs(ctx, &planSetValues, false)

	// If the length of the state and plan values are different a change is already detected the loop can be skipped
	if len(stateSetValues) == len(planSetValues) {
		for index, stateValue := range stateSetValues {
			nullInStateFound := false
			if stateValue.Af.IsNull() {
				nullInStateFound = true
				planSetValues[index].Af = basetypes.NewStringNull()
			}
			if stateValue.Annotation.IsNull() {
				nullInStateFound = true
				planSetValues[index].Annotation = basetypes.NewStringNull()
			}
			if stateValue.TnOspfCtxPolName.IsNull() {
				nullInStateFound = true
				planSetValues[index].TnOspfCtxPolName = basetypes.NewStringNull()
			}
			if !nullInStateFound {
				// when there are no null fields we can conclude the version supports all attributes in set
				break
			}
		}
	}
	planSet, _ := types.SetValueFrom(ctx, FvRsCtxToOspfCtxPolFvCtxType, planSetValues)
	return planSet

}

// TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel() TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel {
	return TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxToOspfCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxToOspfCtxPolFvCtxResourceModel() TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel {
	return TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxToOspfCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsCtxToSDWanVpnFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsCtxToSDWanVpnFvCtxResourceModel struct {
	Annotation    types.String `tfsdk:"annotation"`
	TDn           types.String `tfsdk:"target_dn"`
	TagAnnotation types.Set    `tfsdk:"annotations"`
	TagTag        types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsCtxToSDWanVpnFvCtxResourceModel() FvRsCtxToSDWanVpnFvCtxResourceModel {
	return FvRsCtxToSDWanVpnFvCtxResourceModel{
		Annotation: basetypes.NewStringNull(),
		TDn:        basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsCtxToSDWanVpnFvCtxType = map[string]attr.Type{
	"annotation":  types.StringType,
	"target_dn":   types.StringType,
	"annotations": types.SetType{ElemType: TagAnnotationFvRsCtxToSDWanVpnFvCtxType},
	"tags":        types.SetType{ElemType: TagTagFvRsCtxToSDWanVpnFvCtxType},
}

// TagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel() TagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel {
	return TagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsCtxToSDWanVpnFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsCtxToSDWanVpnFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsCtxToSDWanVpnFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsCtxToSDWanVpnFvCtxResourceModel() TagTagFvRsCtxToSDWanVpnFvCtxResourceModel {
	return TagTagFvRsCtxToSDWanVpnFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsCtxToSDWanVpnFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// FvRsOspfCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type FvRsOspfCtxPolFvCtxResourceModel struct {
	Annotation       types.String `tfsdk:"annotation"`
	TnOspfCtxPolName types.String `tfsdk:"ospf_timers_name"`
	TagAnnotation    types.Set    `tfsdk:"annotations"`
	TagTag           types.Set    `tfsdk:"tags"`
}

func getEmptyFvRsOspfCtxPolFvCtxResourceModel() FvRsOspfCtxPolFvCtxResourceModel {
	return FvRsOspfCtxPolFvCtxResourceModel{
		Annotation:       basetypes.NewStringNull(),
		TnOspfCtxPolName: basetypes.NewStringNull(),
		TagAnnotation: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
		TagTag: types.SetNull(types.ObjectType{
			AttrTypes: map[string]attr.Type{
				"key":   types.StringType,
				"value": types.StringType,
			},
		}),
	}
}

var FvRsOspfCtxPolFvCtxType = map[string]attr.Type{
	"annotation":       types.StringType,
	"ospf_timers_name": types.StringType,
	"annotations":      types.SetType{ElemType: TagAnnotationFvRsOspfCtxPolFvCtxType},
	"tags":             types.SetType{ElemType: TagTagFvRsOspfCtxPolFvCtxType},
}

// TagAnnotationFvRsOspfCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvRsOspfCtxPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvRsOspfCtxPolFvCtxResourceModel() TagAnnotationFvRsOspfCtxPolFvCtxResourceModel {
	return TagAnnotationFvRsOspfCtxPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvRsOspfCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvRsOspfCtxPolFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvRsOspfCtxPolFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvRsOspfCtxPolFvCtxResourceModel() TagTagFvRsOspfCtxPolFvCtxResourceModel {
	return TagTagFvRsOspfCtxPolFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvRsOspfCtxPolFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagAnnotationFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagAnnotationFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagAnnotationFvCtxResourceModel() TagAnnotationFvCtxResourceModel {
	return TagAnnotationFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagAnnotationFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

// TagTagFvCtxResourceModel describes the resource data model for the children without relation ships.
type TagTagFvCtxResourceModel struct {
	Key   types.String `tfsdk:"key"`
	Value types.String `tfsdk:"value"`
}

func getEmptyTagTagFvCtxResourceModel() TagTagFvCtxResourceModel {
	return TagTagFvCtxResourceModel{
		Key:   basetypes.NewStringNull(),
		Value: basetypes.NewStringNull(),
	}
}

var TagTagFvCtxType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"key":   types.StringType,
		"value": types.StringType,
	},
}

type FvCtxIdentifier struct {
	Name types.String
}

var deprecatedFvRsCtxToBgpCtxAfPolType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"af":                     basetypes.StringType{},
		"tn_bgp_ctx_af_pol_name": basetypes.StringType{},
	},
}

var deprecatedFvRsCtxToEigrpCtxAfPolType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"af":                       basetypes.StringType{},
		"tn_eigrp_ctx_af_pol_name": basetypes.StringType{},
	},
}

var deprecatedFvRsCtxToOspfCtxPolType = types.ObjectType{
	AttrTypes: map[string]attr.Type{
		"af":                   basetypes.StringType{},
		"tn_ospf_ctx_pol_name": basetypes.StringType{},
	},
}

type FvCtxResourceModelV1 struct {
	Annotation                                types.String `tfsdk:"annotation"`
	BdEnforcedEnable                          types.String `tfsdk:"bd_enforced_enable"`
	Descr                                     types.String `tfsdk:"description"`
	Id                                        types.String `tfsdk:"id"`
	IpDataPlaneLearning                       types.String `tfsdk:"ip_data_plane_learning"`
	Name                                      types.String `tfsdk:"name"`
	NameAlias                                 types.String `tfsdk:"name_alias"`
	ParentDn                                  types.String `tfsdk:"tenant_dn"`
	PcEnfDir                                  types.String `tfsdk:"pc_enf_dir"`
	PcEnfPref                                 types.String `tfsdk:"pc_enf_pref"`
	Ignored_knw_mcast_act                     types.String `tfsdk:"knw_mcast_act"`
	FvRsCtxToEpRet                            types.String `tfsdk:"relation_fv_rs_ctx_to_ep_ret"`
	FvRsCtxToExtRouteTagPol                   types.String `tfsdk:"relation_fv_rs_ctx_to_ext_route_tag_pol"`
	FvRsCtxMonPol                             types.String `tfsdk:"relation_fv_rs_ctx_mon_pol"`
	Ignored_relation_fv_rs_ctx_mcast_to       types.Set    `tfsdk:"relation_fv_rs_ctx_mcast_to"`
	Ignored_relation_fv_rs_vrf_validation_pol types.String `tfsdk:"relation_fv_rs_vrf_validation_pol"`
	FvRsBgpCtxPol                             types.String `tfsdk:"relation_fv_rs_bgp_ctx_pol"`
	FvRsOspfCtxPol                            types.String `tfsdk:"relation_fv_rs_ospf_ctx_pol"`
	FvRsCtxToBgpCtxAfPol                      types.Set    `tfsdk:"relation_fv_rs_ctx_to_bgp_ctx_af_pol"`
	FvRsCtxToEigrpCtxAfPol                    types.Set    `tfsdk:"relation_fv_rs_ctx_to_eigrp_ctx_af_pol"`
	FvRsCtxToOspfCtxPol                       types.Set    `tfsdk:"relation_fv_rs_ctx_to_ospf_ctx_pol"`
}

type FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1 struct {
	Af                types.String `tfsdk:"af"`
	TnBgpCtxAfPolName types.String `tfsdk:"tn_bgp_ctx_af_pol_name"`
}

func getEmptyFvRsCtxToBgpCtxAfPolFvCtxResourceModelV1() FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1 {
	return FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1{
		Af:                basetypes.NewStringNull(),
		TnBgpCtxAfPolName: basetypes.NewStringNull(),
	}
}

type FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1 struct {
	Af                  types.String `tfsdk:"af"`
	TnEigrpCtxAfPolName types.String `tfsdk:"tn_eigrp_ctx_af_pol_name"`
}

func getEmptyFvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1() FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1 {
	return FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1{
		Af:                  basetypes.NewStringNull(),
		TnEigrpCtxAfPolName: basetypes.NewStringNull(),
	}
}

type FvRsCtxToOspfCtxPolFvCtxResourceModelV1 struct {
	Af               types.String `tfsdk:"af"`
	TnOspfCtxPolName types.String `tfsdk:"tn_ospf_ctx_pol_name"`
}

func getEmptyFvRsCtxToOspfCtxPolFvCtxResourceModelV1() FvRsCtxToOspfCtxPolFvCtxResourceModelV1 {
	return FvRsCtxToOspfCtxPolFvCtxResourceModelV1{
		Af:               basetypes.NewStringNull(),
		TnOspfCtxPolName: basetypes.NewStringNull(),
	}
}

func (r *FvCtxResource) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader {
	return map[int64]resource.StateUpgrader{
		1: {
			PriorSchema: &schema.Schema{
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"bd_enforced_enable": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"description": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"id": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"ip_data_plane_learning": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"name": schema.StringAttribute{
						Required: true,
						Optional: false,
						Computed: false,
					},
					"name_alias": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"tenant_dn": schema.StringAttribute{
						Required: true,
						Optional: false,
						Computed: false,
					},
					"pc_enf_dir": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"pc_enf_pref": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"knw_mcast_act": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"relation_fv_rs_ctx_to_ep_ret": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"relation_fv_rs_ctx_to_ext_route_tag_pol": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"relation_fv_rs_ctx_mon_pol": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: false,
					},
					"relation_fv_rs_ctx_mcast_to": schema.SetAttribute{
						Required:    false,
						Optional:    true,
						Computed:    false,
						ElementType: types.StringType,
					},
					"relation_fv_rs_vrf_validation_pol": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"relation_fv_rs_bgp_ctx_pol": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
					"relation_fv_rs_ospf_ctx_pol": schema.StringAttribute{
						Required: false,
						Optional: true,
						Computed: true,
					},
				},
				Blocks: map[string]schema.Block{
					"relation_fv_rs_ctx_to_bgp_ctx_af_pol": schema.SetNestedBlock{
						NestedObject: schema.NestedBlockObject{
							Attributes: map[string]schema.Attribute{
								"af": schema.StringAttribute{
									Required: true,
									Optional: false,
									Computed: false,
								},
								"tn_bgp_ctx_af_pol_name": schema.StringAttribute{
									Required: true,
									Optional: false,
									Computed: false,
								},
							},
						},
					},
					"relation_fv_rs_ctx_to_eigrp_ctx_af_pol": schema.SetNestedBlock{
						NestedObject: schema.NestedBlockObject{
							Attributes: map[string]schema.Attribute{
								"af": schema.StringAttribute{
									Required: true,
									Optional: false,
									Computed: false,
								},
								"tn_eigrp_ctx_af_pol_name": schema.StringAttribute{
									Required: true,
									Optional: false,
									Computed: false,
								},
							},
						},
					},
					"relation_fv_rs_ctx_to_ospf_ctx_pol": schema.SetNestedBlock{
						NestedObject: schema.NestedBlockObject{
							Attributes: map[string]schema.Attribute{
								"af": schema.StringAttribute{
									Required: true,
									Optional: false,
									Computed: false,
								},
								"tn_ospf_ctx_pol_name": schema.StringAttribute{
									Required: true,
									Optional: false,
									Computed: false,
								},
							},
						},
					},
				},
			},
			StateUpgrader: func(ctx context.Context, req resource.UpgradeStateRequest, resp *resource.UpgradeStateResponse) {
				var priorStateData FvCtxResourceModelV1

				resp.Diagnostics.Append(req.State.Get(ctx, &priorStateData)...)

				if resp.Diagnostics.HasError() {
					return
				}

				upgradedStateData := FvCtxResourceModel{
					Id:                                  priorStateData.Id,
					ParentDn:                            priorStateData.ParentDn,
					Annotation:                          priorStateData.Annotation,
					BdEnforcedEnable:                    priorStateData.BdEnforcedEnable,
					Descr:                               priorStateData.Descr,
					IpDataPlaneLearning:                 priorStateData.IpDataPlaneLearning,
					Name:                                priorStateData.Name,
					NameAlias:                           priorStateData.NameAlias,
					OwnerKey:                            basetypes.NewStringNull(),
					OwnerTag:                            basetypes.NewStringNull(),
					PcEnfDir:                            priorStateData.PcEnfDir,
					PcEnfPref:                           priorStateData.PcEnfPref,
					PcTag:                               basetypes.NewStringNull(),
					Scope:                               basetypes.NewStringNull(),
					DeprecatedBdEnforcedEnable:          priorStateData.BdEnforcedEnable,
					DeprecatedParentDn:                  priorStateData.ParentDn,
					DeprecatedPcEnfDir:                  priorStateData.PcEnfDir,
					DeprecatedPcEnfPref:                 priorStateData.PcEnfPref,
					Ignored_knw_mcast_act:               priorStateData.Ignored_knw_mcast_act,
					DeprecatedFvRsCtxToEpRet:            priorStateData.FvRsCtxToEpRet,
					DeprecatedFvRsCtxToExtRouteTagPol:   priorStateData.FvRsCtxToExtRouteTagPol,
					DeprecatedFvRsCtxMonPol:             priorStateData.FvRsCtxMonPol,
					Ignored_relation_fv_rs_ctx_mcast_to: priorStateData.Ignored_relation_fv_rs_ctx_mcast_to,
					Ignored_relation_fv_rs_vrf_validation_pol: priorStateData.Ignored_relation_fv_rs_vrf_validation_pol,
					DeprecatedFvRsBgpCtxPol:                   priorStateData.FvRsBgpCtxPol,
					DeprecatedFvRsOspfCtxPol:                  priorStateData.FvRsOspfCtxPol,
				}

				FvRsBgpCtxPolObject := FvRsBgpCtxPolFvCtxResourceModel{
					Annotation:      basetypes.NewStringNull(),
					TnBgpCtxPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsBgpCtxPol.ValueString())),
					TagAnnotation: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
					TagTag: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
				}
				fvRsBgpCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsBgpCtxPolFvCtxType, FvRsBgpCtxPolObject)
				upgradedStateData.FvRsBgpCtxPol = fvRsBgpCtxPolObject

				FvRsCtxMonPolObject := FvRsCtxMonPolFvCtxResourceModel{
					Annotation:      basetypes.NewStringNull(),
					TnMonEPGPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsCtxMonPol.ValueString())),
					TagAnnotation: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
					TagTag: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
				}
				fvRsCtxMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxMonPolFvCtxType, FvRsCtxMonPolObject)
				upgradedStateData.FvRsCtxMonPol = fvRsCtxMonPolObject

				FvRsCtxToBgpCtxAfPolList := make([]FvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0)
				var priorStateDataFvRsCtxToBgpCtxAfPolList []FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1
				priorStateData.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &priorStateDataFvRsCtxToBgpCtxAfPolList, false)
				for _, priorStateDataFvRsCtxToBgpCtxAfPol := range priorStateDataFvRsCtxToBgpCtxAfPolList {
					FvRsCtxToBgpCtxAfPol := FvRsCtxToBgpCtxAfPolFvCtxResourceModel{
						Af:                priorStateDataFvRsCtxToBgpCtxAfPol.Af,
						Annotation:        basetypes.NewStringNull(),
						TnBgpCtxAfPolName: priorStateDataFvRsCtxToBgpCtxAfPol.TnBgpCtxAfPolName,
						TagAnnotation: basetypes.NewSetNull(types.ObjectType{
							AttrTypes: map[string]attr.Type{
								"key":   types.StringType,
								"value": types.StringType,
							},
						}),
						TagTag: basetypes.NewSetNull(types.ObjectType{
							AttrTypes: map[string]attr.Type{
								"key":   types.StringType,
								"value": types.StringType,
							},
						}),
					}
					FvRsCtxToBgpCtxAfPolList = append(FvRsCtxToBgpCtxAfPolList, FvRsCtxToBgpCtxAfPol)
				}
				FvRsCtxToBgpCtxAfPolSet, _ := types.SetValueFrom(ctx, FvRsCtxToBgpCtxAfPolFvCtxType, FvRsCtxToBgpCtxAfPolList)
				upgradedStateData.FvRsCtxToBgpCtxAfPol = FvRsCtxToBgpCtxAfPolSet

				FvRsCtxToEigrpCtxAfPolList := make([]FvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0)
				var priorStateDataFvRsCtxToEigrpCtxAfPolList []FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1
				priorStateData.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &priorStateDataFvRsCtxToEigrpCtxAfPolList, false)
				for _, priorStateDataFvRsCtxToEigrpCtxAfPol := range priorStateDataFvRsCtxToEigrpCtxAfPolList {
					FvRsCtxToEigrpCtxAfPol := FvRsCtxToEigrpCtxAfPolFvCtxResourceModel{
						Af:                  priorStateDataFvRsCtxToEigrpCtxAfPol.Af,
						Annotation:          basetypes.NewStringNull(),
						TnEigrpCtxAfPolName: priorStateDataFvRsCtxToEigrpCtxAfPol.TnEigrpCtxAfPolName,
						TagAnnotation: basetypes.NewSetNull(types.ObjectType{
							AttrTypes: map[string]attr.Type{
								"key":   types.StringType,
								"value": types.StringType,
							},
						}),
						TagTag: basetypes.NewSetNull(types.ObjectType{
							AttrTypes: map[string]attr.Type{
								"key":   types.StringType,
								"value": types.StringType,
							},
						}),
					}
					FvRsCtxToEigrpCtxAfPolList = append(FvRsCtxToEigrpCtxAfPolList, FvRsCtxToEigrpCtxAfPol)
				}
				FvRsCtxToEigrpCtxAfPolSet, _ := types.SetValueFrom(ctx, FvRsCtxToEigrpCtxAfPolFvCtxType, FvRsCtxToEigrpCtxAfPolList)
				upgradedStateData.FvRsCtxToEigrpCtxAfPol = FvRsCtxToEigrpCtxAfPolSet

				FvRsCtxToEpRetObject := FvRsCtxToEpRetFvCtxResourceModel{
					Annotation:       basetypes.NewStringNull(),
					TnFvEpRetPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsCtxToEpRet.ValueString())),
					TagAnnotation: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
					TagTag: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
				}
				fvRsCtxToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToEpRetFvCtxType, FvRsCtxToEpRetObject)
				upgradedStateData.FvRsCtxToEpRet = fvRsCtxToEpRetObject

				FvRsCtxToExtRouteTagPolObject := FvRsCtxToExtRouteTagPolFvCtxResourceModel{
					Annotation:             basetypes.NewStringNull(),
					TnL3extRouteTagPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsCtxToExtRouteTagPol.ValueString())),
					TagAnnotation: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
					TagTag: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
				}
				fvRsCtxToExtRouteTagPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToExtRouteTagPolFvCtxType, FvRsCtxToExtRouteTagPolObject)
				upgradedStateData.FvRsCtxToExtRouteTagPol = fvRsCtxToExtRouteTagPolObject

				FvRsCtxToOspfCtxPolList := make([]FvRsCtxToOspfCtxPolFvCtxResourceModel, 0)
				var priorStateDataFvRsCtxToOspfCtxPolList []FvRsCtxToOspfCtxPolFvCtxResourceModelV1
				priorStateData.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &priorStateDataFvRsCtxToOspfCtxPolList, false)
				for _, priorStateDataFvRsCtxToOspfCtxPol := range priorStateDataFvRsCtxToOspfCtxPolList {
					FvRsCtxToOspfCtxPol := FvRsCtxToOspfCtxPolFvCtxResourceModel{
						Af:               priorStateDataFvRsCtxToOspfCtxPol.Af,
						Annotation:       basetypes.NewStringNull(),
						TnOspfCtxPolName: priorStateDataFvRsCtxToOspfCtxPol.TnOspfCtxPolName,
						TagAnnotation: basetypes.NewSetNull(types.ObjectType{
							AttrTypes: map[string]attr.Type{
								"key":   types.StringType,
								"value": types.StringType,
							},
						}),
						TagTag: basetypes.NewSetNull(types.ObjectType{
							AttrTypes: map[string]attr.Type{
								"key":   types.StringType,
								"value": types.StringType,
							},
						}),
					}
					FvRsCtxToOspfCtxPolList = append(FvRsCtxToOspfCtxPolList, FvRsCtxToOspfCtxPol)
				}
				FvRsCtxToOspfCtxPolSet, _ := types.SetValueFrom(ctx, FvRsCtxToOspfCtxPolFvCtxType, FvRsCtxToOspfCtxPolList)
				upgradedStateData.FvRsCtxToOspfCtxPol = FvRsCtxToOspfCtxPolSet

				upgradedStateData.FvRsCtxToSDWanVpn = types.ObjectNull(FvRsCtxToSDWanVpnFvCtxType)

				FvRsOspfCtxPolObject := FvRsOspfCtxPolFvCtxResourceModel{
					Annotation:       basetypes.NewStringNull(),
					TnOspfCtxPolName: basetypes.NewStringValue(GetMOName(priorStateData.FvRsOspfCtxPol.ValueString())),
					TagAnnotation: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
					TagTag: basetypes.NewSetNull(types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   types.StringType,
							"value": types.StringType,
						},
					}),
				}
				fvRsOspfCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsOspfCtxPolFvCtxType, FvRsOspfCtxPolObject)
				upgradedStateData.FvRsOspfCtxPol = fvRsOspfCtxPolObject

				upgradedStateData.TagAnnotation = types.SetNull(
					types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   basetypes.StringType{},
							"value": basetypes.StringType{},
						},
					},
				)

				upgradedStateData.TagTag = types.SetNull(
					types.ObjectType{
						AttrTypes: map[string]attr.Type{
							"key":   basetypes.StringType{},
							"value": basetypes.StringType{},
						},
					},
				)

				var FvRsCtxToBgpCtxAfPolV1List []FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1
				priorStateData.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &FvRsCtxToBgpCtxAfPolV1List, false)
				FvRsCtxToBgpCtxAfPolV1Set, _ := types.SetValueFrom(ctx, deprecatedFvRsCtxToBgpCtxAfPolType, FvRsCtxToBgpCtxAfPolV1List)
				upgradedStateData.DeprecatedFvRsCtxToBgpCtxAfPol = FvRsCtxToBgpCtxAfPolV1Set

				var FvRsCtxToEigrpCtxAfPolV1List []FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1
				priorStateData.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &FvRsCtxToEigrpCtxAfPolV1List, false)
				FvRsCtxToEigrpCtxAfPolV1Set, _ := types.SetValueFrom(ctx, deprecatedFvRsCtxToEigrpCtxAfPolType, FvRsCtxToEigrpCtxAfPolV1List)
				upgradedStateData.DeprecatedFvRsCtxToEigrpCtxAfPol = FvRsCtxToEigrpCtxAfPolV1Set

				var FvRsCtxToOspfCtxPolV1List []FvRsCtxToOspfCtxPolFvCtxResourceModelV1
				priorStateData.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &FvRsCtxToOspfCtxPolV1List, false)
				FvRsCtxToOspfCtxPolV1Set, _ := types.SetValueFrom(ctx, deprecatedFvRsCtxToOspfCtxPolType, FvRsCtxToOspfCtxPolV1List)
				upgradedStateData.DeprecatedFvRsCtxToOspfCtxPol = FvRsCtxToOspfCtxPolV1Set

				resp.Diagnostics.Append(resp.State.Set(ctx, upgradedStateData)...)
			},
		},
	}
}

func setFvCtxLegacyAttributes(ctx context.Context, diags *diag.Diagnostics, data, staticData *FvCtxResourceModel, classReadInfo []interface{}) {
	data.DeprecatedParentDn = data.ParentDn
	if !staticData.Ignored_knw_mcast_act.IsUnknown() {
		data.Ignored_knw_mcast_act = staticData.Ignored_knw_mcast_act
	}
	if !staticData.Ignored_relation_fv_rs_ctx_mcast_to.IsUnknown() && !staticData.Ignored_relation_fv_rs_ctx_mcast_to.IsNull() {
		data.Ignored_relation_fv_rs_ctx_mcast_to = staticData.Ignored_relation_fv_rs_ctx_mcast_to
	} else {
		Ignored_relation_fv_rs_ctx_mcast_toSet, _ := types.SetValueFrom(ctx, types.StringType, []string{})
		data.Ignored_relation_fv_rs_ctx_mcast_to = Ignored_relation_fv_rs_ctx_mcast_toSet
	}
	if !staticData.Ignored_relation_fv_rs_vrf_validation_pol.IsUnknown() {
		data.Ignored_relation_fv_rs_vrf_validation_pol = staticData.Ignored_relation_fv_rs_vrf_validation_pol
	}
	attributes := classReadInfo[0].(map[string]interface{})["attributes"].(map[string]interface{})
	for attributeName, attributeValue := range attributes {
		if attributeName == "bdEnforcedEnable" {
			data.DeprecatedBdEnforcedEnable = basetypes.NewStringValue(attributeValue.(string))
		}
		if attributeName == "pcEnfDir" {
			data.DeprecatedPcEnfDir = basetypes.NewStringValue(attributeValue.(string))
		}
		if attributeName == "pcEnfPref" {
			data.DeprecatedPcEnfPref = basetypes.NewStringValue(attributeValue.(string))
		}
	}
	data.DeprecatedFvRsBgpCtxPol = basetypes.NewStringNull()
	data.DeprecatedFvRsCtxMonPol = basetypes.NewStringNull()
	DeprecatedFvRsCtxToBgpCtxAfPolFvCtxList := make([]FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1, 0)
	DeprecatedFvRsCtxToEigrpCtxAfPolFvCtxList := make([]FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1, 0)
	data.DeprecatedFvRsCtxToEpRet = basetypes.NewStringNull()
	data.DeprecatedFvRsCtxToExtRouteTagPol = basetypes.NewStringNull()
	DeprecatedFvRsCtxToOspfCtxPolFvCtxList := make([]FvRsCtxToOspfCtxPolFvCtxResourceModelV1, 0)
	data.DeprecatedFvRsOspfCtxPol = basetypes.NewStringNull()

	_, ok := classReadInfo[0].(map[string]interface{})["children"]
	if ok {
		children := classReadInfo[0].(map[string]interface{})["children"].([]interface{})
		for _, child := range children {
			for childClassName, childClassDetails := range child.(map[string]interface{}) {
				childAttributes := childClassDetails.(map[string]interface{})["attributes"].(map[string]interface{})
				if childClassName == "fvRsBgpCtxPol" {
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "tDn" {
							data.DeprecatedFvRsBgpCtxPol = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
				}
				if childClassName == "fvRsCtxMonPol" {
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "tDn" {
							data.DeprecatedFvRsCtxMonPol = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
				}
				if childClassName == "fvRsCtxToBgpCtxAfPol" {
					DeprecatedFvRsCtxToBgpCtxAfPolFvCtx := getEmptyFvRsCtxToBgpCtxAfPolFvCtxResourceModelV1()
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "af" {
							DeprecatedFvRsCtxToBgpCtxAfPolFvCtx.Af = basetypes.NewStringValue(childAttributeValue.(string))
						}
						if childAttributeName == "tDn" {
							DeprecatedFvRsCtxToBgpCtxAfPolFvCtx.TnBgpCtxAfPolName = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
					DeprecatedFvRsCtxToBgpCtxAfPolFvCtxList = append(DeprecatedFvRsCtxToBgpCtxAfPolFvCtxList, DeprecatedFvRsCtxToBgpCtxAfPolFvCtx)
				}
				if childClassName == "fvRsCtxToEigrpCtxAfPol" {
					DeprecatedFvRsCtxToEigrpCtxAfPolFvCtx := getEmptyFvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1()
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "af" {
							DeprecatedFvRsCtxToEigrpCtxAfPolFvCtx.Af = basetypes.NewStringValue(childAttributeValue.(string))
						}
						if childAttributeName == "tDn" {
							DeprecatedFvRsCtxToEigrpCtxAfPolFvCtx.TnEigrpCtxAfPolName = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
					DeprecatedFvRsCtxToEigrpCtxAfPolFvCtxList = append(DeprecatedFvRsCtxToEigrpCtxAfPolFvCtxList, DeprecatedFvRsCtxToEigrpCtxAfPolFvCtx)
				}
				if childClassName == "fvRsCtxToEpRet" {
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "tDn" {
							data.DeprecatedFvRsCtxToEpRet = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
				}
				if childClassName == "fvRsCtxToExtRouteTagPol" {
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "tDn" {
							data.DeprecatedFvRsCtxToExtRouteTagPol = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
				}
				if childClassName == "fvRsCtxToOspfCtxPol" {
					DeprecatedFvRsCtxToOspfCtxPolFvCtx := getEmptyFvRsCtxToOspfCtxPolFvCtxResourceModelV1()
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "af" {
							DeprecatedFvRsCtxToOspfCtxPolFvCtx.Af = basetypes.NewStringValue(childAttributeValue.(string))
						}
						if childAttributeName == "tDn" {
							DeprecatedFvRsCtxToOspfCtxPolFvCtx.TnOspfCtxPolName = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
					DeprecatedFvRsCtxToOspfCtxPolFvCtxList = append(DeprecatedFvRsCtxToOspfCtxPolFvCtxList, DeprecatedFvRsCtxToOspfCtxPolFvCtx)
				}
				if childClassName == "fvRsOspfCtxPol" {
					for childAttributeName, childAttributeValue := range childAttributes {
						if childAttributeName == "tDn" {
							data.DeprecatedFvRsOspfCtxPol = basetypes.NewStringValue(childAttributeValue.(string))
						}
					}
				}
			}
		}
		fvRsCtxToBgpCtxAfPolSet, _ := types.SetValueFrom(ctx, data.DeprecatedFvRsCtxToBgpCtxAfPol.ElementType(ctx), DeprecatedFvRsCtxToBgpCtxAfPolFvCtxList)
		data.DeprecatedFvRsCtxToBgpCtxAfPol = fvRsCtxToBgpCtxAfPolSet
		fvRsCtxToEigrpCtxAfPolSet, _ := types.SetValueFrom(ctx, data.DeprecatedFvRsCtxToEigrpCtxAfPol.ElementType(ctx), DeprecatedFvRsCtxToEigrpCtxAfPolFvCtxList)
		data.DeprecatedFvRsCtxToEigrpCtxAfPol = fvRsCtxToEigrpCtxAfPolSet
		fvRsCtxToOspfCtxPolSet, _ := types.SetValueFrom(ctx, data.DeprecatedFvRsCtxToOspfCtxPol.ElementType(ctx), DeprecatedFvRsCtxToOspfCtxPolFvCtxList)
		data.DeprecatedFvRsCtxToOspfCtxPol = fvRsCtxToOspfCtxPolSet
	}
}

func (r *FvCtxResource) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) {
	if !req.Plan.Raw.IsNull() {
		var planData, stateData, configData *FvCtxResourceModel
		resp.Diagnostics.Append(req.Plan.Get(ctx, &planData)...)
		resp.Diagnostics.Append(req.State.Get(ctx, &stateData)...)
		resp.Diagnostics.Append(req.Config.Get(ctx, &configData)...)

		if resp.Diagnostics.HasError() {
			return
		}

		if (planData.Id.IsUnknown() || planData.Id.IsNull()) && !planData.ParentDn.IsUnknown() && !planData.Name.IsUnknown() {
			setFvCtxId(ctx, planData)
		}

		if stateData == nil && !globalAllowExistingOnCreate && !planData.Id.IsUnknown() && !planData.Id.IsNull() {
			CheckDn(ctx, &resp.Diagnostics, r.client, "fvCtx", planData.Id.ValueString())
			if resp.Diagnostics.HasError() {
				return
			}
		}
		if !configData.FvRsBgpCtxPol.IsNull() && stateData != nil {
			if IsEmptySingleNestedAttribute(configData.FvRsBgpCtxPol.Attributes()) {
				FvRsBgpCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsBgpCtxPolFvCtxType, getEmptyFvRsBgpCtxPolFvCtxResourceModel())
				planData.FvRsBgpCtxPol = FvRsBgpCtxPolObject
			}
		}
		if !configData.FvRsCtxMonPol.IsNull() && stateData != nil {
			if IsEmptySingleNestedAttribute(configData.FvRsCtxMonPol.Attributes()) {
				FvRsCtxMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxMonPolFvCtxType, getEmptyFvRsCtxMonPolFvCtxResourceModel())
				planData.FvRsCtxMonPol = FvRsCtxMonPolObject
			}
		}
		if !configData.FvRsCtxToEpRet.IsNull() && stateData != nil {
			if IsEmptySingleNestedAttribute(configData.FvRsCtxToEpRet.Attributes()) {
				FvRsCtxToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToEpRetFvCtxType, getEmptyFvRsCtxToEpRetFvCtxResourceModel())
				planData.FvRsCtxToEpRet = FvRsCtxToEpRetObject
			}
		}
		if !configData.FvRsCtxToExtRouteTagPol.IsNull() && stateData != nil {
			if IsEmptySingleNestedAttribute(configData.FvRsCtxToExtRouteTagPol.Attributes()) {
				FvRsCtxToExtRouteTagPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToExtRouteTagPolFvCtxType, getEmptyFvRsCtxToExtRouteTagPolFvCtxResourceModel())
				planData.FvRsCtxToExtRouteTagPol = FvRsCtxToExtRouteTagPolObject
			}
		}
		if !configData.FvRsCtxToSDWanVpn.IsNull() && stateData != nil {
			if IsEmptySingleNestedAttribute(configData.FvRsCtxToSDWanVpn.Attributes()) {
				FvRsCtxToSDWanVpnObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToSDWanVpnFvCtxType, getEmptyFvRsCtxToSDWanVpnFvCtxResourceModel())
				planData.FvRsCtxToSDWanVpn = FvRsCtxToSDWanVpnObject
			}
		}
		if !configData.FvRsOspfCtxPol.IsNull() && stateData != nil {
			if IsEmptySingleNestedAttribute(configData.FvRsOspfCtxPol.Attributes()) {
				FvRsOspfCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsOspfCtxPolFvCtxType, getEmptyFvRsOspfCtxPolFvCtxResourceModel())
				planData.FvRsOspfCtxPol = FvRsOspfCtxPolObject
			}
		}

		if !configData.DeprecatedBdEnforcedEnable.IsNull() {
			planData.BdEnforcedEnable = configData.DeprecatedBdEnforcedEnable
		}

		if !configData.DeprecatedParentDn.IsNull() {
			planData.ParentDn = configData.DeprecatedParentDn
		}

		if !configData.DeprecatedPcEnfDir.IsNull() {
			planData.PcEnfDir = configData.DeprecatedPcEnfDir
		}

		if !configData.DeprecatedPcEnfPref.IsNull() {
			planData.PcEnfPref = configData.DeprecatedPcEnfPref
		}

		if !configData.DeprecatedFvRsCtxToEpRet.IsNull() {
			var newAttributeValues FvRsCtxToEpRetFvCtxResourceModel
			tagAnnotationFvRsCtxToEpRetFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToEpRetFvCtxType, make([]TagAnnotationFvRsCtxToEpRetFvCtxResourceModel, 0))
			tagTagFvRsCtxToEpRetFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToEpRetFvCtxType, make([]TagTagFvRsCtxToEpRetFvCtxResourceModel, 0))
			annotationValue := planData.Annotation
			if stateData != nil && !IsEmptySingleNestedAttribute(stateData.FvRsCtxToEpRet.Attributes()) {
				stateData.FvRsCtxToEpRet.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{})
				annotationValue = newAttributeValues.Annotation
				tagAnnotationFvRsCtxToEpRetFvCtxValue = newAttributeValues.TagAnnotation
				tagTagFvRsCtxToEpRetFvCtxValue = newAttributeValues.TagTag
			}
			tnFvEpRetPolNameValue := basetypes.NewStringUnknown()
			if !configData.DeprecatedFvRsCtxToEpRet.IsUnknown() {
				tnFvEpRetPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCtxToEpRet.ValueString()))
			}
			FvRsCtxToEpRet := FvRsCtxToEpRetFvCtxResourceModel{
				Annotation:       annotationValue,
				TnFvEpRetPolName: tnFvEpRetPolNameValue,
				TagAnnotation:    tagAnnotationFvRsCtxToEpRetFvCtxValue,
				TagTag:           tagTagFvRsCtxToEpRetFvCtxValue,
			}
			FvRsCtxToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToEpRetFvCtxType, FvRsCtxToEpRet)
			planData.FvRsCtxToEpRet = FvRsCtxToEpRetObject
		}

		if !configData.DeprecatedFvRsCtxToExtRouteTagPol.IsNull() {
			var newAttributeValues FvRsCtxToExtRouteTagPolFvCtxResourceModel
			tagAnnotationFvRsCtxToExtRouteTagPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToExtRouteTagPolFvCtxType, make([]TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel, 0))
			tagTagFvRsCtxToExtRouteTagPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToExtRouteTagPolFvCtxType, make([]TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel, 0))
			annotationValue := planData.Annotation
			if stateData != nil && !IsEmptySingleNestedAttribute(stateData.FvRsCtxToExtRouteTagPol.Attributes()) {
				stateData.FvRsCtxToExtRouteTagPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{})
				annotationValue = newAttributeValues.Annotation
				tagAnnotationFvRsCtxToExtRouteTagPolFvCtxValue = newAttributeValues.TagAnnotation
				tagTagFvRsCtxToExtRouteTagPolFvCtxValue = newAttributeValues.TagTag
			}
			tnL3extRouteTagPolNameValue := basetypes.NewStringUnknown()
			if !configData.DeprecatedFvRsCtxToExtRouteTagPol.IsUnknown() {
				tnL3extRouteTagPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCtxToExtRouteTagPol.ValueString()))
			}
			FvRsCtxToExtRouteTagPol := FvRsCtxToExtRouteTagPolFvCtxResourceModel{
				Annotation:             annotationValue,
				TnL3extRouteTagPolName: tnL3extRouteTagPolNameValue,
				TagAnnotation:          tagAnnotationFvRsCtxToExtRouteTagPolFvCtxValue,
				TagTag:                 tagTagFvRsCtxToExtRouteTagPolFvCtxValue,
			}
			FvRsCtxToExtRouteTagPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToExtRouteTagPolFvCtxType, FvRsCtxToExtRouteTagPol)
			planData.FvRsCtxToExtRouteTagPol = FvRsCtxToExtRouteTagPolObject
		}

		if !configData.DeprecatedFvRsCtxMonPol.IsNull() {
			var newAttributeValues FvRsCtxMonPolFvCtxResourceModel
			tagAnnotationFvRsCtxMonPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxMonPolFvCtxType, make([]TagAnnotationFvRsCtxMonPolFvCtxResourceModel, 0))
			tagTagFvRsCtxMonPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxMonPolFvCtxType, make([]TagTagFvRsCtxMonPolFvCtxResourceModel, 0))
			annotationValue := planData.Annotation
			if stateData != nil && !IsEmptySingleNestedAttribute(stateData.FvRsCtxMonPol.Attributes()) {
				stateData.FvRsCtxMonPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{})
				annotationValue = newAttributeValues.Annotation
				tagAnnotationFvRsCtxMonPolFvCtxValue = newAttributeValues.TagAnnotation
				tagTagFvRsCtxMonPolFvCtxValue = newAttributeValues.TagTag
			}
			tnMonEPGPolNameValue := basetypes.NewStringUnknown()
			if !configData.DeprecatedFvRsCtxMonPol.IsUnknown() {
				tnMonEPGPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsCtxMonPol.ValueString()))
			}
			FvRsCtxMonPol := FvRsCtxMonPolFvCtxResourceModel{
				Annotation:      annotationValue,
				TnMonEPGPolName: tnMonEPGPolNameValue,
				TagAnnotation:   tagAnnotationFvRsCtxMonPolFvCtxValue,
				TagTag:          tagTagFvRsCtxMonPolFvCtxValue,
			}
			FvRsCtxMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxMonPolFvCtxType, FvRsCtxMonPol)
			planData.FvRsCtxMonPol = FvRsCtxMonPolObject
		}

		if !configData.DeprecatedFvRsBgpCtxPol.IsNull() {
			var newAttributeValues FvRsBgpCtxPolFvCtxResourceModel
			tagAnnotationFvRsBgpCtxPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBgpCtxPolFvCtxType, make([]TagAnnotationFvRsBgpCtxPolFvCtxResourceModel, 0))
			tagTagFvRsBgpCtxPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsBgpCtxPolFvCtxType, make([]TagTagFvRsBgpCtxPolFvCtxResourceModel, 0))
			annotationValue := planData.Annotation
			if stateData != nil && !IsEmptySingleNestedAttribute(stateData.FvRsBgpCtxPol.Attributes()) {
				stateData.FvRsBgpCtxPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{})
				annotationValue = newAttributeValues.Annotation
				tagAnnotationFvRsBgpCtxPolFvCtxValue = newAttributeValues.TagAnnotation
				tagTagFvRsBgpCtxPolFvCtxValue = newAttributeValues.TagTag
			}
			tnBgpCtxPolNameValue := basetypes.NewStringUnknown()
			if !configData.DeprecatedFvRsBgpCtxPol.IsUnknown() {
				tnBgpCtxPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsBgpCtxPol.ValueString()))
			}
			FvRsBgpCtxPol := FvRsBgpCtxPolFvCtxResourceModel{
				Annotation:      annotationValue,
				TnBgpCtxPolName: tnBgpCtxPolNameValue,
				TagAnnotation:   tagAnnotationFvRsBgpCtxPolFvCtxValue,
				TagTag:          tagTagFvRsBgpCtxPolFvCtxValue,
			}
			FvRsBgpCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsBgpCtxPolFvCtxType, FvRsBgpCtxPol)
			planData.FvRsBgpCtxPol = FvRsBgpCtxPolObject
		}

		if !configData.DeprecatedFvRsOspfCtxPol.IsNull() {
			var newAttributeValues FvRsOspfCtxPolFvCtxResourceModel
			tagAnnotationFvRsOspfCtxPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsOspfCtxPolFvCtxType, make([]TagAnnotationFvRsOspfCtxPolFvCtxResourceModel, 0))
			tagTagFvRsOspfCtxPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsOspfCtxPolFvCtxType, make([]TagTagFvRsOspfCtxPolFvCtxResourceModel, 0))
			annotationValue := planData.Annotation
			if stateData != nil && !IsEmptySingleNestedAttribute(stateData.FvRsOspfCtxPol.Attributes()) {
				stateData.FvRsOspfCtxPol.As(ctx, &newAttributeValues, basetypes.ObjectAsOptions{})
				annotationValue = newAttributeValues.Annotation
				tagAnnotationFvRsOspfCtxPolFvCtxValue = newAttributeValues.TagAnnotation
				tagTagFvRsOspfCtxPolFvCtxValue = newAttributeValues.TagTag
			}
			tnOspfCtxPolNameValue := basetypes.NewStringUnknown()
			if !configData.DeprecatedFvRsOspfCtxPol.IsUnknown() {
				tnOspfCtxPolNameValue = basetypes.NewStringValue(GetMOName(configData.DeprecatedFvRsOspfCtxPol.ValueString()))
			}
			FvRsOspfCtxPol := FvRsOspfCtxPolFvCtxResourceModel{
				Annotation:       annotationValue,
				TnOspfCtxPolName: tnOspfCtxPolNameValue,
				TagAnnotation:    tagAnnotationFvRsOspfCtxPolFvCtxValue,
				TagTag:           tagTagFvRsOspfCtxPolFvCtxValue,
			}
			FvRsOspfCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsOspfCtxPolFvCtxType, FvRsOspfCtxPol)
			planData.FvRsOspfCtxPol = FvRsOspfCtxPolObject
		}

		if !configData.DeprecatedFvRsCtxToBgpCtxAfPol.IsNull() {
			FvRsCtxToBgpCtxAfPolList := make([]FvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0)
			var attributeValues []FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1
			var newAttributeValues []FvRsCtxToBgpCtxAfPolFvCtxResourceModel
			if stateData != nil {
				stateData.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &newAttributeValues, false)
			}
			planData.DeprecatedFvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &attributeValues, false)
			for _, attributeValue := range attributeValues {
				plannedFvRsCtxToBgpCtxAfPol := FvRsCtxToBgpCtxAfPolFvCtxResourceModel{}
				foundAttributeValue := false
				for _, newAttributeValue := range newAttributeValues {
					if newAttributeValue.TnBgpCtxAfPolName.ValueString() == GetMOName(attributeValue.TnBgpCtxAfPolName.ValueString()) {
						plannedFvRsCtxToBgpCtxAfPol = newAttributeValue
						foundAttributeValue = true
						break
					}
				}
				tnBgpCtxAfPolNameValue := basetypes.NewStringUnknown()
				if !attributeValue.TnBgpCtxAfPolName.IsUnknown() {
					tnBgpCtxAfPolNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TnBgpCtxAfPolName.ValueString()))
				}
				FvRsCtxToBgpCtxAfPol := FvRsCtxToBgpCtxAfPolFvCtxResourceModel{
					Af:                attributeValue.Af,
					Annotation:        planData.Annotation,
					TnBgpCtxAfPolName: tnBgpCtxAfPolNameValue,
				}
				if foundAttributeValue {
					FvRsCtxToBgpCtxAfPol.Annotation = plannedFvRsCtxToBgpCtxAfPol.Annotation
				}
				tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxType, make([]TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0))
				FvRsCtxToBgpCtxAfPol.TagAnnotation = tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxValue
				tagTagFvRsCtxToBgpCtxAfPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToBgpCtxAfPolFvCtxType, make([]TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0))
				FvRsCtxToBgpCtxAfPol.TagTag = tagTagFvRsCtxToBgpCtxAfPolFvCtxValue
				FvRsCtxToBgpCtxAfPolList = append(FvRsCtxToBgpCtxAfPolList, FvRsCtxToBgpCtxAfPol)
			}
			FvRsCtxToBgpCtxAfPolSet, _ := types.SetValueFrom(ctx, FvRsCtxToBgpCtxAfPolFvCtxType, FvRsCtxToBgpCtxAfPolList)
			planData.FvRsCtxToBgpCtxAfPol = FvRsCtxToBgpCtxAfPolSet
		} else if !configData.FvRsCtxToBgpCtxAfPol.IsNull() && stateData == nil {
			setUnknownDeprecatedFvRsCtxToBgpCtxAfPolFvCtxResourceModelToPlan(ctx, planData)
		}

		if !configData.DeprecatedFvRsCtxToEigrpCtxAfPol.IsNull() {
			FvRsCtxToEigrpCtxAfPolList := make([]FvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0)
			var attributeValues []FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1
			var newAttributeValues []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel
			if stateData != nil {
				stateData.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &newAttributeValues, false)
			}
			planData.DeprecatedFvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &attributeValues, false)
			for _, attributeValue := range attributeValues {
				plannedFvRsCtxToEigrpCtxAfPol := FvRsCtxToEigrpCtxAfPolFvCtxResourceModel{}
				foundAttributeValue := false
				for _, newAttributeValue := range newAttributeValues {
					if newAttributeValue.TnEigrpCtxAfPolName.ValueString() == GetMOName(attributeValue.TnEigrpCtxAfPolName.ValueString()) {
						plannedFvRsCtxToEigrpCtxAfPol = newAttributeValue
						foundAttributeValue = true
						break
					}
				}
				tnEigrpCtxAfPolNameValue := basetypes.NewStringUnknown()
				if !attributeValue.TnEigrpCtxAfPolName.IsUnknown() {
					tnEigrpCtxAfPolNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TnEigrpCtxAfPolName.ValueString()))
				}
				FvRsCtxToEigrpCtxAfPol := FvRsCtxToEigrpCtxAfPolFvCtxResourceModel{
					Af:                  attributeValue.Af,
					Annotation:          planData.Annotation,
					TnEigrpCtxAfPolName: tnEigrpCtxAfPolNameValue,
				}
				if foundAttributeValue {
					FvRsCtxToEigrpCtxAfPol.Annotation = plannedFvRsCtxToEigrpCtxAfPol.Annotation
				}
				tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxType, make([]TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0))
				FvRsCtxToEigrpCtxAfPol.TagAnnotation = tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxValue
				tagTagFvRsCtxToEigrpCtxAfPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToEigrpCtxAfPolFvCtxType, make([]TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0))
				FvRsCtxToEigrpCtxAfPol.TagTag = tagTagFvRsCtxToEigrpCtxAfPolFvCtxValue
				FvRsCtxToEigrpCtxAfPolList = append(FvRsCtxToEigrpCtxAfPolList, FvRsCtxToEigrpCtxAfPol)
			}
			FvRsCtxToEigrpCtxAfPolSet, _ := types.SetValueFrom(ctx, FvRsCtxToEigrpCtxAfPolFvCtxType, FvRsCtxToEigrpCtxAfPolList)
			planData.FvRsCtxToEigrpCtxAfPol = FvRsCtxToEigrpCtxAfPolSet
		} else if !configData.FvRsCtxToEigrpCtxAfPol.IsNull() && stateData == nil {
			setUnknownDeprecatedFvRsCtxToEigrpCtxAfPolFvCtxResourceModelToPlan(ctx, planData)
		}

		if !configData.DeprecatedFvRsCtxToOspfCtxPol.IsNull() {
			FvRsCtxToOspfCtxPolList := make([]FvRsCtxToOspfCtxPolFvCtxResourceModel, 0)
			var attributeValues []FvRsCtxToOspfCtxPolFvCtxResourceModelV1
			var newAttributeValues []FvRsCtxToOspfCtxPolFvCtxResourceModel
			if stateData != nil {
				stateData.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &newAttributeValues, false)
			}
			planData.DeprecatedFvRsCtxToOspfCtxPol.ElementsAs(ctx, &attributeValues, false)
			for _, attributeValue := range attributeValues {
				plannedFvRsCtxToOspfCtxPol := FvRsCtxToOspfCtxPolFvCtxResourceModel{}
				foundAttributeValue := false
				for _, newAttributeValue := range newAttributeValues {
					if newAttributeValue.TnOspfCtxPolName.ValueString() == GetMOName(attributeValue.TnOspfCtxPolName.ValueString()) {
						plannedFvRsCtxToOspfCtxPol = newAttributeValue
						foundAttributeValue = true
						break
					}
				}
				tnOspfCtxPolNameValue := basetypes.NewStringUnknown()
				if !attributeValue.TnOspfCtxPolName.IsUnknown() {
					tnOspfCtxPolNameValue = basetypes.NewStringValue(GetMOName(attributeValue.TnOspfCtxPolName.ValueString()))
				}
				FvRsCtxToOspfCtxPol := FvRsCtxToOspfCtxPolFvCtxResourceModel{
					Af:               attributeValue.Af,
					Annotation:       planData.Annotation,
					TnOspfCtxPolName: tnOspfCtxPolNameValue,
				}
				if foundAttributeValue {
					FvRsCtxToOspfCtxPol.Annotation = plannedFvRsCtxToOspfCtxPol.Annotation
				}
				tagAnnotationFvRsCtxToOspfCtxPolFvCtxValue, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToOspfCtxPolFvCtxType, make([]TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel, 0))
				FvRsCtxToOspfCtxPol.TagAnnotation = tagAnnotationFvRsCtxToOspfCtxPolFvCtxValue
				tagTagFvRsCtxToOspfCtxPolFvCtxValue, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToOspfCtxPolFvCtxType, make([]TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel, 0))
				FvRsCtxToOspfCtxPol.TagTag = tagTagFvRsCtxToOspfCtxPolFvCtxValue
				FvRsCtxToOspfCtxPolList = append(FvRsCtxToOspfCtxPolList, FvRsCtxToOspfCtxPol)
			}
			FvRsCtxToOspfCtxPolSet, _ := types.SetValueFrom(ctx, FvRsCtxToOspfCtxPolFvCtxType, FvRsCtxToOspfCtxPolList)
			planData.FvRsCtxToOspfCtxPol = FvRsCtxToOspfCtxPolSet
		} else if !configData.FvRsCtxToOspfCtxPol.IsNull() && stateData == nil {
			setUnknownDeprecatedFvRsCtxToOspfCtxPolFvCtxResourceModelToPlan(ctx, planData)
		}

		// Workaround to compare the state with plan to avoid plan changes with only known after apply
		if stateData != nil {
			avoidFvCtxPlanChangeForKnownAfterApplyOnly(ctx, planData, stateData, configData)
		}

		resp.Diagnostics.Append(resp.Plan.Set(ctx, &planData)...)
	}
}
func setUnknownDeprecatedFvRsCtxToBgpCtxAfPolFvCtxResourceModelToPlan(ctx context.Context, planData *FvCtxResourceModel) {
	var attributeValues []FvRsCtxToBgpCtxAfPolFvCtxResourceModel
	var legacyAttributeValues []FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1
	planData.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &attributeValues, false)
	for i := 0; i < len(attributeValues); i++ {
		legacyAttributeValues = append(legacyAttributeValues, FvRsCtxToBgpCtxAfPolFvCtxResourceModelV1{
			Af:                basetypes.NewStringUnknown(),
			TnBgpCtxAfPolName: basetypes.NewStringUnknown(),
		})
	}
	DeprecatedFvRsCtxToBgpCtxAfPolSet, _ := types.SetValueFrom(ctx, deprecatedFvRsCtxToBgpCtxAfPolType, legacyAttributeValues)
	planData.DeprecatedFvRsCtxToBgpCtxAfPol = DeprecatedFvRsCtxToBgpCtxAfPolSet
}
func setUnknownDeprecatedFvRsCtxToEigrpCtxAfPolFvCtxResourceModelToPlan(ctx context.Context, planData *FvCtxResourceModel) {
	var attributeValues []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel
	var legacyAttributeValues []FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1
	planData.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &attributeValues, false)
	for i := 0; i < len(attributeValues); i++ {
		legacyAttributeValues = append(legacyAttributeValues, FvRsCtxToEigrpCtxAfPolFvCtxResourceModelV1{
			Af:                  basetypes.NewStringUnknown(),
			TnEigrpCtxAfPolName: basetypes.NewStringUnknown(),
		})
	}
	DeprecatedFvRsCtxToEigrpCtxAfPolSet, _ := types.SetValueFrom(ctx, deprecatedFvRsCtxToEigrpCtxAfPolType, legacyAttributeValues)
	planData.DeprecatedFvRsCtxToEigrpCtxAfPol = DeprecatedFvRsCtxToEigrpCtxAfPolSet
}
func setUnknownDeprecatedFvRsCtxToOspfCtxPolFvCtxResourceModelToPlan(ctx context.Context, planData *FvCtxResourceModel) {
	var attributeValues []FvRsCtxToOspfCtxPolFvCtxResourceModel
	var legacyAttributeValues []FvRsCtxToOspfCtxPolFvCtxResourceModelV1
	planData.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &attributeValues, false)
	for i := 0; i < len(attributeValues); i++ {
		legacyAttributeValues = append(legacyAttributeValues, FvRsCtxToOspfCtxPolFvCtxResourceModelV1{
			Af:               basetypes.NewStringUnknown(),
			TnOspfCtxPolName: basetypes.NewStringUnknown(),
		})
	}
	DeprecatedFvRsCtxToOspfCtxPolSet, _ := types.SetValueFrom(ctx, deprecatedFvRsCtxToOspfCtxPolType, legacyAttributeValues)
	planData.DeprecatedFvRsCtxToOspfCtxPol = DeprecatedFvRsCtxToOspfCtxPolSet
}

func avoidFvCtxPlanChangeForKnownAfterApplyOnly(ctx context.Context, planData, stateData, configData *FvCtxResourceModel) {
	// Set read-only and deprecated attributes in planData from stateData
	planData.PcTag = stateData.PcTag
	planData.Scope = stateData.Scope
	if configData.DeprecatedBdEnforcedEnable.IsNull() {
		planData.DeprecatedBdEnforcedEnable = stateData.DeprecatedBdEnforcedEnable
	}
	if configData.DeprecatedParentDn.IsNull() {
		planData.DeprecatedParentDn = stateData.DeprecatedParentDn
	}
	if configData.DeprecatedPcEnfDir.IsNull() {
		planData.DeprecatedPcEnfDir = stateData.DeprecatedPcEnfDir
	}
	if configData.DeprecatedPcEnfPref.IsNull() {
		planData.DeprecatedPcEnfPref = stateData.DeprecatedPcEnfPref
	}
	if configData.DeprecatedFvRsCtxToEpRet.IsNull() {
		planData.DeprecatedFvRsCtxToEpRet = stateData.DeprecatedFvRsCtxToEpRet
	}
	if configData.DeprecatedFvRsCtxToExtRouteTagPol.IsNull() {
		planData.DeprecatedFvRsCtxToExtRouteTagPol = stateData.DeprecatedFvRsCtxToExtRouteTagPol
	}
	if configData.DeprecatedFvRsCtxMonPol.IsNull() {
		planData.DeprecatedFvRsCtxMonPol = stateData.DeprecatedFvRsCtxMonPol
	}
	if configData.DeprecatedFvRsBgpCtxPol.IsNull() {
		planData.DeprecatedFvRsBgpCtxPol = stateData.DeprecatedFvRsBgpCtxPol
	}
	if configData.DeprecatedFvRsOspfCtxPol.IsNull() {
		planData.DeprecatedFvRsOspfCtxPol = stateData.DeprecatedFvRsOspfCtxPol
	}
	if configData.DeprecatedFvRsCtxToBgpCtxAfPol.IsNull() {
		planData.DeprecatedFvRsCtxToBgpCtxAfPol = stateData.DeprecatedFvRsCtxToBgpCtxAfPol
	}
	if configData.DeprecatedFvRsCtxToEigrpCtxAfPol.IsNull() {
		planData.DeprecatedFvRsCtxToEigrpCtxAfPol = stateData.DeprecatedFvRsCtxToEigrpCtxAfPol
	}
	if configData.DeprecatedFvRsCtxToOspfCtxPol.IsNull() {
		planData.DeprecatedFvRsCtxToOspfCtxPol = stateData.DeprecatedFvRsCtxToOspfCtxPol
	}

	// Compare the string representation of the planData and stateData because structs cannot be compared directly
	if fmt.Sprintf("%s", planData) != fmt.Sprintf("%s", stateData) {
		planData.PcTag = basetypes.NewStringUnknown()
		planData.Scope = basetypes.NewStringUnknown()
		if configData.DeprecatedBdEnforcedEnable.IsNull() {
			planData.DeprecatedBdEnforcedEnable = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedParentDn.IsNull() {
			planData.DeprecatedParentDn = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedPcEnfDir.IsNull() {
			planData.DeprecatedPcEnfDir = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedPcEnfPref.IsNull() {
			planData.DeprecatedPcEnfPref = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedFvRsCtxToEpRet.IsNull() {
			planData.DeprecatedFvRsCtxToEpRet = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedFvRsCtxToExtRouteTagPol.IsNull() {
			planData.DeprecatedFvRsCtxToExtRouteTagPol = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedFvRsCtxMonPol.IsNull() {
			planData.DeprecatedFvRsCtxMonPol = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedFvRsBgpCtxPol.IsNull() {
			planData.DeprecatedFvRsBgpCtxPol = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedFvRsOspfCtxPol.IsNull() {
			planData.DeprecatedFvRsOspfCtxPol = basetypes.NewStringUnknown()
		}
		if configData.DeprecatedFvRsCtxToBgpCtxAfPol.IsNull() {
			setUnknownDeprecatedFvRsCtxToBgpCtxAfPolFvCtxResourceModelToPlan(ctx, planData)
		}
		if configData.DeprecatedFvRsCtxToEigrpCtxAfPol.IsNull() {
			setUnknownDeprecatedFvRsCtxToEigrpCtxAfPolFvCtxResourceModelToPlan(ctx, planData)
		}
		if configData.DeprecatedFvRsCtxToOspfCtxPol.IsNull() {
			setUnknownDeprecatedFvRsCtxToOspfCtxPolFvCtxResourceModelToPlan(ctx, planData)
		}
	}
}

func (r *FvCtxResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) {
	tflog.Debug(ctx, "Start metadata of resource: aci_vrf")
	resp.TypeName = req.ProviderTypeName + "_vrf"
	tflog.Debug(ctx, "End metadata of resource: aci_vrf")
}

func (r *FvCtxResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
	tflog.Debug(ctx, "Start schema of resource: aci_vrf")
	resp.Schema = schema.Schema{
		// This description is used by the documentation generator and the language server.
		MarkdownDescription: "The vrf resource for the 'fvCtx' class",
		Version:             2,

		Attributes: map[string]schema.Attribute{
			// Deprecated attributes
			"bd_enforced_enable": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'bd_enforced_enable' is deprecated, please refer to 'bd_enforcement' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("bd_enforcement"),
					}...),
				},
			},
			"tenant_dn": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'tenant_dn' is deprecated, please refer to 'parent_dn' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("parent_dn"),
					}...),
				},
			},
			"pc_enf_dir": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'pc_enf_dir' is deprecated, please refer to 'policy_control_enforcement_direction' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("policy_control_enforcement_direction"),
					}...),
				},
			},
			"pc_enf_pref": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'pc_enf_pref' is deprecated, please refer to 'policy_control_enforcement_mode' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("policy_control_enforcement_mode"),
					}...),
				},
			},
			"knw_mcast_act": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute `knw_mcast_act` is deprecated. The configuration was not functioning as intended because the Managed Object (MO) created by the pre-migrated resource was either configured incorrectly or exposed without any implemented functionality on the APIC. The MO for this attribute is no longer created on the APIC, but the existing MO will remain present until the resource is destroyed. This attribute will be removed in the next major version of the provider.",
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
			},
			"relation_fv_rs_ctx_to_ep_ret": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'relation_fv_rs_ctx_to_ep_ret' is deprecated, please refer to 'relation_to_end_point_retention_policy' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("relation_to_end_point_retention_policy"),
					}...),
				},
			},
			"relation_fv_rs_ctx_to_ext_route_tag_pol": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'relation_fv_rs_ctx_to_ext_route_tag_pol' is deprecated, please refer to 'relation_to_l3out_route_tag_policy' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("relation_to_l3out_route_tag_policy"),
					}...),
				},
			},
			"relation_fv_rs_ctx_mon_pol": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'relation_fv_rs_ctx_mon_pol' is deprecated, please refer to 'relation_to_monitoring_policy' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("relation_to_monitoring_policy"),
					}...),
				},
			},
			"relation_fv_rs_ctx_mcast_to": schema.SetAttribute{
				Optional:           true,
				Computed:           true,
				ElementType:        types.StringType,
				DeprecationMessage: "Attribute `relation_fv_rs_ctx_mcast_to` is deprecated. The configuration was not functioning as intended because the Managed Object (MO) created by the pre-migrated resource was either configured incorrectly or exposed without any implemented functionality on the APIC. The MO for this attribute is no longer created on the APIC, but the existing MO will remain present until the resource is destroyed. This attribute will be removed in the next major version of the provider.",
				PlanModifiers: []planmodifier.Set{
					setplanmodifier.UseStateForUnknown(),
				},
			},
			"relation_fv_rs_vrf_validation_pol": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute `relation_fv_rs_vrf_validation_pol` is deprecated. The configuration was not functioning as intended because the Managed Object (MO) created by the pre-migrated resource was either configured incorrectly or exposed without any implemented functionality on the APIC. The MO for this attribute is no longer created on the APIC, but the existing MO will remain present until the resource is destroyed. This attribute will be removed in the next major version of the provider.",
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
			},
			"relation_fv_rs_bgp_ctx_pol": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'relation_fv_rs_bgp_ctx_pol' is deprecated, please refer to 'relation_to_bgp_timers' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("relation_to_bgp_timers"),
					}...),
				},
			},
			"relation_fv_rs_ospf_ctx_pol": schema.StringAttribute{
				Optional:           true,
				Computed:           true,
				DeprecationMessage: "Attribute 'relation_fv_rs_ospf_ctx_pol' is deprecated, please refer to 'relation_to_ospf_timers' instead. The attribute will be removed in the next major version of the provider.",
				Validators: []validator.String{
					stringvalidator.ConflictsWith(path.Expressions{
						path.MatchRoot("relation_to_ospf_timers"),
					}...),
				},
			},
			// End of deprecated attributes
			"id": schema.StringAttribute{
				Computed:            true,
				MarkdownDescription: "The distinguished name (DN) of the VRF object.",
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"parent_dn": schema.StringAttribute{
				Optional:            true,
				Computed:            true,
				MarkdownDescription: "The distinguished name (DN) of the parent object.",
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					stringplanmodifier.RequiresReplace(),
				},
				Validators: []validator.String{
					stringvalidator.AtLeastOneOf(path.Expressions{
						path.MatchRoot("tenant_dn"),
					}...),
				},
			},
			"annotation": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				Default:             stringdefault.StaticString(globalAnnotation),
				MarkdownDescription: `The annotation of the VRF object.`,
			},
			"bd_enforcement": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				Validators: []validator.String{
					stringvalidator.OneOf("no", "yes"),
				},
				MarkdownDescription: `The Bridge Domain (BD) enforcement status of the VRF. BD enforcement will restrict a host from sending ping requests to subnets outside the Bridge Domain (BD). The feature blocks ICMP, TCP and UDP traffic between BDs.`,
			},
			"description": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				MarkdownDescription: `The description of the VRF object.`,
			},
			"ip_data_plane_learning": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				Validators: []validator.String{
					stringvalidator.OneOf("disabled", "enabled"),
				},
				MarkdownDescription: `The IP data plane status of the VRF object. The process known as IP data plane learning involves acquiring the endpoint's IPv4 or IPv6 address through data plane routing of traffic from the endpoint.`,
			},
			"name": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
					stringplanmodifier.RequiresReplace(),
				},
				Validators: []validator.String{
					MakeStringRequired(),
				},
				MarkdownDescription: `The name of the VRF object.`,
			},
			"name_alias": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				MarkdownDescription: `The name alias of the VRF object.`,
			},
			"owner_key": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`,
			},
			"owner_tag": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`,
			},
			"policy_control_enforcement_direction": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				Validators: []validator.String{
					stringvalidator.OneOf("egress", "ingress"),
				},
				MarkdownDescription: `The policy control enforcement direction of the VRF object. VRF ingress policy enforcement involves ACL filtering on the leaf switch where the endpoint is located, reducing the policy CAM usage on the border leaf switch by confining the filtering to 'compute' leaf switches. VRF egress policy enforcement extends ACL filtering to the border leaf switch, increasing its policy CAM usage. The border leaf switch handles filtering for traffic from L3Out to EPG after the endpoint is learned, unless the endpoint-to-destination class mapping is unknown, in which case the compute leaf switch handles the filtering.`,
			},
			"policy_control_enforcement_mode": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
					SetToStringNullWhenStateIsNullPlanIsUnknownDuringUpdate(),
				},
				Validators: []validator.String{
					stringvalidator.OneOf("enforced", "unenforced"),
				},
				MarkdownDescription: `The policy control enforcement mode of the VRF object. VRFs in unenforced mode do not restrict traffic between EPGs that are member of the VRF. VRFs in enforced mode restrict traffic not allowed by contracts between EPGs that are member of the VRF. The policy control enforcement direction is used to determine the preferred enforcement method.`,
			},
			"pc_tag": schema.StringAttribute{
				Computed:            true,
				MarkdownDescription: `The classification tag used for policy enforcement and zoning.`,
			},
			"scope": schema.StringAttribute{
				Computed:            true,
				MarkdownDescription: `The scope ID (L3-VNI) of the VRF object.`,
			},
			"relation_to_bgp_timers": schema.SingleNestedAttribute{
				MarkdownDescription: `A source relation to the BGP timer policy. This is an internal object.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Object{
					objectplanmodifier.UseStateForUnknown(),
				},
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The annotation of the Relation To BGP Timers object.`,
					},
					"bgp_timers_name": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The name of the BGP timers policy associated with this context.`,
					},
					"annotations": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
					"tags": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
				},
			},
			"relation_to_monitoring_policy": schema.SingleNestedAttribute{
				MarkdownDescription: `A source relation to the monitoring policy model for the endpoint group semantic scope. This is an internal object.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Object{
					objectplanmodifier.UseStateForUnknown(),
				},
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The annotation of the Relation From VRF To Monitoring Policy object.`,
					},
					"monitoring_policy_name": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The name of the monitoring policy associated with this context.`,
					},
					"annotations": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
					"tags": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
				},
			},
			"relation_to_bgp_address_family_contexts": schema.SetNestedAttribute{
				MarkdownDescription: `A source relation to the BGP address family context policy.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Set{
					setplanmodifier.UseStateForUnknown(),
					SetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(FvRsCtxToBgpCtxAfPolFvCtxSetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate),
				},
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"address_family": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								stringvalidator.OneOf("ipv4-ucast", "ipv6-ucast"),
								MakeStringRequired(),
							},
							MarkdownDescription: `The type of address family for the Relation From VRF To BGP Address Family Context.`,
						},
						"annotation": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators:          []validator.String{},
							MarkdownDescription: `The annotation of the Relation From VRF To BGP Address Family Context object.`,
						},
						"bgp_address_family_context_name": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The name of the BGP Address Family Context.`,
						},
						"annotations": schema.SetNestedAttribute{
							MarkdownDescription: ``,
							Optional:            true,
							Computed:            true,
							PlanModifiers: []planmodifier.Set{
								setplanmodifier.UseStateForUnknown(),
							},
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"key": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The key used to uniquely identify this configuration object.`,
									},
									"value": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The value of the property.`,
									},
								},
							},
						},
						"tags": schema.SetNestedAttribute{
							MarkdownDescription: ``,
							Optional:            true,
							Computed:            true,
							PlanModifiers: []planmodifier.Set{
								setplanmodifier.UseStateForUnknown(),
							},
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"key": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The key used to uniquely identify this configuration object.`,
									},
									"value": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The value of the property.`,
									},
								},
							},
						},
					},
				},
			},
			"relation_to_eigrp_address_family_contexts": schema.SetNestedAttribute{
				MarkdownDescription: `A source relation to the per-address family EIGRP context policy.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Set{
					setplanmodifier.UseStateForUnknown(),
					SetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(FvRsCtxToEigrpCtxAfPolFvCtxSetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate),
				},
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"address_family": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								stringvalidator.OneOf("ipv4-ucast", "ipv6-ucast"),
								MakeStringRequired(),
							},
							MarkdownDescription: `The type of address family for the Relation From VRF To EIGRP Address Family Context.`,
						},
						"annotation": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators:          []validator.String{},
							MarkdownDescription: `The annotation of the Relation From VRF To EIGRP Address Family Context object.`,
						},
						"eigrp_address_family_context_name": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The name of the EIGRP Address Family Context.`,
						},
						"annotations": schema.SetNestedAttribute{
							MarkdownDescription: ``,
							Optional:            true,
							Computed:            true,
							PlanModifiers: []planmodifier.Set{
								setplanmodifier.UseStateForUnknown(),
							},
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"key": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The key used to uniquely identify this configuration object.`,
									},
									"value": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The value of the property.`,
									},
								},
							},
						},
						"tags": schema.SetNestedAttribute{
							MarkdownDescription: ``,
							Optional:            true,
							Computed:            true,
							PlanModifiers: []planmodifier.Set{
								setplanmodifier.UseStateForUnknown(),
							},
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"key": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The key used to uniquely identify this configuration object.`,
									},
									"value": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The value of the property.`,
									},
								},
							},
						},
					},
				},
			},
			"relation_to_end_point_retention_policy": schema.SingleNestedAttribute{
				MarkdownDescription: `Name of the endpoint retention policy associated with this context.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Object{
					objectplanmodifier.UseStateForUnknown(),
				},
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The annotation of the Relation From VRF To End Point Retention Policy object.`,
					},
					"end_point_retention_policy_name": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The end point retention policy name.`,
					},
					"annotations": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
					"tags": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
				},
			},
			"relation_to_l3out_route_tag_policy": schema.SingleNestedAttribute{
				MarkdownDescription: ``,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Object{
					objectplanmodifier.UseStateForUnknown(),
				},
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The annotation of the Relation From VRF To L3Out Route Tag Policy object.`,
					},
					"l3out_route_tag_policy_name": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The name of the External Route Tag policy associated with this context.`,
					},
					"annotations": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
					"tags": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
				},
			},
			"relation_to_address_family_ospf_timers": schema.SetNestedAttribute{
				MarkdownDescription: `A source relation to the per-address family OSPF context policy.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Set{
					setplanmodifier.UseStateForUnknown(),
					SetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate(FvRsCtxToOspfCtxPolFvCtxSetToSetNullWhenStateIsNullPlanIsUnknownDuringUpdate),
				},
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"address_family": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								stringvalidator.OneOf("ipv4-ucast", "ipv6-ucast"),
								MakeStringRequired(),
							},
							MarkdownDescription: `The type of address family for the Relation From VRF To Address Family OSPF Timers.`,
						},
						"annotation": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators:          []validator.String{},
							MarkdownDescription: `The annotation of the Relation From VRF To Address Family OSPF Timers object.`,
						},
						"ospf_timers_name": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The name of the OSPF timers policy associated with this object.`,
						},
						"annotations": schema.SetNestedAttribute{
							MarkdownDescription: ``,
							Optional:            true,
							Computed:            true,
							PlanModifiers: []planmodifier.Set{
								setplanmodifier.UseStateForUnknown(),
							},
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"key": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The key used to uniquely identify this configuration object.`,
									},
									"value": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The value of the property.`,
									},
								},
							},
						},
						"tags": schema.SetNestedAttribute{
							MarkdownDescription: ``,
							Optional:            true,
							Computed:            true,
							PlanModifiers: []planmodifier.Set{
								setplanmodifier.UseStateForUnknown(),
							},
							NestedObject: schema.NestedAttributeObject{
								Attributes: map[string]schema.Attribute{
									"key": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The key used to uniquely identify this configuration object.`,
									},
									"value": schema.StringAttribute{
										Optional: true,
										Computed: true,
										PlanModifiers: []planmodifier.String{
											stringplanmodifier.UseStateForUnknown(),
										},
										Validators: []validator.String{
											MakeStringRequired(),
										},
										MarkdownDescription: `The value of the property.`,
									},
								},
							},
						},
					},
				},
			},
			"relation_to_wan_vpn": schema.SingleNestedAttribute{
				MarkdownDescription: `Relationship to WAN VPNs`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Object{
					objectplanmodifier.UseStateForUnknown(),
				},
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The annotation of the Relation From VRF To WAN VPN object.`,
					},
					"target_dn": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The distinguished name of the target.`,
					},
					"annotations": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
					"tags": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
				},
			},
			"relation_to_ospf_timers": schema.SingleNestedAttribute{
				MarkdownDescription: `A source relation to the context-level OSPF timer policy. This is an internal object.`,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Object{
					objectplanmodifier.UseStateForUnknown(),
				},
				Attributes: map[string]schema.Attribute{
					"annotation": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The annotation of the Relation To OSPF Timers object.`,
					},
					"ospf_timers_name": schema.StringAttribute{
						Optional: true,
						Computed: true,
						PlanModifiers: []planmodifier.String{
							stringplanmodifier.UseStateForUnknown(),
						},
						MarkdownDescription: `The name of the OSPF timers policy associated with this context.`,
					},
					"annotations": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
					"tags": schema.SetNestedAttribute{
						MarkdownDescription: ``,
						Optional:            true,
						Computed:            true,
						PlanModifiers: []planmodifier.Set{
							setplanmodifier.UseStateForUnknown(),
						},
						NestedObject: schema.NestedAttributeObject{
							Attributes: map[string]schema.Attribute{
								"key": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The key used to uniquely identify this configuration object.`,
								},
								"value": schema.StringAttribute{
									Optional: true,
									Computed: true,
									PlanModifiers: []planmodifier.String{
										stringplanmodifier.UseStateForUnknown(),
									},
									Validators: []validator.String{
										MakeStringRequired(),
									},
									MarkdownDescription: `The value of the property.`,
								},
							},
						},
					},
				},
			},
			"annotations": schema.SetNestedAttribute{
				MarkdownDescription: ``,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Set{
					setplanmodifier.UseStateForUnknown(),
				},
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"key": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The key used to uniquely identify this configuration object.`,
						},
						"value": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The value of the property.`,
						},
					},
				},
			},
			"tags": schema.SetNestedAttribute{
				MarkdownDescription: ``,
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Set{
					setplanmodifier.UseStateForUnknown(),
				},
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"key": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The key used to uniquely identify this configuration object.`,
						},
						"value": schema.StringAttribute{
							Optional: true,
							Computed: true,
							PlanModifiers: []planmodifier.String{
								stringplanmodifier.UseStateForUnknown(),
							},
							Validators: []validator.String{
								MakeStringRequired(),
							},
							MarkdownDescription: `The value of the property.`,
						},
					},
				},
			},
		},
		Blocks: map[string]schema.Block{
			"relation_fv_rs_ctx_to_bgp_ctx_af_pol": schema.SetNestedBlock{
				NestedObject: schema.NestedBlockObject{
					Attributes: map[string]schema.Attribute{
						"af": schema.StringAttribute{
							Optional:           true,
							Computed:           true,
							DeprecationMessage: "Attribute 'af' will be deprecated soon, please use 'relation_to_bgp_address_family_contexts.address_family' instead",
							Validators: []validator.String{
								stringvalidator.ConflictsWith(path.Expressions{
									path.MatchRoot("relation_to_bgp_address_family_contexts"),
								}...),
								MakeStringRequired(),
							},
						},
						"tn_bgp_ctx_af_pol_name": schema.StringAttribute{
							Optional:           true,
							Computed:           true,
							DeprecationMessage: "Attribute 'tn_bgp_ctx_af_pol_name' will be deprecated soon, please use 'relation_to_bgp_address_family_contexts.bgp_address_family_context_name' instead",
							Validators: []validator.String{
								stringvalidator.ConflictsWith(path.Expressions{
									path.MatchRoot("relation_to_bgp_address_family_contexts"),
								}...),
								MakeStringRequired(),
							},
						},
					},
				},
			},
			"relation_fv_rs_ctx_to_eigrp_ctx_af_pol": schema.SetNestedBlock{
				NestedObject: schema.NestedBlockObject{
					Attributes: map[string]schema.Attribute{
						"af": schema.StringAttribute{
							Optional:           true,
							Computed:           true,
							DeprecationMessage: "Attribute 'af' will be deprecated soon, please use 'relation_to_eigrp_address_family_contexts.address_family' instead",
							Validators: []validator.String{
								stringvalidator.ConflictsWith(path.Expressions{
									path.MatchRoot("relation_to_eigrp_address_family_contexts"),
								}...),
								MakeStringRequired(),
							},
						},
						"tn_eigrp_ctx_af_pol_name": schema.StringAttribute{
							Optional:           true,
							Computed:           true,
							DeprecationMessage: "Attribute 'tn_eigrp_ctx_af_pol_name' will be deprecated soon, please use 'relation_to_eigrp_address_family_contexts.eigrp_address_family_context_name' instead",
							Validators: []validator.String{
								stringvalidator.ConflictsWith(path.Expressions{
									path.MatchRoot("relation_to_eigrp_address_family_contexts"),
								}...),
								MakeStringRequired(),
							},
						},
					},
				},
			},
			"relation_fv_rs_ctx_to_ospf_ctx_pol": schema.SetNestedBlock{
				NestedObject: schema.NestedBlockObject{
					Attributes: map[string]schema.Attribute{
						"af": schema.StringAttribute{
							Optional:           true,
							Computed:           true,
							DeprecationMessage: "Attribute 'af' will be deprecated soon, please use 'relation_to_address_family_ospf_timers.address_family' instead",
							Validators: []validator.String{
								stringvalidator.ConflictsWith(path.Expressions{
									path.MatchRoot("relation_to_address_family_ospf_timers"),
								}...),
								MakeStringRequired(),
							},
						},
						"tn_ospf_ctx_pol_name": schema.StringAttribute{
							Optional:           true,
							Computed:           true,
							DeprecationMessage: "Attribute 'tn_ospf_ctx_pol_name' will be deprecated soon, please use 'relation_to_address_family_ospf_timers.ospf_timers_name' instead",
							Validators: []validator.String{
								stringvalidator.ConflictsWith(path.Expressions{
									path.MatchRoot("relation_to_address_family_ospf_timers"),
								}...),
								MakeStringRequired(),
							},
						},
					},
				},
			},
		},
	}
	tflog.Debug(ctx, "End schema of resource: aci_vrf")
}

func (r *FvCtxResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) {
	tflog.Debug(ctx, "Start configure of resource: aci_vrf")
	// Prevent panic if the provider has not been configured.
	if req.ProviderData == nil {
		return
	}

	client, ok := req.ProviderData.(*client.Client)

	if !ok {
		resp.Diagnostics.AddError(
			"Unexpected Resource Configure Type",
			fmt.Sprintf("Expected *client.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData),
		)

		return
	}

	r.client = client
	tflog.Debug(ctx, "End configure of resource: aci_vrf")
}

func (r *FvCtxResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
	tflog.Debug(ctx, "Start create of resource: aci_vrf")
	// On create retrieve information on current state prior to making any changes in order to determine child delete operations
	var stateData *FvCtxResourceModel
	resp.Diagnostics.Append(req.Plan.Get(ctx, &stateData)...)
	if stateData.Id.IsUnknown() || stateData.Id.IsNull() {
		setFvCtxId(ctx, stateData)
	}
	getAndSetFvCtxAttributes(ctx, &resp.Diagnostics, r.client, stateData)
	if !globalAllowExistingOnCreate && !stateData.Id.IsNull() {
		resp.Diagnostics.AddError(
			"Object Already Exists",
			fmt.Sprintf("The fvCtx object with DN '%s' already exists.", stateData.Id.ValueString()),
		)
		return
	}

	var data *FvCtxResourceModel

	// Read Terraform plan data into the model
	resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...)

	if resp.Diagnostics.HasError() {
		return
	}

	if data.Id.IsUnknown() || data.Id.IsNull() {
		setFvCtxId(ctx, data)
	}

	tflog.Debug(ctx, fmt.Sprintf("Create of resource aci_vrf with id '%s'", data.Id.ValueString()))

	var fvRsBgpCtxPolPlan, fvRsBgpCtxPolState FvRsBgpCtxPolFvCtxResourceModel
	data.FvRsBgpCtxPol.As(ctx, &fvRsBgpCtxPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsBgpCtxPol.As(ctx, &fvRsBgpCtxPolState, basetypes.ObjectAsOptions{})
	var fvRsCtxMonPolPlan, fvRsCtxMonPolState FvRsCtxMonPolFvCtxResourceModel
	data.FvRsCtxMonPol.As(ctx, &fvRsCtxMonPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxMonPol.As(ctx, &fvRsCtxMonPolState, basetypes.ObjectAsOptions{})
	var fvRsCtxToBgpCtxAfPolPlan, fvRsCtxToBgpCtxAfPolState []FvRsCtxToBgpCtxAfPolFvCtxResourceModel
	data.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &fvRsCtxToBgpCtxAfPolPlan, false)
	stateData.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &fvRsCtxToBgpCtxAfPolState, false)
	var fvRsCtxToEigrpCtxAfPolPlan, fvRsCtxToEigrpCtxAfPolState []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel
	data.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &fvRsCtxToEigrpCtxAfPolPlan, false)
	stateData.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &fvRsCtxToEigrpCtxAfPolState, false)
	var fvRsCtxToEpRetPlan, fvRsCtxToEpRetState FvRsCtxToEpRetFvCtxResourceModel
	data.FvRsCtxToEpRet.As(ctx, &fvRsCtxToEpRetPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxToEpRet.As(ctx, &fvRsCtxToEpRetState, basetypes.ObjectAsOptions{})
	var fvRsCtxToExtRouteTagPolPlan, fvRsCtxToExtRouteTagPolState FvRsCtxToExtRouteTagPolFvCtxResourceModel
	data.FvRsCtxToExtRouteTagPol.As(ctx, &fvRsCtxToExtRouteTagPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxToExtRouteTagPol.As(ctx, &fvRsCtxToExtRouteTagPolState, basetypes.ObjectAsOptions{})
	var fvRsCtxToOspfCtxPolPlan, fvRsCtxToOspfCtxPolState []FvRsCtxToOspfCtxPolFvCtxResourceModel
	data.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &fvRsCtxToOspfCtxPolPlan, false)
	stateData.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &fvRsCtxToOspfCtxPolState, false)
	var fvRsCtxToSDWanVpnPlan, fvRsCtxToSDWanVpnState FvRsCtxToSDWanVpnFvCtxResourceModel
	data.FvRsCtxToSDWanVpn.As(ctx, &fvRsCtxToSDWanVpnPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxToSDWanVpn.As(ctx, &fvRsCtxToSDWanVpnState, basetypes.ObjectAsOptions{})
	var fvRsOspfCtxPolPlan, fvRsOspfCtxPolState FvRsOspfCtxPolFvCtxResourceModel
	data.FvRsOspfCtxPol.As(ctx, &fvRsOspfCtxPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsOspfCtxPol.As(ctx, &fvRsOspfCtxPolState, basetypes.ObjectAsOptions{})
	var tagAnnotationPlan, tagAnnotationState []TagAnnotationFvCtxResourceModel
	data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false)
	stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false)
	var tagTagPlan, tagTagState []TagTagFvCtxResourceModel
	data.TagTag.ElementsAs(ctx, &tagTagPlan, false)
	stateData.TagTag.ElementsAs(ctx, &tagTagState, false)
	jsonPayload := getFvCtxCreateJsonPayload(ctx, &resp.Diagnostics, true, data, fvRsBgpCtxPolPlan, fvRsBgpCtxPolState, fvRsCtxMonPolPlan, fvRsCtxMonPolState, fvRsCtxToBgpCtxAfPolPlan, fvRsCtxToBgpCtxAfPolState, fvRsCtxToEigrpCtxAfPolPlan, fvRsCtxToEigrpCtxAfPolState, fvRsCtxToEpRetPlan, fvRsCtxToEpRetState, fvRsCtxToExtRouteTagPolPlan, fvRsCtxToExtRouteTagPolState, fvRsCtxToOspfCtxPolPlan, fvRsCtxToOspfCtxPolState, fvRsCtxToSDWanVpnPlan, fvRsCtxToSDWanVpnState, fvRsOspfCtxPolPlan, fvRsOspfCtxPolState, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState)

	if resp.Diagnostics.HasError() {
		return
	}

	DoRestRequest(ctx, &resp.Diagnostics, r.client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "POST", jsonPayload)

	if resp.Diagnostics.HasError() {
		return
	}

	getAndSetFvCtxAttributes(ctx, &resp.Diagnostics, r.client, data)

	// Save data into Terraform state
	resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
	tflog.Debug(ctx, fmt.Sprintf("End create of resource aci_vrf with id '%s'", data.Id.ValueString()))
}

func (r *FvCtxResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
	tflog.Debug(ctx, "Start read of resource: aci_vrf")
	var data *FvCtxResourceModel

	// Read Terraform prior state data into the model
	resp.Diagnostics.Append(req.State.Get(ctx, &data)...)

	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("Read of resource aci_vrf with id '%s'", data.Id.ValueString()))

	getAndSetFvCtxAttributes(ctx, &resp.Diagnostics, r.client, data)

	// Save updated data into Terraform state
	if data.Id.IsNull() {
		var emptyData *FvCtxResourceModel
		resp.Diagnostics.Append(resp.State.Set(ctx, &emptyData)...)
	} else {
		resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
	}

	tflog.Debug(ctx, fmt.Sprintf("End read of resource aci_vrf with id '%s'", data.Id.ValueString()))
}

func (r *FvCtxResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) {
	tflog.Debug(ctx, "Start update of resource: aci_vrf")
	var data *FvCtxResourceModel
	var stateData *FvCtxResourceModel

	// Read Terraform plan data into the model
	resp.Diagnostics.Append(req.Plan.Get(ctx, &data)...)
	resp.Diagnostics.Append(req.State.Get(ctx, &stateData)...)
	// Error out when child object fvRsBgpCtxPol is being deleted
	if IsEmptySingleNestedAttribute(data.FvRsBgpCtxPol.Attributes()) && !IsEmptySingleNestedAttribute(stateData.FvRsBgpCtxPol.Attributes()) {
		resp.Diagnostics.AddError(
			"FvRsBgpCtxPol object cannot be deleted",
			"deletion of child is only possible upon deletion of the parent",
		)
	}
	// Error out when child object fvRsCtxToEpRet is being deleted
	if IsEmptySingleNestedAttribute(data.FvRsCtxToEpRet.Attributes()) && !IsEmptySingleNestedAttribute(stateData.FvRsCtxToEpRet.Attributes()) {
		resp.Diagnostics.AddError(
			"FvRsCtxToEpRet object cannot be deleted",
			"deletion of child is only possible upon deletion of the parent",
		)
	}
	// Error out when child object fvRsCtxToExtRouteTagPol is being deleted
	if IsEmptySingleNestedAttribute(data.FvRsCtxToExtRouteTagPol.Attributes()) && !IsEmptySingleNestedAttribute(stateData.FvRsCtxToExtRouteTagPol.Attributes()) {
		resp.Diagnostics.AddError(
			"FvRsCtxToExtRouteTagPol object cannot be deleted",
			"deletion of child is only possible upon deletion of the parent",
		)
	}
	// Error out when child object fvRsOspfCtxPol is being deleted
	if IsEmptySingleNestedAttribute(data.FvRsOspfCtxPol.Attributes()) && !IsEmptySingleNestedAttribute(stateData.FvRsOspfCtxPol.Attributes()) {
		resp.Diagnostics.AddError(
			"FvRsOspfCtxPol object cannot be deleted",
			"deletion of child is only possible upon deletion of the parent",
		)
	}

	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("Update of resource aci_vrf with id '%s'", data.Id.ValueString()))

	var fvRsBgpCtxPolPlan, fvRsBgpCtxPolState FvRsBgpCtxPolFvCtxResourceModel
	data.FvRsBgpCtxPol.As(ctx, &fvRsBgpCtxPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsBgpCtxPol.As(ctx, &fvRsBgpCtxPolState, basetypes.ObjectAsOptions{})
	var fvRsCtxMonPolPlan, fvRsCtxMonPolState FvRsCtxMonPolFvCtxResourceModel
	data.FvRsCtxMonPol.As(ctx, &fvRsCtxMonPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxMonPol.As(ctx, &fvRsCtxMonPolState, basetypes.ObjectAsOptions{})
	var fvRsCtxToBgpCtxAfPolPlan, fvRsCtxToBgpCtxAfPolState []FvRsCtxToBgpCtxAfPolFvCtxResourceModel
	data.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &fvRsCtxToBgpCtxAfPolPlan, false)
	stateData.FvRsCtxToBgpCtxAfPol.ElementsAs(ctx, &fvRsCtxToBgpCtxAfPolState, false)
	var fvRsCtxToEigrpCtxAfPolPlan, fvRsCtxToEigrpCtxAfPolState []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel
	data.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &fvRsCtxToEigrpCtxAfPolPlan, false)
	stateData.FvRsCtxToEigrpCtxAfPol.ElementsAs(ctx, &fvRsCtxToEigrpCtxAfPolState, false)
	var fvRsCtxToEpRetPlan, fvRsCtxToEpRetState FvRsCtxToEpRetFvCtxResourceModel
	data.FvRsCtxToEpRet.As(ctx, &fvRsCtxToEpRetPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxToEpRet.As(ctx, &fvRsCtxToEpRetState, basetypes.ObjectAsOptions{})
	var fvRsCtxToExtRouteTagPolPlan, fvRsCtxToExtRouteTagPolState FvRsCtxToExtRouteTagPolFvCtxResourceModel
	data.FvRsCtxToExtRouteTagPol.As(ctx, &fvRsCtxToExtRouteTagPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxToExtRouteTagPol.As(ctx, &fvRsCtxToExtRouteTagPolState, basetypes.ObjectAsOptions{})
	var fvRsCtxToOspfCtxPolPlan, fvRsCtxToOspfCtxPolState []FvRsCtxToOspfCtxPolFvCtxResourceModel
	data.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &fvRsCtxToOspfCtxPolPlan, false)
	stateData.FvRsCtxToOspfCtxPol.ElementsAs(ctx, &fvRsCtxToOspfCtxPolState, false)
	var fvRsCtxToSDWanVpnPlan, fvRsCtxToSDWanVpnState FvRsCtxToSDWanVpnFvCtxResourceModel
	data.FvRsCtxToSDWanVpn.As(ctx, &fvRsCtxToSDWanVpnPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsCtxToSDWanVpn.As(ctx, &fvRsCtxToSDWanVpnState, basetypes.ObjectAsOptions{})
	var fvRsOspfCtxPolPlan, fvRsOspfCtxPolState FvRsOspfCtxPolFvCtxResourceModel
	data.FvRsOspfCtxPol.As(ctx, &fvRsOspfCtxPolPlan, basetypes.ObjectAsOptions{})
	stateData.FvRsOspfCtxPol.As(ctx, &fvRsOspfCtxPolState, basetypes.ObjectAsOptions{})
	var tagAnnotationPlan, tagAnnotationState []TagAnnotationFvCtxResourceModel
	data.TagAnnotation.ElementsAs(ctx, &tagAnnotationPlan, false)
	stateData.TagAnnotation.ElementsAs(ctx, &tagAnnotationState, false)
	var tagTagPlan, tagTagState []TagTagFvCtxResourceModel
	data.TagTag.ElementsAs(ctx, &tagTagPlan, false)
	stateData.TagTag.ElementsAs(ctx, &tagTagState, false)
	jsonPayload := getFvCtxCreateJsonPayload(ctx, &resp.Diagnostics, false, data, fvRsBgpCtxPolPlan, fvRsBgpCtxPolState, fvRsCtxMonPolPlan, fvRsCtxMonPolState, fvRsCtxToBgpCtxAfPolPlan, fvRsCtxToBgpCtxAfPolState, fvRsCtxToEigrpCtxAfPolPlan, fvRsCtxToEigrpCtxAfPolState, fvRsCtxToEpRetPlan, fvRsCtxToEpRetState, fvRsCtxToExtRouteTagPolPlan, fvRsCtxToExtRouteTagPolState, fvRsCtxToOspfCtxPolPlan, fvRsCtxToOspfCtxPolState, fvRsCtxToSDWanVpnPlan, fvRsCtxToSDWanVpnState, fvRsOspfCtxPolPlan, fvRsOspfCtxPolState, tagAnnotationPlan, tagAnnotationState, tagTagPlan, tagTagState)

	if resp.Diagnostics.HasError() {
		return
	}

	DoRestRequest(ctx, &resp.Diagnostics, r.client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "POST", jsonPayload)

	if resp.Diagnostics.HasError() {
		return
	}

	getAndSetFvCtxAttributes(ctx, &resp.Diagnostics, r.client, data)

	// Save updated data into Terraform state
	resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
	tflog.Debug(ctx, fmt.Sprintf("End update of resource aci_vrf with id '%s'", data.Id.ValueString()))
}

func (r *FvCtxResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) {
	tflog.Debug(ctx, "Start delete of resource: aci_vrf")
	var data *FvCtxResourceModel

	// Read Terraform prior state data into the model
	resp.Diagnostics.Append(req.State.Get(ctx, &data)...)

	if resp.Diagnostics.HasError() {
		return
	}

	tflog.Debug(ctx, fmt.Sprintf("Delete of resource aci_vrf with id '%s'", data.Id.ValueString()))
	jsonPayload := GetDeleteJsonPayload(ctx, &resp.Diagnostics, "fvCtx", data.Id.ValueString())
	if resp.Diagnostics.HasError() {
		return
	}
	DoRestRequest(ctx, &resp.Diagnostics, r.client, fmt.Sprintf("api/mo/%s.json", data.Id.ValueString()), "POST", jsonPayload)
	if resp.Diagnostics.HasError() {
		return
	}
	tflog.Debug(ctx, fmt.Sprintf("End delete of resource aci_vrf with id '%s'", data.Id.ValueString()))
}

func (r *FvCtxResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
	tflog.Debug(ctx, "Start import state of resource: aci_vrf")
	resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp)

	var stateData *FvCtxResourceModel
	resp.Diagnostics.Append(resp.State.Get(ctx, &stateData)...)
	tflog.Debug(ctx, fmt.Sprintf("Import state of resource aci_vrf with id '%s'", stateData.Id.ValueString()))

	tflog.Debug(ctx, "End import of state resource: aci_vrf")
}

func getAndSetFvCtxAttributes(ctx context.Context, diags *diag.Diagnostics, client *client.Client, data *FvCtxResourceModel) {
	requestData := DoRestRequest(ctx, diags, client, fmt.Sprintf("api/mo/%s.json?rsp-subtree=full&rsp-subtree-class=%s", data.Id.ValueString(), "fvCtx,fvRsBgpCtxPol,fvRsCtxMonPol,fvRsCtxToBgpCtxAfPol,fvRsCtxToEigrpCtxAfPol,fvRsCtxToEpRet,fvRsCtxToExtRouteTagPol,fvRsCtxToOspfCtxPol,fvRsCtxToSDWanVpn,fvRsOspfCtxPol,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag,tagAnnotation,tagTag"), "GET", nil)

	readData := getEmptyFvCtxResourceModel()

	if diags.HasError() {
		return
	}
	if requestData.Search("imdata").Search("fvCtx").Data() != nil {
		classReadInfo := requestData.Search("imdata").Search("fvCtx").Data().([]interface{})
		if len(classReadInfo) == 1 {
			attributes := classReadInfo[0].(map[string]interface{})["attributes"].(map[string]interface{})
			for attributeName, attributeValue := range attributes {
				if attributeName == "dn" {
					readData.Id = basetypes.NewStringValue(attributeValue.(string))
					setFvCtxParentDn(ctx, attributeValue.(string), readData)
				}
				if attributeName == "annotation" {
					readData.Annotation = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "bdEnforcedEnable" {
					readData.BdEnforcedEnable = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "descr" {
					readData.Descr = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "ipDataPlaneLearning" {
					readData.IpDataPlaneLearning = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "name" {
					readData.Name = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "nameAlias" {
					readData.NameAlias = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "ownerKey" {
					readData.OwnerKey = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "ownerTag" {
					readData.OwnerTag = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "pcEnfDir" {
					readData.PcEnfDir = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "pcEnfPref" {
					readData.PcEnfPref = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "pcTag" {
					readData.PcTag = basetypes.NewStringValue(attributeValue.(string))
				}
				if attributeName == "scope" {
					readData.Scope = basetypes.NewStringValue(attributeValue.(string))
				}
			}
			FvRsBgpCtxPolFvCtxList := make([]FvRsBgpCtxPolFvCtxResourceModel, 0)
			FvRsCtxMonPolFvCtxList := make([]FvRsCtxMonPolFvCtxResourceModel, 0)
			FvRsCtxToBgpCtxAfPolFvCtxList := make([]FvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0)
			FvRsCtxToEigrpCtxAfPolFvCtxList := make([]FvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0)
			FvRsCtxToEpRetFvCtxList := make([]FvRsCtxToEpRetFvCtxResourceModel, 0)
			FvRsCtxToExtRouteTagPolFvCtxList := make([]FvRsCtxToExtRouteTagPolFvCtxResourceModel, 0)
			FvRsCtxToOspfCtxPolFvCtxList := make([]FvRsCtxToOspfCtxPolFvCtxResourceModel, 0)
			FvRsCtxToSDWanVpnFvCtxList := make([]FvRsCtxToSDWanVpnFvCtxResourceModel, 0)
			FvRsOspfCtxPolFvCtxList := make([]FvRsOspfCtxPolFvCtxResourceModel, 0)
			TagAnnotationFvCtxList := make([]TagAnnotationFvCtxResourceModel, 0)
			TagTagFvCtxList := make([]TagTagFvCtxResourceModel, 0)
			_, ok := classReadInfo[0].(map[string]interface{})["children"]
			if ok {
				children := classReadInfo[0].(map[string]interface{})["children"].([]interface{})
				for _, child := range children {
					for childClassName, childClassDetails := range child.(map[string]interface{}) {
						childAttributes := childClassDetails.(map[string]interface{})["attributes"].(map[string]interface{})
						if childClassName == "fvRsBgpCtxPol" {
							FvRsBgpCtxPolFvCtx := getEmptyFvRsBgpCtxPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "annotation" {
									FvRsBgpCtxPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnBgpCtxPolName" {
									FvRsBgpCtxPolFvCtx.TnBgpCtxPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsBgpCtxPolFvCtxList := make([]TagAnnotationFvRsBgpCtxPolFvCtxResourceModel, 0)
							TagTagFvRsBgpCtxPolFvCtxList := make([]TagTagFvRsBgpCtxPolFvCtxResourceModel, 0)
							childrenOfFvRsBgpCtxPolFvCtx, childrenOfFvRsBgpCtxPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsBgpCtxPolFvCtxExist {
								for _, childFvRsBgpCtxPolFvCtx := range childrenOfFvRsBgpCtxPolFvCtx.([]interface{}) {
									for childClassNameFvRsBgpCtxPolFvCtx, childClassDetailsFvRsBgpCtxPolFvCtx := range childFvRsBgpCtxPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsBgpCtxPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsBgpCtxPolFvCtx := getEmptyTagAnnotationFvRsBgpCtxPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsBgpCtxPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsBgpCtxPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsBgpCtxPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsBgpCtxPolFvCtxList = append(TagAnnotationFvRsBgpCtxPolFvCtxList, TagAnnotationFvRsBgpCtxPolFvCtx)
										}
										if childClassNameFvRsBgpCtxPolFvCtx == "tagTag" {
											TagTagFvRsBgpCtxPolFvCtx := getEmptyTagTagFvRsBgpCtxPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsBgpCtxPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsBgpCtxPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsBgpCtxPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsBgpCtxPolFvCtxList = append(TagTagFvRsBgpCtxPolFvCtxList, TagTagFvRsBgpCtxPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsBgpCtxPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsBgpCtxPolFvCtxType, TagAnnotationFvRsBgpCtxPolFvCtxList)
							FvRsBgpCtxPolFvCtx.TagAnnotation = TagAnnotationFvRsBgpCtxPolFvCtxSet
							TagTagFvRsBgpCtxPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsBgpCtxPolFvCtxType, TagTagFvRsBgpCtxPolFvCtxList)
							FvRsBgpCtxPolFvCtx.TagTag = TagTagFvRsBgpCtxPolFvCtxSet
							FvRsBgpCtxPolFvCtxList = append(FvRsBgpCtxPolFvCtxList, FvRsBgpCtxPolFvCtx)
						}
						if childClassName == "fvRsCtxMonPol" {
							FvRsCtxMonPolFvCtx := getEmptyFvRsCtxMonPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "annotation" {
									FvRsCtxMonPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnMonEPGPolName" {
									FvRsCtxMonPolFvCtx.TnMonEPGPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxMonPolFvCtxList := make([]TagAnnotationFvRsCtxMonPolFvCtxResourceModel, 0)
							TagTagFvRsCtxMonPolFvCtxList := make([]TagTagFvRsCtxMonPolFvCtxResourceModel, 0)
							childrenOfFvRsCtxMonPolFvCtx, childrenOfFvRsCtxMonPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxMonPolFvCtxExist {
								for _, childFvRsCtxMonPolFvCtx := range childrenOfFvRsCtxMonPolFvCtx.([]interface{}) {
									for childClassNameFvRsCtxMonPolFvCtx, childClassDetailsFvRsCtxMonPolFvCtx := range childFvRsCtxMonPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxMonPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxMonPolFvCtx := getEmptyTagAnnotationFvRsCtxMonPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxMonPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxMonPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxMonPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxMonPolFvCtxList = append(TagAnnotationFvRsCtxMonPolFvCtxList, TagAnnotationFvRsCtxMonPolFvCtx)
										}
										if childClassNameFvRsCtxMonPolFvCtx == "tagTag" {
											TagTagFvRsCtxMonPolFvCtx := getEmptyTagTagFvRsCtxMonPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxMonPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxMonPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxMonPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxMonPolFvCtxList = append(TagTagFvRsCtxMonPolFvCtxList, TagTagFvRsCtxMonPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxMonPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxMonPolFvCtxType, TagAnnotationFvRsCtxMonPolFvCtxList)
							FvRsCtxMonPolFvCtx.TagAnnotation = TagAnnotationFvRsCtxMonPolFvCtxSet
							TagTagFvRsCtxMonPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxMonPolFvCtxType, TagTagFvRsCtxMonPolFvCtxList)
							FvRsCtxMonPolFvCtx.TagTag = TagTagFvRsCtxMonPolFvCtxSet
							FvRsCtxMonPolFvCtxList = append(FvRsCtxMonPolFvCtxList, FvRsCtxMonPolFvCtx)
						}
						if childClassName == "fvRsCtxToBgpCtxAfPol" {
							FvRsCtxToBgpCtxAfPolFvCtx := getEmptyFvRsCtxToBgpCtxAfPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "af" {
									FvRsCtxToBgpCtxAfPolFvCtx.Af = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "annotation" {
									FvRsCtxToBgpCtxAfPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnBgpCtxAfPolName" {
									FvRsCtxToBgpCtxAfPolFvCtx.TnBgpCtxAfPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxList := make([]TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0)
							TagTagFvRsCtxToBgpCtxAfPolFvCtxList := make([]TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel, 0)
							childrenOfFvRsCtxToBgpCtxAfPolFvCtx, childrenOfFvRsCtxToBgpCtxAfPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxToBgpCtxAfPolFvCtxExist {
								for _, childFvRsCtxToBgpCtxAfPolFvCtx := range childrenOfFvRsCtxToBgpCtxAfPolFvCtx.([]interface{}) {
									for childClassNameFvRsCtxToBgpCtxAfPolFvCtx, childClassDetailsFvRsCtxToBgpCtxAfPolFvCtx := range childFvRsCtxToBgpCtxAfPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxToBgpCtxAfPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxToBgpCtxAfPolFvCtx := getEmptyTagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxToBgpCtxAfPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxList = append(TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxList, TagAnnotationFvRsCtxToBgpCtxAfPolFvCtx)
										}
										if childClassNameFvRsCtxToBgpCtxAfPolFvCtx == "tagTag" {
											TagTagFvRsCtxToBgpCtxAfPolFvCtx := getEmptyTagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxToBgpCtxAfPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxToBgpCtxAfPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxToBgpCtxAfPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxToBgpCtxAfPolFvCtxList = append(TagTagFvRsCtxToBgpCtxAfPolFvCtxList, TagTagFvRsCtxToBgpCtxAfPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxType, TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxList)
							FvRsCtxToBgpCtxAfPolFvCtx.TagAnnotation = TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxSet
							TagTagFvRsCtxToBgpCtxAfPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToBgpCtxAfPolFvCtxType, TagTagFvRsCtxToBgpCtxAfPolFvCtxList)
							FvRsCtxToBgpCtxAfPolFvCtx.TagTag = TagTagFvRsCtxToBgpCtxAfPolFvCtxSet
							FvRsCtxToBgpCtxAfPolFvCtxList = append(FvRsCtxToBgpCtxAfPolFvCtxList, FvRsCtxToBgpCtxAfPolFvCtx)
						}
						if childClassName == "fvRsCtxToEigrpCtxAfPol" {
							FvRsCtxToEigrpCtxAfPolFvCtx := getEmptyFvRsCtxToEigrpCtxAfPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "af" {
									FvRsCtxToEigrpCtxAfPolFvCtx.Af = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "annotation" {
									FvRsCtxToEigrpCtxAfPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnEigrpCtxAfPolName" {
									FvRsCtxToEigrpCtxAfPolFvCtx.TnEigrpCtxAfPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxList := make([]TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0)
							TagTagFvRsCtxToEigrpCtxAfPolFvCtxList := make([]TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel, 0)
							childrenOfFvRsCtxToEigrpCtxAfPolFvCtx, childrenOfFvRsCtxToEigrpCtxAfPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxToEigrpCtxAfPolFvCtxExist {
								for _, childFvRsCtxToEigrpCtxAfPolFvCtx := range childrenOfFvRsCtxToEigrpCtxAfPolFvCtx.([]interface{}) {
									for childClassNameFvRsCtxToEigrpCtxAfPolFvCtx, childClassDetailsFvRsCtxToEigrpCtxAfPolFvCtx := range childFvRsCtxToEigrpCtxAfPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxToEigrpCtxAfPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx := getEmptyTagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxToEigrpCtxAfPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxList = append(TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxList, TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx)
										}
										if childClassNameFvRsCtxToEigrpCtxAfPolFvCtx == "tagTag" {
											TagTagFvRsCtxToEigrpCtxAfPolFvCtx := getEmptyTagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxToEigrpCtxAfPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxToEigrpCtxAfPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxToEigrpCtxAfPolFvCtxList = append(TagTagFvRsCtxToEigrpCtxAfPolFvCtxList, TagTagFvRsCtxToEigrpCtxAfPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxType, TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxList)
							FvRsCtxToEigrpCtxAfPolFvCtx.TagAnnotation = TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxSet
							TagTagFvRsCtxToEigrpCtxAfPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToEigrpCtxAfPolFvCtxType, TagTagFvRsCtxToEigrpCtxAfPolFvCtxList)
							FvRsCtxToEigrpCtxAfPolFvCtx.TagTag = TagTagFvRsCtxToEigrpCtxAfPolFvCtxSet
							FvRsCtxToEigrpCtxAfPolFvCtxList = append(FvRsCtxToEigrpCtxAfPolFvCtxList, FvRsCtxToEigrpCtxAfPolFvCtx)
						}
						if childClassName == "fvRsCtxToEpRet" {
							FvRsCtxToEpRetFvCtx := getEmptyFvRsCtxToEpRetFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "annotation" {
									FvRsCtxToEpRetFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnFvEpRetPolName" {
									FvRsCtxToEpRetFvCtx.TnFvEpRetPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxToEpRetFvCtxList := make([]TagAnnotationFvRsCtxToEpRetFvCtxResourceModel, 0)
							TagTagFvRsCtxToEpRetFvCtxList := make([]TagTagFvRsCtxToEpRetFvCtxResourceModel, 0)
							childrenOfFvRsCtxToEpRetFvCtx, childrenOfFvRsCtxToEpRetFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxToEpRetFvCtxExist {
								for _, childFvRsCtxToEpRetFvCtx := range childrenOfFvRsCtxToEpRetFvCtx.([]interface{}) {
									for childClassNameFvRsCtxToEpRetFvCtx, childClassDetailsFvRsCtxToEpRetFvCtx := range childFvRsCtxToEpRetFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxToEpRetFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxToEpRetFvCtx := getEmptyTagAnnotationFvRsCtxToEpRetFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxToEpRetFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxToEpRetFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxToEpRetFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxToEpRetFvCtxList = append(TagAnnotationFvRsCtxToEpRetFvCtxList, TagAnnotationFvRsCtxToEpRetFvCtx)
										}
										if childClassNameFvRsCtxToEpRetFvCtx == "tagTag" {
											TagTagFvRsCtxToEpRetFvCtx := getEmptyTagTagFvRsCtxToEpRetFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxToEpRetFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxToEpRetFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxToEpRetFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxToEpRetFvCtxList = append(TagTagFvRsCtxToEpRetFvCtxList, TagTagFvRsCtxToEpRetFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxToEpRetFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToEpRetFvCtxType, TagAnnotationFvRsCtxToEpRetFvCtxList)
							FvRsCtxToEpRetFvCtx.TagAnnotation = TagAnnotationFvRsCtxToEpRetFvCtxSet
							TagTagFvRsCtxToEpRetFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToEpRetFvCtxType, TagTagFvRsCtxToEpRetFvCtxList)
							FvRsCtxToEpRetFvCtx.TagTag = TagTagFvRsCtxToEpRetFvCtxSet
							FvRsCtxToEpRetFvCtxList = append(FvRsCtxToEpRetFvCtxList, FvRsCtxToEpRetFvCtx)
						}
						if childClassName == "fvRsCtxToExtRouteTagPol" {
							FvRsCtxToExtRouteTagPolFvCtx := getEmptyFvRsCtxToExtRouteTagPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "annotation" {
									FvRsCtxToExtRouteTagPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnL3extRouteTagPolName" {
									FvRsCtxToExtRouteTagPolFvCtx.TnL3extRouteTagPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxToExtRouteTagPolFvCtxList := make([]TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel, 0)
							TagTagFvRsCtxToExtRouteTagPolFvCtxList := make([]TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel, 0)
							childrenOfFvRsCtxToExtRouteTagPolFvCtx, childrenOfFvRsCtxToExtRouteTagPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxToExtRouteTagPolFvCtxExist {
								for _, childFvRsCtxToExtRouteTagPolFvCtx := range childrenOfFvRsCtxToExtRouteTagPolFvCtx.([]interface{}) {
									for childClassNameFvRsCtxToExtRouteTagPolFvCtx, childClassDetailsFvRsCtxToExtRouteTagPolFvCtx := range childFvRsCtxToExtRouteTagPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxToExtRouteTagPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxToExtRouteTagPolFvCtx := getEmptyTagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxToExtRouteTagPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxToExtRouteTagPolFvCtxList = append(TagAnnotationFvRsCtxToExtRouteTagPolFvCtxList, TagAnnotationFvRsCtxToExtRouteTagPolFvCtx)
										}
										if childClassNameFvRsCtxToExtRouteTagPolFvCtx == "tagTag" {
											TagTagFvRsCtxToExtRouteTagPolFvCtx := getEmptyTagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxToExtRouteTagPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxToExtRouteTagPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxToExtRouteTagPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxToExtRouteTagPolFvCtxList = append(TagTagFvRsCtxToExtRouteTagPolFvCtxList, TagTagFvRsCtxToExtRouteTagPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxToExtRouteTagPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToExtRouteTagPolFvCtxType, TagAnnotationFvRsCtxToExtRouteTagPolFvCtxList)
							FvRsCtxToExtRouteTagPolFvCtx.TagAnnotation = TagAnnotationFvRsCtxToExtRouteTagPolFvCtxSet
							TagTagFvRsCtxToExtRouteTagPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToExtRouteTagPolFvCtxType, TagTagFvRsCtxToExtRouteTagPolFvCtxList)
							FvRsCtxToExtRouteTagPolFvCtx.TagTag = TagTagFvRsCtxToExtRouteTagPolFvCtxSet
							FvRsCtxToExtRouteTagPolFvCtxList = append(FvRsCtxToExtRouteTagPolFvCtxList, FvRsCtxToExtRouteTagPolFvCtx)
						}
						if childClassName == "fvRsCtxToOspfCtxPol" {
							FvRsCtxToOspfCtxPolFvCtx := getEmptyFvRsCtxToOspfCtxPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "af" {
									FvRsCtxToOspfCtxPolFvCtx.Af = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "annotation" {
									FvRsCtxToOspfCtxPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnOspfCtxPolName" {
									FvRsCtxToOspfCtxPolFvCtx.TnOspfCtxPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxToOspfCtxPolFvCtxList := make([]TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel, 0)
							TagTagFvRsCtxToOspfCtxPolFvCtxList := make([]TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel, 0)
							childrenOfFvRsCtxToOspfCtxPolFvCtx, childrenOfFvRsCtxToOspfCtxPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxToOspfCtxPolFvCtxExist {
								for _, childFvRsCtxToOspfCtxPolFvCtx := range childrenOfFvRsCtxToOspfCtxPolFvCtx.([]interface{}) {
									for childClassNameFvRsCtxToOspfCtxPolFvCtx, childClassDetailsFvRsCtxToOspfCtxPolFvCtx := range childFvRsCtxToOspfCtxPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxToOspfCtxPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxToOspfCtxPolFvCtx := getEmptyTagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxToOspfCtxPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxToOspfCtxPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxToOspfCtxPolFvCtxList = append(TagAnnotationFvRsCtxToOspfCtxPolFvCtxList, TagAnnotationFvRsCtxToOspfCtxPolFvCtx)
										}
										if childClassNameFvRsCtxToOspfCtxPolFvCtx == "tagTag" {
											TagTagFvRsCtxToOspfCtxPolFvCtx := getEmptyTagTagFvRsCtxToOspfCtxPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxToOspfCtxPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxToOspfCtxPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxToOspfCtxPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxToOspfCtxPolFvCtxList = append(TagTagFvRsCtxToOspfCtxPolFvCtxList, TagTagFvRsCtxToOspfCtxPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxToOspfCtxPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToOspfCtxPolFvCtxType, TagAnnotationFvRsCtxToOspfCtxPolFvCtxList)
							FvRsCtxToOspfCtxPolFvCtx.TagAnnotation = TagAnnotationFvRsCtxToOspfCtxPolFvCtxSet
							TagTagFvRsCtxToOspfCtxPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToOspfCtxPolFvCtxType, TagTagFvRsCtxToOspfCtxPolFvCtxList)
							FvRsCtxToOspfCtxPolFvCtx.TagTag = TagTagFvRsCtxToOspfCtxPolFvCtxSet
							FvRsCtxToOspfCtxPolFvCtxList = append(FvRsCtxToOspfCtxPolFvCtxList, FvRsCtxToOspfCtxPolFvCtx)
						}
						if childClassName == "fvRsCtxToSDWanVpn" {
							FvRsCtxToSDWanVpnFvCtx := getEmptyFvRsCtxToSDWanVpnFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "annotation" {
									FvRsCtxToSDWanVpnFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tDn" {
									FvRsCtxToSDWanVpnFvCtx.TDn = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsCtxToSDWanVpnFvCtxList := make([]TagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel, 0)
							TagTagFvRsCtxToSDWanVpnFvCtxList := make([]TagTagFvRsCtxToSDWanVpnFvCtxResourceModel, 0)
							childrenOfFvRsCtxToSDWanVpnFvCtx, childrenOfFvRsCtxToSDWanVpnFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsCtxToSDWanVpnFvCtxExist {
								for _, childFvRsCtxToSDWanVpnFvCtx := range childrenOfFvRsCtxToSDWanVpnFvCtx.([]interface{}) {
									for childClassNameFvRsCtxToSDWanVpnFvCtx, childClassDetailsFvRsCtxToSDWanVpnFvCtx := range childFvRsCtxToSDWanVpnFvCtx.(map[string]interface{}) {
										if childClassNameFvRsCtxToSDWanVpnFvCtx == "tagAnnotation" {
											TagAnnotationFvRsCtxToSDWanVpnFvCtx := getEmptyTagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsCtxToSDWanVpnFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsCtxToSDWanVpnFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsCtxToSDWanVpnFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsCtxToSDWanVpnFvCtxList = append(TagAnnotationFvRsCtxToSDWanVpnFvCtxList, TagAnnotationFvRsCtxToSDWanVpnFvCtx)
										}
										if childClassNameFvRsCtxToSDWanVpnFvCtx == "tagTag" {
											TagTagFvRsCtxToSDWanVpnFvCtx := getEmptyTagTagFvRsCtxToSDWanVpnFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsCtxToSDWanVpnFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsCtxToSDWanVpnFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsCtxToSDWanVpnFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsCtxToSDWanVpnFvCtxList = append(TagTagFvRsCtxToSDWanVpnFvCtxList, TagTagFvRsCtxToSDWanVpnFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsCtxToSDWanVpnFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsCtxToSDWanVpnFvCtxType, TagAnnotationFvRsCtxToSDWanVpnFvCtxList)
							FvRsCtxToSDWanVpnFvCtx.TagAnnotation = TagAnnotationFvRsCtxToSDWanVpnFvCtxSet
							TagTagFvRsCtxToSDWanVpnFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsCtxToSDWanVpnFvCtxType, TagTagFvRsCtxToSDWanVpnFvCtxList)
							FvRsCtxToSDWanVpnFvCtx.TagTag = TagTagFvRsCtxToSDWanVpnFvCtxSet
							FvRsCtxToSDWanVpnFvCtxList = append(FvRsCtxToSDWanVpnFvCtxList, FvRsCtxToSDWanVpnFvCtx)
						}
						if childClassName == "fvRsOspfCtxPol" {
							FvRsOspfCtxPolFvCtx := getEmptyFvRsOspfCtxPolFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "annotation" {
									FvRsOspfCtxPolFvCtx.Annotation = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "tnOspfCtxPolName" {
									FvRsOspfCtxPolFvCtx.TnOspfCtxPolName = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvRsOspfCtxPolFvCtxList := make([]TagAnnotationFvRsOspfCtxPolFvCtxResourceModel, 0)
							TagTagFvRsOspfCtxPolFvCtxList := make([]TagTagFvRsOspfCtxPolFvCtxResourceModel, 0)
							childrenOfFvRsOspfCtxPolFvCtx, childrenOfFvRsOspfCtxPolFvCtxExist := childClassDetails.(map[string]interface{})["children"]
							if childrenOfFvRsOspfCtxPolFvCtxExist {
								for _, childFvRsOspfCtxPolFvCtx := range childrenOfFvRsOspfCtxPolFvCtx.([]interface{}) {
									for childClassNameFvRsOspfCtxPolFvCtx, childClassDetailsFvRsOspfCtxPolFvCtx := range childFvRsOspfCtxPolFvCtx.(map[string]interface{}) {
										if childClassNameFvRsOspfCtxPolFvCtx == "tagAnnotation" {
											TagAnnotationFvRsOspfCtxPolFvCtx := getEmptyTagAnnotationFvRsOspfCtxPolFvCtxResourceModel()
											tagAnnotationchildAttributeValue := childClassDetailsFvRsOspfCtxPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagAnnotationchildAttributeValue {
												if childAttributeName == "key" {
													TagAnnotationFvRsOspfCtxPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagAnnotationFvRsOspfCtxPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagAnnotationFvRsOspfCtxPolFvCtxList = append(TagAnnotationFvRsOspfCtxPolFvCtxList, TagAnnotationFvRsOspfCtxPolFvCtx)
										}
										if childClassNameFvRsOspfCtxPolFvCtx == "tagTag" {
											TagTagFvRsOspfCtxPolFvCtx := getEmptyTagTagFvRsOspfCtxPolFvCtxResourceModel()
											tagTagchildAttributeValue := childClassDetailsFvRsOspfCtxPolFvCtx.(map[string]interface{})["attributes"].(map[string]interface{})
											for childAttributeName, childAttributeValue := range tagTagchildAttributeValue {
												if childAttributeName == "key" {
													TagTagFvRsOspfCtxPolFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
												}
												if childAttributeName == "value" {
													TagTagFvRsOspfCtxPolFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
												}
											}
											TagTagFvRsOspfCtxPolFvCtxList = append(TagTagFvRsOspfCtxPolFvCtxList, TagTagFvRsOspfCtxPolFvCtx)
										}
									}
								}
							}
							TagAnnotationFvRsOspfCtxPolFvCtxSet, _ := types.SetValueFrom(ctx, TagAnnotationFvRsOspfCtxPolFvCtxType, TagAnnotationFvRsOspfCtxPolFvCtxList)
							FvRsOspfCtxPolFvCtx.TagAnnotation = TagAnnotationFvRsOspfCtxPolFvCtxSet
							TagTagFvRsOspfCtxPolFvCtxSet, _ := types.SetValueFrom(ctx, TagTagFvRsOspfCtxPolFvCtxType, TagTagFvRsOspfCtxPolFvCtxList)
							FvRsOspfCtxPolFvCtx.TagTag = TagTagFvRsOspfCtxPolFvCtxSet
							FvRsOspfCtxPolFvCtxList = append(FvRsOspfCtxPolFvCtxList, FvRsOspfCtxPolFvCtx)
						}
						if childClassName == "tagAnnotation" {
							TagAnnotationFvCtx := getEmptyTagAnnotationFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "key" {
									TagAnnotationFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "value" {
									TagAnnotationFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagAnnotationFvCtxList = append(TagAnnotationFvCtxList, TagAnnotationFvCtx)
						}
						if childClassName == "tagTag" {
							TagTagFvCtx := getEmptyTagTagFvCtxResourceModel()
							for childAttributeName, childAttributeValue := range childAttributes {
								if childAttributeName == "key" {
									TagTagFvCtx.Key = basetypes.NewStringValue(childAttributeValue.(string))
								}
								if childAttributeName == "value" {
									TagTagFvCtx.Value = basetypes.NewStringValue(childAttributeValue.(string))
								}

							}
							TagTagFvCtxList = append(TagTagFvCtxList, TagTagFvCtx)
						}
					}
				}
			}
			if len(FvRsBgpCtxPolFvCtxList) == 1 {
				fvRsBgpCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsBgpCtxPolFvCtxType, FvRsBgpCtxPolFvCtxList[0])
				readData.FvRsBgpCtxPol = fvRsBgpCtxPolObject
			} else {
				fvRsBgpCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsBgpCtxPolFvCtxType, getEmptyFvRsBgpCtxPolFvCtxResourceModel())
				readData.FvRsBgpCtxPol = fvRsBgpCtxPolObject
			}
			if len(FvRsCtxMonPolFvCtxList) == 1 {
				fvRsCtxMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxMonPolFvCtxType, FvRsCtxMonPolFvCtxList[0])
				readData.FvRsCtxMonPol = fvRsCtxMonPolObject
			} else {
				fvRsCtxMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxMonPolFvCtxType, getEmptyFvRsCtxMonPolFvCtxResourceModel())
				readData.FvRsCtxMonPol = fvRsCtxMonPolObject
			}
			fvRsCtxToBgpCtxAfPolSet, _ := types.SetValueFrom(ctx, readData.FvRsCtxToBgpCtxAfPol.ElementType(ctx), FvRsCtxToBgpCtxAfPolFvCtxList)
			readData.FvRsCtxToBgpCtxAfPol = fvRsCtxToBgpCtxAfPolSet
			fvRsCtxToEigrpCtxAfPolSet, _ := types.SetValueFrom(ctx, readData.FvRsCtxToEigrpCtxAfPol.ElementType(ctx), FvRsCtxToEigrpCtxAfPolFvCtxList)
			readData.FvRsCtxToEigrpCtxAfPol = fvRsCtxToEigrpCtxAfPolSet
			if len(FvRsCtxToEpRetFvCtxList) == 1 {
				fvRsCtxToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToEpRetFvCtxType, FvRsCtxToEpRetFvCtxList[0])
				readData.FvRsCtxToEpRet = fvRsCtxToEpRetObject
			} else {
				fvRsCtxToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToEpRetFvCtxType, getEmptyFvRsCtxToEpRetFvCtxResourceModel())
				readData.FvRsCtxToEpRet = fvRsCtxToEpRetObject
			}
			if len(FvRsCtxToExtRouteTagPolFvCtxList) == 1 {
				fvRsCtxToExtRouteTagPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToExtRouteTagPolFvCtxType, FvRsCtxToExtRouteTagPolFvCtxList[0])
				readData.FvRsCtxToExtRouteTagPol = fvRsCtxToExtRouteTagPolObject
			} else {
				fvRsCtxToExtRouteTagPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToExtRouteTagPolFvCtxType, getEmptyFvRsCtxToExtRouteTagPolFvCtxResourceModel())
				readData.FvRsCtxToExtRouteTagPol = fvRsCtxToExtRouteTagPolObject
			}
			fvRsCtxToOspfCtxPolSet, _ := types.SetValueFrom(ctx, readData.FvRsCtxToOspfCtxPol.ElementType(ctx), FvRsCtxToOspfCtxPolFvCtxList)
			readData.FvRsCtxToOspfCtxPol = fvRsCtxToOspfCtxPolSet
			if len(FvRsCtxToSDWanVpnFvCtxList) == 1 {
				fvRsCtxToSDWanVpnObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToSDWanVpnFvCtxType, FvRsCtxToSDWanVpnFvCtxList[0])
				readData.FvRsCtxToSDWanVpn = fvRsCtxToSDWanVpnObject
			} else {
				fvRsCtxToSDWanVpnObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToSDWanVpnFvCtxType, getEmptyFvRsCtxToSDWanVpnFvCtxResourceModel())
				readData.FvRsCtxToSDWanVpn = fvRsCtxToSDWanVpnObject
			}
			if len(FvRsOspfCtxPolFvCtxList) == 1 {
				fvRsOspfCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsOspfCtxPolFvCtxType, FvRsOspfCtxPolFvCtxList[0])
				readData.FvRsOspfCtxPol = fvRsOspfCtxPolObject
			} else {
				fvRsOspfCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsOspfCtxPolFvCtxType, getEmptyFvRsOspfCtxPolFvCtxResourceModel())
				readData.FvRsOspfCtxPol = fvRsOspfCtxPolObject
			}
			tagAnnotationSet, _ := types.SetValueFrom(ctx, readData.TagAnnotation.ElementType(ctx), TagAnnotationFvCtxList)
			readData.TagAnnotation = tagAnnotationSet
			tagTagSet, _ := types.SetValueFrom(ctx, readData.TagTag.ElementType(ctx), TagTagFvCtxList)
			readData.TagTag = tagTagSet
			setFvCtxLegacyAttributes(ctx, diags, readData, data, classReadInfo)
		} else {
			diags.AddError(
				"too many results in response",
				fmt.Sprintf("%v matches returned for class 'fvCtx'. Please report this issue to the provider developers.", len(classReadInfo)),
			)
		}
	} else {
		readData.Id = basetypes.NewStringNull()
	}
	*data = *readData
}

func getFvCtxRn(ctx context.Context, data *FvCtxResourceModel) string {
	return fmt.Sprintf("ctx-%s", data.Name.ValueString())
}

func setFvCtxParentDn(ctx context.Context, dn string, data *FvCtxResourceModel) {
	bracketIndex := 0
	rnIndex := 0
	for i := len(dn) - 1; i >= 0; i-- {
		if string(dn[i]) == "]" {
			bracketIndex = bracketIndex + 1
		} else if string(dn[i]) == "[" {
			bracketIndex = bracketIndex - 1
		} else if string(dn[i]) == "/" && bracketIndex == 0 {
			rnIndex = i
			break
		}
	}
	data.ParentDn = basetypes.NewStringValue(dn[:rnIndex])
}

func setFvCtxId(ctx context.Context, data *FvCtxResourceModel) {
	rn := getFvCtxRn(ctx, data)
	data.Id = types.StringValue(fmt.Sprintf("%s/%s", data.ParentDn.ValueString(), rn))
}

func getFvCtxFvRsBgpCtxPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsBgpCtxPolFvCtxPlan, fvRsBgpCtxPolFvCtxState FvRsBgpCtxPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsBgpCtxPol.IsNull() && !data.FvRsBgpCtxPol.IsUnknown() {
		FvRsBgpCtxPolFvCtxChildren := make([]map[string]interface{}, 0)
		childMap := NewAciObject()
		if !IsEmptySingleNestedAttribute(data.FvRsBgpCtxPol.Attributes()) {
			if !fvRsBgpCtxPolFvCtxPlan.Annotation.IsUnknown() && !fvRsBgpCtxPolFvCtxPlan.Annotation.IsNull() {
				childMap.Attributes["annotation"] = fvRsBgpCtxPolFvCtxPlan.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsBgpCtxPolFvCtxPlan.TnBgpCtxPolName.IsUnknown() && !fvRsBgpCtxPolFvCtxPlan.TnBgpCtxPolName.IsNull() {
				childMap.Attributes["tnBgpCtxPolName"] = fvRsBgpCtxPolFvCtxPlan.TnBgpCtxPolName.ValueString()
			}

			var tagAnnotationFvRsBgpCtxPolFvCtxPlan, tagAnnotationFvRsBgpCtxPolFvCtxState []TagAnnotationFvRsBgpCtxPolFvCtxResourceModel
			fvRsBgpCtxPolFvCtxPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBgpCtxPolFvCtxPlan, false)
			if !fvRsBgpCtxPolFvCtxState.TagAnnotation.IsNull() {
				fvRsBgpCtxPolFvCtxState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsBgpCtxPolFvCtxState, false)
			}
			if !fvRsBgpCtxPolFvCtxPlan.TagAnnotation.IsNull() && !fvRsBgpCtxPolFvCtxPlan.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsBgpCtxPolFvCtx := range tagAnnotationFvRsBgpCtxPolFvCtxPlan {
					tagAnnotationFvRsBgpCtxPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsBgpCtxPolFvCtx.Key.IsNull() && !tagAnnotationFvRsBgpCtxPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsBgpCtxPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsBgpCtxPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsBgpCtxPolFvCtx.Value.IsNull() && !tagAnnotationFvRsBgpCtxPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsBgpCtxPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsBgpCtxPolFvCtx.Value.ValueString()
					}
					FvRsBgpCtxPolFvCtxChildren = append(FvRsBgpCtxPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBgpCtxPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsBgpCtxPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsBgpCtxPolFvCtx := range tagAnnotationFvRsBgpCtxPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsBgpCtxPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsBgpCtxPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsBgpCtxPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsBgpCtxPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsBgpCtxPolFvCtx.Key.ValueString()
						FvRsBgpCtxPolFvCtxChildren = append(FvRsBgpCtxPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsBgpCtxPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsBgpCtxPolFvCtxPlan, tagTagFvRsBgpCtxPolFvCtxState []TagTagFvRsBgpCtxPolFvCtxResourceModel
			fvRsBgpCtxPolFvCtxPlan.TagTag.ElementsAs(ctx, &tagTagFvRsBgpCtxPolFvCtxPlan, false)
			if !fvRsBgpCtxPolFvCtxState.TagTag.IsNull() {
				fvRsBgpCtxPolFvCtxState.TagTag.ElementsAs(ctx, &tagTagFvRsBgpCtxPolFvCtxState, false)
			}
			if !fvRsBgpCtxPolFvCtxPlan.TagTag.IsNull() && !fvRsBgpCtxPolFvCtxPlan.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsBgpCtxPolFvCtx := range tagTagFvRsBgpCtxPolFvCtxPlan {
					tagTagFvRsBgpCtxPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsBgpCtxPolFvCtx.Key.IsNull() && !tagTagFvRsBgpCtxPolFvCtx.Key.IsUnknown() {
						tagTagFvRsBgpCtxPolFvCtxChildMap.Attributes["key"] = tagTagFvRsBgpCtxPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsBgpCtxPolFvCtx.Value.IsNull() && !tagTagFvRsBgpCtxPolFvCtx.Value.IsUnknown() {
						tagTagFvRsBgpCtxPolFvCtxChildMap.Attributes["value"] = tagTagFvRsBgpCtxPolFvCtx.Value.ValueString()
					}
					FvRsBgpCtxPolFvCtxChildren = append(FvRsBgpCtxPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsBgpCtxPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsBgpCtxPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsBgpCtxPolFvCtx := range tagTagFvRsBgpCtxPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsBgpCtxPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsBgpCtxPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsBgpCtxPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsBgpCtxPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsBgpCtxPolFvCtx.Key.ValueString()
						FvRsBgpCtxPolFvCtxChildren = append(FvRsBgpCtxPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsBgpCtxPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsBgpCtxPolFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsBgpCtxPol": childMap})
		}
	} else {
		FvRsBgpCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsBgpCtxPolFvCtxType, getEmptyFvRsBgpCtxPolFvCtxResourceModel())
		data.FvRsBgpCtxPol = FvRsBgpCtxPolObject
	}

	return childPayloads
}

func getFvCtxFvRsCtxMonPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxMonPolFvCtxPlan, fvRsCtxMonPolFvCtxState FvRsCtxMonPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxMonPol.IsNull() && !data.FvRsCtxMonPol.IsUnknown() {
		FvRsCtxMonPolFvCtxChildren := make([]map[string]interface{}, 0)
		childMap := NewAciObject()
		if !IsEmptySingleNestedAttribute(data.FvRsCtxMonPol.Attributes()) {
			if !fvRsCtxMonPolFvCtxPlan.Annotation.IsUnknown() && !fvRsCtxMonPolFvCtxPlan.Annotation.IsNull() {
				childMap.Attributes["annotation"] = fvRsCtxMonPolFvCtxPlan.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxMonPolFvCtxPlan.TnMonEPGPolName.IsUnknown() && !fvRsCtxMonPolFvCtxPlan.TnMonEPGPolName.IsNull() {
				childMap.Attributes["tnMonEPGPolName"] = fvRsCtxMonPolFvCtxPlan.TnMonEPGPolName.ValueString()
			}

			var tagAnnotationFvRsCtxMonPolFvCtxPlan, tagAnnotationFvRsCtxMonPolFvCtxState []TagAnnotationFvRsCtxMonPolFvCtxResourceModel
			fvRsCtxMonPolFvCtxPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxMonPolFvCtxPlan, false)
			if !fvRsCtxMonPolFvCtxState.TagAnnotation.IsNull() {
				fvRsCtxMonPolFvCtxState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxMonPolFvCtxState, false)
			}
			if !fvRsCtxMonPolFvCtxPlan.TagAnnotation.IsNull() && !fvRsCtxMonPolFvCtxPlan.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxMonPolFvCtx := range tagAnnotationFvRsCtxMonPolFvCtxPlan {
					tagAnnotationFvRsCtxMonPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxMonPolFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxMonPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxMonPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxMonPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxMonPolFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxMonPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxMonPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxMonPolFvCtx.Value.ValueString()
					}
					FvRsCtxMonPolFvCtxChildren = append(FvRsCtxMonPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxMonPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxMonPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxMonPolFvCtx := range tagAnnotationFvRsCtxMonPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxMonPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxMonPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxMonPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxMonPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxMonPolFvCtx.Key.ValueString()
						FvRsCtxMonPolFvCtxChildren = append(FvRsCtxMonPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxMonPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxMonPolFvCtxPlan, tagTagFvRsCtxMonPolFvCtxState []TagTagFvRsCtxMonPolFvCtxResourceModel
			fvRsCtxMonPolFvCtxPlan.TagTag.ElementsAs(ctx, &tagTagFvRsCtxMonPolFvCtxPlan, false)
			if !fvRsCtxMonPolFvCtxState.TagTag.IsNull() {
				fvRsCtxMonPolFvCtxState.TagTag.ElementsAs(ctx, &tagTagFvRsCtxMonPolFvCtxState, false)
			}
			if !fvRsCtxMonPolFvCtxPlan.TagTag.IsNull() && !fvRsCtxMonPolFvCtxPlan.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxMonPolFvCtx := range tagTagFvRsCtxMonPolFvCtxPlan {
					tagTagFvRsCtxMonPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxMonPolFvCtx.Key.IsNull() && !tagTagFvRsCtxMonPolFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxMonPolFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxMonPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxMonPolFvCtx.Value.IsNull() && !tagTagFvRsCtxMonPolFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxMonPolFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxMonPolFvCtx.Value.ValueString()
					}
					FvRsCtxMonPolFvCtxChildren = append(FvRsCtxMonPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxMonPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxMonPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxMonPolFvCtx := range tagTagFvRsCtxMonPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxMonPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxMonPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxMonPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxMonPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxMonPolFvCtx.Key.ValueString()
						FvRsCtxMonPolFvCtxChildren = append(FvRsCtxMonPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxMonPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxMonPolFvCtxChildren
		} else {
			childMap.Attributes["status"] = "deleted"
		}
		childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxMonPol": childMap})
	} else {
		FvRsCtxMonPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxMonPolFvCtxType, getEmptyFvRsCtxMonPolFvCtxResourceModel())
		data.FvRsCtxMonPol = FvRsCtxMonPolObject
	}

	return childPayloads
}

func getFvCtxFvRsCtxToBgpCtxAfPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxToBgpCtxAfPolFvCtxPlan, fvRsCtxToBgpCtxAfPolFvCtxState []FvRsCtxToBgpCtxAfPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxToBgpCtxAfPol.IsNull() && !data.FvRsCtxToBgpCtxAfPol.IsUnknown() {
		fvRsCtxToBgpCtxAfPolIdentifiers := []FvRsCtxToBgpCtxAfPolIdentifier{}
		for _, fvRsCtxToBgpCtxAfPolFvCtx := range fvRsCtxToBgpCtxAfPolFvCtxPlan {
			FvRsCtxToBgpCtxAfPolFvCtxChildren := make([]map[string]interface{}, 0)
			childMap := NewAciObject()
			if !fvRsCtxToBgpCtxAfPolFvCtx.Af.IsNull() && !fvRsCtxToBgpCtxAfPolFvCtx.Af.IsUnknown() {
				childMap.Attributes["af"] = fvRsCtxToBgpCtxAfPolFvCtx.Af.ValueString()
			}
			if !fvRsCtxToBgpCtxAfPolFvCtx.Annotation.IsNull() && !fvRsCtxToBgpCtxAfPolFvCtx.Annotation.IsUnknown() {
				childMap.Attributes["annotation"] = fvRsCtxToBgpCtxAfPolFvCtx.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxToBgpCtxAfPolFvCtx.TnBgpCtxAfPolName.IsNull() && !fvRsCtxToBgpCtxAfPolFvCtx.TnBgpCtxAfPolName.IsUnknown() {
				childMap.Attributes["tnBgpCtxAfPolName"] = fvRsCtxToBgpCtxAfPolFvCtx.TnBgpCtxAfPolName.ValueString()
			}

			var tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxPlan, tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxState []TagAnnotationFvRsCtxToBgpCtxAfPolFvCtxResourceModel
			fvRsCtxToBgpCtxAfPolFvCtx.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxPlan, false)
			for _, tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxstate := range fvRsCtxToBgpCtxAfPolFvCtxState {
				tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxState, false)
			}
			if !fvRsCtxToBgpCtxAfPolFvCtx.TagAnnotation.IsNull() && !fvRsCtxToBgpCtxAfPolFvCtx.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx := range tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxPlan {
					tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Value.ValueString()
					}
					FvRsCtxToBgpCtxAfPolFvCtxChildren = append(FvRsCtxToBgpCtxAfPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx := range tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxToBgpCtxAfPolFvCtx.Key.ValueString()
						FvRsCtxToBgpCtxAfPolFvCtxChildren = append(FvRsCtxToBgpCtxAfPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxToBgpCtxAfPolFvCtxPlan, tagTagFvRsCtxToBgpCtxAfPolFvCtxState []TagTagFvRsCtxToBgpCtxAfPolFvCtxResourceModel
			fvRsCtxToBgpCtxAfPolFvCtx.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToBgpCtxAfPolFvCtxPlan, false)
			for _, tagTagFvRsCtxToBgpCtxAfPolFvCtxstate := range fvRsCtxToBgpCtxAfPolFvCtxState {
				tagTagFvRsCtxToBgpCtxAfPolFvCtxstate.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToBgpCtxAfPolFvCtxState, false)
			}
			if !fvRsCtxToBgpCtxAfPolFvCtx.TagTag.IsNull() && !fvRsCtxToBgpCtxAfPolFvCtx.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxToBgpCtxAfPolFvCtx := range tagTagFvRsCtxToBgpCtxAfPolFvCtxPlan {
					tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxToBgpCtxAfPolFvCtx.Key.IsNull() && !tagTagFvRsCtxToBgpCtxAfPolFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxToBgpCtxAfPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxToBgpCtxAfPolFvCtx.Value.IsNull() && !tagTagFvRsCtxToBgpCtxAfPolFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxToBgpCtxAfPolFvCtx.Value.ValueString()
					}
					FvRsCtxToBgpCtxAfPolFvCtxChildren = append(FvRsCtxToBgpCtxAfPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxToBgpCtxAfPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxToBgpCtxAfPolFvCtx := range tagTagFvRsCtxToBgpCtxAfPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxToBgpCtxAfPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxToBgpCtxAfPolFvCtx.Key.ValueString()
						FvRsCtxToBgpCtxAfPolFvCtxChildren = append(FvRsCtxToBgpCtxAfPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToBgpCtxAfPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxToBgpCtxAfPolFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToBgpCtxAfPol": childMap})
			fvRsCtxToBgpCtxAfPolIdentifier := FvRsCtxToBgpCtxAfPolIdentifier{}
			fvRsCtxToBgpCtxAfPolIdentifier.Af = fvRsCtxToBgpCtxAfPolFvCtx.Af
			fvRsCtxToBgpCtxAfPolIdentifier.TnBgpCtxAfPolName = fvRsCtxToBgpCtxAfPolFvCtx.TnBgpCtxAfPolName
			fvRsCtxToBgpCtxAfPolIdentifiers = append(fvRsCtxToBgpCtxAfPolIdentifiers, fvRsCtxToBgpCtxAfPolIdentifier)
		}
		for _, fvRsCtxToBgpCtxAfPol := range fvRsCtxToBgpCtxAfPolFvCtxState {
			delete := true
			for _, fvRsCtxToBgpCtxAfPolIdentifier := range fvRsCtxToBgpCtxAfPolIdentifiers {
				if fvRsCtxToBgpCtxAfPolIdentifier.Af == fvRsCtxToBgpCtxAfPol.Af &&
					fvRsCtxToBgpCtxAfPolIdentifier.TnBgpCtxAfPolName == fvRsCtxToBgpCtxAfPol.TnBgpCtxAfPolName {
					delete = false
					break
				}
			}
			if delete {
				fvRsCtxToBgpCtxAfPolChildMapForDelete := NewAciObject()
				fvRsCtxToBgpCtxAfPolChildMapForDelete.Attributes["status"] = "deleted"
				fvRsCtxToBgpCtxAfPolChildMapForDelete.Attributes["af"] = fvRsCtxToBgpCtxAfPol.Af.ValueString()
				fvRsCtxToBgpCtxAfPolChildMapForDelete.Attributes["tnBgpCtxAfPolName"] = fvRsCtxToBgpCtxAfPol.TnBgpCtxAfPolName.ValueString()
				childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToBgpCtxAfPol": fvRsCtxToBgpCtxAfPolChildMapForDelete})
			}
		}
	} else {
		data.FvRsCtxToBgpCtxAfPol = types.SetNull(data.FvRsCtxToBgpCtxAfPol.ElementType(ctx))
	}

	return childPayloads
}

func getFvCtxFvRsCtxToEigrpCtxAfPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxToEigrpCtxAfPolFvCtxPlan, fvRsCtxToEigrpCtxAfPolFvCtxState []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxToEigrpCtxAfPol.IsNull() && !data.FvRsCtxToEigrpCtxAfPol.IsUnknown() {
		fvRsCtxToEigrpCtxAfPolIdentifiers := []FvRsCtxToEigrpCtxAfPolIdentifier{}
		for _, fvRsCtxToEigrpCtxAfPolFvCtx := range fvRsCtxToEigrpCtxAfPolFvCtxPlan {
			FvRsCtxToEigrpCtxAfPolFvCtxChildren := make([]map[string]interface{}, 0)
			childMap := NewAciObject()
			if !fvRsCtxToEigrpCtxAfPolFvCtx.Af.IsNull() && !fvRsCtxToEigrpCtxAfPolFvCtx.Af.IsUnknown() {
				childMap.Attributes["af"] = fvRsCtxToEigrpCtxAfPolFvCtx.Af.ValueString()
			}
			if !fvRsCtxToEigrpCtxAfPolFvCtx.Annotation.IsNull() && !fvRsCtxToEigrpCtxAfPolFvCtx.Annotation.IsUnknown() {
				childMap.Attributes["annotation"] = fvRsCtxToEigrpCtxAfPolFvCtx.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxToEigrpCtxAfPolFvCtx.TnEigrpCtxAfPolName.IsNull() && !fvRsCtxToEigrpCtxAfPolFvCtx.TnEigrpCtxAfPolName.IsUnknown() {
				childMap.Attributes["tnEigrpCtxAfPolName"] = fvRsCtxToEigrpCtxAfPolFvCtx.TnEigrpCtxAfPolName.ValueString()
			}

			var tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxPlan, tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxState []TagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxResourceModel
			fvRsCtxToEigrpCtxAfPolFvCtx.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxPlan, false)
			for _, tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxstate := range fvRsCtxToEigrpCtxAfPolFvCtxState {
				tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxState, false)
			}
			if !fvRsCtxToEigrpCtxAfPolFvCtx.TagAnnotation.IsNull() && !fvRsCtxToEigrpCtxAfPolFvCtx.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx := range tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxPlan {
					tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Value.ValueString()
					}
					FvRsCtxToEigrpCtxAfPolFvCtxChildren = append(FvRsCtxToEigrpCtxAfPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx := range tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtx.Key.ValueString()
						FvRsCtxToEigrpCtxAfPolFvCtxChildren = append(FvRsCtxToEigrpCtxAfPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxToEigrpCtxAfPolFvCtxPlan, tagTagFvRsCtxToEigrpCtxAfPolFvCtxState []TagTagFvRsCtxToEigrpCtxAfPolFvCtxResourceModel
			fvRsCtxToEigrpCtxAfPolFvCtx.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToEigrpCtxAfPolFvCtxPlan, false)
			for _, tagTagFvRsCtxToEigrpCtxAfPolFvCtxstate := range fvRsCtxToEigrpCtxAfPolFvCtxState {
				tagTagFvRsCtxToEigrpCtxAfPolFvCtxstate.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToEigrpCtxAfPolFvCtxState, false)
			}
			if !fvRsCtxToEigrpCtxAfPolFvCtx.TagTag.IsNull() && !fvRsCtxToEigrpCtxAfPolFvCtx.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxToEigrpCtxAfPolFvCtx := range tagTagFvRsCtxToEigrpCtxAfPolFvCtxPlan {
					tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key.IsNull() && !tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Value.IsNull() && !tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Value.ValueString()
					}
					FvRsCtxToEigrpCtxAfPolFvCtxChildren = append(FvRsCtxToEigrpCtxAfPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxToEigrpCtxAfPolFvCtx := range tagTagFvRsCtxToEigrpCtxAfPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxToEigrpCtxAfPolFvCtx.Key.ValueString()
						FvRsCtxToEigrpCtxAfPolFvCtxChildren = append(FvRsCtxToEigrpCtxAfPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToEigrpCtxAfPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxToEigrpCtxAfPolFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToEigrpCtxAfPol": childMap})
			fvRsCtxToEigrpCtxAfPolIdentifier := FvRsCtxToEigrpCtxAfPolIdentifier{}
			fvRsCtxToEigrpCtxAfPolIdentifier.Af = fvRsCtxToEigrpCtxAfPolFvCtx.Af
			fvRsCtxToEigrpCtxAfPolIdentifier.TnEigrpCtxAfPolName = fvRsCtxToEigrpCtxAfPolFvCtx.TnEigrpCtxAfPolName
			fvRsCtxToEigrpCtxAfPolIdentifiers = append(fvRsCtxToEigrpCtxAfPolIdentifiers, fvRsCtxToEigrpCtxAfPolIdentifier)
		}
		for _, fvRsCtxToEigrpCtxAfPol := range fvRsCtxToEigrpCtxAfPolFvCtxState {
			delete := true
			for _, fvRsCtxToEigrpCtxAfPolIdentifier := range fvRsCtxToEigrpCtxAfPolIdentifiers {
				if fvRsCtxToEigrpCtxAfPolIdentifier.Af == fvRsCtxToEigrpCtxAfPol.Af &&
					fvRsCtxToEigrpCtxAfPolIdentifier.TnEigrpCtxAfPolName == fvRsCtxToEigrpCtxAfPol.TnEigrpCtxAfPolName {
					delete = false
					break
				}
			}
			if delete {
				fvRsCtxToEigrpCtxAfPolChildMapForDelete := NewAciObject()
				fvRsCtxToEigrpCtxAfPolChildMapForDelete.Attributes["status"] = "deleted"
				fvRsCtxToEigrpCtxAfPolChildMapForDelete.Attributes["af"] = fvRsCtxToEigrpCtxAfPol.Af.ValueString()
				fvRsCtxToEigrpCtxAfPolChildMapForDelete.Attributes["tnEigrpCtxAfPolName"] = fvRsCtxToEigrpCtxAfPol.TnEigrpCtxAfPolName.ValueString()
				childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToEigrpCtxAfPol": fvRsCtxToEigrpCtxAfPolChildMapForDelete})
			}
		}
	} else {
		data.FvRsCtxToEigrpCtxAfPol = types.SetNull(data.FvRsCtxToEigrpCtxAfPol.ElementType(ctx))
	}

	return childPayloads
}

func getFvCtxFvRsCtxToEpRetChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxToEpRetFvCtxPlan, fvRsCtxToEpRetFvCtxState FvRsCtxToEpRetFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxToEpRet.IsNull() && !data.FvRsCtxToEpRet.IsUnknown() {
		FvRsCtxToEpRetFvCtxChildren := make([]map[string]interface{}, 0)
		childMap := NewAciObject()
		if !IsEmptySingleNestedAttribute(data.FvRsCtxToEpRet.Attributes()) {
			if !fvRsCtxToEpRetFvCtxPlan.Annotation.IsUnknown() && !fvRsCtxToEpRetFvCtxPlan.Annotation.IsNull() {
				childMap.Attributes["annotation"] = fvRsCtxToEpRetFvCtxPlan.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxToEpRetFvCtxPlan.TnFvEpRetPolName.IsUnknown() && !fvRsCtxToEpRetFvCtxPlan.TnFvEpRetPolName.IsNull() {
				childMap.Attributes["tnFvEpRetPolName"] = fvRsCtxToEpRetFvCtxPlan.TnFvEpRetPolName.ValueString()
			}

			var tagAnnotationFvRsCtxToEpRetFvCtxPlan, tagAnnotationFvRsCtxToEpRetFvCtxState []TagAnnotationFvRsCtxToEpRetFvCtxResourceModel
			fvRsCtxToEpRetFvCtxPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToEpRetFvCtxPlan, false)
			if !fvRsCtxToEpRetFvCtxState.TagAnnotation.IsNull() {
				fvRsCtxToEpRetFvCtxState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToEpRetFvCtxState, false)
			}
			if !fvRsCtxToEpRetFvCtxPlan.TagAnnotation.IsNull() && !fvRsCtxToEpRetFvCtxPlan.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxToEpRetFvCtx := range tagAnnotationFvRsCtxToEpRetFvCtxPlan {
					tagAnnotationFvRsCtxToEpRetFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxToEpRetFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxToEpRetFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxToEpRetFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxToEpRetFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxToEpRetFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxToEpRetFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxToEpRetFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxToEpRetFvCtx.Value.ValueString()
					}
					FvRsCtxToEpRetFvCtxChildren = append(FvRsCtxToEpRetFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToEpRetFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxToEpRetFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxToEpRetFvCtx := range tagAnnotationFvRsCtxToEpRetFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxToEpRetFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxToEpRetFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxToEpRetFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxToEpRetFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxToEpRetFvCtx.Key.ValueString()
						FvRsCtxToEpRetFvCtxChildren = append(FvRsCtxToEpRetFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToEpRetFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxToEpRetFvCtxPlan, tagTagFvRsCtxToEpRetFvCtxState []TagTagFvRsCtxToEpRetFvCtxResourceModel
			fvRsCtxToEpRetFvCtxPlan.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToEpRetFvCtxPlan, false)
			if !fvRsCtxToEpRetFvCtxState.TagTag.IsNull() {
				fvRsCtxToEpRetFvCtxState.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToEpRetFvCtxState, false)
			}
			if !fvRsCtxToEpRetFvCtxPlan.TagTag.IsNull() && !fvRsCtxToEpRetFvCtxPlan.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxToEpRetFvCtx := range tagTagFvRsCtxToEpRetFvCtxPlan {
					tagTagFvRsCtxToEpRetFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxToEpRetFvCtx.Key.IsNull() && !tagTagFvRsCtxToEpRetFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxToEpRetFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxToEpRetFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxToEpRetFvCtx.Value.IsNull() && !tagTagFvRsCtxToEpRetFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxToEpRetFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxToEpRetFvCtx.Value.ValueString()
					}
					FvRsCtxToEpRetFvCtxChildren = append(FvRsCtxToEpRetFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToEpRetFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxToEpRetFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxToEpRetFvCtx := range tagTagFvRsCtxToEpRetFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxToEpRetFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxToEpRetFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxToEpRetFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxToEpRetFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxToEpRetFvCtx.Key.ValueString()
						FvRsCtxToEpRetFvCtxChildren = append(FvRsCtxToEpRetFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToEpRetFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxToEpRetFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToEpRet": childMap})
		}
	} else {
		FvRsCtxToEpRetObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToEpRetFvCtxType, getEmptyFvRsCtxToEpRetFvCtxResourceModel())
		data.FvRsCtxToEpRet = FvRsCtxToEpRetObject
	}

	return childPayloads
}

func getFvCtxFvRsCtxToExtRouteTagPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxToExtRouteTagPolFvCtxPlan, fvRsCtxToExtRouteTagPolFvCtxState FvRsCtxToExtRouteTagPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxToExtRouteTagPol.IsNull() && !data.FvRsCtxToExtRouteTagPol.IsUnknown() {
		FvRsCtxToExtRouteTagPolFvCtxChildren := make([]map[string]interface{}, 0)
		childMap := NewAciObject()
		if !IsEmptySingleNestedAttribute(data.FvRsCtxToExtRouteTagPol.Attributes()) {
			if !fvRsCtxToExtRouteTagPolFvCtxPlan.Annotation.IsUnknown() && !fvRsCtxToExtRouteTagPolFvCtxPlan.Annotation.IsNull() {
				childMap.Attributes["annotation"] = fvRsCtxToExtRouteTagPolFvCtxPlan.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxToExtRouteTagPolFvCtxPlan.TnL3extRouteTagPolName.IsUnknown() && !fvRsCtxToExtRouteTagPolFvCtxPlan.TnL3extRouteTagPolName.IsNull() {
				childMap.Attributes["tnL3extRouteTagPolName"] = fvRsCtxToExtRouteTagPolFvCtxPlan.TnL3extRouteTagPolName.ValueString()
			}

			var tagAnnotationFvRsCtxToExtRouteTagPolFvCtxPlan, tagAnnotationFvRsCtxToExtRouteTagPolFvCtxState []TagAnnotationFvRsCtxToExtRouteTagPolFvCtxResourceModel
			fvRsCtxToExtRouteTagPolFvCtxPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToExtRouteTagPolFvCtxPlan, false)
			if !fvRsCtxToExtRouteTagPolFvCtxState.TagAnnotation.IsNull() {
				fvRsCtxToExtRouteTagPolFvCtxState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToExtRouteTagPolFvCtxState, false)
			}
			if !fvRsCtxToExtRouteTagPolFvCtxPlan.TagAnnotation.IsNull() && !fvRsCtxToExtRouteTagPolFvCtxPlan.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxToExtRouteTagPolFvCtx := range tagAnnotationFvRsCtxToExtRouteTagPolFvCtxPlan {
					tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Value.ValueString()
					}
					FvRsCtxToExtRouteTagPolFvCtxChildren = append(FvRsCtxToExtRouteTagPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxToExtRouteTagPolFvCtx := range tagAnnotationFvRsCtxToExtRouteTagPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxToExtRouteTagPolFvCtx.Key.ValueString()
						FvRsCtxToExtRouteTagPolFvCtxChildren = append(FvRsCtxToExtRouteTagPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxToExtRouteTagPolFvCtxPlan, tagTagFvRsCtxToExtRouteTagPolFvCtxState []TagTagFvRsCtxToExtRouteTagPolFvCtxResourceModel
			fvRsCtxToExtRouteTagPolFvCtxPlan.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToExtRouteTagPolFvCtxPlan, false)
			if !fvRsCtxToExtRouteTagPolFvCtxState.TagTag.IsNull() {
				fvRsCtxToExtRouteTagPolFvCtxState.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToExtRouteTagPolFvCtxState, false)
			}
			if !fvRsCtxToExtRouteTagPolFvCtxPlan.TagTag.IsNull() && !fvRsCtxToExtRouteTagPolFvCtxPlan.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxToExtRouteTagPolFvCtx := range tagTagFvRsCtxToExtRouteTagPolFvCtxPlan {
					tagTagFvRsCtxToExtRouteTagPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxToExtRouteTagPolFvCtx.Key.IsNull() && !tagTagFvRsCtxToExtRouteTagPolFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxToExtRouteTagPolFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxToExtRouteTagPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxToExtRouteTagPolFvCtx.Value.IsNull() && !tagTagFvRsCtxToExtRouteTagPolFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxToExtRouteTagPolFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxToExtRouteTagPolFvCtx.Value.ValueString()
					}
					FvRsCtxToExtRouteTagPolFvCtxChildren = append(FvRsCtxToExtRouteTagPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToExtRouteTagPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxToExtRouteTagPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxToExtRouteTagPolFvCtx := range tagTagFvRsCtxToExtRouteTagPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxToExtRouteTagPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxToExtRouteTagPolFvCtx.Key.ValueString()
						FvRsCtxToExtRouteTagPolFvCtxChildren = append(FvRsCtxToExtRouteTagPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToExtRouteTagPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxToExtRouteTagPolFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToExtRouteTagPol": childMap})
		}
	} else {
		FvRsCtxToExtRouteTagPolObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToExtRouteTagPolFvCtxType, getEmptyFvRsCtxToExtRouteTagPolFvCtxResourceModel())
		data.FvRsCtxToExtRouteTagPol = FvRsCtxToExtRouteTagPolObject
	}

	return childPayloads
}

func getFvCtxFvRsCtxToOspfCtxPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxToOspfCtxPolFvCtxPlan, fvRsCtxToOspfCtxPolFvCtxState []FvRsCtxToOspfCtxPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxToOspfCtxPol.IsNull() && !data.FvRsCtxToOspfCtxPol.IsUnknown() {
		fvRsCtxToOspfCtxPolIdentifiers := []FvRsCtxToOspfCtxPolIdentifier{}
		for _, fvRsCtxToOspfCtxPolFvCtx := range fvRsCtxToOspfCtxPolFvCtxPlan {
			FvRsCtxToOspfCtxPolFvCtxChildren := make([]map[string]interface{}, 0)
			childMap := NewAciObject()
			if !fvRsCtxToOspfCtxPolFvCtx.Af.IsNull() && !fvRsCtxToOspfCtxPolFvCtx.Af.IsUnknown() {
				childMap.Attributes["af"] = fvRsCtxToOspfCtxPolFvCtx.Af.ValueString()
			}
			if !fvRsCtxToOspfCtxPolFvCtx.Annotation.IsNull() && !fvRsCtxToOspfCtxPolFvCtx.Annotation.IsUnknown() {
				childMap.Attributes["annotation"] = fvRsCtxToOspfCtxPolFvCtx.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxToOspfCtxPolFvCtx.TnOspfCtxPolName.IsNull() && !fvRsCtxToOspfCtxPolFvCtx.TnOspfCtxPolName.IsUnknown() {
				childMap.Attributes["tnOspfCtxPolName"] = fvRsCtxToOspfCtxPolFvCtx.TnOspfCtxPolName.ValueString()
			}

			var tagAnnotationFvRsCtxToOspfCtxPolFvCtxPlan, tagAnnotationFvRsCtxToOspfCtxPolFvCtxState []TagAnnotationFvRsCtxToOspfCtxPolFvCtxResourceModel
			fvRsCtxToOspfCtxPolFvCtx.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToOspfCtxPolFvCtxPlan, false)
			for _, tagAnnotationFvRsCtxToOspfCtxPolFvCtxstate := range fvRsCtxToOspfCtxPolFvCtxState {
				tagAnnotationFvRsCtxToOspfCtxPolFvCtxstate.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToOspfCtxPolFvCtxState, false)
			}
			if !fvRsCtxToOspfCtxPolFvCtx.TagAnnotation.IsNull() && !fvRsCtxToOspfCtxPolFvCtx.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxToOspfCtxPolFvCtx := range tagAnnotationFvRsCtxToOspfCtxPolFvCtxPlan {
					tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Value.ValueString()
					}
					FvRsCtxToOspfCtxPolFvCtxChildren = append(FvRsCtxToOspfCtxPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxToOspfCtxPolFvCtx := range tagAnnotationFvRsCtxToOspfCtxPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxToOspfCtxPolFvCtx.Key.ValueString()
						FvRsCtxToOspfCtxPolFvCtxChildren = append(FvRsCtxToOspfCtxPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToOspfCtxPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxToOspfCtxPolFvCtxPlan, tagTagFvRsCtxToOspfCtxPolFvCtxState []TagTagFvRsCtxToOspfCtxPolFvCtxResourceModel
			fvRsCtxToOspfCtxPolFvCtx.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToOspfCtxPolFvCtxPlan, false)
			for _, tagTagFvRsCtxToOspfCtxPolFvCtxstate := range fvRsCtxToOspfCtxPolFvCtxState {
				tagTagFvRsCtxToOspfCtxPolFvCtxstate.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToOspfCtxPolFvCtxState, false)
			}
			if !fvRsCtxToOspfCtxPolFvCtx.TagTag.IsNull() && !fvRsCtxToOspfCtxPolFvCtx.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxToOspfCtxPolFvCtx := range tagTagFvRsCtxToOspfCtxPolFvCtxPlan {
					tagTagFvRsCtxToOspfCtxPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxToOspfCtxPolFvCtx.Key.IsNull() && !tagTagFvRsCtxToOspfCtxPolFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxToOspfCtxPolFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxToOspfCtxPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxToOspfCtxPolFvCtx.Value.IsNull() && !tagTagFvRsCtxToOspfCtxPolFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxToOspfCtxPolFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxToOspfCtxPolFvCtx.Value.ValueString()
					}
					FvRsCtxToOspfCtxPolFvCtxChildren = append(FvRsCtxToOspfCtxPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToOspfCtxPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxToOspfCtxPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxToOspfCtxPolFvCtx := range tagTagFvRsCtxToOspfCtxPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxToOspfCtxPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxToOspfCtxPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxToOspfCtxPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxToOspfCtxPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxToOspfCtxPolFvCtx.Key.ValueString()
						FvRsCtxToOspfCtxPolFvCtxChildren = append(FvRsCtxToOspfCtxPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToOspfCtxPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxToOspfCtxPolFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToOspfCtxPol": childMap})
			fvRsCtxToOspfCtxPolIdentifier := FvRsCtxToOspfCtxPolIdentifier{}
			fvRsCtxToOspfCtxPolIdentifier.Af = fvRsCtxToOspfCtxPolFvCtx.Af
			fvRsCtxToOspfCtxPolIdentifier.TnOspfCtxPolName = fvRsCtxToOspfCtxPolFvCtx.TnOspfCtxPolName
			fvRsCtxToOspfCtxPolIdentifiers = append(fvRsCtxToOspfCtxPolIdentifiers, fvRsCtxToOspfCtxPolIdentifier)
		}
		for _, fvRsCtxToOspfCtxPol := range fvRsCtxToOspfCtxPolFvCtxState {
			delete := true
			for _, fvRsCtxToOspfCtxPolIdentifier := range fvRsCtxToOspfCtxPolIdentifiers {
				if fvRsCtxToOspfCtxPolIdentifier.Af == fvRsCtxToOspfCtxPol.Af &&
					fvRsCtxToOspfCtxPolIdentifier.TnOspfCtxPolName == fvRsCtxToOspfCtxPol.TnOspfCtxPolName {
					delete = false
					break
				}
			}
			if delete {
				fvRsCtxToOspfCtxPolChildMapForDelete := NewAciObject()
				fvRsCtxToOspfCtxPolChildMapForDelete.Attributes["status"] = "deleted"
				fvRsCtxToOspfCtxPolChildMapForDelete.Attributes["af"] = fvRsCtxToOspfCtxPol.Af.ValueString()
				fvRsCtxToOspfCtxPolChildMapForDelete.Attributes["tnOspfCtxPolName"] = fvRsCtxToOspfCtxPol.TnOspfCtxPolName.ValueString()
				childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToOspfCtxPol": fvRsCtxToOspfCtxPolChildMapForDelete})
			}
		}
	} else {
		data.FvRsCtxToOspfCtxPol = types.SetNull(data.FvRsCtxToOspfCtxPol.ElementType(ctx))
	}

	return childPayloads
}

func getFvCtxFvRsCtxToSDWanVpnChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsCtxToSDWanVpnFvCtxPlan, fvRsCtxToSDWanVpnFvCtxState FvRsCtxToSDWanVpnFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsCtxToSDWanVpn.IsNull() && !data.FvRsCtxToSDWanVpn.IsUnknown() {
		FvRsCtxToSDWanVpnFvCtxChildren := make([]map[string]interface{}, 0)
		childMap := NewAciObject()
		if !IsEmptySingleNestedAttribute(data.FvRsCtxToSDWanVpn.Attributes()) {
			if !fvRsCtxToSDWanVpnFvCtxPlan.Annotation.IsUnknown() && !fvRsCtxToSDWanVpnFvCtxPlan.Annotation.IsNull() {
				childMap.Attributes["annotation"] = fvRsCtxToSDWanVpnFvCtxPlan.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsCtxToSDWanVpnFvCtxPlan.TDn.IsUnknown() && !fvRsCtxToSDWanVpnFvCtxPlan.TDn.IsNull() {
				childMap.Attributes["tDn"] = fvRsCtxToSDWanVpnFvCtxPlan.TDn.ValueString()
			}

			var tagAnnotationFvRsCtxToSDWanVpnFvCtxPlan, tagAnnotationFvRsCtxToSDWanVpnFvCtxState []TagAnnotationFvRsCtxToSDWanVpnFvCtxResourceModel
			fvRsCtxToSDWanVpnFvCtxPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToSDWanVpnFvCtxPlan, false)
			if !fvRsCtxToSDWanVpnFvCtxState.TagAnnotation.IsNull() {
				fvRsCtxToSDWanVpnFvCtxState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsCtxToSDWanVpnFvCtxState, false)
			}
			if !fvRsCtxToSDWanVpnFvCtxPlan.TagAnnotation.IsNull() && !fvRsCtxToSDWanVpnFvCtxPlan.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsCtxToSDWanVpnFvCtx := range tagAnnotationFvRsCtxToSDWanVpnFvCtxPlan {
					tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsCtxToSDWanVpnFvCtx.Key.IsNull() && !tagAnnotationFvRsCtxToSDWanVpnFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsCtxToSDWanVpnFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsCtxToSDWanVpnFvCtx.Value.IsNull() && !tagAnnotationFvRsCtxToSDWanVpnFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsCtxToSDWanVpnFvCtx.Value.ValueString()
					}
					FvRsCtxToSDWanVpnFvCtxChildren = append(FvRsCtxToSDWanVpnFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsCtxToSDWanVpnFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsCtxToSDWanVpnFvCtx := range tagAnnotationFvRsCtxToSDWanVpnFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsCtxToSDWanVpnFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsCtxToSDWanVpnFvCtx.Key.ValueString()
						FvRsCtxToSDWanVpnFvCtxChildren = append(FvRsCtxToSDWanVpnFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsCtxToSDWanVpnFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsCtxToSDWanVpnFvCtxPlan, tagTagFvRsCtxToSDWanVpnFvCtxState []TagTagFvRsCtxToSDWanVpnFvCtxResourceModel
			fvRsCtxToSDWanVpnFvCtxPlan.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToSDWanVpnFvCtxPlan, false)
			if !fvRsCtxToSDWanVpnFvCtxState.TagTag.IsNull() {
				fvRsCtxToSDWanVpnFvCtxState.TagTag.ElementsAs(ctx, &tagTagFvRsCtxToSDWanVpnFvCtxState, false)
			}
			if !fvRsCtxToSDWanVpnFvCtxPlan.TagTag.IsNull() && !fvRsCtxToSDWanVpnFvCtxPlan.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsCtxToSDWanVpnFvCtx := range tagTagFvRsCtxToSDWanVpnFvCtxPlan {
					tagTagFvRsCtxToSDWanVpnFvCtxChildMap := NewAciObject()
					if !tagTagFvRsCtxToSDWanVpnFvCtx.Key.IsNull() && !tagTagFvRsCtxToSDWanVpnFvCtx.Key.IsUnknown() {
						tagTagFvRsCtxToSDWanVpnFvCtxChildMap.Attributes["key"] = tagTagFvRsCtxToSDWanVpnFvCtx.Key.ValueString()
					}
					if !tagTagFvRsCtxToSDWanVpnFvCtx.Value.IsNull() && !tagTagFvRsCtxToSDWanVpnFvCtx.Value.IsUnknown() {
						tagTagFvRsCtxToSDWanVpnFvCtxChildMap.Attributes["value"] = tagTagFvRsCtxToSDWanVpnFvCtx.Value.ValueString()
					}
					FvRsCtxToSDWanVpnFvCtxChildren = append(FvRsCtxToSDWanVpnFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToSDWanVpnFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsCtxToSDWanVpnFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsCtxToSDWanVpnFvCtx := range tagTagFvRsCtxToSDWanVpnFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsCtxToSDWanVpnFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsCtxToSDWanVpnFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsCtxToSDWanVpnFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsCtxToSDWanVpnFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsCtxToSDWanVpnFvCtx.Key.ValueString()
						FvRsCtxToSDWanVpnFvCtxChildren = append(FvRsCtxToSDWanVpnFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsCtxToSDWanVpnFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsCtxToSDWanVpnFvCtxChildren
		} else {
			childMap.Attributes["status"] = "deleted"
		}
		childPayloads = append(childPayloads, map[string]interface{}{"fvRsCtxToSDWanVpn": childMap})
	} else {
		FvRsCtxToSDWanVpnObject, _ := types.ObjectValueFrom(ctx, FvRsCtxToSDWanVpnFvCtxType, getEmptyFvRsCtxToSDWanVpnFvCtxResourceModel())
		data.FvRsCtxToSDWanVpn = FvRsCtxToSDWanVpnObject
	}

	return childPayloads
}

func getFvCtxFvRsOspfCtxPolChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, fvRsOspfCtxPolFvCtxPlan, fvRsOspfCtxPolFvCtxState FvRsOspfCtxPolFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.FvRsOspfCtxPol.IsNull() && !data.FvRsOspfCtxPol.IsUnknown() {
		FvRsOspfCtxPolFvCtxChildren := make([]map[string]interface{}, 0)
		childMap := NewAciObject()
		if !IsEmptySingleNestedAttribute(data.FvRsOspfCtxPol.Attributes()) {
			if !fvRsOspfCtxPolFvCtxPlan.Annotation.IsUnknown() && !fvRsOspfCtxPolFvCtxPlan.Annotation.IsNull() {
				childMap.Attributes["annotation"] = fvRsOspfCtxPolFvCtxPlan.Annotation.ValueString()
			} else {
				childMap.Attributes["annotation"] = globalAnnotation
			}
			if !fvRsOspfCtxPolFvCtxPlan.TnOspfCtxPolName.IsUnknown() && !fvRsOspfCtxPolFvCtxPlan.TnOspfCtxPolName.IsNull() {
				childMap.Attributes["tnOspfCtxPolName"] = fvRsOspfCtxPolFvCtxPlan.TnOspfCtxPolName.ValueString()
			}

			var tagAnnotationFvRsOspfCtxPolFvCtxPlan, tagAnnotationFvRsOspfCtxPolFvCtxState []TagAnnotationFvRsOspfCtxPolFvCtxResourceModel
			fvRsOspfCtxPolFvCtxPlan.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsOspfCtxPolFvCtxPlan, false)
			if !fvRsOspfCtxPolFvCtxState.TagAnnotation.IsNull() {
				fvRsOspfCtxPolFvCtxState.TagAnnotation.ElementsAs(ctx, &tagAnnotationFvRsOspfCtxPolFvCtxState, false)
			}
			if !fvRsOspfCtxPolFvCtxPlan.TagAnnotation.IsNull() && !fvRsOspfCtxPolFvCtxPlan.TagAnnotation.IsUnknown() {
				tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
				for _, tagAnnotationFvRsOspfCtxPolFvCtx := range tagAnnotationFvRsOspfCtxPolFvCtxPlan {
					tagAnnotationFvRsOspfCtxPolFvCtxChildMap := NewAciObject()
					if !tagAnnotationFvRsOspfCtxPolFvCtx.Key.IsNull() && !tagAnnotationFvRsOspfCtxPolFvCtx.Key.IsUnknown() {
						tagAnnotationFvRsOspfCtxPolFvCtxChildMap.Attributes["key"] = tagAnnotationFvRsOspfCtxPolFvCtx.Key.ValueString()
					}
					if !tagAnnotationFvRsOspfCtxPolFvCtx.Value.IsNull() && !tagAnnotationFvRsOspfCtxPolFvCtx.Value.IsUnknown() {
						tagAnnotationFvRsOspfCtxPolFvCtxChildMap.Attributes["value"] = tagAnnotationFvRsOspfCtxPolFvCtx.Value.ValueString()
					}
					FvRsOspfCtxPolFvCtxChildren = append(FvRsOspfCtxPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsOspfCtxPolFvCtxChildMap})
					tagAnnotationIdentifier := TagAnnotationIdentifier{}
					tagAnnotationIdentifier.Key = tagAnnotationFvRsOspfCtxPolFvCtx.Key
					tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
				}
				for _, tagAnnotationFvRsOspfCtxPolFvCtx := range tagAnnotationFvRsOspfCtxPolFvCtxState {
					delete := true
					for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
						if tagAnnotationIdentifier.Key == tagAnnotationFvRsOspfCtxPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagAnnotationFvRsOspfCtxPolFvCtxChildMapForDelete := NewAciObject()
						tagAnnotationFvRsOspfCtxPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagAnnotationFvRsOspfCtxPolFvCtxChildMapForDelete.Attributes["key"] = tagAnnotationFvRsOspfCtxPolFvCtx.Key.ValueString()
						FvRsOspfCtxPolFvCtxChildren = append(FvRsOspfCtxPolFvCtxChildren, map[string]interface{}{"tagAnnotation": tagAnnotationFvRsOspfCtxPolFvCtxChildMapForDelete})
					}
				}
			}

			var tagTagFvRsOspfCtxPolFvCtxPlan, tagTagFvRsOspfCtxPolFvCtxState []TagTagFvRsOspfCtxPolFvCtxResourceModel
			fvRsOspfCtxPolFvCtxPlan.TagTag.ElementsAs(ctx, &tagTagFvRsOspfCtxPolFvCtxPlan, false)
			if !fvRsOspfCtxPolFvCtxState.TagTag.IsNull() {
				fvRsOspfCtxPolFvCtxState.TagTag.ElementsAs(ctx, &tagTagFvRsOspfCtxPolFvCtxState, false)
			}
			if !fvRsOspfCtxPolFvCtxPlan.TagTag.IsNull() && !fvRsOspfCtxPolFvCtxPlan.TagTag.IsUnknown() {
				tagTagIdentifiers := []TagTagIdentifier{}
				for _, tagTagFvRsOspfCtxPolFvCtx := range tagTagFvRsOspfCtxPolFvCtxPlan {
					tagTagFvRsOspfCtxPolFvCtxChildMap := NewAciObject()
					if !tagTagFvRsOspfCtxPolFvCtx.Key.IsNull() && !tagTagFvRsOspfCtxPolFvCtx.Key.IsUnknown() {
						tagTagFvRsOspfCtxPolFvCtxChildMap.Attributes["key"] = tagTagFvRsOspfCtxPolFvCtx.Key.ValueString()
					}
					if !tagTagFvRsOspfCtxPolFvCtx.Value.IsNull() && !tagTagFvRsOspfCtxPolFvCtx.Value.IsUnknown() {
						tagTagFvRsOspfCtxPolFvCtxChildMap.Attributes["value"] = tagTagFvRsOspfCtxPolFvCtx.Value.ValueString()
					}
					FvRsOspfCtxPolFvCtxChildren = append(FvRsOspfCtxPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsOspfCtxPolFvCtxChildMap})
					tagTagIdentifier := TagTagIdentifier{}
					tagTagIdentifier.Key = tagTagFvRsOspfCtxPolFvCtx.Key
					tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
				}
				for _, tagTagFvRsOspfCtxPolFvCtx := range tagTagFvRsOspfCtxPolFvCtxState {
					delete := true
					for _, tagTagIdentifier := range tagTagIdentifiers {
						if tagTagIdentifier.Key == tagTagFvRsOspfCtxPolFvCtx.Key {
							delete = false
							break
						}
					}
					if delete {
						tagTagFvRsOspfCtxPolFvCtxChildMapForDelete := NewAciObject()
						tagTagFvRsOspfCtxPolFvCtxChildMapForDelete.Attributes["status"] = "deleted"
						tagTagFvRsOspfCtxPolFvCtxChildMapForDelete.Attributes["key"] = tagTagFvRsOspfCtxPolFvCtx.Key.ValueString()
						FvRsOspfCtxPolFvCtxChildren = append(FvRsOspfCtxPolFvCtxChildren, map[string]interface{}{"tagTag": tagTagFvRsOspfCtxPolFvCtxChildMapForDelete})
					}
				}
			}
			childMap.Children = FvRsOspfCtxPolFvCtxChildren
			childPayloads = append(childPayloads, map[string]interface{}{"fvRsOspfCtxPol": childMap})
		}
	} else {
		FvRsOspfCtxPolObject, _ := types.ObjectValueFrom(ctx, FvRsOspfCtxPolFvCtxType, getEmptyFvRsOspfCtxPolFvCtxResourceModel())
		data.FvRsOspfCtxPol = FvRsOspfCtxPolObject
	}

	return childPayloads
}

func getFvCtxTagAnnotationChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, tagAnnotationFvCtxPlan, tagAnnotationFvCtxState []TagAnnotationFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.TagAnnotation.IsNull() && !data.TagAnnotation.IsUnknown() {
		tagAnnotationIdentifiers := []TagAnnotationIdentifier{}
		for _, tagAnnotationFvCtx := range tagAnnotationFvCtxPlan {
			childMap := NewAciObject()
			if !tagAnnotationFvCtx.Key.IsNull() && !tagAnnotationFvCtx.Key.IsUnknown() {
				childMap.Attributes["key"] = tagAnnotationFvCtx.Key.ValueString()
			}
			if !tagAnnotationFvCtx.Value.IsNull() && !tagAnnotationFvCtx.Value.IsUnknown() {
				childMap.Attributes["value"] = tagAnnotationFvCtx.Value.ValueString()
			}
			childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": childMap})
			tagAnnotationIdentifier := TagAnnotationIdentifier{}
			tagAnnotationIdentifier.Key = tagAnnotationFvCtx.Key
			tagAnnotationIdentifiers = append(tagAnnotationIdentifiers, tagAnnotationIdentifier)
		}
		for _, tagAnnotation := range tagAnnotationFvCtxState {
			delete := true
			for _, tagAnnotationIdentifier := range tagAnnotationIdentifiers {
				if tagAnnotationIdentifier.Key == tagAnnotation.Key {
					delete = false
					break
				}
			}
			if delete {
				tagAnnotationChildMapForDelete := NewAciObject()
				tagAnnotationChildMapForDelete.Attributes["status"] = "deleted"
				tagAnnotationChildMapForDelete.Attributes["key"] = tagAnnotation.Key.ValueString()
				childPayloads = append(childPayloads, map[string]interface{}{"tagAnnotation": tagAnnotationChildMapForDelete})
			}
		}
	} else {
		data.TagAnnotation = types.SetNull(data.TagAnnotation.ElementType(ctx))
	}

	return childPayloads
}

func getFvCtxTagTagChildPayloads(ctx context.Context, diags *diag.Diagnostics, data *FvCtxResourceModel, tagTagFvCtxPlan, tagTagFvCtxState []TagTagFvCtxResourceModel) []map[string]interface{} {
	childPayloads := []map[string]interface{}{}
	if !data.TagTag.IsNull() && !data.TagTag.IsUnknown() {
		tagTagIdentifiers := []TagTagIdentifier{}
		for _, tagTagFvCtx := range tagTagFvCtxPlan {
			childMap := NewAciObject()
			if !tagTagFvCtx.Key.IsNull() && !tagTagFvCtx.Key.IsUnknown() {
				childMap.Attributes["key"] = tagTagFvCtx.Key.ValueString()
			}
			if !tagTagFvCtx.Value.IsNull() && !tagTagFvCtx.Value.IsUnknown() {
				childMap.Attributes["value"] = tagTagFvCtx.Value.ValueString()
			}
			childPayloads = append(childPayloads, map[string]interface{}{"tagTag": childMap})
			tagTagIdentifier := TagTagIdentifier{}
			tagTagIdentifier.Key = tagTagFvCtx.Key
			tagTagIdentifiers = append(tagTagIdentifiers, tagTagIdentifier)
		}
		for _, tagTag := range tagTagFvCtxState {
			delete := true
			for _, tagTagIdentifier := range tagTagIdentifiers {
				if tagTagIdentifier.Key == tagTag.Key {
					delete = false
					break
				}
			}
			if delete {
				tagTagChildMapForDelete := NewAciObject()
				tagTagChildMapForDelete.Attributes["status"] = "deleted"
				tagTagChildMapForDelete.Attributes["key"] = tagTag.Key.ValueString()
				childPayloads = append(childPayloads, map[string]interface{}{"tagTag": tagTagChildMapForDelete})
			}
		}
	} else {
		data.TagTag = types.SetNull(data.TagTag.ElementType(ctx))
	}

	return childPayloads
}

func getFvCtxCreateJsonPayload(ctx context.Context, diags *diag.Diagnostics, createType bool, data *FvCtxResourceModel, fvRsBgpCtxPolPlan, fvRsBgpCtxPolState FvRsBgpCtxPolFvCtxResourceModel, fvRsCtxMonPolPlan, fvRsCtxMonPolState FvRsCtxMonPolFvCtxResourceModel, fvRsCtxToBgpCtxAfPolPlan, fvRsCtxToBgpCtxAfPolState []FvRsCtxToBgpCtxAfPolFvCtxResourceModel, fvRsCtxToEigrpCtxAfPolPlan, fvRsCtxToEigrpCtxAfPolState []FvRsCtxToEigrpCtxAfPolFvCtxResourceModel, fvRsCtxToEpRetPlan, fvRsCtxToEpRetState FvRsCtxToEpRetFvCtxResourceModel, fvRsCtxToExtRouteTagPolPlan, fvRsCtxToExtRouteTagPolState FvRsCtxToExtRouteTagPolFvCtxResourceModel, fvRsCtxToOspfCtxPolPlan, fvRsCtxToOspfCtxPolState []FvRsCtxToOspfCtxPolFvCtxResourceModel, fvRsCtxToSDWanVpnPlan, fvRsCtxToSDWanVpnState FvRsCtxToSDWanVpnFvCtxResourceModel, fvRsOspfCtxPolPlan, fvRsOspfCtxPolState FvRsOspfCtxPolFvCtxResourceModel, tagAnnotationPlan, tagAnnotationState []TagAnnotationFvCtxResourceModel, tagTagPlan, tagTagState []TagTagFvCtxResourceModel) *container.Container {
	payloadMap := map[string]interface{}{}
	payloadMap["attributes"] = map[string]string{}

	if createType && !globalAllowExistingOnCreate {
		payloadMap["attributes"].(map[string]string)["status"] = "created"
	}
	childPayloads := []map[string]interface{}{}

	FvRsBgpCtxPolchildPayloads := getFvCtxFvRsBgpCtxPolChildPayloads(ctx, diags, data, fvRsBgpCtxPolPlan, fvRsBgpCtxPolState)
	if FvRsBgpCtxPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsBgpCtxPolchildPayloads...)

	FvRsCtxMonPolchildPayloads := getFvCtxFvRsCtxMonPolChildPayloads(ctx, diags, data, fvRsCtxMonPolPlan, fvRsCtxMonPolState)
	if FvRsCtxMonPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxMonPolchildPayloads...)

	FvRsCtxToBgpCtxAfPolchildPayloads := getFvCtxFvRsCtxToBgpCtxAfPolChildPayloads(ctx, diags, data, fvRsCtxToBgpCtxAfPolPlan, fvRsCtxToBgpCtxAfPolState)
	if FvRsCtxToBgpCtxAfPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxToBgpCtxAfPolchildPayloads...)

	FvRsCtxToEigrpCtxAfPolchildPayloads := getFvCtxFvRsCtxToEigrpCtxAfPolChildPayloads(ctx, diags, data, fvRsCtxToEigrpCtxAfPolPlan, fvRsCtxToEigrpCtxAfPolState)
	if FvRsCtxToEigrpCtxAfPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxToEigrpCtxAfPolchildPayloads...)

	FvRsCtxToEpRetchildPayloads := getFvCtxFvRsCtxToEpRetChildPayloads(ctx, diags, data, fvRsCtxToEpRetPlan, fvRsCtxToEpRetState)
	if FvRsCtxToEpRetchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxToEpRetchildPayloads...)

	FvRsCtxToExtRouteTagPolchildPayloads := getFvCtxFvRsCtxToExtRouteTagPolChildPayloads(ctx, diags, data, fvRsCtxToExtRouteTagPolPlan, fvRsCtxToExtRouteTagPolState)
	if FvRsCtxToExtRouteTagPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxToExtRouteTagPolchildPayloads...)

	FvRsCtxToOspfCtxPolchildPayloads := getFvCtxFvRsCtxToOspfCtxPolChildPayloads(ctx, diags, data, fvRsCtxToOspfCtxPolPlan, fvRsCtxToOspfCtxPolState)
	if FvRsCtxToOspfCtxPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxToOspfCtxPolchildPayloads...)

	FvRsCtxToSDWanVpnchildPayloads := getFvCtxFvRsCtxToSDWanVpnChildPayloads(ctx, diags, data, fvRsCtxToSDWanVpnPlan, fvRsCtxToSDWanVpnState)
	if FvRsCtxToSDWanVpnchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsCtxToSDWanVpnchildPayloads...)

	FvRsOspfCtxPolchildPayloads := getFvCtxFvRsOspfCtxPolChildPayloads(ctx, diags, data, fvRsOspfCtxPolPlan, fvRsOspfCtxPolState)
	if FvRsOspfCtxPolchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, FvRsOspfCtxPolchildPayloads...)

	TagAnnotationchildPayloads := getFvCtxTagAnnotationChildPayloads(ctx, diags, data, tagAnnotationPlan, tagAnnotationState)
	if TagAnnotationchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, TagAnnotationchildPayloads...)

	TagTagchildPayloads := getFvCtxTagTagChildPayloads(ctx, diags, data, tagTagPlan, tagTagState)
	if TagTagchildPayloads == nil {
		return nil
	}
	childPayloads = append(childPayloads, TagTagchildPayloads...)

	payloadMap["children"] = childPayloads
	if !data.Annotation.IsNull() && !data.Annotation.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["annotation"] = data.Annotation.ValueString()
	}
	if !data.BdEnforcedEnable.IsNull() && !data.BdEnforcedEnable.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["bdEnforcedEnable"] = data.BdEnforcedEnable.ValueString()
	}
	if !data.Descr.IsNull() && !data.Descr.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["descr"] = data.Descr.ValueString()
	}
	if !data.IpDataPlaneLearning.IsNull() && !data.IpDataPlaneLearning.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["ipDataPlaneLearning"] = data.IpDataPlaneLearning.ValueString()
	}
	if !data.Name.IsNull() && !data.Name.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["name"] = data.Name.ValueString()
	}
	if !data.NameAlias.IsNull() && !data.NameAlias.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["nameAlias"] = data.NameAlias.ValueString()
	}
	if !data.OwnerKey.IsNull() && !data.OwnerKey.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["ownerKey"] = data.OwnerKey.ValueString()
	}
	if !data.OwnerTag.IsNull() && !data.OwnerTag.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["ownerTag"] = data.OwnerTag.ValueString()
	}
	if !data.PcEnfDir.IsNull() && !data.PcEnfDir.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["pcEnfDir"] = data.PcEnfDir.ValueString()
	}
	if !data.PcEnfPref.IsNull() && !data.PcEnfPref.IsUnknown() {
		payloadMap["attributes"].(map[string]string)["pcEnfPref"] = data.PcEnfPref.ValueString()
	}
	payload, err := json.Marshal(map[string]interface{}{"fvCtx": payloadMap})
	if err != nil {
		diags.AddError(
			"Marshalling of json payload failed",
			fmt.Sprintf("Err: %s. Please report this issue to the provider developers.", err),
		)
		return nil
	}

	jsonPayload, err := container.ParseJSON(payload)

	if err != nil {
		diags.AddError(
			"Construction of json payload failed",
			fmt.Sprintf("Err: %s. Please report this issue to the provider developers.", err),
		)
		return nil
	}
	return jsonPayload
}
