// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package storage

import (
	"fmt"
	v20220701s "github.com/Azure/azure-service-operator/v2/api/network/v1api20220701/storage"
	v20240101s "github.com/Azure/azure-service-operator/v2/api/network/v1api20240101/storage"
	v20240301s "github.com/Azure/azure-service-operator/v2/api/network/v1api20240301/storage"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/core"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets"
	"github.com/rotisserie/eris"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,network}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1api20201101.VirtualNetworkGateway
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2020-11-01/virtualNetworkGateway.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}
type VirtualNetworkGateway struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              VirtualNetworkGateway_Spec   `json:"spec,omitempty"`
	Status            VirtualNetworkGateway_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &VirtualNetworkGateway{}

// GetConditions returns the conditions of the resource
func (gateway *VirtualNetworkGateway) GetConditions() conditions.Conditions {
	return gateway.Status.Conditions
}

// SetConditions sets the conditions on the resource status
func (gateway *VirtualNetworkGateway) SetConditions(conditions conditions.Conditions) {
	gateway.Status.Conditions = conditions
}

var _ conversion.Convertible = &VirtualNetworkGateway{}

// ConvertFrom populates our VirtualNetworkGateway from the provided hub VirtualNetworkGateway
func (gateway *VirtualNetworkGateway) ConvertFrom(hub conversion.Hub) error {
	source, ok := hub.(*v20240301s.VirtualNetworkGateway)
	if !ok {
		return fmt.Errorf("expected network/v1api20240301/storage/VirtualNetworkGateway but received %T instead", hub)
	}

	return gateway.AssignProperties_From_VirtualNetworkGateway(source)
}

// ConvertTo populates the provided hub VirtualNetworkGateway from our VirtualNetworkGateway
func (gateway *VirtualNetworkGateway) ConvertTo(hub conversion.Hub) error {
	destination, ok := hub.(*v20240301s.VirtualNetworkGateway)
	if !ok {
		return fmt.Errorf("expected network/v1api20240301/storage/VirtualNetworkGateway but received %T instead", hub)
	}

	return gateway.AssignProperties_To_VirtualNetworkGateway(destination)
}

var _ configmaps.Exporter = &VirtualNetworkGateway{}

// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property
func (gateway *VirtualNetworkGateway) ConfigMapDestinationExpressions() []*core.DestinationExpression {
	if gateway.Spec.OperatorSpec == nil {
		return nil
	}
	return gateway.Spec.OperatorSpec.ConfigMapExpressions
}

var _ secrets.Exporter = &VirtualNetworkGateway{}

// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property
func (gateway *VirtualNetworkGateway) SecretDestinationExpressions() []*core.DestinationExpression {
	if gateway.Spec.OperatorSpec == nil {
		return nil
	}
	return gateway.Spec.OperatorSpec.SecretExpressions
}

var _ genruntime.KubernetesResource = &VirtualNetworkGateway{}

// AzureName returns the Azure name of the resource
func (gateway *VirtualNetworkGateway) AzureName() string {
	return gateway.Spec.AzureName
}

// GetAPIVersion returns the ARM API version of the resource. This is always "2020-11-01"
func (gateway VirtualNetworkGateway) GetAPIVersion() string {
	return "2020-11-01"
}

// GetResourceScope returns the scope of the resource
func (gateway *VirtualNetworkGateway) GetResourceScope() genruntime.ResourceScope {
	return genruntime.ResourceScopeResourceGroup
}

// GetSpec returns the specification of this resource
func (gateway *VirtualNetworkGateway) GetSpec() genruntime.ConvertibleSpec {
	return &gateway.Spec
}

// GetStatus returns the status of this resource
func (gateway *VirtualNetworkGateway) GetStatus() genruntime.ConvertibleStatus {
	return &gateway.Status
}

// GetSupportedOperations returns the operations supported by the resource
func (gateway *VirtualNetworkGateway) GetSupportedOperations() []genruntime.ResourceOperation {
	return []genruntime.ResourceOperation{
		genruntime.ResourceOperationDelete,
		genruntime.ResourceOperationGet,
		genruntime.ResourceOperationPut,
	}
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.Network/virtualNetworkGateways"
func (gateway *VirtualNetworkGateway) GetType() string {
	return "Microsoft.Network/virtualNetworkGateways"
}

// NewEmptyStatus returns a new empty (blank) status
func (gateway *VirtualNetworkGateway) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &VirtualNetworkGateway_STATUS{}
}

// Owner returns the ResourceReference of the owner
func (gateway *VirtualNetworkGateway) Owner() *genruntime.ResourceReference {
	if gateway.Spec.Owner == nil {
		return nil
	}

	group, kind := genruntime.LookupOwnerGroupKind(gateway.Spec)
	return gateway.Spec.Owner.AsResourceReference(group, kind)
}

// SetStatus sets the status of this resource
func (gateway *VirtualNetworkGateway) SetStatus(status genruntime.ConvertibleStatus) error {
	// If we have exactly the right type of status, assign it
	if st, ok := status.(*VirtualNetworkGateway_STATUS); ok {
		gateway.Status = *st
		return nil
	}

	// Convert status to required version
	var st VirtualNetworkGateway_STATUS
	err := status.ConvertStatusTo(&st)
	if err != nil {
		return eris.Wrap(err, "failed to convert status")
	}

	gateway.Status = st
	return nil
}

// AssignProperties_From_VirtualNetworkGateway populates our VirtualNetworkGateway from the provided source VirtualNetworkGateway
func (gateway *VirtualNetworkGateway) AssignProperties_From_VirtualNetworkGateway(source *v20240301s.VirtualNetworkGateway) error {

	// ObjectMeta
	gateway.ObjectMeta = *source.ObjectMeta.DeepCopy()

	// Spec
	var spec VirtualNetworkGateway_Spec
	err := spec.AssignProperties_From_VirtualNetworkGateway_Spec(&source.Spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGateway_Spec() to populate field Spec")
	}
	gateway.Spec = spec

	// Status
	var status VirtualNetworkGateway_STATUS
	err = status.AssignProperties_From_VirtualNetworkGateway_STATUS(&source.Status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGateway_STATUS() to populate field Status")
	}
	gateway.Status = status

	// Invoke the augmentConversionForVirtualNetworkGateway interface (if implemented) to customize the conversion
	var gatewayAsAny any = gateway
	if augmentedGateway, ok := gatewayAsAny.(augmentConversionForVirtualNetworkGateway); ok {
		err := augmentedGateway.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGateway populates the provided destination VirtualNetworkGateway from our VirtualNetworkGateway
func (gateway *VirtualNetworkGateway) AssignProperties_To_VirtualNetworkGateway(destination *v20240301s.VirtualNetworkGateway) error {

	// ObjectMeta
	destination.ObjectMeta = *gateway.ObjectMeta.DeepCopy()

	// Spec
	var spec v20240301s.VirtualNetworkGateway_Spec
	err := gateway.Spec.AssignProperties_To_VirtualNetworkGateway_Spec(&spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGateway_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status v20240301s.VirtualNetworkGateway_STATUS
	err = gateway.Status.AssignProperties_To_VirtualNetworkGateway_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGateway_STATUS() to populate field Status")
	}
	destination.Status = status

	// Invoke the augmentConversionForVirtualNetworkGateway interface (if implemented) to customize the conversion
	var gatewayAsAny any = gateway
	if augmentedGateway, ok := gatewayAsAny.(augmentConversionForVirtualNetworkGateway); ok {
		err := augmentedGateway.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (gateway *VirtualNetworkGateway) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: gateway.Spec.OriginalVersion,
		Kind:    "VirtualNetworkGateway",
	}
}

// +kubebuilder:object:root=true
// Storage version of v1api20201101.VirtualNetworkGateway
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2020-11-01/virtualNetworkGateway.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}
type VirtualNetworkGatewayList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []VirtualNetworkGateway `json:"items"`
}

type augmentConversionForVirtualNetworkGateway interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGateway) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGateway) error
}

// Storage version of v1api20201101.VirtualNetworkGateway_Spec
type VirtualNetworkGateway_Spec struct {
	ActiveActive *bool `json:"activeActive,omitempty"`

	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName              string                                 `json:"azureName,omitempty"`
	BgpSettings            *BgpSettings                           `json:"bgpSettings,omitempty"`
	CustomRoutes           *AddressSpace                          `json:"customRoutes,omitempty"`
	EnableBgp              *bool                                  `json:"enableBgp,omitempty"`
	EnableDnsForwarding    *bool                                  `json:"enableDnsForwarding,omitempty"`
	EnablePrivateIpAddress *bool                                  `json:"enablePrivateIpAddress,omitempty"`
	ExtendedLocation       *ExtendedLocation                      `json:"extendedLocation,omitempty"`
	GatewayDefaultSite     *SubResource                           `json:"gatewayDefaultSite,omitempty"`
	GatewayType            *string                                `json:"gatewayType,omitempty"`
	IpConfigurations       []VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"`
	Location               *string                                `json:"location,omitempty"`
	OperatorSpec           *VirtualNetworkGatewayOperatorSpec     `json:"operatorSpec,omitempty"`
	OriginalVersion        string                                 `json:"originalVersion,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner       *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`
	PropertyBag genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
	Sku         *VirtualNetworkGatewaySku          `json:"sku,omitempty"`
	Tags        map[string]string                  `json:"tags,omitempty"`

	// VNetExtendedLocationResourceReference: Customer vnet resource id. VirtualNetworkGateway of type local gateway is
	// associated with the customer vnet.
	VNetExtendedLocationResourceReference *genruntime.ResourceReference `armReference:"VNetExtendedLocationResourceId" json:"vNetExtendedLocationResourceReference,omitempty"`
	VpnClientConfiguration                *VpnClientConfiguration       `json:"vpnClientConfiguration,omitempty"`
	VpnGatewayGeneration                  *string                       `json:"vpnGatewayGeneration,omitempty"`
	VpnType                               *string                       `json:"vpnType,omitempty"`
}

var _ genruntime.ConvertibleSpec = &VirtualNetworkGateway_Spec{}

// ConvertSpecFrom populates our VirtualNetworkGateway_Spec from the provided source
func (gateway *VirtualNetworkGateway_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*v20240301s.VirtualNetworkGateway_Spec)
	if ok {
		// Populate our instance from source
		return gateway.AssignProperties_From_VirtualNetworkGateway_Spec(src)
	}

	// Convert to an intermediate form
	src = &v20240301s.VirtualNetworkGateway_Spec{}
	err := src.ConvertSpecFrom(source)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
	}

	// Update our instance from src
	err = gateway.AssignProperties_From_VirtualNetworkGateway_Spec(src)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()")
	}

	return nil
}

// ConvertSpecTo populates the provided destination from our VirtualNetworkGateway_Spec
func (gateway *VirtualNetworkGateway_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*v20240301s.VirtualNetworkGateway_Spec)
	if ok {
		// Populate destination from our instance
		return gateway.AssignProperties_To_VirtualNetworkGateway_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &v20240301s.VirtualNetworkGateway_Spec{}
	err := gateway.AssignProperties_To_VirtualNetworkGateway_Spec(dst)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()")
	}

	// Update dst from our instance
	err = dst.ConvertSpecTo(destination)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertSpecTo()")
	}

	return nil
}

// AssignProperties_From_VirtualNetworkGateway_Spec populates our VirtualNetworkGateway_Spec from the provided source VirtualNetworkGateway_Spec
func (gateway *VirtualNetworkGateway_Spec) AssignProperties_From_VirtualNetworkGateway_Spec(source *v20240301s.VirtualNetworkGateway_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ActiveActive
	if source.ActiveActive != nil {
		activeActive := *source.ActiveActive
		gateway.ActiveActive = &activeActive
	} else {
		gateway.ActiveActive = nil
	}

	// AdminState
	if source.AdminState != nil {
		propertyBag.Add("AdminState", *source.AdminState)
	} else {
		propertyBag.Remove("AdminState")
	}

	// AllowRemoteVnetTraffic
	if source.AllowRemoteVnetTraffic != nil {
		propertyBag.Add("AllowRemoteVnetTraffic", *source.AllowRemoteVnetTraffic)
	} else {
		propertyBag.Remove("AllowRemoteVnetTraffic")
	}

	// AllowVirtualWanTraffic
	if source.AllowVirtualWanTraffic != nil {
		propertyBag.Add("AllowVirtualWanTraffic", *source.AllowVirtualWanTraffic)
	} else {
		propertyBag.Remove("AllowVirtualWanTraffic")
	}

	// AutoScaleConfiguration
	if source.AutoScaleConfiguration != nil {
		propertyBag.Add("AutoScaleConfiguration", *source.AutoScaleConfiguration)
	} else {
		propertyBag.Remove("AutoScaleConfiguration")
	}

	// AzureName
	gateway.AzureName = source.AzureName

	// BgpSettings
	if source.BgpSettings != nil {
		var bgpSetting BgpSettings
		err := bgpSetting.AssignProperties_From_BgpSettings(source.BgpSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BgpSettings() to populate field BgpSettings")
		}
		gateway.BgpSettings = &bgpSetting
	} else {
		gateway.BgpSettings = nil
	}

	// CustomRoutes
	if source.CustomRoutes != nil {
		var customRoute AddressSpace
		err := customRoute.AssignProperties_From_AddressSpace(source.CustomRoutes)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AddressSpace() to populate field CustomRoutes")
		}
		gateway.CustomRoutes = &customRoute
	} else {
		gateway.CustomRoutes = nil
	}

	// DisableIPSecReplayProtection
	if source.DisableIPSecReplayProtection != nil {
		propertyBag.Add("DisableIPSecReplayProtection", *source.DisableIPSecReplayProtection)
	} else {
		propertyBag.Remove("DisableIPSecReplayProtection")
	}

	// EnableBgp
	if source.EnableBgp != nil {
		enableBgp := *source.EnableBgp
		gateway.EnableBgp = &enableBgp
	} else {
		gateway.EnableBgp = nil
	}

	// EnableBgpRouteTranslationForNat
	if source.EnableBgpRouteTranslationForNat != nil {
		propertyBag.Add("EnableBgpRouteTranslationForNat", *source.EnableBgpRouteTranslationForNat)
	} else {
		propertyBag.Remove("EnableBgpRouteTranslationForNat")
	}

	// EnableDnsForwarding
	if source.EnableDnsForwarding != nil {
		enableDnsForwarding := *source.EnableDnsForwarding
		gateway.EnableDnsForwarding = &enableDnsForwarding
	} else {
		gateway.EnableDnsForwarding = nil
	}

	// EnablePrivateIpAddress
	if source.EnablePrivateIpAddress != nil {
		enablePrivateIpAddress := *source.EnablePrivateIpAddress
		gateway.EnablePrivateIpAddress = &enablePrivateIpAddress
	} else {
		gateway.EnablePrivateIpAddress = nil
	}

	// ExtendedLocation
	if source.ExtendedLocation != nil {
		var extendedLocationStash v20220701s.ExtendedLocation
		err := extendedLocationStash.AssignProperties_From_ExtendedLocation(source.ExtendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocationStash from ExtendedLocation")
		}
		var extendedLocation ExtendedLocation
		err = extendedLocation.AssignProperties_From_ExtendedLocation(&extendedLocationStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocation from ExtendedLocationStash")
		}
		gateway.ExtendedLocation = &extendedLocation
	} else {
		gateway.ExtendedLocation = nil
	}

	// GatewayDefaultSite
	if source.GatewayDefaultSite != nil {
		var subResourceStash v20220701s.SubResource
		err := subResourceStash.AssignProperties_From_SubResource(source.GatewayDefaultSite)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field SubResourceStash from GatewayDefaultSite")
		}
		var gatewayDefaultSite SubResource
		err = gatewayDefaultSite.AssignProperties_From_SubResource(&subResourceStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field GatewayDefaultSite from SubResourceStash")
		}
		gateway.GatewayDefaultSite = &gatewayDefaultSite
	} else {
		gateway.GatewayDefaultSite = nil
	}

	// GatewayType
	gateway.GatewayType = genruntime.ClonePointerToString(source.GatewayType)

	// Identity
	if source.Identity != nil {
		propertyBag.Add("Identity", *source.Identity)
	} else {
		propertyBag.Remove("Identity")
	}

	// IpConfigurations
	if source.IpConfigurations != nil {
		ipConfigurationList := make([]VirtualNetworkGatewayIPConfiguration, len(source.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range source.IpConfigurations {
			var ipConfiguration VirtualNetworkGatewayIPConfiguration
			err := ipConfiguration.AssignProperties_From_VirtualNetworkGatewayIPConfiguration(&ipConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayIPConfiguration() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		gateway.IpConfigurations = ipConfigurationList
	} else {
		gateway.IpConfigurations = nil
	}

	// Location
	gateway.Location = genruntime.ClonePointerToString(source.Location)

	// NatRules
	if len(source.NatRules) > 0 {
		propertyBag.Add("NatRules", source.NatRules)
	} else {
		propertyBag.Remove("NatRules")
	}

	// OperatorSpec
	if source.OperatorSpec != nil {
		var operatorSpec VirtualNetworkGatewayOperatorSpec
		err := operatorSpec.AssignProperties_From_VirtualNetworkGatewayOperatorSpec(source.OperatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayOperatorSpec() to populate field OperatorSpec")
		}
		gateway.OperatorSpec = &operatorSpec
	} else {
		gateway.OperatorSpec = nil
	}

	// OriginalVersion
	gateway.OriginalVersion = source.OriginalVersion

	// Owner
	if source.Owner != nil {
		owner := source.Owner.Copy()
		gateway.Owner = &owner
	} else {
		gateway.Owner = nil
	}

	// ResiliencyModel
	if source.ResiliencyModel != nil {
		propertyBag.Add("ResiliencyModel", *source.ResiliencyModel)
	} else {
		propertyBag.Remove("ResiliencyModel")
	}

	// Sku
	if source.Sku != nil {
		var sku VirtualNetworkGatewaySku
		err := sku.AssignProperties_From_VirtualNetworkGatewaySku(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewaySku() to populate field Sku")
		}
		gateway.Sku = &sku
	} else {
		gateway.Sku = nil
	}

	// Tags
	gateway.Tags = genruntime.CloneMapOfStringToString(source.Tags)

	// VNetExtendedLocationResourceReference
	if source.VNetExtendedLocationResourceReference != nil {
		vNetExtendedLocationResourceReference := source.VNetExtendedLocationResourceReference.Copy()
		gateway.VNetExtendedLocationResourceReference = &vNetExtendedLocationResourceReference
	} else {
		gateway.VNetExtendedLocationResourceReference = nil
	}

	// VirtualNetworkGatewayPolicyGroups
	if len(source.VirtualNetworkGatewayPolicyGroups) > 0 {
		propertyBag.Add("VirtualNetworkGatewayPolicyGroups", source.VirtualNetworkGatewayPolicyGroups)
	} else {
		propertyBag.Remove("VirtualNetworkGatewayPolicyGroups")
	}

	// VpnClientConfiguration
	if source.VpnClientConfiguration != nil {
		var vpnClientConfiguration VpnClientConfiguration
		err := vpnClientConfiguration.AssignProperties_From_VpnClientConfiguration(source.VpnClientConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VpnClientConfiguration() to populate field VpnClientConfiguration")
		}
		gateway.VpnClientConfiguration = &vpnClientConfiguration
	} else {
		gateway.VpnClientConfiguration = nil
	}

	// VpnGatewayGeneration
	gateway.VpnGatewayGeneration = genruntime.ClonePointerToString(source.VpnGatewayGeneration)

	// VpnType
	gateway.VpnType = genruntime.ClonePointerToString(source.VpnType)

	// Update the property bag
	if len(propertyBag) > 0 {
		gateway.PropertyBag = propertyBag
	} else {
		gateway.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGateway_Spec interface (if implemented) to customize the conversion
	var gatewayAsAny any = gateway
	if augmentedGateway, ok := gatewayAsAny.(augmentConversionForVirtualNetworkGateway_Spec); ok {
		err := augmentedGateway.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGateway_Spec populates the provided destination VirtualNetworkGateway_Spec from our VirtualNetworkGateway_Spec
func (gateway *VirtualNetworkGateway_Spec) AssignProperties_To_VirtualNetworkGateway_Spec(destination *v20240301s.VirtualNetworkGateway_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(gateway.PropertyBag)

	// ActiveActive
	if gateway.ActiveActive != nil {
		activeActive := *gateway.ActiveActive
		destination.ActiveActive = &activeActive
	} else {
		destination.ActiveActive = nil
	}

	// AdminState
	if propertyBag.Contains("AdminState") {
		var adminState string
		err := propertyBag.Pull("AdminState", &adminState)
		if err != nil {
			return eris.Wrap(err, "pulling 'AdminState' from propertyBag")
		}

		destination.AdminState = &adminState
	} else {
		destination.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if propertyBag.Contains("AllowRemoteVnetTraffic") {
		var allowRemoteVnetTraffic bool
		err := propertyBag.Pull("AllowRemoteVnetTraffic", &allowRemoteVnetTraffic)
		if err != nil {
			return eris.Wrap(err, "pulling 'AllowRemoteVnetTraffic' from propertyBag")
		}

		destination.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		destination.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if propertyBag.Contains("AllowVirtualWanTraffic") {
		var allowVirtualWanTraffic bool
		err := propertyBag.Pull("AllowVirtualWanTraffic", &allowVirtualWanTraffic)
		if err != nil {
			return eris.Wrap(err, "pulling 'AllowVirtualWanTraffic' from propertyBag")
		}

		destination.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		destination.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if propertyBag.Contains("AutoScaleConfiguration") {
		var autoScaleConfiguration v20240301s.VirtualNetworkGatewayAutoScaleConfiguration
		err := propertyBag.Pull("AutoScaleConfiguration", &autoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "pulling 'AutoScaleConfiguration' from propertyBag")
		}

		destination.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		destination.AutoScaleConfiguration = nil
	}

	// AzureName
	destination.AzureName = gateway.AzureName

	// BgpSettings
	if gateway.BgpSettings != nil {
		var bgpSetting v20240301s.BgpSettings
		err := gateway.BgpSettings.AssignProperties_To_BgpSettings(&bgpSetting)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BgpSettings() to populate field BgpSettings")
		}
		destination.BgpSettings = &bgpSetting
	} else {
		destination.BgpSettings = nil
	}

	// CustomRoutes
	if gateway.CustomRoutes != nil {
		var customRoute v20240301s.AddressSpace
		err := gateway.CustomRoutes.AssignProperties_To_AddressSpace(&customRoute)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AddressSpace() to populate field CustomRoutes")
		}
		destination.CustomRoutes = &customRoute
	} else {
		destination.CustomRoutes = nil
	}

	// DisableIPSecReplayProtection
	if propertyBag.Contains("DisableIPSecReplayProtection") {
		var disableIPSecReplayProtection bool
		err := propertyBag.Pull("DisableIPSecReplayProtection", &disableIPSecReplayProtection)
		if err != nil {
			return eris.Wrap(err, "pulling 'DisableIPSecReplayProtection' from propertyBag")
		}

		destination.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		destination.DisableIPSecReplayProtection = nil
	}

	// EnableBgp
	if gateway.EnableBgp != nil {
		enableBgp := *gateway.EnableBgp
		destination.EnableBgp = &enableBgp
	} else {
		destination.EnableBgp = nil
	}

	// EnableBgpRouteTranslationForNat
	if propertyBag.Contains("EnableBgpRouteTranslationForNat") {
		var enableBgpRouteTranslationForNat bool
		err := propertyBag.Pull("EnableBgpRouteTranslationForNat", &enableBgpRouteTranslationForNat)
		if err != nil {
			return eris.Wrap(err, "pulling 'EnableBgpRouteTranslationForNat' from propertyBag")
		}

		destination.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
	} else {
		destination.EnableBgpRouteTranslationForNat = nil
	}

	// EnableDnsForwarding
	if gateway.EnableDnsForwarding != nil {
		enableDnsForwarding := *gateway.EnableDnsForwarding
		destination.EnableDnsForwarding = &enableDnsForwarding
	} else {
		destination.EnableDnsForwarding = nil
	}

	// EnablePrivateIpAddress
	if gateway.EnablePrivateIpAddress != nil {
		enablePrivateIpAddress := *gateway.EnablePrivateIpAddress
		destination.EnablePrivateIpAddress = &enablePrivateIpAddress
	} else {
		destination.EnablePrivateIpAddress = nil
	}

	// ExtendedLocation
	if gateway.ExtendedLocation != nil {
		var extendedLocationStash v20220701s.ExtendedLocation
		err := gateway.ExtendedLocation.AssignProperties_To_ExtendedLocation(&extendedLocationStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocationStash from ExtendedLocation")
		}
		var extendedLocation v20240301s.ExtendedLocation
		err = extendedLocationStash.AssignProperties_To_ExtendedLocation(&extendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocation from ExtendedLocationStash")
		}
		destination.ExtendedLocation = &extendedLocation
	} else {
		destination.ExtendedLocation = nil
	}

	// GatewayDefaultSite
	if gateway.GatewayDefaultSite != nil {
		var subResourceStash v20220701s.SubResource
		err := gateway.GatewayDefaultSite.AssignProperties_To_SubResource(&subResourceStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field SubResourceStash from GatewayDefaultSite")
		}
		var gatewayDefaultSite v20240301s.SubResource
		err = subResourceStash.AssignProperties_To_SubResource(&gatewayDefaultSite)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field GatewayDefaultSite from SubResourceStash")
		}
		destination.GatewayDefaultSite = &gatewayDefaultSite
	} else {
		destination.GatewayDefaultSite = nil
	}

	// GatewayType
	destination.GatewayType = genruntime.ClonePointerToString(gateway.GatewayType)

	// Identity
	if propertyBag.Contains("Identity") {
		var identity v20240301s.ManagedServiceIdentity
		err := propertyBag.Pull("Identity", &identity)
		if err != nil {
			return eris.Wrap(err, "pulling 'Identity' from propertyBag")
		}

		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

	// IpConfigurations
	if gateway.IpConfigurations != nil {
		ipConfigurationList := make([]v20240301s.VirtualNetworkGatewayIPConfiguration, len(gateway.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range gateway.IpConfigurations {
			var ipConfiguration v20240301s.VirtualNetworkGatewayIPConfiguration
			err := ipConfigurationItem.AssignProperties_To_VirtualNetworkGatewayIPConfiguration(&ipConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayIPConfiguration() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		destination.IpConfigurations = ipConfigurationList
	} else {
		destination.IpConfigurations = nil
	}

	// Location
	destination.Location = genruntime.ClonePointerToString(gateway.Location)

	// NatRules
	if propertyBag.Contains("NatRules") {
		var natRule []v20240301s.VirtualNetworkGatewayNatRule
		err := propertyBag.Pull("NatRules", &natRule)
		if err != nil {
			return eris.Wrap(err, "pulling 'NatRules' from propertyBag")
		}

		destination.NatRules = natRule
	} else {
		destination.NatRules = nil
	}

	// OperatorSpec
	if gateway.OperatorSpec != nil {
		var operatorSpec v20240301s.VirtualNetworkGatewayOperatorSpec
		err := gateway.OperatorSpec.AssignProperties_To_VirtualNetworkGatewayOperatorSpec(&operatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayOperatorSpec() to populate field OperatorSpec")
		}
		destination.OperatorSpec = &operatorSpec
	} else {
		destination.OperatorSpec = nil
	}

	// OriginalVersion
	destination.OriginalVersion = gateway.OriginalVersion

	// Owner
	if gateway.Owner != nil {
		owner := gateway.Owner.Copy()
		destination.Owner = &owner
	} else {
		destination.Owner = nil
	}

	// ResiliencyModel
	if propertyBag.Contains("ResiliencyModel") {
		var resiliencyModel string
		err := propertyBag.Pull("ResiliencyModel", &resiliencyModel)
		if err != nil {
			return eris.Wrap(err, "pulling 'ResiliencyModel' from propertyBag")
		}

		destination.ResiliencyModel = &resiliencyModel
	} else {
		destination.ResiliencyModel = nil
	}

	// Sku
	if gateway.Sku != nil {
		var sku v20240301s.VirtualNetworkGatewaySku
		err := gateway.Sku.AssignProperties_To_VirtualNetworkGatewaySku(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewaySku() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

	// Tags
	destination.Tags = genruntime.CloneMapOfStringToString(gateway.Tags)

	// VNetExtendedLocationResourceReference
	if gateway.VNetExtendedLocationResourceReference != nil {
		vNetExtendedLocationResourceReference := gateway.VNetExtendedLocationResourceReference.Copy()
		destination.VNetExtendedLocationResourceReference = &vNetExtendedLocationResourceReference
	} else {
		destination.VNetExtendedLocationResourceReference = nil
	}

	// VirtualNetworkGatewayPolicyGroups
	if propertyBag.Contains("VirtualNetworkGatewayPolicyGroups") {
		var virtualNetworkGatewayPolicyGroup []v20240301s.VirtualNetworkGatewayPolicyGroup
		err := propertyBag.Pull("VirtualNetworkGatewayPolicyGroups", &virtualNetworkGatewayPolicyGroup)
		if err != nil {
			return eris.Wrap(err, "pulling 'VirtualNetworkGatewayPolicyGroups' from propertyBag")
		}

		destination.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroup
	} else {
		destination.VirtualNetworkGatewayPolicyGroups = nil
	}

	// VpnClientConfiguration
	if gateway.VpnClientConfiguration != nil {
		var vpnClientConfiguration v20240301s.VpnClientConfiguration
		err := gateway.VpnClientConfiguration.AssignProperties_To_VpnClientConfiguration(&vpnClientConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VpnClientConfiguration() to populate field VpnClientConfiguration")
		}
		destination.VpnClientConfiguration = &vpnClientConfiguration
	} else {
		destination.VpnClientConfiguration = nil
	}

	// VpnGatewayGeneration
	destination.VpnGatewayGeneration = genruntime.ClonePointerToString(gateway.VpnGatewayGeneration)

	// VpnType
	destination.VpnType = genruntime.ClonePointerToString(gateway.VpnType)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGateway_Spec interface (if implemented) to customize the conversion
	var gatewayAsAny any = gateway
	if augmentedGateway, ok := gatewayAsAny.(augmentConversionForVirtualNetworkGateway_Spec); ok {
		err := augmentedGateway.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VirtualNetworkGateway_STATUS
// A common class for general resource information.
type VirtualNetworkGateway_STATUS struct {
	ActiveActive                   *bool                                         `json:"activeActive,omitempty"`
	BgpSettings                    *BgpSettings_STATUS                           `json:"bgpSettings,omitempty"`
	Conditions                     []conditions.Condition                        `json:"conditions,omitempty"`
	CustomRoutes                   *AddressSpace_STATUS                          `json:"customRoutes,omitempty"`
	EnableBgp                      *bool                                         `json:"enableBgp,omitempty"`
	EnableDnsForwarding            *bool                                         `json:"enableDnsForwarding,omitempty"`
	EnablePrivateIpAddress         *bool                                         `json:"enablePrivateIpAddress,omitempty"`
	Etag                           *string                                       `json:"etag,omitempty"`
	ExtendedLocation               *ExtendedLocation_STATUS                      `json:"extendedLocation,omitempty"`
	GatewayDefaultSite             *SubResource_STATUS                           `json:"gatewayDefaultSite,omitempty"`
	GatewayType                    *string                                       `json:"gatewayType,omitempty"`
	Id                             *string                                       `json:"id,omitempty"`
	InboundDnsForwardingEndpoint   *string                                       `json:"inboundDnsForwardingEndpoint,omitempty"`
	IpConfigurations               []VirtualNetworkGatewayIPConfiguration_STATUS `json:"ipConfigurations,omitempty"`
	Location                       *string                                       `json:"location,omitempty"`
	Name                           *string                                       `json:"name,omitempty"`
	PropertyBag                    genruntime.PropertyBag                        `json:"$propertyBag,omitempty"`
	ProvisioningState              *string                                       `json:"provisioningState,omitempty"`
	ResourceGuid                   *string                                       `json:"resourceGuid,omitempty"`
	Sku                            *VirtualNetworkGatewaySku_STATUS              `json:"sku,omitempty"`
	Tags                           map[string]string                             `json:"tags,omitempty"`
	Type                           *string                                       `json:"type,omitempty"`
	VNetExtendedLocationResourceId *string                                       `json:"vNetExtendedLocationResourceId,omitempty"`
	VpnClientConfiguration         *VpnClientConfiguration_STATUS                `json:"vpnClientConfiguration,omitempty"`
	VpnGatewayGeneration           *string                                       `json:"vpnGatewayGeneration,omitempty"`
	VpnType                        *string                                       `json:"vpnType,omitempty"`
}

var _ genruntime.ConvertibleStatus = &VirtualNetworkGateway_STATUS{}

// ConvertStatusFrom populates our VirtualNetworkGateway_STATUS from the provided source
func (gateway *VirtualNetworkGateway_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*v20240301s.VirtualNetworkGateway_STATUS)
	if ok {
		// Populate our instance from source
		return gateway.AssignProperties_From_VirtualNetworkGateway_STATUS(src)
	}

	// Convert to an intermediate form
	src = &v20240301s.VirtualNetworkGateway_STATUS{}
	err := src.ConvertStatusFrom(source)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
	}

	// Update our instance from src
	err = gateway.AssignProperties_From_VirtualNetworkGateway_STATUS(src)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()")
	}

	return nil
}

// ConvertStatusTo populates the provided destination from our VirtualNetworkGateway_STATUS
func (gateway *VirtualNetworkGateway_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*v20240301s.VirtualNetworkGateway_STATUS)
	if ok {
		// Populate destination from our instance
		return gateway.AssignProperties_To_VirtualNetworkGateway_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &v20240301s.VirtualNetworkGateway_STATUS{}
	err := gateway.AssignProperties_To_VirtualNetworkGateway_STATUS(dst)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()")
	}

	// Update dst from our instance
	err = dst.ConvertStatusTo(destination)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertStatusTo()")
	}

	return nil
}

// AssignProperties_From_VirtualNetworkGateway_STATUS populates our VirtualNetworkGateway_STATUS from the provided source VirtualNetworkGateway_STATUS
func (gateway *VirtualNetworkGateway_STATUS) AssignProperties_From_VirtualNetworkGateway_STATUS(source *v20240301s.VirtualNetworkGateway_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ActiveActive
	if source.ActiveActive != nil {
		activeActive := *source.ActiveActive
		gateway.ActiveActive = &activeActive
	} else {
		gateway.ActiveActive = nil
	}

	// AdminState
	if source.AdminState != nil {
		propertyBag.Add("AdminState", *source.AdminState)
	} else {
		propertyBag.Remove("AdminState")
	}

	// AllowRemoteVnetTraffic
	if source.AllowRemoteVnetTraffic != nil {
		propertyBag.Add("AllowRemoteVnetTraffic", *source.AllowRemoteVnetTraffic)
	} else {
		propertyBag.Remove("AllowRemoteVnetTraffic")
	}

	// AllowVirtualWanTraffic
	if source.AllowVirtualWanTraffic != nil {
		propertyBag.Add("AllowVirtualWanTraffic", *source.AllowVirtualWanTraffic)
	} else {
		propertyBag.Remove("AllowVirtualWanTraffic")
	}

	// AutoScaleConfiguration
	if source.AutoScaleConfiguration != nil {
		propertyBag.Add("AutoScaleConfiguration", *source.AutoScaleConfiguration)
	} else {
		propertyBag.Remove("AutoScaleConfiguration")
	}

	// BgpSettings
	if source.BgpSettings != nil {
		var bgpSetting BgpSettings_STATUS
		err := bgpSetting.AssignProperties_From_BgpSettings_STATUS(source.BgpSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BgpSettings_STATUS() to populate field BgpSettings")
		}
		gateway.BgpSettings = &bgpSetting
	} else {
		gateway.BgpSettings = nil
	}

	// Conditions
	gateway.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)

	// CustomRoutes
	if source.CustomRoutes != nil {
		var customRoute AddressSpace_STATUS
		err := customRoute.AssignProperties_From_AddressSpace_STATUS(source.CustomRoutes)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AddressSpace_STATUS() to populate field CustomRoutes")
		}
		gateway.CustomRoutes = &customRoute
	} else {
		gateway.CustomRoutes = nil
	}

	// DisableIPSecReplayProtection
	if source.DisableIPSecReplayProtection != nil {
		propertyBag.Add("DisableIPSecReplayProtection", *source.DisableIPSecReplayProtection)
	} else {
		propertyBag.Remove("DisableIPSecReplayProtection")
	}

	// EnableBgp
	if source.EnableBgp != nil {
		enableBgp := *source.EnableBgp
		gateway.EnableBgp = &enableBgp
	} else {
		gateway.EnableBgp = nil
	}

	// EnableBgpRouteTranslationForNat
	if source.EnableBgpRouteTranslationForNat != nil {
		propertyBag.Add("EnableBgpRouteTranslationForNat", *source.EnableBgpRouteTranslationForNat)
	} else {
		propertyBag.Remove("EnableBgpRouteTranslationForNat")
	}

	// EnableDnsForwarding
	if source.EnableDnsForwarding != nil {
		enableDnsForwarding := *source.EnableDnsForwarding
		gateway.EnableDnsForwarding = &enableDnsForwarding
	} else {
		gateway.EnableDnsForwarding = nil
	}

	// EnablePrivateIpAddress
	if source.EnablePrivateIpAddress != nil {
		enablePrivateIpAddress := *source.EnablePrivateIpAddress
		gateway.EnablePrivateIpAddress = &enablePrivateIpAddress
	} else {
		gateway.EnablePrivateIpAddress = nil
	}

	// Etag
	gateway.Etag = genruntime.ClonePointerToString(source.Etag)

	// ExtendedLocation
	if source.ExtendedLocation != nil {
		var extendedLocationSTATUSStash v20220701s.ExtendedLocation_STATUS
		err := extendedLocationSTATUSStash.AssignProperties_From_ExtendedLocation_STATUS(source.ExtendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation_STATUSStash from ExtendedLocation")
		}
		var extendedLocation ExtendedLocation_STATUS
		err = extendedLocation.AssignProperties_From_ExtendedLocation_STATUS(&extendedLocationSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation from ExtendedLocation_STATUSStash")
		}
		gateway.ExtendedLocation = &extendedLocation
	} else {
		gateway.ExtendedLocation = nil
	}

	// GatewayDefaultSite
	if source.GatewayDefaultSite != nil {
		var subResourceSTATUSStash v20240101s.SubResource_STATUS
		err := subResourceSTATUSStash.AssignProperties_From_SubResource_STATUS(source.GatewayDefaultSite)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash from GatewayDefaultSite")
		}
		var subResourceSTATUSStashLocal v20220701s.SubResource_STATUS
		err = subResourceSTATUSStashLocal.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash")
		}
		var gatewayDefaultSite SubResource_STATUS
		err = gatewayDefaultSite.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field GatewayDefaultSite from SubResource_STATUSStash")
		}
		gateway.GatewayDefaultSite = &gatewayDefaultSite
	} else {
		gateway.GatewayDefaultSite = nil
	}

	// GatewayType
	gateway.GatewayType = genruntime.ClonePointerToString(source.GatewayType)

	// Id
	gateway.Id = genruntime.ClonePointerToString(source.Id)

	// Identity
	if source.Identity != nil {
		propertyBag.Add("Identity", *source.Identity)
	} else {
		propertyBag.Remove("Identity")
	}

	// InboundDnsForwardingEndpoint
	gateway.InboundDnsForwardingEndpoint = genruntime.ClonePointerToString(source.InboundDnsForwardingEndpoint)

	// IpConfigurations
	if source.IpConfigurations != nil {
		ipConfigurationList := make([]VirtualNetworkGatewayIPConfiguration_STATUS, len(source.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range source.IpConfigurations {
			var ipConfiguration VirtualNetworkGatewayIPConfiguration_STATUS
			err := ipConfiguration.AssignProperties_From_VirtualNetworkGatewayIPConfiguration_STATUS(&ipConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayIPConfiguration_STATUS() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		gateway.IpConfigurations = ipConfigurationList
	} else {
		gateway.IpConfigurations = nil
	}

	// Location
	gateway.Location = genruntime.ClonePointerToString(source.Location)

	// Name
	gateway.Name = genruntime.ClonePointerToString(source.Name)

	// NatRules
	if len(source.NatRules) > 0 {
		propertyBag.Add("NatRules", source.NatRules)
	} else {
		propertyBag.Remove("NatRules")
	}

	// ProvisioningState
	gateway.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

	// ResiliencyModel
	if source.ResiliencyModel != nil {
		propertyBag.Add("ResiliencyModel", *source.ResiliencyModel)
	} else {
		propertyBag.Remove("ResiliencyModel")
	}

	// ResourceGuid
	gateway.ResourceGuid = genruntime.ClonePointerToString(source.ResourceGuid)

	// Sku
	if source.Sku != nil {
		var sku VirtualNetworkGatewaySku_STATUS
		err := sku.AssignProperties_From_VirtualNetworkGatewaySku_STATUS(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewaySku_STATUS() to populate field Sku")
		}
		gateway.Sku = &sku
	} else {
		gateway.Sku = nil
	}

	// Tags
	gateway.Tags = genruntime.CloneMapOfStringToString(source.Tags)

	// Type
	gateway.Type = genruntime.ClonePointerToString(source.Type)

	// VNetExtendedLocationResourceId
	gateway.VNetExtendedLocationResourceId = genruntime.ClonePointerToString(source.VNetExtendedLocationResourceId)

	// VirtualNetworkGatewayPolicyGroups
	if len(source.VirtualNetworkGatewayPolicyGroups) > 0 {
		propertyBag.Add("VirtualNetworkGatewayPolicyGroups", source.VirtualNetworkGatewayPolicyGroups)
	} else {
		propertyBag.Remove("VirtualNetworkGatewayPolicyGroups")
	}

	// VpnClientConfiguration
	if source.VpnClientConfiguration != nil {
		var vpnClientConfiguration VpnClientConfiguration_STATUS
		err := vpnClientConfiguration.AssignProperties_From_VpnClientConfiguration_STATUS(source.VpnClientConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VpnClientConfiguration_STATUS() to populate field VpnClientConfiguration")
		}
		gateway.VpnClientConfiguration = &vpnClientConfiguration
	} else {
		gateway.VpnClientConfiguration = nil
	}

	// VpnGatewayGeneration
	gateway.VpnGatewayGeneration = genruntime.ClonePointerToString(source.VpnGatewayGeneration)

	// VpnType
	gateway.VpnType = genruntime.ClonePointerToString(source.VpnType)

	// Update the property bag
	if len(propertyBag) > 0 {
		gateway.PropertyBag = propertyBag
	} else {
		gateway.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGateway_STATUS interface (if implemented) to customize the conversion
	var gatewayAsAny any = gateway
	if augmentedGateway, ok := gatewayAsAny.(augmentConversionForVirtualNetworkGateway_STATUS); ok {
		err := augmentedGateway.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGateway_STATUS populates the provided destination VirtualNetworkGateway_STATUS from our VirtualNetworkGateway_STATUS
func (gateway *VirtualNetworkGateway_STATUS) AssignProperties_To_VirtualNetworkGateway_STATUS(destination *v20240301s.VirtualNetworkGateway_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(gateway.PropertyBag)

	// ActiveActive
	if gateway.ActiveActive != nil {
		activeActive := *gateway.ActiveActive
		destination.ActiveActive = &activeActive
	} else {
		destination.ActiveActive = nil
	}

	// AdminState
	if propertyBag.Contains("AdminState") {
		var adminState string
		err := propertyBag.Pull("AdminState", &adminState)
		if err != nil {
			return eris.Wrap(err, "pulling 'AdminState' from propertyBag")
		}

		destination.AdminState = &adminState
	} else {
		destination.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if propertyBag.Contains("AllowRemoteVnetTraffic") {
		var allowRemoteVnetTraffic bool
		err := propertyBag.Pull("AllowRemoteVnetTraffic", &allowRemoteVnetTraffic)
		if err != nil {
			return eris.Wrap(err, "pulling 'AllowRemoteVnetTraffic' from propertyBag")
		}

		destination.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		destination.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if propertyBag.Contains("AllowVirtualWanTraffic") {
		var allowVirtualWanTraffic bool
		err := propertyBag.Pull("AllowVirtualWanTraffic", &allowVirtualWanTraffic)
		if err != nil {
			return eris.Wrap(err, "pulling 'AllowVirtualWanTraffic' from propertyBag")
		}

		destination.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		destination.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if propertyBag.Contains("AutoScaleConfiguration") {
		var autoScaleConfiguration v20240301s.VirtualNetworkGatewayAutoScaleConfiguration_STATUS
		err := propertyBag.Pull("AutoScaleConfiguration", &autoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "pulling 'AutoScaleConfiguration' from propertyBag")
		}

		destination.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		destination.AutoScaleConfiguration = nil
	}

	// BgpSettings
	if gateway.BgpSettings != nil {
		var bgpSetting v20240301s.BgpSettings_STATUS
		err := gateway.BgpSettings.AssignProperties_To_BgpSettings_STATUS(&bgpSetting)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BgpSettings_STATUS() to populate field BgpSettings")
		}
		destination.BgpSettings = &bgpSetting
	} else {
		destination.BgpSettings = nil
	}

	// Conditions
	destination.Conditions = genruntime.CloneSliceOfCondition(gateway.Conditions)

	// CustomRoutes
	if gateway.CustomRoutes != nil {
		var customRoute v20240301s.AddressSpace_STATUS
		err := gateway.CustomRoutes.AssignProperties_To_AddressSpace_STATUS(&customRoute)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AddressSpace_STATUS() to populate field CustomRoutes")
		}
		destination.CustomRoutes = &customRoute
	} else {
		destination.CustomRoutes = nil
	}

	// DisableIPSecReplayProtection
	if propertyBag.Contains("DisableIPSecReplayProtection") {
		var disableIPSecReplayProtection bool
		err := propertyBag.Pull("DisableIPSecReplayProtection", &disableIPSecReplayProtection)
		if err != nil {
			return eris.Wrap(err, "pulling 'DisableIPSecReplayProtection' from propertyBag")
		}

		destination.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		destination.DisableIPSecReplayProtection = nil
	}

	// EnableBgp
	if gateway.EnableBgp != nil {
		enableBgp := *gateway.EnableBgp
		destination.EnableBgp = &enableBgp
	} else {
		destination.EnableBgp = nil
	}

	// EnableBgpRouteTranslationForNat
	if propertyBag.Contains("EnableBgpRouteTranslationForNat") {
		var enableBgpRouteTranslationForNat bool
		err := propertyBag.Pull("EnableBgpRouteTranslationForNat", &enableBgpRouteTranslationForNat)
		if err != nil {
			return eris.Wrap(err, "pulling 'EnableBgpRouteTranslationForNat' from propertyBag")
		}

		destination.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
	} else {
		destination.EnableBgpRouteTranslationForNat = nil
	}

	// EnableDnsForwarding
	if gateway.EnableDnsForwarding != nil {
		enableDnsForwarding := *gateway.EnableDnsForwarding
		destination.EnableDnsForwarding = &enableDnsForwarding
	} else {
		destination.EnableDnsForwarding = nil
	}

	// EnablePrivateIpAddress
	if gateway.EnablePrivateIpAddress != nil {
		enablePrivateIpAddress := *gateway.EnablePrivateIpAddress
		destination.EnablePrivateIpAddress = &enablePrivateIpAddress
	} else {
		destination.EnablePrivateIpAddress = nil
	}

	// Etag
	destination.Etag = genruntime.ClonePointerToString(gateway.Etag)

	// ExtendedLocation
	if gateway.ExtendedLocation != nil {
		var extendedLocationSTATUSStash v20220701s.ExtendedLocation_STATUS
		err := gateway.ExtendedLocation.AssignProperties_To_ExtendedLocation_STATUS(&extendedLocationSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ExtendedLocation_STATUS() to populate field ExtendedLocation_STATUSStash from ExtendedLocation")
		}
		var extendedLocation v20240301s.ExtendedLocation_STATUS
		err = extendedLocationSTATUSStash.AssignProperties_To_ExtendedLocation_STATUS(&extendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ExtendedLocation_STATUS() to populate field ExtendedLocation from ExtendedLocation_STATUSStash")
		}
		destination.ExtendedLocation = &extendedLocation
	} else {
		destination.ExtendedLocation = nil
	}

	// GatewayDefaultSite
	if gateway.GatewayDefaultSite != nil {
		var subResourceSTATUSStash v20220701s.SubResource_STATUS
		err := gateway.GatewayDefaultSite.AssignProperties_To_SubResource_STATUS(&subResourceSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field SubResource_STATUSStash from GatewayDefaultSite")
		}
		var subResourceSTATUSStashLocal v20240101s.SubResource_STATUS
		err = subResourceSTATUSStash.AssignProperties_To_SubResource_STATUS(&subResourceSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field SubResource_STATUSStash")
		}
		var gatewayDefaultSite v20240301s.SubResource_STATUS
		err = subResourceSTATUSStashLocal.AssignProperties_To_SubResource_STATUS(&gatewayDefaultSite)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field GatewayDefaultSite from SubResource_STATUSStash")
		}
		destination.GatewayDefaultSite = &gatewayDefaultSite
	} else {
		destination.GatewayDefaultSite = nil
	}

	// GatewayType
	destination.GatewayType = genruntime.ClonePointerToString(gateway.GatewayType)

	// Id
	destination.Id = genruntime.ClonePointerToString(gateway.Id)

	// Identity
	if propertyBag.Contains("Identity") {
		var identity v20240301s.ManagedServiceIdentity_STATUS
		err := propertyBag.Pull("Identity", &identity)
		if err != nil {
			return eris.Wrap(err, "pulling 'Identity' from propertyBag")
		}

		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

	// InboundDnsForwardingEndpoint
	destination.InboundDnsForwardingEndpoint = genruntime.ClonePointerToString(gateway.InboundDnsForwardingEndpoint)

	// IpConfigurations
	if gateway.IpConfigurations != nil {
		ipConfigurationList := make([]v20240301s.VirtualNetworkGatewayIPConfiguration_STATUS, len(gateway.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range gateway.IpConfigurations {
			var ipConfiguration v20240301s.VirtualNetworkGatewayIPConfiguration_STATUS
			err := ipConfigurationItem.AssignProperties_To_VirtualNetworkGatewayIPConfiguration_STATUS(&ipConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayIPConfiguration_STATUS() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		destination.IpConfigurations = ipConfigurationList
	} else {
		destination.IpConfigurations = nil
	}

	// Location
	destination.Location = genruntime.ClonePointerToString(gateway.Location)

	// Name
	destination.Name = genruntime.ClonePointerToString(gateway.Name)

	// NatRules
	if propertyBag.Contains("NatRules") {
		var natRule []v20240301s.VirtualNetworkGatewayNatRule_STATUS
		err := propertyBag.Pull("NatRules", &natRule)
		if err != nil {
			return eris.Wrap(err, "pulling 'NatRules' from propertyBag")
		}

		destination.NatRules = natRule
	} else {
		destination.NatRules = nil
	}

	// ProvisioningState
	destination.ProvisioningState = genruntime.ClonePointerToString(gateway.ProvisioningState)

	// ResiliencyModel
	if propertyBag.Contains("ResiliencyModel") {
		var resiliencyModel string
		err := propertyBag.Pull("ResiliencyModel", &resiliencyModel)
		if err != nil {
			return eris.Wrap(err, "pulling 'ResiliencyModel' from propertyBag")
		}

		destination.ResiliencyModel = &resiliencyModel
	} else {
		destination.ResiliencyModel = nil
	}

	// ResourceGuid
	destination.ResourceGuid = genruntime.ClonePointerToString(gateway.ResourceGuid)

	// Sku
	if gateway.Sku != nil {
		var sku v20240301s.VirtualNetworkGatewaySku_STATUS
		err := gateway.Sku.AssignProperties_To_VirtualNetworkGatewaySku_STATUS(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewaySku_STATUS() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

	// Tags
	destination.Tags = genruntime.CloneMapOfStringToString(gateway.Tags)

	// Type
	destination.Type = genruntime.ClonePointerToString(gateway.Type)

	// VNetExtendedLocationResourceId
	destination.VNetExtendedLocationResourceId = genruntime.ClonePointerToString(gateway.VNetExtendedLocationResourceId)

	// VirtualNetworkGatewayPolicyGroups
	if propertyBag.Contains("VirtualNetworkGatewayPolicyGroups") {
		var virtualNetworkGatewayPolicyGroup []v20240301s.VirtualNetworkGatewayPolicyGroup_STATUS
		err := propertyBag.Pull("VirtualNetworkGatewayPolicyGroups", &virtualNetworkGatewayPolicyGroup)
		if err != nil {
			return eris.Wrap(err, "pulling 'VirtualNetworkGatewayPolicyGroups' from propertyBag")
		}

		destination.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroup
	} else {
		destination.VirtualNetworkGatewayPolicyGroups = nil
	}

	// VpnClientConfiguration
	if gateway.VpnClientConfiguration != nil {
		var vpnClientConfiguration v20240301s.VpnClientConfiguration_STATUS
		err := gateway.VpnClientConfiguration.AssignProperties_To_VpnClientConfiguration_STATUS(&vpnClientConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VpnClientConfiguration_STATUS() to populate field VpnClientConfiguration")
		}
		destination.VpnClientConfiguration = &vpnClientConfiguration
	} else {
		destination.VpnClientConfiguration = nil
	}

	// VpnGatewayGeneration
	destination.VpnGatewayGeneration = genruntime.ClonePointerToString(gateway.VpnGatewayGeneration)

	// VpnType
	destination.VpnType = genruntime.ClonePointerToString(gateway.VpnType)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGateway_STATUS interface (if implemented) to customize the conversion
	var gatewayAsAny any = gateway
	if augmentedGateway, ok := gatewayAsAny.(augmentConversionForVirtualNetworkGateway_STATUS); ok {
		err := augmentedGateway.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForVirtualNetworkGateway_Spec interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGateway_Spec) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGateway_Spec) error
}

type augmentConversionForVirtualNetworkGateway_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGateway_STATUS) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGateway_STATUS) error
}

// Storage version of v1api20201101.BgpSettings
// BGP settings details.
type BgpSettings struct {
	Asn                 *uint32                            `json:"asn,omitempty"`
	BgpPeeringAddress   *string                            `json:"bgpPeeringAddress,omitempty"`
	BgpPeeringAddresses []IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"`
	PeerWeight          *int                               `json:"peerWeight,omitempty"`
	PropertyBag         genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_BgpSettings populates our BgpSettings from the provided source BgpSettings
func (settings *BgpSettings) AssignProperties_From_BgpSettings(source *v20240301s.BgpSettings) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Asn
	if source.Asn != nil {
		asn := *source.Asn
		settings.Asn = &asn
	} else {
		settings.Asn = nil
	}

	// BgpPeeringAddress
	settings.BgpPeeringAddress = genruntime.ClonePointerToString(source.BgpPeeringAddress)

	// BgpPeeringAddresses
	if source.BgpPeeringAddresses != nil {
		bgpPeeringAddressList := make([]IPConfigurationBgpPeeringAddress, len(source.BgpPeeringAddresses))
		for bgpPeeringAddressIndex, bgpPeeringAddressItem := range source.BgpPeeringAddresses {
			var bgpPeeringAddress IPConfigurationBgpPeeringAddress
			err := bgpPeeringAddress.AssignProperties_From_IPConfigurationBgpPeeringAddress(&bgpPeeringAddressItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IPConfigurationBgpPeeringAddress() to populate field BgpPeeringAddresses")
			}
			bgpPeeringAddressList[bgpPeeringAddressIndex] = bgpPeeringAddress
		}
		settings.BgpPeeringAddresses = bgpPeeringAddressList
	} else {
		settings.BgpPeeringAddresses = nil
	}

	// PeerWeight
	settings.PeerWeight = genruntime.ClonePointerToInt(source.PeerWeight)

	// Update the property bag
	if len(propertyBag) > 0 {
		settings.PropertyBag = propertyBag
	} else {
		settings.PropertyBag = nil
	}

	// Invoke the augmentConversionForBgpSettings interface (if implemented) to customize the conversion
	var settingsAsAny any = settings
	if augmentedSettings, ok := settingsAsAny.(augmentConversionForBgpSettings); ok {
		err := augmentedSettings.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BgpSettings populates the provided destination BgpSettings from our BgpSettings
func (settings *BgpSettings) AssignProperties_To_BgpSettings(destination *v20240301s.BgpSettings) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(settings.PropertyBag)

	// Asn
	if settings.Asn != nil {
		asn := *settings.Asn
		destination.Asn = &asn
	} else {
		destination.Asn = nil
	}

	// BgpPeeringAddress
	destination.BgpPeeringAddress = genruntime.ClonePointerToString(settings.BgpPeeringAddress)

	// BgpPeeringAddresses
	if settings.BgpPeeringAddresses != nil {
		bgpPeeringAddressList := make([]v20240301s.IPConfigurationBgpPeeringAddress, len(settings.BgpPeeringAddresses))
		for bgpPeeringAddressIndex, bgpPeeringAddressItem := range settings.BgpPeeringAddresses {
			var bgpPeeringAddress v20240301s.IPConfigurationBgpPeeringAddress
			err := bgpPeeringAddressItem.AssignProperties_To_IPConfigurationBgpPeeringAddress(&bgpPeeringAddress)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IPConfigurationBgpPeeringAddress() to populate field BgpPeeringAddresses")
			}
			bgpPeeringAddressList[bgpPeeringAddressIndex] = bgpPeeringAddress
		}
		destination.BgpPeeringAddresses = bgpPeeringAddressList
	} else {
		destination.BgpPeeringAddresses = nil
	}

	// PeerWeight
	destination.PeerWeight = genruntime.ClonePointerToInt(settings.PeerWeight)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForBgpSettings interface (if implemented) to customize the conversion
	var settingsAsAny any = settings
	if augmentedSettings, ok := settingsAsAny.(augmentConversionForBgpSettings); ok {
		err := augmentedSettings.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.BgpSettings_STATUS
// BGP settings details.
type BgpSettings_STATUS struct {
	Asn                 *uint32                                   `json:"asn,omitempty"`
	BgpPeeringAddress   *string                                   `json:"bgpPeeringAddress,omitempty"`
	BgpPeeringAddresses []IPConfigurationBgpPeeringAddress_STATUS `json:"bgpPeeringAddresses,omitempty"`
	PeerWeight          *int                                      `json:"peerWeight,omitempty"`
	PropertyBag         genruntime.PropertyBag                    `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_BgpSettings_STATUS populates our BgpSettings_STATUS from the provided source BgpSettings_STATUS
func (settings *BgpSettings_STATUS) AssignProperties_From_BgpSettings_STATUS(source *v20240301s.BgpSettings_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Asn
	if source.Asn != nil {
		asn := *source.Asn
		settings.Asn = &asn
	} else {
		settings.Asn = nil
	}

	// BgpPeeringAddress
	settings.BgpPeeringAddress = genruntime.ClonePointerToString(source.BgpPeeringAddress)

	// BgpPeeringAddresses
	if source.BgpPeeringAddresses != nil {
		bgpPeeringAddressList := make([]IPConfigurationBgpPeeringAddress_STATUS, len(source.BgpPeeringAddresses))
		for bgpPeeringAddressIndex, bgpPeeringAddressItem := range source.BgpPeeringAddresses {
			var bgpPeeringAddress IPConfigurationBgpPeeringAddress_STATUS
			err := bgpPeeringAddress.AssignProperties_From_IPConfigurationBgpPeeringAddress_STATUS(&bgpPeeringAddressItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IPConfigurationBgpPeeringAddress_STATUS() to populate field BgpPeeringAddresses")
			}
			bgpPeeringAddressList[bgpPeeringAddressIndex] = bgpPeeringAddress
		}
		settings.BgpPeeringAddresses = bgpPeeringAddressList
	} else {
		settings.BgpPeeringAddresses = nil
	}

	// PeerWeight
	settings.PeerWeight = genruntime.ClonePointerToInt(source.PeerWeight)

	// Update the property bag
	if len(propertyBag) > 0 {
		settings.PropertyBag = propertyBag
	} else {
		settings.PropertyBag = nil
	}

	// Invoke the augmentConversionForBgpSettings_STATUS interface (if implemented) to customize the conversion
	var settingsAsAny any = settings
	if augmentedSettings, ok := settingsAsAny.(augmentConversionForBgpSettings_STATUS); ok {
		err := augmentedSettings.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BgpSettings_STATUS populates the provided destination BgpSettings_STATUS from our BgpSettings_STATUS
func (settings *BgpSettings_STATUS) AssignProperties_To_BgpSettings_STATUS(destination *v20240301s.BgpSettings_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(settings.PropertyBag)

	// Asn
	if settings.Asn != nil {
		asn := *settings.Asn
		destination.Asn = &asn
	} else {
		destination.Asn = nil
	}

	// BgpPeeringAddress
	destination.BgpPeeringAddress = genruntime.ClonePointerToString(settings.BgpPeeringAddress)

	// BgpPeeringAddresses
	if settings.BgpPeeringAddresses != nil {
		bgpPeeringAddressList := make([]v20240301s.IPConfigurationBgpPeeringAddress_STATUS, len(settings.BgpPeeringAddresses))
		for bgpPeeringAddressIndex, bgpPeeringAddressItem := range settings.BgpPeeringAddresses {
			var bgpPeeringAddress v20240301s.IPConfigurationBgpPeeringAddress_STATUS
			err := bgpPeeringAddressItem.AssignProperties_To_IPConfigurationBgpPeeringAddress_STATUS(&bgpPeeringAddress)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IPConfigurationBgpPeeringAddress_STATUS() to populate field BgpPeeringAddresses")
			}
			bgpPeeringAddressList[bgpPeeringAddressIndex] = bgpPeeringAddress
		}
		destination.BgpPeeringAddresses = bgpPeeringAddressList
	} else {
		destination.BgpPeeringAddresses = nil
	}

	// PeerWeight
	destination.PeerWeight = genruntime.ClonePointerToInt(settings.PeerWeight)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForBgpSettings_STATUS interface (if implemented) to customize the conversion
	var settingsAsAny any = settings
	if augmentedSettings, ok := settingsAsAny.(augmentConversionForBgpSettings_STATUS); ok {
		err := augmentedSettings.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VirtualNetworkGatewayIPConfiguration
// IP configuration for virtual network gateway.
type VirtualNetworkGatewayIPConfiguration struct {
	Name                      *string                `json:"name,omitempty"`
	PrivateIPAllocationMethod *string                `json:"privateIPAllocationMethod,omitempty"`
	PropertyBag               genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	PublicIPAddress           *SubResource           `json:"publicIPAddress,omitempty"`
	Subnet                    *SubResource           `json:"subnet,omitempty"`
}

// AssignProperties_From_VirtualNetworkGatewayIPConfiguration populates our VirtualNetworkGatewayIPConfiguration from the provided source VirtualNetworkGatewayIPConfiguration
func (configuration *VirtualNetworkGatewayIPConfiguration) AssignProperties_From_VirtualNetworkGatewayIPConfiguration(source *v20240301s.VirtualNetworkGatewayIPConfiguration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Name
	configuration.Name = genruntime.ClonePointerToString(source.Name)

	// PrivateIPAllocationMethod
	configuration.PrivateIPAllocationMethod = genruntime.ClonePointerToString(source.PrivateIPAllocationMethod)

	// PublicIPAddress
	if source.PublicIPAddress != nil {
		var subResourceStash v20220701s.SubResource
		err := subResourceStash.AssignProperties_From_SubResource(source.PublicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field SubResourceStash from PublicIPAddress")
		}
		var publicIPAddress SubResource
		err = publicIPAddress.AssignProperties_From_SubResource(&subResourceStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field PublicIPAddress from SubResourceStash")
		}
		configuration.PublicIPAddress = &publicIPAddress
	} else {
		configuration.PublicIPAddress = nil
	}

	// Subnet
	if source.Subnet != nil {
		var subResourceStash v20220701s.SubResource
		err := subResourceStash.AssignProperties_From_SubResource(source.Subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field SubResourceStash from Subnet")
		}
		var subnet SubResource
		err = subnet.AssignProperties_From_SubResource(&subResourceStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field Subnet from SubResourceStash")
		}
		configuration.Subnet = &subnet
	} else {
		configuration.Subnet = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		configuration.PropertyBag = propertyBag
	} else {
		configuration.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewayIPConfiguration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVirtualNetworkGatewayIPConfiguration); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayIPConfiguration populates the provided destination VirtualNetworkGatewayIPConfiguration from our VirtualNetworkGatewayIPConfiguration
func (configuration *VirtualNetworkGatewayIPConfiguration) AssignProperties_To_VirtualNetworkGatewayIPConfiguration(destination *v20240301s.VirtualNetworkGatewayIPConfiguration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

	// Name
	destination.Name = genruntime.ClonePointerToString(configuration.Name)

	// PrivateIPAllocationMethod
	destination.PrivateIPAllocationMethod = genruntime.ClonePointerToString(configuration.PrivateIPAllocationMethod)

	// PublicIPAddress
	if configuration.PublicIPAddress != nil {
		var subResourceStash v20220701s.SubResource
		err := configuration.PublicIPAddress.AssignProperties_To_SubResource(&subResourceStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field SubResourceStash from PublicIPAddress")
		}
		var publicIPAddress v20240301s.SubResource
		err = subResourceStash.AssignProperties_To_SubResource(&publicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field PublicIPAddress from SubResourceStash")
		}
		destination.PublicIPAddress = &publicIPAddress
	} else {
		destination.PublicIPAddress = nil
	}

	// Subnet
	if configuration.Subnet != nil {
		var subResourceStash v20220701s.SubResource
		err := configuration.Subnet.AssignProperties_To_SubResource(&subResourceStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field SubResourceStash from Subnet")
		}
		var subnet v20240301s.SubResource
		err = subResourceStash.AssignProperties_To_SubResource(&subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field Subnet from SubResourceStash")
		}
		destination.Subnet = &subnet
	} else {
		destination.Subnet = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewayIPConfiguration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVirtualNetworkGatewayIPConfiguration); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VirtualNetworkGatewayIPConfiguration_STATUS
// IP configuration for virtual network gateway.
type VirtualNetworkGatewayIPConfiguration_STATUS struct {
	Etag                      *string                `json:"etag,omitempty"`
	Id                        *string                `json:"id,omitempty"`
	Name                      *string                `json:"name,omitempty"`
	PrivateIPAddress          *string                `json:"privateIPAddress,omitempty"`
	PrivateIPAllocationMethod *string                `json:"privateIPAllocationMethod,omitempty"`
	PropertyBag               genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ProvisioningState         *string                `json:"provisioningState,omitempty"`
	PublicIPAddress           *SubResource_STATUS    `json:"publicIPAddress,omitempty"`
	Subnet                    *SubResource_STATUS    `json:"subnet,omitempty"`
}

// AssignProperties_From_VirtualNetworkGatewayIPConfiguration_STATUS populates our VirtualNetworkGatewayIPConfiguration_STATUS from the provided source VirtualNetworkGatewayIPConfiguration_STATUS
func (configuration *VirtualNetworkGatewayIPConfiguration_STATUS) AssignProperties_From_VirtualNetworkGatewayIPConfiguration_STATUS(source *v20240301s.VirtualNetworkGatewayIPConfiguration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Etag
	configuration.Etag = genruntime.ClonePointerToString(source.Etag)

	// Id
	configuration.Id = genruntime.ClonePointerToString(source.Id)

	// Name
	configuration.Name = genruntime.ClonePointerToString(source.Name)

	// PrivateIPAddress
	configuration.PrivateIPAddress = genruntime.ClonePointerToString(source.PrivateIPAddress)

	// PrivateIPAllocationMethod
	configuration.PrivateIPAllocationMethod = genruntime.ClonePointerToString(source.PrivateIPAllocationMethod)

	// ProvisioningState
	configuration.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

	// PublicIPAddress
	if source.PublicIPAddress != nil {
		var subResourceSTATUSStash v20240101s.SubResource_STATUS
		err := subResourceSTATUSStash.AssignProperties_From_SubResource_STATUS(source.PublicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash from PublicIPAddress")
		}
		var subResourceSTATUSStashLocal v20220701s.SubResource_STATUS
		err = subResourceSTATUSStashLocal.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash")
		}
		var publicIPAddress SubResource_STATUS
		err = publicIPAddress.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field PublicIPAddress from SubResource_STATUSStash")
		}
		configuration.PublicIPAddress = &publicIPAddress
	} else {
		configuration.PublicIPAddress = nil
	}

	// Subnet
	if source.Subnet != nil {
		var subResourceSTATUSStash v20240101s.SubResource_STATUS
		err := subResourceSTATUSStash.AssignProperties_From_SubResource_STATUS(source.Subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash from Subnet")
		}
		var subResourceSTATUSStashLocal v20220701s.SubResource_STATUS
		err = subResourceSTATUSStashLocal.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash")
		}
		var subnet SubResource_STATUS
		err = subnet.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field Subnet from SubResource_STATUSStash")
		}
		configuration.Subnet = &subnet
	} else {
		configuration.Subnet = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		configuration.PropertyBag = propertyBag
	} else {
		configuration.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewayIPConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVirtualNetworkGatewayIPConfiguration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayIPConfiguration_STATUS populates the provided destination VirtualNetworkGatewayIPConfiguration_STATUS from our VirtualNetworkGatewayIPConfiguration_STATUS
func (configuration *VirtualNetworkGatewayIPConfiguration_STATUS) AssignProperties_To_VirtualNetworkGatewayIPConfiguration_STATUS(destination *v20240301s.VirtualNetworkGatewayIPConfiguration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

	// Etag
	destination.Etag = genruntime.ClonePointerToString(configuration.Etag)

	// Id
	destination.Id = genruntime.ClonePointerToString(configuration.Id)

	// Name
	destination.Name = genruntime.ClonePointerToString(configuration.Name)

	// PrivateIPAddress
	destination.PrivateIPAddress = genruntime.ClonePointerToString(configuration.PrivateIPAddress)

	// PrivateIPAllocationMethod
	destination.PrivateIPAllocationMethod = genruntime.ClonePointerToString(configuration.PrivateIPAllocationMethod)

	// ProvisioningState
	destination.ProvisioningState = genruntime.ClonePointerToString(configuration.ProvisioningState)

	// PublicIPAddress
	if configuration.PublicIPAddress != nil {
		var subResourceSTATUSStash v20220701s.SubResource_STATUS
		err := configuration.PublicIPAddress.AssignProperties_To_SubResource_STATUS(&subResourceSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field SubResource_STATUSStash from PublicIPAddress")
		}
		var subResourceSTATUSStashLocal v20240101s.SubResource_STATUS
		err = subResourceSTATUSStash.AssignProperties_To_SubResource_STATUS(&subResourceSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field SubResource_STATUSStash")
		}
		var publicIPAddress v20240301s.SubResource_STATUS
		err = subResourceSTATUSStashLocal.AssignProperties_To_SubResource_STATUS(&publicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field PublicIPAddress from SubResource_STATUSStash")
		}
		destination.PublicIPAddress = &publicIPAddress
	} else {
		destination.PublicIPAddress = nil
	}

	// Subnet
	if configuration.Subnet != nil {
		var subResourceSTATUSStash v20220701s.SubResource_STATUS
		err := configuration.Subnet.AssignProperties_To_SubResource_STATUS(&subResourceSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field SubResource_STATUSStash from Subnet")
		}
		var subResourceSTATUSStashLocal v20240101s.SubResource_STATUS
		err = subResourceSTATUSStash.AssignProperties_To_SubResource_STATUS(&subResourceSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field SubResource_STATUSStash")
		}
		var subnet v20240301s.SubResource_STATUS
		err = subResourceSTATUSStashLocal.AssignProperties_To_SubResource_STATUS(&subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field Subnet from SubResource_STATUSStash")
		}
		destination.Subnet = &subnet
	} else {
		destination.Subnet = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewayIPConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVirtualNetworkGatewayIPConfiguration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VirtualNetworkGatewayOperatorSpec
// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type VirtualNetworkGatewayOperatorSpec struct {
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`
	PropertyBag          genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	SecretExpressions    []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_VirtualNetworkGatewayOperatorSpec populates our VirtualNetworkGatewayOperatorSpec from the provided source VirtualNetworkGatewayOperatorSpec
func (operator *VirtualNetworkGatewayOperatorSpec) AssignProperties_From_VirtualNetworkGatewayOperatorSpec(source *v20240301s.VirtualNetworkGatewayOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ConfigMapExpressions
	if source.ConfigMapExpressions != nil {
		configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions))
		for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions {
			if configMapExpressionItem != nil {
				configMapExpression := *configMapExpressionItem.DeepCopy()
				configMapExpressionList[configMapExpressionIndex] = &configMapExpression
			} else {
				configMapExpressionList[configMapExpressionIndex] = nil
			}
		}
		operator.ConfigMapExpressions = configMapExpressionList
	} else {
		operator.ConfigMapExpressions = nil
	}

	// SecretExpressions
	if source.SecretExpressions != nil {
		secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions))
		for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions {
			if secretExpressionItem != nil {
				secretExpression := *secretExpressionItem.DeepCopy()
				secretExpressionList[secretExpressionIndex] = &secretExpression
			} else {
				secretExpressionList[secretExpressionIndex] = nil
			}
		}
		operator.SecretExpressions = secretExpressionList
	} else {
		operator.SecretExpressions = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		operator.PropertyBag = propertyBag
	} else {
		operator.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewayOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForVirtualNetworkGatewayOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayOperatorSpec populates the provided destination VirtualNetworkGatewayOperatorSpec from our VirtualNetworkGatewayOperatorSpec
func (operator *VirtualNetworkGatewayOperatorSpec) AssignProperties_To_VirtualNetworkGatewayOperatorSpec(destination *v20240301s.VirtualNetworkGatewayOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(operator.PropertyBag)

	// ConfigMapExpressions
	if operator.ConfigMapExpressions != nil {
		configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions))
		for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions {
			if configMapExpressionItem != nil {
				configMapExpression := *configMapExpressionItem.DeepCopy()
				configMapExpressionList[configMapExpressionIndex] = &configMapExpression
			} else {
				configMapExpressionList[configMapExpressionIndex] = nil
			}
		}
		destination.ConfigMapExpressions = configMapExpressionList
	} else {
		destination.ConfigMapExpressions = nil
	}

	// SecretExpressions
	if operator.SecretExpressions != nil {
		secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions))
		for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions {
			if secretExpressionItem != nil {
				secretExpression := *secretExpressionItem.DeepCopy()
				secretExpressionList[secretExpressionIndex] = &secretExpression
			} else {
				secretExpressionList[secretExpressionIndex] = nil
			}
		}
		destination.SecretExpressions = secretExpressionList
	} else {
		destination.SecretExpressions = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewayOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForVirtualNetworkGatewayOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VirtualNetworkGatewaySku
// VirtualNetworkGatewaySku details.
type VirtualNetworkGatewaySku struct {
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Tier        *string                `json:"tier,omitempty"`
}

// AssignProperties_From_VirtualNetworkGatewaySku populates our VirtualNetworkGatewaySku from the provided source VirtualNetworkGatewaySku
func (gatewaySku *VirtualNetworkGatewaySku) AssignProperties_From_VirtualNetworkGatewaySku(source *v20240301s.VirtualNetworkGatewaySku) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Name
	gatewaySku.Name = genruntime.ClonePointerToString(source.Name)

	// Tier
	gatewaySku.Tier = genruntime.ClonePointerToString(source.Tier)

	// Update the property bag
	if len(propertyBag) > 0 {
		gatewaySku.PropertyBag = propertyBag
	} else {
		gatewaySku.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewaySku interface (if implemented) to customize the conversion
	var gatewaySkuAsAny any = gatewaySku
	if augmentedGatewaySku, ok := gatewaySkuAsAny.(augmentConversionForVirtualNetworkGatewaySku); ok {
		err := augmentedGatewaySku.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewaySku populates the provided destination VirtualNetworkGatewaySku from our VirtualNetworkGatewaySku
func (gatewaySku *VirtualNetworkGatewaySku) AssignProperties_To_VirtualNetworkGatewaySku(destination *v20240301s.VirtualNetworkGatewaySku) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(gatewaySku.PropertyBag)

	// Name
	destination.Name = genruntime.ClonePointerToString(gatewaySku.Name)

	// Tier
	destination.Tier = genruntime.ClonePointerToString(gatewaySku.Tier)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewaySku interface (if implemented) to customize the conversion
	var gatewaySkuAsAny any = gatewaySku
	if augmentedGatewaySku, ok := gatewaySkuAsAny.(augmentConversionForVirtualNetworkGatewaySku); ok {
		err := augmentedGatewaySku.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VirtualNetworkGatewaySku_STATUS
// VirtualNetworkGatewaySku details.
type VirtualNetworkGatewaySku_STATUS struct {
	Capacity    *int                   `json:"capacity,omitempty"`
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Tier        *string                `json:"tier,omitempty"`
}

// AssignProperties_From_VirtualNetworkGatewaySku_STATUS populates our VirtualNetworkGatewaySku_STATUS from the provided source VirtualNetworkGatewaySku_STATUS
func (gatewaySku *VirtualNetworkGatewaySku_STATUS) AssignProperties_From_VirtualNetworkGatewaySku_STATUS(source *v20240301s.VirtualNetworkGatewaySku_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Capacity
	gatewaySku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

	// Name
	gatewaySku.Name = genruntime.ClonePointerToString(source.Name)

	// Tier
	gatewaySku.Tier = genruntime.ClonePointerToString(source.Tier)

	// Update the property bag
	if len(propertyBag) > 0 {
		gatewaySku.PropertyBag = propertyBag
	} else {
		gatewaySku.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewaySku_STATUS interface (if implemented) to customize the conversion
	var gatewaySkuAsAny any = gatewaySku
	if augmentedGatewaySku, ok := gatewaySkuAsAny.(augmentConversionForVirtualNetworkGatewaySku_STATUS); ok {
		err := augmentedGatewaySku.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewaySku_STATUS populates the provided destination VirtualNetworkGatewaySku_STATUS from our VirtualNetworkGatewaySku_STATUS
func (gatewaySku *VirtualNetworkGatewaySku_STATUS) AssignProperties_To_VirtualNetworkGatewaySku_STATUS(destination *v20240301s.VirtualNetworkGatewaySku_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(gatewaySku.PropertyBag)

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(gatewaySku.Capacity)

	// Name
	destination.Name = genruntime.ClonePointerToString(gatewaySku.Name)

	// Tier
	destination.Tier = genruntime.ClonePointerToString(gatewaySku.Tier)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVirtualNetworkGatewaySku_STATUS interface (if implemented) to customize the conversion
	var gatewaySkuAsAny any = gatewaySku
	if augmentedGatewaySku, ok := gatewaySkuAsAny.(augmentConversionForVirtualNetworkGatewaySku_STATUS); ok {
		err := augmentedGatewaySku.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VpnClientConfiguration
// VpnClientConfiguration for P2S client.
type VpnClientConfiguration struct {
	AadAudience                  *string                       `json:"aadAudience,omitempty"`
	AadIssuer                    *string                       `json:"aadIssuer,omitempty"`
	AadTenant                    *string                       `json:"aadTenant,omitempty"`
	PropertyBag                  genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	RadiusServerAddress          *string                       `json:"radiusServerAddress,omitempty"`
	RadiusServerSecret           *string                       `json:"radiusServerSecret,omitempty"`
	RadiusServers                []RadiusServer                `json:"radiusServers,omitempty"`
	VpnAuthenticationTypes       []string                      `json:"vpnAuthenticationTypes,omitempty"`
	VpnClientAddressPool         *AddressSpace                 `json:"vpnClientAddressPool,omitempty"`
	VpnClientIpsecPolicies       []IpsecPolicy                 `json:"vpnClientIpsecPolicies,omitempty"`
	VpnClientProtocols           []string                      `json:"vpnClientProtocols,omitempty"`
	VpnClientRevokedCertificates []VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"`
	VpnClientRootCertificates    []VpnClientRootCertificate    `json:"vpnClientRootCertificates,omitempty"`
}

// AssignProperties_From_VpnClientConfiguration populates our VpnClientConfiguration from the provided source VpnClientConfiguration
func (configuration *VpnClientConfiguration) AssignProperties_From_VpnClientConfiguration(source *v20240301s.VpnClientConfiguration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AadAudience
	configuration.AadAudience = genruntime.ClonePointerToString(source.AadAudience)

	// AadIssuer
	configuration.AadIssuer = genruntime.ClonePointerToString(source.AadIssuer)

	// AadTenant
	configuration.AadTenant = genruntime.ClonePointerToString(source.AadTenant)

	// RadiusServerAddress
	configuration.RadiusServerAddress = genruntime.ClonePointerToString(source.RadiusServerAddress)

	// RadiusServerSecret
	configuration.RadiusServerSecret = genruntime.ClonePointerToString(source.RadiusServerSecret)

	// RadiusServers
	if source.RadiusServers != nil {
		radiusServerList := make([]RadiusServer, len(source.RadiusServers))
		for radiusServerIndex, radiusServerItem := range source.RadiusServers {
			var radiusServer RadiusServer
			err := radiusServer.AssignProperties_From_RadiusServer(&radiusServerItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_RadiusServer() to populate field RadiusServers")
			}
			radiusServerList[radiusServerIndex] = radiusServer
		}
		configuration.RadiusServers = radiusServerList
	} else {
		configuration.RadiusServers = nil
	}

	// VngClientConnectionConfigurations
	if len(source.VngClientConnectionConfigurations) > 0 {
		propertyBag.Add("VngClientConnectionConfigurations", source.VngClientConnectionConfigurations)
	} else {
		propertyBag.Remove("VngClientConnectionConfigurations")
	}

	// VpnAuthenticationTypes
	configuration.VpnAuthenticationTypes = genruntime.CloneSliceOfString(source.VpnAuthenticationTypes)

	// VpnClientAddressPool
	if source.VpnClientAddressPool != nil {
		var vpnClientAddressPool AddressSpace
		err := vpnClientAddressPool.AssignProperties_From_AddressSpace(source.VpnClientAddressPool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AddressSpace() to populate field VpnClientAddressPool")
		}
		configuration.VpnClientAddressPool = &vpnClientAddressPool
	} else {
		configuration.VpnClientAddressPool = nil
	}

	// VpnClientIpsecPolicies
	if source.VpnClientIpsecPolicies != nil {
		vpnClientIpsecPolicyList := make([]IpsecPolicy, len(source.VpnClientIpsecPolicies))
		for vpnClientIpsecPolicyIndex, vpnClientIpsecPolicyItem := range source.VpnClientIpsecPolicies {
			var vpnClientIpsecPolicy IpsecPolicy
			err := vpnClientIpsecPolicy.AssignProperties_From_IpsecPolicy(&vpnClientIpsecPolicyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IpsecPolicy() to populate field VpnClientIpsecPolicies")
			}
			vpnClientIpsecPolicyList[vpnClientIpsecPolicyIndex] = vpnClientIpsecPolicy
		}
		configuration.VpnClientIpsecPolicies = vpnClientIpsecPolicyList
	} else {
		configuration.VpnClientIpsecPolicies = nil
	}

	// VpnClientProtocols
	configuration.VpnClientProtocols = genruntime.CloneSliceOfString(source.VpnClientProtocols)

	// VpnClientRevokedCertificates
	if source.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]VpnClientRevokedCertificate, len(source.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range source.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate VpnClientRevokedCertificate
			err := vpnClientRevokedCertificate.AssignProperties_From_VpnClientRevokedCertificate(&vpnClientRevokedCertificateItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnClientRevokedCertificate() to populate field VpnClientRevokedCertificates")
			}
			vpnClientRevokedCertificateList[vpnClientRevokedCertificateIndex] = vpnClientRevokedCertificate
		}
		configuration.VpnClientRevokedCertificates = vpnClientRevokedCertificateList
	} else {
		configuration.VpnClientRevokedCertificates = nil
	}

	// VpnClientRootCertificates
	if source.VpnClientRootCertificates != nil {
		vpnClientRootCertificateList := make([]VpnClientRootCertificate, len(source.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range source.VpnClientRootCertificates {
			var vpnClientRootCertificate VpnClientRootCertificate
			err := vpnClientRootCertificate.AssignProperties_From_VpnClientRootCertificate(&vpnClientRootCertificateItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnClientRootCertificate() to populate field VpnClientRootCertificates")
			}
			vpnClientRootCertificateList[vpnClientRootCertificateIndex] = vpnClientRootCertificate
		}
		configuration.VpnClientRootCertificates = vpnClientRootCertificateList
	} else {
		configuration.VpnClientRootCertificates = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		configuration.PropertyBag = propertyBag
	} else {
		configuration.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientConfiguration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVpnClientConfiguration); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientConfiguration populates the provided destination VpnClientConfiguration from our VpnClientConfiguration
func (configuration *VpnClientConfiguration) AssignProperties_To_VpnClientConfiguration(destination *v20240301s.VpnClientConfiguration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

	// AadAudience
	destination.AadAudience = genruntime.ClonePointerToString(configuration.AadAudience)

	// AadIssuer
	destination.AadIssuer = genruntime.ClonePointerToString(configuration.AadIssuer)

	// AadTenant
	destination.AadTenant = genruntime.ClonePointerToString(configuration.AadTenant)

	// RadiusServerAddress
	destination.RadiusServerAddress = genruntime.ClonePointerToString(configuration.RadiusServerAddress)

	// RadiusServerSecret
	destination.RadiusServerSecret = genruntime.ClonePointerToString(configuration.RadiusServerSecret)

	// RadiusServers
	if configuration.RadiusServers != nil {
		radiusServerList := make([]v20240301s.RadiusServer, len(configuration.RadiusServers))
		for radiusServerIndex, radiusServerItem := range configuration.RadiusServers {
			var radiusServer v20240301s.RadiusServer
			err := radiusServerItem.AssignProperties_To_RadiusServer(&radiusServer)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_RadiusServer() to populate field RadiusServers")
			}
			radiusServerList[radiusServerIndex] = radiusServer
		}
		destination.RadiusServers = radiusServerList
	} else {
		destination.RadiusServers = nil
	}

	// VngClientConnectionConfigurations
	if propertyBag.Contains("VngClientConnectionConfigurations") {
		var vngClientConnectionConfiguration []v20240301s.VngClientConnectionConfiguration
		err := propertyBag.Pull("VngClientConnectionConfigurations", &vngClientConnectionConfiguration)
		if err != nil {
			return eris.Wrap(err, "pulling 'VngClientConnectionConfigurations' from propertyBag")
		}

		destination.VngClientConnectionConfigurations = vngClientConnectionConfiguration
	} else {
		destination.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	destination.VpnAuthenticationTypes = genruntime.CloneSliceOfString(configuration.VpnAuthenticationTypes)

	// VpnClientAddressPool
	if configuration.VpnClientAddressPool != nil {
		var vpnClientAddressPool v20240301s.AddressSpace
		err := configuration.VpnClientAddressPool.AssignProperties_To_AddressSpace(&vpnClientAddressPool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AddressSpace() to populate field VpnClientAddressPool")
		}
		destination.VpnClientAddressPool = &vpnClientAddressPool
	} else {
		destination.VpnClientAddressPool = nil
	}

	// VpnClientIpsecPolicies
	if configuration.VpnClientIpsecPolicies != nil {
		vpnClientIpsecPolicyList := make([]v20240301s.IpsecPolicy, len(configuration.VpnClientIpsecPolicies))
		for vpnClientIpsecPolicyIndex, vpnClientIpsecPolicyItem := range configuration.VpnClientIpsecPolicies {
			var vpnClientIpsecPolicy v20240301s.IpsecPolicy
			err := vpnClientIpsecPolicyItem.AssignProperties_To_IpsecPolicy(&vpnClientIpsecPolicy)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IpsecPolicy() to populate field VpnClientIpsecPolicies")
			}
			vpnClientIpsecPolicyList[vpnClientIpsecPolicyIndex] = vpnClientIpsecPolicy
		}
		destination.VpnClientIpsecPolicies = vpnClientIpsecPolicyList
	} else {
		destination.VpnClientIpsecPolicies = nil
	}

	// VpnClientProtocols
	destination.VpnClientProtocols = genruntime.CloneSliceOfString(configuration.VpnClientProtocols)

	// VpnClientRevokedCertificates
	if configuration.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]v20240301s.VpnClientRevokedCertificate, len(configuration.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range configuration.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate v20240301s.VpnClientRevokedCertificate
			err := vpnClientRevokedCertificateItem.AssignProperties_To_VpnClientRevokedCertificate(&vpnClientRevokedCertificate)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnClientRevokedCertificate() to populate field VpnClientRevokedCertificates")
			}
			vpnClientRevokedCertificateList[vpnClientRevokedCertificateIndex] = vpnClientRevokedCertificate
		}
		destination.VpnClientRevokedCertificates = vpnClientRevokedCertificateList
	} else {
		destination.VpnClientRevokedCertificates = nil
	}

	// VpnClientRootCertificates
	if configuration.VpnClientRootCertificates != nil {
		vpnClientRootCertificateList := make([]v20240301s.VpnClientRootCertificate, len(configuration.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range configuration.VpnClientRootCertificates {
			var vpnClientRootCertificate v20240301s.VpnClientRootCertificate
			err := vpnClientRootCertificateItem.AssignProperties_To_VpnClientRootCertificate(&vpnClientRootCertificate)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnClientRootCertificate() to populate field VpnClientRootCertificates")
			}
			vpnClientRootCertificateList[vpnClientRootCertificateIndex] = vpnClientRootCertificate
		}
		destination.VpnClientRootCertificates = vpnClientRootCertificateList
	} else {
		destination.VpnClientRootCertificates = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientConfiguration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVpnClientConfiguration); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VpnClientConfiguration_STATUS
// VpnClientConfiguration for P2S client.
type VpnClientConfiguration_STATUS struct {
	AadAudience                  *string                              `json:"aadAudience,omitempty"`
	AadIssuer                    *string                              `json:"aadIssuer,omitempty"`
	AadTenant                    *string                              `json:"aadTenant,omitempty"`
	PropertyBag                  genruntime.PropertyBag               `json:"$propertyBag,omitempty"`
	RadiusServerAddress          *string                              `json:"radiusServerAddress,omitempty"`
	RadiusServerSecret           *string                              `json:"radiusServerSecret,omitempty"`
	RadiusServers                []RadiusServer_STATUS                `json:"radiusServers,omitempty"`
	VpnAuthenticationTypes       []string                             `json:"vpnAuthenticationTypes,omitempty"`
	VpnClientAddressPool         *AddressSpace_STATUS                 `json:"vpnClientAddressPool,omitempty"`
	VpnClientIpsecPolicies       []IpsecPolicy_STATUS                 `json:"vpnClientIpsecPolicies,omitempty"`
	VpnClientProtocols           []string                             `json:"vpnClientProtocols,omitempty"`
	VpnClientRevokedCertificates []VpnClientRevokedCertificate_STATUS `json:"vpnClientRevokedCertificates,omitempty"`
	VpnClientRootCertificates    []VpnClientRootCertificate_STATUS    `json:"vpnClientRootCertificates,omitempty"`
}

// AssignProperties_From_VpnClientConfiguration_STATUS populates our VpnClientConfiguration_STATUS from the provided source VpnClientConfiguration_STATUS
func (configuration *VpnClientConfiguration_STATUS) AssignProperties_From_VpnClientConfiguration_STATUS(source *v20240301s.VpnClientConfiguration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AadAudience
	configuration.AadAudience = genruntime.ClonePointerToString(source.AadAudience)

	// AadIssuer
	configuration.AadIssuer = genruntime.ClonePointerToString(source.AadIssuer)

	// AadTenant
	configuration.AadTenant = genruntime.ClonePointerToString(source.AadTenant)

	// RadiusServerAddress
	configuration.RadiusServerAddress = genruntime.ClonePointerToString(source.RadiusServerAddress)

	// RadiusServerSecret
	configuration.RadiusServerSecret = genruntime.ClonePointerToString(source.RadiusServerSecret)

	// RadiusServers
	if source.RadiusServers != nil {
		radiusServerList := make([]RadiusServer_STATUS, len(source.RadiusServers))
		for radiusServerIndex, radiusServerItem := range source.RadiusServers {
			var radiusServer RadiusServer_STATUS
			err := radiusServer.AssignProperties_From_RadiusServer_STATUS(&radiusServerItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_RadiusServer_STATUS() to populate field RadiusServers")
			}
			radiusServerList[radiusServerIndex] = radiusServer
		}
		configuration.RadiusServers = radiusServerList
	} else {
		configuration.RadiusServers = nil
	}

	// VngClientConnectionConfigurations
	if len(source.VngClientConnectionConfigurations) > 0 {
		propertyBag.Add("VngClientConnectionConfigurations", source.VngClientConnectionConfigurations)
	} else {
		propertyBag.Remove("VngClientConnectionConfigurations")
	}

	// VpnAuthenticationTypes
	configuration.VpnAuthenticationTypes = genruntime.CloneSliceOfString(source.VpnAuthenticationTypes)

	// VpnClientAddressPool
	if source.VpnClientAddressPool != nil {
		var vpnClientAddressPool AddressSpace_STATUS
		err := vpnClientAddressPool.AssignProperties_From_AddressSpace_STATUS(source.VpnClientAddressPool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AddressSpace_STATUS() to populate field VpnClientAddressPool")
		}
		configuration.VpnClientAddressPool = &vpnClientAddressPool
	} else {
		configuration.VpnClientAddressPool = nil
	}

	// VpnClientIpsecPolicies
	if source.VpnClientIpsecPolicies != nil {
		vpnClientIpsecPolicyList := make([]IpsecPolicy_STATUS, len(source.VpnClientIpsecPolicies))
		for vpnClientIpsecPolicyIndex, vpnClientIpsecPolicyItem := range source.VpnClientIpsecPolicies {
			var vpnClientIpsecPolicy IpsecPolicy_STATUS
			err := vpnClientIpsecPolicy.AssignProperties_From_IpsecPolicy_STATUS(&vpnClientIpsecPolicyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IpsecPolicy_STATUS() to populate field VpnClientIpsecPolicies")
			}
			vpnClientIpsecPolicyList[vpnClientIpsecPolicyIndex] = vpnClientIpsecPolicy
		}
		configuration.VpnClientIpsecPolicies = vpnClientIpsecPolicyList
	} else {
		configuration.VpnClientIpsecPolicies = nil
	}

	// VpnClientProtocols
	configuration.VpnClientProtocols = genruntime.CloneSliceOfString(source.VpnClientProtocols)

	// VpnClientRevokedCertificates
	if source.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]VpnClientRevokedCertificate_STATUS, len(source.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range source.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate VpnClientRevokedCertificate_STATUS
			err := vpnClientRevokedCertificate.AssignProperties_From_VpnClientRevokedCertificate_STATUS(&vpnClientRevokedCertificateItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnClientRevokedCertificate_STATUS() to populate field VpnClientRevokedCertificates")
			}
			vpnClientRevokedCertificateList[vpnClientRevokedCertificateIndex] = vpnClientRevokedCertificate
		}
		configuration.VpnClientRevokedCertificates = vpnClientRevokedCertificateList
	} else {
		configuration.VpnClientRevokedCertificates = nil
	}

	// VpnClientRootCertificates
	if source.VpnClientRootCertificates != nil {
		vpnClientRootCertificateList := make([]VpnClientRootCertificate_STATUS, len(source.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range source.VpnClientRootCertificates {
			var vpnClientRootCertificate VpnClientRootCertificate_STATUS
			err := vpnClientRootCertificate.AssignProperties_From_VpnClientRootCertificate_STATUS(&vpnClientRootCertificateItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnClientRootCertificate_STATUS() to populate field VpnClientRootCertificates")
			}
			vpnClientRootCertificateList[vpnClientRootCertificateIndex] = vpnClientRootCertificate
		}
		configuration.VpnClientRootCertificates = vpnClientRootCertificateList
	} else {
		configuration.VpnClientRootCertificates = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		configuration.PropertyBag = propertyBag
	} else {
		configuration.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVpnClientConfiguration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientConfiguration_STATUS populates the provided destination VpnClientConfiguration_STATUS from our VpnClientConfiguration_STATUS
func (configuration *VpnClientConfiguration_STATUS) AssignProperties_To_VpnClientConfiguration_STATUS(destination *v20240301s.VpnClientConfiguration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

	// AadAudience
	destination.AadAudience = genruntime.ClonePointerToString(configuration.AadAudience)

	// AadIssuer
	destination.AadIssuer = genruntime.ClonePointerToString(configuration.AadIssuer)

	// AadTenant
	destination.AadTenant = genruntime.ClonePointerToString(configuration.AadTenant)

	// RadiusServerAddress
	destination.RadiusServerAddress = genruntime.ClonePointerToString(configuration.RadiusServerAddress)

	// RadiusServerSecret
	destination.RadiusServerSecret = genruntime.ClonePointerToString(configuration.RadiusServerSecret)

	// RadiusServers
	if configuration.RadiusServers != nil {
		radiusServerList := make([]v20240301s.RadiusServer_STATUS, len(configuration.RadiusServers))
		for radiusServerIndex, radiusServerItem := range configuration.RadiusServers {
			var radiusServer v20240301s.RadiusServer_STATUS
			err := radiusServerItem.AssignProperties_To_RadiusServer_STATUS(&radiusServer)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_RadiusServer_STATUS() to populate field RadiusServers")
			}
			radiusServerList[radiusServerIndex] = radiusServer
		}
		destination.RadiusServers = radiusServerList
	} else {
		destination.RadiusServers = nil
	}

	// VngClientConnectionConfigurations
	if propertyBag.Contains("VngClientConnectionConfigurations") {
		var vngClientConnectionConfiguration []v20240301s.VngClientConnectionConfiguration_STATUS
		err := propertyBag.Pull("VngClientConnectionConfigurations", &vngClientConnectionConfiguration)
		if err != nil {
			return eris.Wrap(err, "pulling 'VngClientConnectionConfigurations' from propertyBag")
		}

		destination.VngClientConnectionConfigurations = vngClientConnectionConfiguration
	} else {
		destination.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	destination.VpnAuthenticationTypes = genruntime.CloneSliceOfString(configuration.VpnAuthenticationTypes)

	// VpnClientAddressPool
	if configuration.VpnClientAddressPool != nil {
		var vpnClientAddressPool v20240301s.AddressSpace_STATUS
		err := configuration.VpnClientAddressPool.AssignProperties_To_AddressSpace_STATUS(&vpnClientAddressPool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AddressSpace_STATUS() to populate field VpnClientAddressPool")
		}
		destination.VpnClientAddressPool = &vpnClientAddressPool
	} else {
		destination.VpnClientAddressPool = nil
	}

	// VpnClientIpsecPolicies
	if configuration.VpnClientIpsecPolicies != nil {
		vpnClientIpsecPolicyList := make([]v20240301s.IpsecPolicy_STATUS, len(configuration.VpnClientIpsecPolicies))
		for vpnClientIpsecPolicyIndex, vpnClientIpsecPolicyItem := range configuration.VpnClientIpsecPolicies {
			var vpnClientIpsecPolicy v20240301s.IpsecPolicy_STATUS
			err := vpnClientIpsecPolicyItem.AssignProperties_To_IpsecPolicy_STATUS(&vpnClientIpsecPolicy)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IpsecPolicy_STATUS() to populate field VpnClientIpsecPolicies")
			}
			vpnClientIpsecPolicyList[vpnClientIpsecPolicyIndex] = vpnClientIpsecPolicy
		}
		destination.VpnClientIpsecPolicies = vpnClientIpsecPolicyList
	} else {
		destination.VpnClientIpsecPolicies = nil
	}

	// VpnClientProtocols
	destination.VpnClientProtocols = genruntime.CloneSliceOfString(configuration.VpnClientProtocols)

	// VpnClientRevokedCertificates
	if configuration.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]v20240301s.VpnClientRevokedCertificate_STATUS, len(configuration.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range configuration.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate v20240301s.VpnClientRevokedCertificate_STATUS
			err := vpnClientRevokedCertificateItem.AssignProperties_To_VpnClientRevokedCertificate_STATUS(&vpnClientRevokedCertificate)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnClientRevokedCertificate_STATUS() to populate field VpnClientRevokedCertificates")
			}
			vpnClientRevokedCertificateList[vpnClientRevokedCertificateIndex] = vpnClientRevokedCertificate
		}
		destination.VpnClientRevokedCertificates = vpnClientRevokedCertificateList
	} else {
		destination.VpnClientRevokedCertificates = nil
	}

	// VpnClientRootCertificates
	if configuration.VpnClientRootCertificates != nil {
		vpnClientRootCertificateList := make([]v20240301s.VpnClientRootCertificate_STATUS, len(configuration.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range configuration.VpnClientRootCertificates {
			var vpnClientRootCertificate v20240301s.VpnClientRootCertificate_STATUS
			err := vpnClientRootCertificateItem.AssignProperties_To_VpnClientRootCertificate_STATUS(&vpnClientRootCertificate)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnClientRootCertificate_STATUS() to populate field VpnClientRootCertificates")
			}
			vpnClientRootCertificateList[vpnClientRootCertificateIndex] = vpnClientRootCertificate
		}
		destination.VpnClientRootCertificates = vpnClientRootCertificateList
	} else {
		destination.VpnClientRootCertificates = nil
	}

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVpnClientConfiguration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForBgpSettings interface {
	AssignPropertiesFrom(src *v20240301s.BgpSettings) error
	AssignPropertiesTo(dst *v20240301s.BgpSettings) error
}

type augmentConversionForBgpSettings_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.BgpSettings_STATUS) error
	AssignPropertiesTo(dst *v20240301s.BgpSettings_STATUS) error
}

type augmentConversionForVirtualNetworkGatewayIPConfiguration interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGatewayIPConfiguration) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGatewayIPConfiguration) error
}

type augmentConversionForVirtualNetworkGatewayIPConfiguration_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGatewayIPConfiguration_STATUS) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGatewayIPConfiguration_STATUS) error
}

type augmentConversionForVirtualNetworkGatewayOperatorSpec interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGatewayOperatorSpec) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGatewayOperatorSpec) error
}

type augmentConversionForVirtualNetworkGatewaySku interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGatewaySku) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGatewaySku) error
}

type augmentConversionForVirtualNetworkGatewaySku_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.VirtualNetworkGatewaySku_STATUS) error
	AssignPropertiesTo(dst *v20240301s.VirtualNetworkGatewaySku_STATUS) error
}

type augmentConversionForVpnClientConfiguration interface {
	AssignPropertiesFrom(src *v20240301s.VpnClientConfiguration) error
	AssignPropertiesTo(dst *v20240301s.VpnClientConfiguration) error
}

type augmentConversionForVpnClientConfiguration_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.VpnClientConfiguration_STATUS) error
	AssignPropertiesTo(dst *v20240301s.VpnClientConfiguration_STATUS) error
}

// Storage version of v1api20201101.IPConfigurationBgpPeeringAddress
// Properties of IPConfigurationBgpPeeringAddress.
type IPConfigurationBgpPeeringAddress struct {
	CustomBgpIpAddresses []string               `json:"customBgpIpAddresses,omitempty"`
	IpconfigurationId    *string                `json:"ipconfigurationId,omitempty"`
	PropertyBag          genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_IPConfigurationBgpPeeringAddress populates our IPConfigurationBgpPeeringAddress from the provided source IPConfigurationBgpPeeringAddress
func (address *IPConfigurationBgpPeeringAddress) AssignProperties_From_IPConfigurationBgpPeeringAddress(source *v20240301s.IPConfigurationBgpPeeringAddress) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// CustomBgpIpAddresses
	address.CustomBgpIpAddresses = genruntime.CloneSliceOfString(source.CustomBgpIpAddresses)

	// IpconfigurationId
	address.IpconfigurationId = genruntime.ClonePointerToString(source.IpconfigurationId)

	// Update the property bag
	if len(propertyBag) > 0 {
		address.PropertyBag = propertyBag
	} else {
		address.PropertyBag = nil
	}

	// Invoke the augmentConversionForIPConfigurationBgpPeeringAddress interface (if implemented) to customize the conversion
	var addressAsAny any = address
	if augmentedAddress, ok := addressAsAny.(augmentConversionForIPConfigurationBgpPeeringAddress); ok {
		err := augmentedAddress.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_IPConfigurationBgpPeeringAddress populates the provided destination IPConfigurationBgpPeeringAddress from our IPConfigurationBgpPeeringAddress
func (address *IPConfigurationBgpPeeringAddress) AssignProperties_To_IPConfigurationBgpPeeringAddress(destination *v20240301s.IPConfigurationBgpPeeringAddress) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(address.PropertyBag)

	// CustomBgpIpAddresses
	destination.CustomBgpIpAddresses = genruntime.CloneSliceOfString(address.CustomBgpIpAddresses)

	// IpconfigurationId
	destination.IpconfigurationId = genruntime.ClonePointerToString(address.IpconfigurationId)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForIPConfigurationBgpPeeringAddress interface (if implemented) to customize the conversion
	var addressAsAny any = address
	if augmentedAddress, ok := addressAsAny.(augmentConversionForIPConfigurationBgpPeeringAddress); ok {
		err := augmentedAddress.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.IPConfigurationBgpPeeringAddress_STATUS
// Properties of IPConfigurationBgpPeeringAddress.
type IPConfigurationBgpPeeringAddress_STATUS struct {
	CustomBgpIpAddresses  []string               `json:"customBgpIpAddresses,omitempty"`
	DefaultBgpIpAddresses []string               `json:"defaultBgpIpAddresses,omitempty"`
	IpconfigurationId     *string                `json:"ipconfigurationId,omitempty"`
	PropertyBag           genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	TunnelIpAddresses     []string               `json:"tunnelIpAddresses,omitempty"`
}

// AssignProperties_From_IPConfigurationBgpPeeringAddress_STATUS populates our IPConfigurationBgpPeeringAddress_STATUS from the provided source IPConfigurationBgpPeeringAddress_STATUS
func (address *IPConfigurationBgpPeeringAddress_STATUS) AssignProperties_From_IPConfigurationBgpPeeringAddress_STATUS(source *v20240301s.IPConfigurationBgpPeeringAddress_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// CustomBgpIpAddresses
	address.CustomBgpIpAddresses = genruntime.CloneSliceOfString(source.CustomBgpIpAddresses)

	// DefaultBgpIpAddresses
	address.DefaultBgpIpAddresses = genruntime.CloneSliceOfString(source.DefaultBgpIpAddresses)

	// IpconfigurationId
	address.IpconfigurationId = genruntime.ClonePointerToString(source.IpconfigurationId)

	// TunnelIpAddresses
	address.TunnelIpAddresses = genruntime.CloneSliceOfString(source.TunnelIpAddresses)

	// Update the property bag
	if len(propertyBag) > 0 {
		address.PropertyBag = propertyBag
	} else {
		address.PropertyBag = nil
	}

	// Invoke the augmentConversionForIPConfigurationBgpPeeringAddress_STATUS interface (if implemented) to customize the conversion
	var addressAsAny any = address
	if augmentedAddress, ok := addressAsAny.(augmentConversionForIPConfigurationBgpPeeringAddress_STATUS); ok {
		err := augmentedAddress.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_IPConfigurationBgpPeeringAddress_STATUS populates the provided destination IPConfigurationBgpPeeringAddress_STATUS from our IPConfigurationBgpPeeringAddress_STATUS
func (address *IPConfigurationBgpPeeringAddress_STATUS) AssignProperties_To_IPConfigurationBgpPeeringAddress_STATUS(destination *v20240301s.IPConfigurationBgpPeeringAddress_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(address.PropertyBag)

	// CustomBgpIpAddresses
	destination.CustomBgpIpAddresses = genruntime.CloneSliceOfString(address.CustomBgpIpAddresses)

	// DefaultBgpIpAddresses
	destination.DefaultBgpIpAddresses = genruntime.CloneSliceOfString(address.DefaultBgpIpAddresses)

	// IpconfigurationId
	destination.IpconfigurationId = genruntime.ClonePointerToString(address.IpconfigurationId)

	// TunnelIpAddresses
	destination.TunnelIpAddresses = genruntime.CloneSliceOfString(address.TunnelIpAddresses)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForIPConfigurationBgpPeeringAddress_STATUS interface (if implemented) to customize the conversion
	var addressAsAny any = address
	if augmentedAddress, ok := addressAsAny.(augmentConversionForIPConfigurationBgpPeeringAddress_STATUS); ok {
		err := augmentedAddress.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.IpsecPolicy
// An IPSec Policy configuration for a virtual network gateway connection.
type IpsecPolicy struct {
	DhGroup             *string                `json:"dhGroup,omitempty"`
	IkeEncryption       *string                `json:"ikeEncryption,omitempty"`
	IkeIntegrity        *string                `json:"ikeIntegrity,omitempty"`
	IpsecEncryption     *string                `json:"ipsecEncryption,omitempty"`
	IpsecIntegrity      *string                `json:"ipsecIntegrity,omitempty"`
	PfsGroup            *string                `json:"pfsGroup,omitempty"`
	PropertyBag         genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	SaDataSizeKilobytes *int                   `json:"saDataSizeKilobytes,omitempty"`
	SaLifeTimeSeconds   *int                   `json:"saLifeTimeSeconds,omitempty"`
}

// AssignProperties_From_IpsecPolicy populates our IpsecPolicy from the provided source IpsecPolicy
func (policy *IpsecPolicy) AssignProperties_From_IpsecPolicy(source *v20240301s.IpsecPolicy) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// DhGroup
	policy.DhGroup = genruntime.ClonePointerToString(source.DhGroup)

	// IkeEncryption
	policy.IkeEncryption = genruntime.ClonePointerToString(source.IkeEncryption)

	// IkeIntegrity
	policy.IkeIntegrity = genruntime.ClonePointerToString(source.IkeIntegrity)

	// IpsecEncryption
	policy.IpsecEncryption = genruntime.ClonePointerToString(source.IpsecEncryption)

	// IpsecIntegrity
	policy.IpsecIntegrity = genruntime.ClonePointerToString(source.IpsecIntegrity)

	// PfsGroup
	policy.PfsGroup = genruntime.ClonePointerToString(source.PfsGroup)

	// SaDataSizeKilobytes
	policy.SaDataSizeKilobytes = genruntime.ClonePointerToInt(source.SaDataSizeKilobytes)

	// SaLifeTimeSeconds
	policy.SaLifeTimeSeconds = genruntime.ClonePointerToInt(source.SaLifeTimeSeconds)

	// Update the property bag
	if len(propertyBag) > 0 {
		policy.PropertyBag = propertyBag
	} else {
		policy.PropertyBag = nil
	}

	// Invoke the augmentConversionForIpsecPolicy interface (if implemented) to customize the conversion
	var policyAsAny any = policy
	if augmentedPolicy, ok := policyAsAny.(augmentConversionForIpsecPolicy); ok {
		err := augmentedPolicy.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_IpsecPolicy populates the provided destination IpsecPolicy from our IpsecPolicy
func (policy *IpsecPolicy) AssignProperties_To_IpsecPolicy(destination *v20240301s.IpsecPolicy) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(policy.PropertyBag)

	// DhGroup
	destination.DhGroup = genruntime.ClonePointerToString(policy.DhGroup)

	// IkeEncryption
	destination.IkeEncryption = genruntime.ClonePointerToString(policy.IkeEncryption)

	// IkeIntegrity
	destination.IkeIntegrity = genruntime.ClonePointerToString(policy.IkeIntegrity)

	// IpsecEncryption
	destination.IpsecEncryption = genruntime.ClonePointerToString(policy.IpsecEncryption)

	// IpsecIntegrity
	destination.IpsecIntegrity = genruntime.ClonePointerToString(policy.IpsecIntegrity)

	// PfsGroup
	destination.PfsGroup = genruntime.ClonePointerToString(policy.PfsGroup)

	// SaDataSizeKilobytes
	destination.SaDataSizeKilobytes = genruntime.ClonePointerToInt(policy.SaDataSizeKilobytes)

	// SaLifeTimeSeconds
	destination.SaLifeTimeSeconds = genruntime.ClonePointerToInt(policy.SaLifeTimeSeconds)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForIpsecPolicy interface (if implemented) to customize the conversion
	var policyAsAny any = policy
	if augmentedPolicy, ok := policyAsAny.(augmentConversionForIpsecPolicy); ok {
		err := augmentedPolicy.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.IpsecPolicy_STATUS
// An IPSec Policy configuration for a virtual network gateway connection.
type IpsecPolicy_STATUS struct {
	DhGroup             *string                `json:"dhGroup,omitempty"`
	IkeEncryption       *string                `json:"ikeEncryption,omitempty"`
	IkeIntegrity        *string                `json:"ikeIntegrity,omitempty"`
	IpsecEncryption     *string                `json:"ipsecEncryption,omitempty"`
	IpsecIntegrity      *string                `json:"ipsecIntegrity,omitempty"`
	PfsGroup            *string                `json:"pfsGroup,omitempty"`
	PropertyBag         genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	SaDataSizeKilobytes *int                   `json:"saDataSizeKilobytes,omitempty"`
	SaLifeTimeSeconds   *int                   `json:"saLifeTimeSeconds,omitempty"`
}

// AssignProperties_From_IpsecPolicy_STATUS populates our IpsecPolicy_STATUS from the provided source IpsecPolicy_STATUS
func (policy *IpsecPolicy_STATUS) AssignProperties_From_IpsecPolicy_STATUS(source *v20240301s.IpsecPolicy_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// DhGroup
	policy.DhGroup = genruntime.ClonePointerToString(source.DhGroup)

	// IkeEncryption
	policy.IkeEncryption = genruntime.ClonePointerToString(source.IkeEncryption)

	// IkeIntegrity
	policy.IkeIntegrity = genruntime.ClonePointerToString(source.IkeIntegrity)

	// IpsecEncryption
	policy.IpsecEncryption = genruntime.ClonePointerToString(source.IpsecEncryption)

	// IpsecIntegrity
	policy.IpsecIntegrity = genruntime.ClonePointerToString(source.IpsecIntegrity)

	// PfsGroup
	policy.PfsGroup = genruntime.ClonePointerToString(source.PfsGroup)

	// SaDataSizeKilobytes
	policy.SaDataSizeKilobytes = genruntime.ClonePointerToInt(source.SaDataSizeKilobytes)

	// SaLifeTimeSeconds
	policy.SaLifeTimeSeconds = genruntime.ClonePointerToInt(source.SaLifeTimeSeconds)

	// Update the property bag
	if len(propertyBag) > 0 {
		policy.PropertyBag = propertyBag
	} else {
		policy.PropertyBag = nil
	}

	// Invoke the augmentConversionForIpsecPolicy_STATUS interface (if implemented) to customize the conversion
	var policyAsAny any = policy
	if augmentedPolicy, ok := policyAsAny.(augmentConversionForIpsecPolicy_STATUS); ok {
		err := augmentedPolicy.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_IpsecPolicy_STATUS populates the provided destination IpsecPolicy_STATUS from our IpsecPolicy_STATUS
func (policy *IpsecPolicy_STATUS) AssignProperties_To_IpsecPolicy_STATUS(destination *v20240301s.IpsecPolicy_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(policy.PropertyBag)

	// DhGroup
	destination.DhGroup = genruntime.ClonePointerToString(policy.DhGroup)

	// IkeEncryption
	destination.IkeEncryption = genruntime.ClonePointerToString(policy.IkeEncryption)

	// IkeIntegrity
	destination.IkeIntegrity = genruntime.ClonePointerToString(policy.IkeIntegrity)

	// IpsecEncryption
	destination.IpsecEncryption = genruntime.ClonePointerToString(policy.IpsecEncryption)

	// IpsecIntegrity
	destination.IpsecIntegrity = genruntime.ClonePointerToString(policy.IpsecIntegrity)

	// PfsGroup
	destination.PfsGroup = genruntime.ClonePointerToString(policy.PfsGroup)

	// SaDataSizeKilobytes
	destination.SaDataSizeKilobytes = genruntime.ClonePointerToInt(policy.SaDataSizeKilobytes)

	// SaLifeTimeSeconds
	destination.SaLifeTimeSeconds = genruntime.ClonePointerToInt(policy.SaLifeTimeSeconds)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForIpsecPolicy_STATUS interface (if implemented) to customize the conversion
	var policyAsAny any = policy
	if augmentedPolicy, ok := policyAsAny.(augmentConversionForIpsecPolicy_STATUS); ok {
		err := augmentedPolicy.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.RadiusServer
// Radius Server Settings.
type RadiusServer struct {
	PropertyBag         genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	RadiusServerAddress *string                `json:"radiusServerAddress,omitempty"`
	RadiusServerScore   *int                   `json:"radiusServerScore,omitempty"`
	RadiusServerSecret  *string                `json:"radiusServerSecret,omitempty"`
}

// AssignProperties_From_RadiusServer populates our RadiusServer from the provided source RadiusServer
func (server *RadiusServer) AssignProperties_From_RadiusServer(source *v20240301s.RadiusServer) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// RadiusServerAddress
	server.RadiusServerAddress = genruntime.ClonePointerToString(source.RadiusServerAddress)

	// RadiusServerScore
	server.RadiusServerScore = genruntime.ClonePointerToInt(source.RadiusServerScore)

	// RadiusServerSecret
	server.RadiusServerSecret = genruntime.ClonePointerToString(source.RadiusServerSecret)

	// Update the property bag
	if len(propertyBag) > 0 {
		server.PropertyBag = propertyBag
	} else {
		server.PropertyBag = nil
	}

	// Invoke the augmentConversionForRadiusServer interface (if implemented) to customize the conversion
	var serverAsAny any = server
	if augmentedServer, ok := serverAsAny.(augmentConversionForRadiusServer); ok {
		err := augmentedServer.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_RadiusServer populates the provided destination RadiusServer from our RadiusServer
func (server *RadiusServer) AssignProperties_To_RadiusServer(destination *v20240301s.RadiusServer) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(server.PropertyBag)

	// RadiusServerAddress
	destination.RadiusServerAddress = genruntime.ClonePointerToString(server.RadiusServerAddress)

	// RadiusServerScore
	destination.RadiusServerScore = genruntime.ClonePointerToInt(server.RadiusServerScore)

	// RadiusServerSecret
	destination.RadiusServerSecret = genruntime.ClonePointerToString(server.RadiusServerSecret)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForRadiusServer interface (if implemented) to customize the conversion
	var serverAsAny any = server
	if augmentedServer, ok := serverAsAny.(augmentConversionForRadiusServer); ok {
		err := augmentedServer.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.RadiusServer_STATUS
// Radius Server Settings.
type RadiusServer_STATUS struct {
	PropertyBag         genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	RadiusServerAddress *string                `json:"radiusServerAddress,omitempty"`
	RadiusServerScore   *int                   `json:"radiusServerScore,omitempty"`
	RadiusServerSecret  *string                `json:"radiusServerSecret,omitempty"`
}

// AssignProperties_From_RadiusServer_STATUS populates our RadiusServer_STATUS from the provided source RadiusServer_STATUS
func (server *RadiusServer_STATUS) AssignProperties_From_RadiusServer_STATUS(source *v20240301s.RadiusServer_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// RadiusServerAddress
	server.RadiusServerAddress = genruntime.ClonePointerToString(source.RadiusServerAddress)

	// RadiusServerScore
	server.RadiusServerScore = genruntime.ClonePointerToInt(source.RadiusServerScore)

	// RadiusServerSecret
	server.RadiusServerSecret = genruntime.ClonePointerToString(source.RadiusServerSecret)

	// Update the property bag
	if len(propertyBag) > 0 {
		server.PropertyBag = propertyBag
	} else {
		server.PropertyBag = nil
	}

	// Invoke the augmentConversionForRadiusServer_STATUS interface (if implemented) to customize the conversion
	var serverAsAny any = server
	if augmentedServer, ok := serverAsAny.(augmentConversionForRadiusServer_STATUS); ok {
		err := augmentedServer.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_RadiusServer_STATUS populates the provided destination RadiusServer_STATUS from our RadiusServer_STATUS
func (server *RadiusServer_STATUS) AssignProperties_To_RadiusServer_STATUS(destination *v20240301s.RadiusServer_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(server.PropertyBag)

	// RadiusServerAddress
	destination.RadiusServerAddress = genruntime.ClonePointerToString(server.RadiusServerAddress)

	// RadiusServerScore
	destination.RadiusServerScore = genruntime.ClonePointerToInt(server.RadiusServerScore)

	// RadiusServerSecret
	destination.RadiusServerSecret = genruntime.ClonePointerToString(server.RadiusServerSecret)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForRadiusServer_STATUS interface (if implemented) to customize the conversion
	var serverAsAny any = server
	if augmentedServer, ok := serverAsAny.(augmentConversionForRadiusServer_STATUS); ok {
		err := augmentedServer.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VpnClientRevokedCertificate
// VPN client revoked certificate of virtual network gateway.
type VpnClientRevokedCertificate struct {
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Thumbprint  *string                `json:"thumbprint,omitempty"`
}

// AssignProperties_From_VpnClientRevokedCertificate populates our VpnClientRevokedCertificate from the provided source VpnClientRevokedCertificate
func (certificate *VpnClientRevokedCertificate) AssignProperties_From_VpnClientRevokedCertificate(source *v20240301s.VpnClientRevokedCertificate) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Name
	certificate.Name = genruntime.ClonePointerToString(source.Name)

	// Thumbprint
	certificate.Thumbprint = genruntime.ClonePointerToString(source.Thumbprint)

	// Update the property bag
	if len(propertyBag) > 0 {
		certificate.PropertyBag = propertyBag
	} else {
		certificate.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRevokedCertificate interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRevokedCertificate); ok {
		err := augmentedCertificate.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientRevokedCertificate populates the provided destination VpnClientRevokedCertificate from our VpnClientRevokedCertificate
func (certificate *VpnClientRevokedCertificate) AssignProperties_To_VpnClientRevokedCertificate(destination *v20240301s.VpnClientRevokedCertificate) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(certificate.PropertyBag)

	// Name
	destination.Name = genruntime.ClonePointerToString(certificate.Name)

	// Thumbprint
	destination.Thumbprint = genruntime.ClonePointerToString(certificate.Thumbprint)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRevokedCertificate interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRevokedCertificate); ok {
		err := augmentedCertificate.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VpnClientRevokedCertificate_STATUS
// VPN client revoked certificate of virtual network gateway.
type VpnClientRevokedCertificate_STATUS struct {
	Etag              *string                `json:"etag,omitempty"`
	Id                *string                `json:"id,omitempty"`
	Name              *string                `json:"name,omitempty"`
	PropertyBag       genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ProvisioningState *string                `json:"provisioningState,omitempty"`
	Thumbprint        *string                `json:"thumbprint,omitempty"`
}

// AssignProperties_From_VpnClientRevokedCertificate_STATUS populates our VpnClientRevokedCertificate_STATUS from the provided source VpnClientRevokedCertificate_STATUS
func (certificate *VpnClientRevokedCertificate_STATUS) AssignProperties_From_VpnClientRevokedCertificate_STATUS(source *v20240301s.VpnClientRevokedCertificate_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Etag
	certificate.Etag = genruntime.ClonePointerToString(source.Etag)

	// Id
	certificate.Id = genruntime.ClonePointerToString(source.Id)

	// Name
	certificate.Name = genruntime.ClonePointerToString(source.Name)

	// ProvisioningState
	certificate.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

	// Thumbprint
	certificate.Thumbprint = genruntime.ClonePointerToString(source.Thumbprint)

	// Update the property bag
	if len(propertyBag) > 0 {
		certificate.PropertyBag = propertyBag
	} else {
		certificate.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRevokedCertificate_STATUS interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRevokedCertificate_STATUS); ok {
		err := augmentedCertificate.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientRevokedCertificate_STATUS populates the provided destination VpnClientRevokedCertificate_STATUS from our VpnClientRevokedCertificate_STATUS
func (certificate *VpnClientRevokedCertificate_STATUS) AssignProperties_To_VpnClientRevokedCertificate_STATUS(destination *v20240301s.VpnClientRevokedCertificate_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(certificate.PropertyBag)

	// Etag
	destination.Etag = genruntime.ClonePointerToString(certificate.Etag)

	// Id
	destination.Id = genruntime.ClonePointerToString(certificate.Id)

	// Name
	destination.Name = genruntime.ClonePointerToString(certificate.Name)

	// ProvisioningState
	destination.ProvisioningState = genruntime.ClonePointerToString(certificate.ProvisioningState)

	// Thumbprint
	destination.Thumbprint = genruntime.ClonePointerToString(certificate.Thumbprint)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRevokedCertificate_STATUS interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRevokedCertificate_STATUS); ok {
		err := augmentedCertificate.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VpnClientRootCertificate
// VPN client root certificate of virtual network gateway.
type VpnClientRootCertificate struct {
	Name           *string                `json:"name,omitempty"`
	PropertyBag    genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	PublicCertData *string                `json:"publicCertData,omitempty"`
}

// AssignProperties_From_VpnClientRootCertificate populates our VpnClientRootCertificate from the provided source VpnClientRootCertificate
func (certificate *VpnClientRootCertificate) AssignProperties_From_VpnClientRootCertificate(source *v20240301s.VpnClientRootCertificate) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Name
	certificate.Name = genruntime.ClonePointerToString(source.Name)

	// PublicCertData
	certificate.PublicCertData = genruntime.ClonePointerToString(source.PublicCertData)

	// Update the property bag
	if len(propertyBag) > 0 {
		certificate.PropertyBag = propertyBag
	} else {
		certificate.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRootCertificate interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRootCertificate); ok {
		err := augmentedCertificate.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientRootCertificate populates the provided destination VpnClientRootCertificate from our VpnClientRootCertificate
func (certificate *VpnClientRootCertificate) AssignProperties_To_VpnClientRootCertificate(destination *v20240301s.VpnClientRootCertificate) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(certificate.PropertyBag)

	// Name
	destination.Name = genruntime.ClonePointerToString(certificate.Name)

	// PublicCertData
	destination.PublicCertData = genruntime.ClonePointerToString(certificate.PublicCertData)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRootCertificate interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRootCertificate); ok {
		err := augmentedCertificate.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20201101.VpnClientRootCertificate_STATUS
// VPN client root certificate of virtual network gateway.
type VpnClientRootCertificate_STATUS struct {
	Etag              *string                `json:"etag,omitempty"`
	Id                *string                `json:"id,omitempty"`
	Name              *string                `json:"name,omitempty"`
	PropertyBag       genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ProvisioningState *string                `json:"provisioningState,omitempty"`
	PublicCertData    *string                `json:"publicCertData,omitempty"`
}

// AssignProperties_From_VpnClientRootCertificate_STATUS populates our VpnClientRootCertificate_STATUS from the provided source VpnClientRootCertificate_STATUS
func (certificate *VpnClientRootCertificate_STATUS) AssignProperties_From_VpnClientRootCertificate_STATUS(source *v20240301s.VpnClientRootCertificate_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Etag
	certificate.Etag = genruntime.ClonePointerToString(source.Etag)

	// Id
	certificate.Id = genruntime.ClonePointerToString(source.Id)

	// Name
	certificate.Name = genruntime.ClonePointerToString(source.Name)

	// ProvisioningState
	certificate.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

	// PublicCertData
	certificate.PublicCertData = genruntime.ClonePointerToString(source.PublicCertData)

	// Update the property bag
	if len(propertyBag) > 0 {
		certificate.PropertyBag = propertyBag
	} else {
		certificate.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRootCertificate_STATUS interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRootCertificate_STATUS); ok {
		err := augmentedCertificate.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientRootCertificate_STATUS populates the provided destination VpnClientRootCertificate_STATUS from our VpnClientRootCertificate_STATUS
func (certificate *VpnClientRootCertificate_STATUS) AssignProperties_To_VpnClientRootCertificate_STATUS(destination *v20240301s.VpnClientRootCertificate_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(certificate.PropertyBag)

	// Etag
	destination.Etag = genruntime.ClonePointerToString(certificate.Etag)

	// Id
	destination.Id = genruntime.ClonePointerToString(certificate.Id)

	// Name
	destination.Name = genruntime.ClonePointerToString(certificate.Name)

	// ProvisioningState
	destination.ProvisioningState = genruntime.ClonePointerToString(certificate.ProvisioningState)

	// PublicCertData
	destination.PublicCertData = genruntime.ClonePointerToString(certificate.PublicCertData)

	// Update the property bag
	if len(propertyBag) > 0 {
		destination.PropertyBag = propertyBag
	} else {
		destination.PropertyBag = nil
	}

	// Invoke the augmentConversionForVpnClientRootCertificate_STATUS interface (if implemented) to customize the conversion
	var certificateAsAny any = certificate
	if augmentedCertificate, ok := certificateAsAny.(augmentConversionForVpnClientRootCertificate_STATUS); ok {
		err := augmentedCertificate.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForIPConfigurationBgpPeeringAddress interface {
	AssignPropertiesFrom(src *v20240301s.IPConfigurationBgpPeeringAddress) error
	AssignPropertiesTo(dst *v20240301s.IPConfigurationBgpPeeringAddress) error
}

type augmentConversionForIPConfigurationBgpPeeringAddress_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.IPConfigurationBgpPeeringAddress_STATUS) error
	AssignPropertiesTo(dst *v20240301s.IPConfigurationBgpPeeringAddress_STATUS) error
}

type augmentConversionForIpsecPolicy interface {
	AssignPropertiesFrom(src *v20240301s.IpsecPolicy) error
	AssignPropertiesTo(dst *v20240301s.IpsecPolicy) error
}

type augmentConversionForIpsecPolicy_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.IpsecPolicy_STATUS) error
	AssignPropertiesTo(dst *v20240301s.IpsecPolicy_STATUS) error
}

type augmentConversionForRadiusServer interface {
	AssignPropertiesFrom(src *v20240301s.RadiusServer) error
	AssignPropertiesTo(dst *v20240301s.RadiusServer) error
}

type augmentConversionForRadiusServer_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.RadiusServer_STATUS) error
	AssignPropertiesTo(dst *v20240301s.RadiusServer_STATUS) error
}

type augmentConversionForVpnClientRevokedCertificate interface {
	AssignPropertiesFrom(src *v20240301s.VpnClientRevokedCertificate) error
	AssignPropertiesTo(dst *v20240301s.VpnClientRevokedCertificate) error
}

type augmentConversionForVpnClientRevokedCertificate_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.VpnClientRevokedCertificate_STATUS) error
	AssignPropertiesTo(dst *v20240301s.VpnClientRevokedCertificate_STATUS) error
}

type augmentConversionForVpnClientRootCertificate interface {
	AssignPropertiesFrom(src *v20240301s.VpnClientRootCertificate) error
	AssignPropertiesTo(dst *v20240301s.VpnClientRootCertificate) error
}

type augmentConversionForVpnClientRootCertificate_STATUS interface {
	AssignPropertiesFrom(src *v20240301s.VpnClientRootCertificate_STATUS) error
	AssignPropertiesTo(dst *v20240301s.VpnClientRootCertificate_STATUS) error
}

func init() {
	SchemeBuilder.Register(&VirtualNetworkGateway{}, &VirtualNetworkGatewayList{})
}
