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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/network/v1api20240301/arm"
	storage "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"
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2024-03-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.(*storage.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.(*storage.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.ImportableResource = &VirtualNetworkGateway{}

// InitializeSpec initializes the spec for this resource from the given status
func (gateway *VirtualNetworkGateway) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*VirtualNetworkGateway_STATUS); ok {
		return gateway.Spec.Initialize_From_VirtualNetworkGateway_STATUS(s)
	}

	return fmt.Errorf("expected Status of type VirtualNetworkGateway_STATUS but received %T instead", status)
}

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 "2024-03-01"
func (gateway VirtualNetworkGateway) GetAPIVersion() string {
	return "2024-03-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 *storage.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

	// No error
	return nil
}

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

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

	// Spec
	var spec storage.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 storage.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

	// 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
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2024-03-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 VirtualNetworkGateway_Spec struct {
	// ActiveActive: ActiveActive flag.
	ActiveActive *bool `json:"activeActive,omitempty"`

	// AdminState: Property to indicate if the Express Route Gateway serves traffic when there are multiple Express Route
	// Gateways in the vnet
	AdminState *VirtualNetworkGatewayPropertiesFormat_AdminState `json:"adminState,omitempty"`

	// AllowRemoteVnetTraffic: Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration
	// does not support connectivity to Azure Virtual WAN.
	AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"`

	// AllowVirtualWanTraffic: Configures this gateway to accept traffic from remote Virtual WAN networks.
	AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"`

	// AutoScaleConfiguration: Autoscale configuration for virutal network gateway
	AutoScaleConfiguration *VirtualNetworkGatewayAutoScaleConfiguration `json:"autoScaleConfiguration,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: Virtual network gateway's BGP speaker settings.
	BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`

	// CustomRoutes: The reference to the address space resource which represents the custom routes address space specified by
	// the customer for virtual network gateway and VpnClient.
	CustomRoutes *AddressSpace `json:"customRoutes,omitempty"`

	// DisableIPSecReplayProtection: disableIPSecReplayProtection flag.
	DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"`

	// EnableBgp: Whether BGP is enabled for this virtual network gateway or not.
	EnableBgp *bool `json:"enableBgp,omitempty"`

	// EnableBgpRouteTranslationForNat: EnableBgpRouteTranslationForNat flag.
	EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"`

	// EnableDnsForwarding: Whether dns forwarding is enabled or not.
	EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"`

	// EnablePrivateIpAddress: Whether private IP needs to be enabled on this gateway for connections or not.
	EnablePrivateIpAddress *bool `json:"enablePrivateIpAddress,omitempty"`

	// ExtendedLocation: The extended location of type local virtual network gateway.
	ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`

	// GatewayDefaultSite: The reference to the LocalNetworkGateway resource which represents local network site having default
	// routes. Assign Null value in case of removing existing default site setting.
	GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"`

	// GatewayType: The type of this virtual network gateway.
	GatewayType *VirtualNetworkGatewayPropertiesFormat_GatewayType `json:"gatewayType,omitempty"`

	// Identity: The identity of the virtual network gateway, if configured.
	Identity *ManagedServiceIdentity `json:"identity,omitempty"`

	// IpConfigurations: IP configurations for virtual network gateway.
	IpConfigurations []VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"`

	// Location: Resource location.
	Location *string `json:"location,omitempty"`

	// NatRules: NatRules for virtual network gateway.
	NatRules []VirtualNetworkGatewayNatRule `json:"natRules,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *VirtualNetworkGatewayOperatorSpec `json:"operatorSpec,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"`

	// ResiliencyModel: Property to indicate if the Express Route Gateway has resiliency model of MultiHomed or SingleHomed
	ResiliencyModel *VirtualNetworkGatewayPropertiesFormat_ResiliencyModel `json:"resiliencyModel,omitempty"`

	// Sku: The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network
	// gateway.
	Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"`

	// Tags: Resource tags.
	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"`

	// VirtualNetworkGatewayPolicyGroups: The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the
	// available VirtualNetworkGatewayPolicyGroup for the gateway.
	VirtualNetworkGatewayPolicyGroups []VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"`

	// VpnClientConfiguration: The reference to the VpnClientConfiguration resource which represents the P2S VpnClient
	// configurations.
	VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"`

	// VpnGatewayGeneration: The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN.
	VpnGatewayGeneration *VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"`

	// VpnType: The type of this virtual network gateway.
	VpnType *VirtualNetworkGatewayPropertiesFormat_VpnType `json:"vpnType,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGateway_Spec{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (gateway *VirtualNetworkGateway_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if gateway == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGateway_Spec{}

	// Set property "ExtendedLocation":
	if gateway.ExtendedLocation != nil {
		extendedLocation_ARM, err := gateway.ExtendedLocation.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		extendedLocation := *extendedLocation_ARM.(*arm.ExtendedLocation)
		result.ExtendedLocation = &extendedLocation
	}

	// Set property "Identity":
	if gateway.Identity != nil {
		identity_ARM, err := gateway.Identity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		identity := *identity_ARM.(*arm.ManagedServiceIdentity)
		result.Identity = &identity
	}

	// Set property "Location":
	if gateway.Location != nil {
		location := *gateway.Location
		result.Location = &location
	}

	// Set property "Name":
	result.Name = resolved.Name

	// Set property "Properties":
	if gateway.ActiveActive != nil ||
		gateway.AdminState != nil ||
		gateway.AllowRemoteVnetTraffic != nil ||
		gateway.AllowVirtualWanTraffic != nil ||
		gateway.AutoScaleConfiguration != nil ||
		gateway.BgpSettings != nil ||
		gateway.CustomRoutes != nil ||
		gateway.DisableIPSecReplayProtection != nil ||
		gateway.EnableBgp != nil ||
		gateway.EnableBgpRouteTranslationForNat != nil ||
		gateway.EnableDnsForwarding != nil ||
		gateway.EnablePrivateIpAddress != nil ||
		gateway.GatewayDefaultSite != nil ||
		gateway.GatewayType != nil ||
		gateway.IpConfigurations != nil ||
		gateway.NatRules != nil ||
		gateway.ResiliencyModel != nil ||
		gateway.Sku != nil ||
		gateway.VNetExtendedLocationResourceReference != nil ||
		gateway.VirtualNetworkGatewayPolicyGroups != nil ||
		gateway.VpnClientConfiguration != nil ||
		gateway.VpnGatewayGeneration != nil ||
		gateway.VpnType != nil {
		result.Properties = &arm.VirtualNetworkGatewayPropertiesFormat{}
	}
	if gateway.ActiveActive != nil {
		activeActive := *gateway.ActiveActive
		result.Properties.ActiveActive = &activeActive
	}
	if gateway.AdminState != nil {
		var temp string
		temp = string(*gateway.AdminState)
		adminState := arm.VirtualNetworkGatewayPropertiesFormat_AdminState(temp)
		result.Properties.AdminState = &adminState
	}
	if gateway.AllowRemoteVnetTraffic != nil {
		allowRemoteVnetTraffic := *gateway.AllowRemoteVnetTraffic
		result.Properties.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	}
	if gateway.AllowVirtualWanTraffic != nil {
		allowVirtualWanTraffic := *gateway.AllowVirtualWanTraffic
		result.Properties.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	}
	if gateway.AutoScaleConfiguration != nil {
		autoScaleConfiguration_ARM, err := gateway.AutoScaleConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		autoScaleConfiguration := *autoScaleConfiguration_ARM.(*arm.VirtualNetworkGatewayAutoScaleConfiguration)
		result.Properties.AutoScaleConfiguration = &autoScaleConfiguration
	}
	if gateway.BgpSettings != nil {
		bgpSettings_ARM, err := gateway.BgpSettings.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		bgpSettings := *bgpSettings_ARM.(*arm.BgpSettings)
		result.Properties.BgpSettings = &bgpSettings
	}
	if gateway.CustomRoutes != nil {
		customRoutes_ARM, err := gateway.CustomRoutes.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		customRoutes := *customRoutes_ARM.(*arm.AddressSpace)
		result.Properties.CustomRoutes = &customRoutes
	}
	if gateway.DisableIPSecReplayProtection != nil {
		disableIPSecReplayProtection := *gateway.DisableIPSecReplayProtection
		result.Properties.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	}
	if gateway.EnableBgp != nil {
		enableBgp := *gateway.EnableBgp
		result.Properties.EnableBgp = &enableBgp
	}
	if gateway.EnableBgpRouteTranslationForNat != nil {
		enableBgpRouteTranslationForNat := *gateway.EnableBgpRouteTranslationForNat
		result.Properties.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
	}
	if gateway.EnableDnsForwarding != nil {
		enableDnsForwarding := *gateway.EnableDnsForwarding
		result.Properties.EnableDnsForwarding = &enableDnsForwarding
	}
	if gateway.EnablePrivateIpAddress != nil {
		enablePrivateIpAddress := *gateway.EnablePrivateIpAddress
		result.Properties.EnablePrivateIpAddress = &enablePrivateIpAddress
	}
	if gateway.GatewayDefaultSite != nil {
		gatewayDefaultSite_ARM, err := gateway.GatewayDefaultSite.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		gatewayDefaultSite := *gatewayDefaultSite_ARM.(*arm.SubResource)
		result.Properties.GatewayDefaultSite = &gatewayDefaultSite
	}
	if gateway.GatewayType != nil {
		var temp string
		temp = string(*gateway.GatewayType)
		gatewayType := arm.VirtualNetworkGatewayPropertiesFormat_GatewayType(temp)
		result.Properties.GatewayType = &gatewayType
	}
	for _, item := range gateway.IpConfigurations {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.IpConfigurations = append(result.Properties.IpConfigurations, *item_ARM.(*arm.VirtualNetworkGatewayIPConfiguration))
	}
	for _, item := range gateway.NatRules {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.NatRules = append(result.Properties.NatRules, *item_ARM.(*arm.VirtualNetworkGatewayNatRule))
	}
	if gateway.ResiliencyModel != nil {
		var temp string
		temp = string(*gateway.ResiliencyModel)
		resiliencyModel := arm.VirtualNetworkGatewayPropertiesFormat_ResiliencyModel(temp)
		result.Properties.ResiliencyModel = &resiliencyModel
	}
	if gateway.Sku != nil {
		sku_ARM, err := gateway.Sku.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sku := *sku_ARM.(*arm.VirtualNetworkGatewaySku)
		result.Properties.Sku = &sku
	}
	if gateway.VNetExtendedLocationResourceReference != nil {
		vNetExtendedLocationResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*gateway.VNetExtendedLocationResourceReference)
		if err != nil {
			return nil, err
		}
		vNetExtendedLocationResourceId := vNetExtendedLocationResourceIdARMID
		result.Properties.VNetExtendedLocationResourceId = &vNetExtendedLocationResourceId
	}
	for _, item := range gateway.VirtualNetworkGatewayPolicyGroups {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.VirtualNetworkGatewayPolicyGroups = append(result.Properties.VirtualNetworkGatewayPolicyGroups, *item_ARM.(*arm.VirtualNetworkGatewayPolicyGroup))
	}
	if gateway.VpnClientConfiguration != nil {
		vpnClientConfiguration_ARM, err := gateway.VpnClientConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		vpnClientConfiguration := *vpnClientConfiguration_ARM.(*arm.VpnClientConfiguration)
		result.Properties.VpnClientConfiguration = &vpnClientConfiguration
	}
	if gateway.VpnGatewayGeneration != nil {
		var temp string
		temp = string(*gateway.VpnGatewayGeneration)
		vpnGatewayGeneration := arm.VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration(temp)
		result.Properties.VpnGatewayGeneration = &vpnGatewayGeneration
	}
	if gateway.VpnType != nil {
		var temp string
		temp = string(*gateway.VpnType)
		vpnType := arm.VirtualNetworkGatewayPropertiesFormat_VpnType(temp)
		result.Properties.VpnType = &vpnType
	}

	// Set property "Tags":
	if gateway.Tags != nil {
		result.Tags = make(map[string]string, len(gateway.Tags))
		for key, value := range gateway.Tags {
			result.Tags[key] = value
		}
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (gateway *VirtualNetworkGateway_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGateway_Spec{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (gateway *VirtualNetworkGateway_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGateway_Spec)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGateway_Spec, got %T", armInput)
	}

	// Set property "ActiveActive":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ActiveActive != nil {
			activeActive := *typedInput.Properties.ActiveActive
			gateway.ActiveActive = &activeActive
		}
	}

	// Set property "AdminState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AdminState != nil {
			var temp string
			temp = string(*typedInput.Properties.AdminState)
			adminState := VirtualNetworkGatewayPropertiesFormat_AdminState(temp)
			gateway.AdminState = &adminState
		}
	}

	// Set property "AllowRemoteVnetTraffic":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowRemoteVnetTraffic != nil {
			allowRemoteVnetTraffic := *typedInput.Properties.AllowRemoteVnetTraffic
			gateway.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
		}
	}

	// Set property "AllowVirtualWanTraffic":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowVirtualWanTraffic != nil {
			allowVirtualWanTraffic := *typedInput.Properties.AllowVirtualWanTraffic
			gateway.AllowVirtualWanTraffic = &allowVirtualWanTraffic
		}
	}

	// Set property "AutoScaleConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AutoScaleConfiguration != nil {
			var autoScaleConfiguration1 VirtualNetworkGatewayAutoScaleConfiguration
			err := autoScaleConfiguration1.PopulateFromARM(owner, *typedInput.Properties.AutoScaleConfiguration)
			if err != nil {
				return err
			}
			autoScaleConfiguration := autoScaleConfiguration1
			gateway.AutoScaleConfiguration = &autoScaleConfiguration
		}
	}

	// Set property "AzureName":
	gateway.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name))

	// Set property "BgpSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BgpSettings != nil {
			var bgpSettings1 BgpSettings
			err := bgpSettings1.PopulateFromARM(owner, *typedInput.Properties.BgpSettings)
			if err != nil {
				return err
			}
			bgpSettings := bgpSettings1
			gateway.BgpSettings = &bgpSettings
		}
	}

	// Set property "CustomRoutes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomRoutes != nil {
			var customRoutes1 AddressSpace
			err := customRoutes1.PopulateFromARM(owner, *typedInput.Properties.CustomRoutes)
			if err != nil {
				return err
			}
			customRoutes := customRoutes1
			gateway.CustomRoutes = &customRoutes
		}
	}

	// Set property "DisableIPSecReplayProtection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableIPSecReplayProtection != nil {
			disableIPSecReplayProtection := *typedInput.Properties.DisableIPSecReplayProtection
			gateway.DisableIPSecReplayProtection = &disableIPSecReplayProtection
		}
	}

	// Set property "EnableBgp":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableBgp != nil {
			enableBgp := *typedInput.Properties.EnableBgp
			gateway.EnableBgp = &enableBgp
		}
	}

	// Set property "EnableBgpRouteTranslationForNat":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableBgpRouteTranslationForNat != nil {
			enableBgpRouteTranslationForNat := *typedInput.Properties.EnableBgpRouteTranslationForNat
			gateway.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
		}
	}

	// Set property "EnableDnsForwarding":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableDnsForwarding != nil {
			enableDnsForwarding := *typedInput.Properties.EnableDnsForwarding
			gateway.EnableDnsForwarding = &enableDnsForwarding
		}
	}

	// Set property "EnablePrivateIpAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnablePrivateIpAddress != nil {
			enablePrivateIpAddress := *typedInput.Properties.EnablePrivateIpAddress
			gateway.EnablePrivateIpAddress = &enablePrivateIpAddress
		}
	}

	// Set property "ExtendedLocation":
	if typedInput.ExtendedLocation != nil {
		var extendedLocation1 ExtendedLocation
		err := extendedLocation1.PopulateFromARM(owner, *typedInput.ExtendedLocation)
		if err != nil {
			return err
		}
		extendedLocation := extendedLocation1
		gateway.ExtendedLocation = &extendedLocation
	}

	// Set property "GatewayDefaultSite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GatewayDefaultSite != nil {
			var gatewayDefaultSite1 SubResource
			err := gatewayDefaultSite1.PopulateFromARM(owner, *typedInput.Properties.GatewayDefaultSite)
			if err != nil {
				return err
			}
			gatewayDefaultSite := gatewayDefaultSite1
			gateway.GatewayDefaultSite = &gatewayDefaultSite
		}
	}

	// Set property "GatewayType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GatewayType != nil {
			var temp string
			temp = string(*typedInput.Properties.GatewayType)
			gatewayType := VirtualNetworkGatewayPropertiesFormat_GatewayType(temp)
			gateway.GatewayType = &gatewayType
		}
	}

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ManagedServiceIdentity
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		gateway.Identity = &identity
	}

	// Set property "IpConfigurations":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.IpConfigurations {
			var item1 VirtualNetworkGatewayIPConfiguration
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			gateway.IpConfigurations = append(gateway.IpConfigurations, item1)
		}
	}

	// Set property "Location":
	if typedInput.Location != nil {
		location := *typedInput.Location
		gateway.Location = &location
	}

	// Set property "NatRules":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.NatRules {
			var item1 VirtualNetworkGatewayNatRule
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			gateway.NatRules = append(gateway.NatRules, item1)
		}
	}

	// no assignment for property "OperatorSpec"

	// Set property "Owner":
	gateway.Owner = &genruntime.KnownResourceReference{
		Name:  owner.Name,
		ARMID: owner.ARMID,
	}

	// Set property "ResiliencyModel":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResiliencyModel != nil {
			var temp string
			temp = string(*typedInput.Properties.ResiliencyModel)
			resiliencyModel := VirtualNetworkGatewayPropertiesFormat_ResiliencyModel(temp)
			gateway.ResiliencyModel = &resiliencyModel
		}
	}

	// Set property "Sku":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Sku != nil {
			var sku1 VirtualNetworkGatewaySku
			err := sku1.PopulateFromARM(owner, *typedInput.Properties.Sku)
			if err != nil {
				return err
			}
			sku := sku1
			gateway.Sku = &sku
		}
	}

	// Set property "Tags":
	if typedInput.Tags != nil {
		gateway.Tags = make(map[string]string, len(typedInput.Tags))
		for key, value := range typedInput.Tags {
			gateway.Tags[key] = value
		}
	}

	// no assignment for property "VNetExtendedLocationResourceReference"

	// Set property "VirtualNetworkGatewayPolicyGroups":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.VirtualNetworkGatewayPolicyGroups {
			var item1 VirtualNetworkGatewayPolicyGroup
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			gateway.VirtualNetworkGatewayPolicyGroups = append(gateway.VirtualNetworkGatewayPolicyGroups, item1)
		}
	}

	// Set property "VpnClientConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VpnClientConfiguration != nil {
			var vpnClientConfiguration1 VpnClientConfiguration
			err := vpnClientConfiguration1.PopulateFromARM(owner, *typedInput.Properties.VpnClientConfiguration)
			if err != nil {
				return err
			}
			vpnClientConfiguration := vpnClientConfiguration1
			gateway.VpnClientConfiguration = &vpnClientConfiguration
		}
	}

	// Set property "VpnGatewayGeneration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VpnGatewayGeneration != nil {
			var temp string
			temp = string(*typedInput.Properties.VpnGatewayGeneration)
			vpnGatewayGeneration := VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration(temp)
			gateway.VpnGatewayGeneration = &vpnGatewayGeneration
		}
	}

	// Set property "VpnType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VpnType != nil {
			var temp string
			temp = string(*typedInput.Properties.VpnType)
			vpnType := VirtualNetworkGatewayPropertiesFormat_VpnType(temp)
			gateway.VpnType = &vpnType
		}
	}

	// No error
	return nil
}

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.(*storage.VirtualNetworkGateway_Spec)
	if ok {
		// Populate our instance from source
		return gateway.AssignProperties_From_VirtualNetworkGateway_Spec(src)
	}

	// Convert to an intermediate form
	src = &storage.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.(*storage.VirtualNetworkGateway_Spec)
	if ok {
		// Populate destination from our instance
		return gateway.AssignProperties_To_VirtualNetworkGateway_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &storage.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 *storage.VirtualNetworkGateway_Spec) error {

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

	// AdminState
	if source.AdminState != nil {
		adminState := *source.AdminState
		adminStateTemp := genruntime.ToEnum(adminState, virtualNetworkGatewayPropertiesFormat_AdminState_Values)
		gateway.AdminState = &adminStateTemp
	} else {
		gateway.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if source.AllowRemoteVnetTraffic != nil {
		allowRemoteVnetTraffic := *source.AllowRemoteVnetTraffic
		gateway.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		gateway.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if source.AllowVirtualWanTraffic != nil {
		allowVirtualWanTraffic := *source.AllowVirtualWanTraffic
		gateway.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		gateway.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if source.AutoScaleConfiguration != nil {
		var autoScaleConfiguration VirtualNetworkGatewayAutoScaleConfiguration
		err := autoScaleConfiguration.AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration(source.AutoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration() to populate field AutoScaleConfiguration")
		}
		gateway.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		gateway.AutoScaleConfiguration = nil
	}

	// 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 {
		disableIPSecReplayProtection := *source.DisableIPSecReplayProtection
		gateway.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		gateway.DisableIPSecReplayProtection = nil
	}

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

	// EnableBgpRouteTranslationForNat
	if source.EnableBgpRouteTranslationForNat != nil {
		enableBgpRouteTranslationForNat := *source.EnableBgpRouteTranslationForNat
		gateway.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
	} else {
		gateway.EnableBgpRouteTranslationForNat = nil
	}

	// 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 extendedLocation ExtendedLocation
		err := extendedLocation.AssignProperties_From_ExtendedLocation(source.ExtendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocation")
		}
		gateway.ExtendedLocation = &extendedLocation
	} else {
		gateway.ExtendedLocation = nil
	}

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

	// GatewayType
	if source.GatewayType != nil {
		gatewayType := *source.GatewayType
		gatewayTypeTemp := genruntime.ToEnum(gatewayType, virtualNetworkGatewayPropertiesFormat_GatewayType_Values)
		gateway.GatewayType = &gatewayTypeTemp
	} else {
		gateway.GatewayType = nil
	}

	// Identity
	if source.Identity != nil {
		var identity ManagedServiceIdentity
		err := identity.AssignProperties_From_ManagedServiceIdentity(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedServiceIdentity() to populate field Identity")
		}
		gateway.Identity = &identity
	} else {
		gateway.Identity = nil
	}

	// 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 source.NatRules != nil {
		natRuleList := make([]VirtualNetworkGatewayNatRule, len(source.NatRules))
		for natRuleIndex, natRuleItem := range source.NatRules {
			var natRule VirtualNetworkGatewayNatRule
			err := natRule.AssignProperties_From_VirtualNetworkGatewayNatRule(&natRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayNatRule() to populate field NatRules")
			}
			natRuleList[natRuleIndex] = natRule
		}
		gateway.NatRules = natRuleList
	} else {
		gateway.NatRules = nil
	}

	// 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
	}

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

	// ResiliencyModel
	if source.ResiliencyModel != nil {
		resiliencyModel := *source.ResiliencyModel
		resiliencyModelTemp := genruntime.ToEnum(resiliencyModel, virtualNetworkGatewayPropertiesFormat_ResiliencyModel_Values)
		gateway.ResiliencyModel = &resiliencyModelTemp
	} else {
		gateway.ResiliencyModel = nil
	}

	// 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 source.VirtualNetworkGatewayPolicyGroups != nil {
		virtualNetworkGatewayPolicyGroupList := make([]VirtualNetworkGatewayPolicyGroup, len(source.VirtualNetworkGatewayPolicyGroups))
		for virtualNetworkGatewayPolicyGroupIndex, virtualNetworkGatewayPolicyGroupItem := range source.VirtualNetworkGatewayPolicyGroups {
			var virtualNetworkGatewayPolicyGroup VirtualNetworkGatewayPolicyGroup
			err := virtualNetworkGatewayPolicyGroup.AssignProperties_From_VirtualNetworkGatewayPolicyGroup(&virtualNetworkGatewayPolicyGroupItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayPolicyGroup() to populate field VirtualNetworkGatewayPolicyGroups")
			}
			virtualNetworkGatewayPolicyGroupList[virtualNetworkGatewayPolicyGroupIndex] = virtualNetworkGatewayPolicyGroup
		}
		gateway.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroupList
	} else {
		gateway.VirtualNetworkGatewayPolicyGroups = nil
	}

	// 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
	if source.VpnGatewayGeneration != nil {
		vpnGatewayGeneration := *source.VpnGatewayGeneration
		vpnGatewayGenerationTemp := genruntime.ToEnum(vpnGatewayGeneration, virtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Values)
		gateway.VpnGatewayGeneration = &vpnGatewayGenerationTemp
	} else {
		gateway.VpnGatewayGeneration = nil
	}

	// VpnType
	if source.VpnType != nil {
		vpnType := *source.VpnType
		vpnTypeTemp := genruntime.ToEnum(vpnType, virtualNetworkGatewayPropertiesFormat_VpnType_Values)
		gateway.VpnType = &vpnTypeTemp
	} else {
		gateway.VpnType = nil
	}

	// 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 *storage.VirtualNetworkGateway_Spec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// AdminState
	if gateway.AdminState != nil {
		adminState := string(*gateway.AdminState)
		destination.AdminState = &adminState
	} else {
		destination.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if gateway.AllowRemoteVnetTraffic != nil {
		allowRemoteVnetTraffic := *gateway.AllowRemoteVnetTraffic
		destination.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		destination.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if gateway.AllowVirtualWanTraffic != nil {
		allowVirtualWanTraffic := *gateway.AllowVirtualWanTraffic
		destination.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		destination.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if gateway.AutoScaleConfiguration != nil {
		var autoScaleConfiguration storage.VirtualNetworkGatewayAutoScaleConfiguration
		err := gateway.AutoScaleConfiguration.AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration(&autoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration() to populate field AutoScaleConfiguration")
		}
		destination.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		destination.AutoScaleConfiguration = nil
	}

	// AzureName
	destination.AzureName = gateway.AzureName

	// BgpSettings
	if gateway.BgpSettings != nil {
		var bgpSetting storage.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 storage.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 gateway.DisableIPSecReplayProtection != nil {
		disableIPSecReplayProtection := *gateway.DisableIPSecReplayProtection
		destination.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		destination.DisableIPSecReplayProtection = nil
	}

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

	// EnableBgpRouteTranslationForNat
	if gateway.EnableBgpRouteTranslationForNat != nil {
		enableBgpRouteTranslationForNat := *gateway.EnableBgpRouteTranslationForNat
		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 extendedLocation storage.ExtendedLocation
		err := gateway.ExtendedLocation.AssignProperties_To_ExtendedLocation(&extendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocation")
		}
		destination.ExtendedLocation = &extendedLocation
	} else {
		destination.ExtendedLocation = nil
	}

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

	// GatewayType
	if gateway.GatewayType != nil {
		gatewayType := string(*gateway.GatewayType)
		destination.GatewayType = &gatewayType
	} else {
		destination.GatewayType = nil
	}

	// Identity
	if gateway.Identity != nil {
		var identity storage.ManagedServiceIdentity
		err := gateway.Identity.AssignProperties_To_ManagedServiceIdentity(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedServiceIdentity() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

	// IpConfigurations
	if gateway.IpConfigurations != nil {
		ipConfigurationList := make([]storage.VirtualNetworkGatewayIPConfiguration, len(gateway.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range gateway.IpConfigurations {
			var ipConfiguration storage.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 gateway.NatRules != nil {
		natRuleList := make([]storage.VirtualNetworkGatewayNatRule, len(gateway.NatRules))
		for natRuleIndex, natRuleItem := range gateway.NatRules {
			var natRule storage.VirtualNetworkGatewayNatRule
			err := natRuleItem.AssignProperties_To_VirtualNetworkGatewayNatRule(&natRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayNatRule() to populate field NatRules")
			}
			natRuleList[natRuleIndex] = natRule
		}
		destination.NatRules = natRuleList
	} else {
		destination.NatRules = nil
	}

	// OperatorSpec
	if gateway.OperatorSpec != nil {
		var operatorSpec storage.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 gateway.ResiliencyModel != nil {
		resiliencyModel := string(*gateway.ResiliencyModel)
		destination.ResiliencyModel = &resiliencyModel
	} else {
		destination.ResiliencyModel = nil
	}

	// Sku
	if gateway.Sku != nil {
		var sku storage.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 gateway.VirtualNetworkGatewayPolicyGroups != nil {
		virtualNetworkGatewayPolicyGroupList := make([]storage.VirtualNetworkGatewayPolicyGroup, len(gateway.VirtualNetworkGatewayPolicyGroups))
		for virtualNetworkGatewayPolicyGroupIndex, virtualNetworkGatewayPolicyGroupItem := range gateway.VirtualNetworkGatewayPolicyGroups {
			var virtualNetworkGatewayPolicyGroup storage.VirtualNetworkGatewayPolicyGroup
			err := virtualNetworkGatewayPolicyGroupItem.AssignProperties_To_VirtualNetworkGatewayPolicyGroup(&virtualNetworkGatewayPolicyGroup)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayPolicyGroup() to populate field VirtualNetworkGatewayPolicyGroups")
			}
			virtualNetworkGatewayPolicyGroupList[virtualNetworkGatewayPolicyGroupIndex] = virtualNetworkGatewayPolicyGroup
		}
		destination.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroupList
	} else {
		destination.VirtualNetworkGatewayPolicyGroups = nil
	}

	// VpnClientConfiguration
	if gateway.VpnClientConfiguration != nil {
		var vpnClientConfiguration storage.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
	if gateway.VpnGatewayGeneration != nil {
		vpnGatewayGeneration := string(*gateway.VpnGatewayGeneration)
		destination.VpnGatewayGeneration = &vpnGatewayGeneration
	} else {
		destination.VpnGatewayGeneration = nil
	}

	// VpnType
	if gateway.VpnType != nil {
		vpnType := string(*gateway.VpnType)
		destination.VpnType = &vpnType
	} else {
		destination.VpnType = nil
	}

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGateway_STATUS populates our VirtualNetworkGateway_Spec from the provided source VirtualNetworkGateway_STATUS
func (gateway *VirtualNetworkGateway_Spec) Initialize_From_VirtualNetworkGateway_STATUS(source *VirtualNetworkGateway_STATUS) error {

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

	// AdminState
	if source.AdminState != nil {
		adminState := genruntime.ToEnum(string(*source.AdminState), virtualNetworkGatewayPropertiesFormat_AdminState_Values)
		gateway.AdminState = &adminState
	} else {
		gateway.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if source.AllowRemoteVnetTraffic != nil {
		allowRemoteVnetTraffic := *source.AllowRemoteVnetTraffic
		gateway.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		gateway.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if source.AllowVirtualWanTraffic != nil {
		allowVirtualWanTraffic := *source.AllowVirtualWanTraffic
		gateway.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		gateway.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if source.AutoScaleConfiguration != nil {
		var autoScaleConfiguration VirtualNetworkGatewayAutoScaleConfiguration
		err := autoScaleConfiguration.Initialize_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS(source.AutoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS() to populate field AutoScaleConfiguration")
		}
		gateway.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		gateway.AutoScaleConfiguration = nil
	}

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

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

	// DisableIPSecReplayProtection
	if source.DisableIPSecReplayProtection != nil {
		disableIPSecReplayProtection := *source.DisableIPSecReplayProtection
		gateway.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		gateway.DisableIPSecReplayProtection = nil
	}

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

	// EnableBgpRouteTranslationForNat
	if source.EnableBgpRouteTranslationForNat != nil {
		enableBgpRouteTranslationForNat := *source.EnableBgpRouteTranslationForNat
		gateway.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
	} else {
		gateway.EnableBgpRouteTranslationForNat = nil
	}

	// 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 extendedLocation ExtendedLocation
		err := extendedLocation.Initialize_From_ExtendedLocation_STATUS(source.ExtendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ExtendedLocation_STATUS() to populate field ExtendedLocation")
		}
		gateway.ExtendedLocation = &extendedLocation
	} else {
		gateway.ExtendedLocation = nil
	}

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

	// GatewayType
	if source.GatewayType != nil {
		gatewayType := genruntime.ToEnum(string(*source.GatewayType), virtualNetworkGatewayPropertiesFormat_GatewayType_Values)
		gateway.GatewayType = &gatewayType
	} else {
		gateway.GatewayType = nil
	}

	// Identity
	if source.Identity != nil {
		var identity ManagedServiceIdentity
		err := identity.Initialize_From_ManagedServiceIdentity_STATUS(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ManagedServiceIdentity_STATUS() to populate field Identity")
		}
		gateway.Identity = &identity
	} else {
		gateway.Identity = nil
	}

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

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

	// NatRules
	if source.NatRules != nil {
		natRuleList := make([]VirtualNetworkGatewayNatRule, len(source.NatRules))
		for natRuleIndex, natRuleItem := range source.NatRules {
			var natRule VirtualNetworkGatewayNatRule
			err := natRule.Initialize_From_VirtualNetworkGatewayNatRule_STATUS(&natRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VirtualNetworkGatewayNatRule_STATUS() to populate field NatRules")
			}
			natRuleList[natRuleIndex] = natRule
		}
		gateway.NatRules = natRuleList
	} else {
		gateway.NatRules = nil
	}

	// ResiliencyModel
	if source.ResiliencyModel != nil {
		resiliencyModel := genruntime.ToEnum(string(*source.ResiliencyModel), virtualNetworkGatewayPropertiesFormat_ResiliencyModel_Values)
		gateway.ResiliencyModel = &resiliencyModel
	} else {
		gateway.ResiliencyModel = nil
	}

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

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

	// VNetExtendedLocationResourceReference
	if source.VNetExtendedLocationResourceId != nil {
		vNetExtendedLocationResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.VNetExtendedLocationResourceId)
		gateway.VNetExtendedLocationResourceReference = &vNetExtendedLocationResourceReference
	} else {
		gateway.VNetExtendedLocationResourceReference = nil
	}

	// VirtualNetworkGatewayPolicyGroups
	if source.VirtualNetworkGatewayPolicyGroups != nil {
		virtualNetworkGatewayPolicyGroupList := make([]VirtualNetworkGatewayPolicyGroup, len(source.VirtualNetworkGatewayPolicyGroups))
		for virtualNetworkGatewayPolicyGroupIndex, virtualNetworkGatewayPolicyGroupItem := range source.VirtualNetworkGatewayPolicyGroups {
			var virtualNetworkGatewayPolicyGroup VirtualNetworkGatewayPolicyGroup
			err := virtualNetworkGatewayPolicyGroup.Initialize_From_VirtualNetworkGatewayPolicyGroup_STATUS(&virtualNetworkGatewayPolicyGroupItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VirtualNetworkGatewayPolicyGroup_STATUS() to populate field VirtualNetworkGatewayPolicyGroups")
			}
			virtualNetworkGatewayPolicyGroupList[virtualNetworkGatewayPolicyGroupIndex] = virtualNetworkGatewayPolicyGroup
		}
		gateway.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroupList
	} else {
		gateway.VirtualNetworkGatewayPolicyGroups = nil
	}

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

	// VpnGatewayGeneration
	if source.VpnGatewayGeneration != nil {
		vpnGatewayGeneration := genruntime.ToEnum(string(*source.VpnGatewayGeneration), virtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Values)
		gateway.VpnGatewayGeneration = &vpnGatewayGeneration
	} else {
		gateway.VpnGatewayGeneration = nil
	}

	// VpnType
	if source.VpnType != nil {
		vpnType := genruntime.ToEnum(string(*source.VpnType), virtualNetworkGatewayPropertiesFormat_VpnType_Values)
		gateway.VpnType = &vpnType
	} else {
		gateway.VpnType = nil
	}

	// No error
	return nil
}

// OriginalVersion returns the original API version used to create the resource.
func (gateway *VirtualNetworkGateway_Spec) OriginalVersion() string {
	return GroupVersion.Version
}

// SetAzureName sets the Azure name of the resource
func (gateway *VirtualNetworkGateway_Spec) SetAzureName(azureName string) {
	gateway.AzureName = azureName
}

// A common class for general resource information.
type VirtualNetworkGateway_STATUS struct {
	// ActiveActive: ActiveActive flag.
	ActiveActive *bool `json:"activeActive,omitempty"`

	// AdminState: Property to indicate if the Express Route Gateway serves traffic when there are multiple Express Route
	// Gateways in the vnet
	AdminState *VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS `json:"adminState,omitempty"`

	// AllowRemoteVnetTraffic: Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration
	// does not support connectivity to Azure Virtual WAN.
	AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"`

	// AllowVirtualWanTraffic: Configures this gateway to accept traffic from remote Virtual WAN networks.
	AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"`

	// AutoScaleConfiguration: Autoscale configuration for virutal network gateway
	AutoScaleConfiguration *VirtualNetworkGatewayAutoScaleConfiguration_STATUS `json:"autoScaleConfiguration,omitempty"`

	// BgpSettings: Virtual network gateway's BGP speaker settings.
	BgpSettings *BgpSettings_STATUS `json:"bgpSettings,omitempty"`

	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// CustomRoutes: The reference to the address space resource which represents the custom routes address space specified by
	// the customer for virtual network gateway and VpnClient.
	CustomRoutes *AddressSpace_STATUS `json:"customRoutes,omitempty"`

	// DisableIPSecReplayProtection: disableIPSecReplayProtection flag.
	DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"`

	// EnableBgp: Whether BGP is enabled for this virtual network gateway or not.
	EnableBgp *bool `json:"enableBgp,omitempty"`

	// EnableBgpRouteTranslationForNat: EnableBgpRouteTranslationForNat flag.
	EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"`

	// EnableDnsForwarding: Whether dns forwarding is enabled or not.
	EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"`

	// EnablePrivateIpAddress: Whether private IP needs to be enabled on this gateway for connections or not.
	EnablePrivateIpAddress *bool `json:"enablePrivateIpAddress,omitempty"`

	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// ExtendedLocation: The extended location of type local virtual network gateway.
	ExtendedLocation *ExtendedLocation_STATUS `json:"extendedLocation,omitempty"`

	// GatewayDefaultSite: The reference to the LocalNetworkGateway resource which represents local network site having default
	// routes. Assign Null value in case of removing existing default site setting.
	GatewayDefaultSite *SubResource_STATUS `json:"gatewayDefaultSite,omitempty"`

	// GatewayType: The type of this virtual network gateway.
	GatewayType *VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS `json:"gatewayType,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// Identity: The identity of the virtual network gateway, if configured.
	Identity *ManagedServiceIdentity_STATUS `json:"identity,omitempty"`

	// InboundDnsForwardingEndpoint: The IP address allocated by the gateway to which dns requests can be sent.
	InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"`

	// IpConfigurations: IP configurations for virtual network gateway.
	IpConfigurations []VirtualNetworkGatewayIPConfiguration_STATUS `json:"ipConfigurations,omitempty"`

	// Location: Resource location.
	Location *string `json:"location,omitempty"`

	// Name: Resource name.
	Name *string `json:"name,omitempty"`

	// NatRules: NatRules for virtual network gateway.
	NatRules []VirtualNetworkGatewayNatRule_STATUS `json:"natRules,omitempty"`

	// ProvisioningState: The provisioning state of the virtual network gateway resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// ResiliencyModel: Property to indicate if the Express Route Gateway has resiliency model of MultiHomed or SingleHomed
	ResiliencyModel *VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS `json:"resiliencyModel,omitempty"`

	// ResourceGuid: The resource GUID property of the virtual network gateway resource.
	ResourceGuid *string `json:"resourceGuid,omitempty"`

	// Sku: The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network
	// gateway.
	Sku *VirtualNetworkGatewaySku_STATUS `json:"sku,omitempty"`

	// Tags: Resource tags.
	Tags map[string]string `json:"tags,omitempty"`

	// Type: Resource type.
	Type *string `json:"type,omitempty"`

	// VNetExtendedLocationResourceId: Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated
	// with the customer vnet.
	VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"`

	// VirtualNetworkGatewayPolicyGroups: The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the
	// available VirtualNetworkGatewayPolicyGroup for the gateway.
	VirtualNetworkGatewayPolicyGroups []VirtualNetworkGatewayPolicyGroup_STATUS `json:"virtualNetworkGatewayPolicyGroups,omitempty"`

	// VpnClientConfiguration: The reference to the VpnClientConfiguration resource which represents the P2S VpnClient
	// configurations.
	VpnClientConfiguration *VpnClientConfiguration_STATUS `json:"vpnClientConfiguration,omitempty"`

	// VpnGatewayGeneration: The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN.
	VpnGatewayGeneration *VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS `json:"vpnGatewayGeneration,omitempty"`

	// VpnType: The type of this virtual network gateway.
	VpnType *VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS `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.(*storage.VirtualNetworkGateway_STATUS)
	if ok {
		// Populate our instance from source
		return gateway.AssignProperties_From_VirtualNetworkGateway_STATUS(src)
	}

	// Convert to an intermediate form
	src = &storage.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.(*storage.VirtualNetworkGateway_STATUS)
	if ok {
		// Populate destination from our instance
		return gateway.AssignProperties_To_VirtualNetworkGateway_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &storage.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
}

var _ genruntime.FromARMConverter = &VirtualNetworkGateway_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (gateway *VirtualNetworkGateway_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGateway_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (gateway *VirtualNetworkGateway_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGateway_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGateway_STATUS, got %T", armInput)
	}

	// Set property "ActiveActive":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ActiveActive != nil {
			activeActive := *typedInput.Properties.ActiveActive
			gateway.ActiveActive = &activeActive
		}
	}

	// Set property "AdminState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AdminState != nil {
			var temp string
			temp = string(*typedInput.Properties.AdminState)
			adminState := VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS(temp)
			gateway.AdminState = &adminState
		}
	}

	// Set property "AllowRemoteVnetTraffic":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowRemoteVnetTraffic != nil {
			allowRemoteVnetTraffic := *typedInput.Properties.AllowRemoteVnetTraffic
			gateway.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
		}
	}

	// Set property "AllowVirtualWanTraffic":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowVirtualWanTraffic != nil {
			allowVirtualWanTraffic := *typedInput.Properties.AllowVirtualWanTraffic
			gateway.AllowVirtualWanTraffic = &allowVirtualWanTraffic
		}
	}

	// Set property "AutoScaleConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AutoScaleConfiguration != nil {
			var autoScaleConfiguration1 VirtualNetworkGatewayAutoScaleConfiguration_STATUS
			err := autoScaleConfiguration1.PopulateFromARM(owner, *typedInput.Properties.AutoScaleConfiguration)
			if err != nil {
				return err
			}
			autoScaleConfiguration := autoScaleConfiguration1
			gateway.AutoScaleConfiguration = &autoScaleConfiguration
		}
	}

	// Set property "BgpSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BgpSettings != nil {
			var bgpSettings1 BgpSettings_STATUS
			err := bgpSettings1.PopulateFromARM(owner, *typedInput.Properties.BgpSettings)
			if err != nil {
				return err
			}
			bgpSettings := bgpSettings1
			gateway.BgpSettings = &bgpSettings
		}
	}

	// no assignment for property "Conditions"

	// Set property "CustomRoutes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomRoutes != nil {
			var customRoutes1 AddressSpace_STATUS
			err := customRoutes1.PopulateFromARM(owner, *typedInput.Properties.CustomRoutes)
			if err != nil {
				return err
			}
			customRoutes := customRoutes1
			gateway.CustomRoutes = &customRoutes
		}
	}

	// Set property "DisableIPSecReplayProtection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableIPSecReplayProtection != nil {
			disableIPSecReplayProtection := *typedInput.Properties.DisableIPSecReplayProtection
			gateway.DisableIPSecReplayProtection = &disableIPSecReplayProtection
		}
	}

	// Set property "EnableBgp":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableBgp != nil {
			enableBgp := *typedInput.Properties.EnableBgp
			gateway.EnableBgp = &enableBgp
		}
	}

	// Set property "EnableBgpRouteTranslationForNat":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableBgpRouteTranslationForNat != nil {
			enableBgpRouteTranslationForNat := *typedInput.Properties.EnableBgpRouteTranslationForNat
			gateway.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
		}
	}

	// Set property "EnableDnsForwarding":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableDnsForwarding != nil {
			enableDnsForwarding := *typedInput.Properties.EnableDnsForwarding
			gateway.EnableDnsForwarding = &enableDnsForwarding
		}
	}

	// Set property "EnablePrivateIpAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnablePrivateIpAddress != nil {
			enablePrivateIpAddress := *typedInput.Properties.EnablePrivateIpAddress
			gateway.EnablePrivateIpAddress = &enablePrivateIpAddress
		}
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		gateway.Etag = &etag
	}

	// Set property "ExtendedLocation":
	if typedInput.ExtendedLocation != nil {
		var extendedLocation1 ExtendedLocation_STATUS
		err := extendedLocation1.PopulateFromARM(owner, *typedInput.ExtendedLocation)
		if err != nil {
			return err
		}
		extendedLocation := extendedLocation1
		gateway.ExtendedLocation = &extendedLocation
	}

	// Set property "GatewayDefaultSite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GatewayDefaultSite != nil {
			var gatewayDefaultSite1 SubResource_STATUS
			err := gatewayDefaultSite1.PopulateFromARM(owner, *typedInput.Properties.GatewayDefaultSite)
			if err != nil {
				return err
			}
			gatewayDefaultSite := gatewayDefaultSite1
			gateway.GatewayDefaultSite = &gatewayDefaultSite
		}
	}

	// Set property "GatewayType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GatewayType != nil {
			var temp string
			temp = string(*typedInput.Properties.GatewayType)
			gatewayType := VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS(temp)
			gateway.GatewayType = &gatewayType
		}
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		gateway.Id = &id
	}

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ManagedServiceIdentity_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		gateway.Identity = &identity
	}

	// Set property "InboundDnsForwardingEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.InboundDnsForwardingEndpoint != nil {
			inboundDnsForwardingEndpoint := *typedInput.Properties.InboundDnsForwardingEndpoint
			gateway.InboundDnsForwardingEndpoint = &inboundDnsForwardingEndpoint
		}
	}

	// Set property "IpConfigurations":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.IpConfigurations {
			var item1 VirtualNetworkGatewayIPConfiguration_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			gateway.IpConfigurations = append(gateway.IpConfigurations, item1)
		}
	}

	// Set property "Location":
	if typedInput.Location != nil {
		location := *typedInput.Location
		gateway.Location = &location
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		gateway.Name = &name
	}

	// Set property "NatRules":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.NatRules {
			var item1 VirtualNetworkGatewayNatRule_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			gateway.NatRules = append(gateway.NatRules, item1)
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			gateway.ProvisioningState = &provisioningState
		}
	}

	// Set property "ResiliencyModel":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResiliencyModel != nil {
			var temp string
			temp = string(*typedInput.Properties.ResiliencyModel)
			resiliencyModel := VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS(temp)
			gateway.ResiliencyModel = &resiliencyModel
		}
	}

	// Set property "ResourceGuid":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResourceGuid != nil {
			resourceGuid := *typedInput.Properties.ResourceGuid
			gateway.ResourceGuid = &resourceGuid
		}
	}

	// Set property "Sku":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Sku != nil {
			var sku1 VirtualNetworkGatewaySku_STATUS
			err := sku1.PopulateFromARM(owner, *typedInput.Properties.Sku)
			if err != nil {
				return err
			}
			sku := sku1
			gateway.Sku = &sku
		}
	}

	// Set property "Tags":
	if typedInput.Tags != nil {
		gateway.Tags = make(map[string]string, len(typedInput.Tags))
		for key, value := range typedInput.Tags {
			gateway.Tags[key] = value
		}
	}

	// Set property "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		gateway.Type = &typeVar
	}

	// Set property "VNetExtendedLocationResourceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VNetExtendedLocationResourceId != nil {
			vNetExtendedLocationResourceId := *typedInput.Properties.VNetExtendedLocationResourceId
			gateway.VNetExtendedLocationResourceId = &vNetExtendedLocationResourceId
		}
	}

	// Set property "VirtualNetworkGatewayPolicyGroups":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.VirtualNetworkGatewayPolicyGroups {
			var item1 VirtualNetworkGatewayPolicyGroup_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			gateway.VirtualNetworkGatewayPolicyGroups = append(gateway.VirtualNetworkGatewayPolicyGroups, item1)
		}
	}

	// Set property "VpnClientConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VpnClientConfiguration != nil {
			var vpnClientConfiguration1 VpnClientConfiguration_STATUS
			err := vpnClientConfiguration1.PopulateFromARM(owner, *typedInput.Properties.VpnClientConfiguration)
			if err != nil {
				return err
			}
			vpnClientConfiguration := vpnClientConfiguration1
			gateway.VpnClientConfiguration = &vpnClientConfiguration
		}
	}

	// Set property "VpnGatewayGeneration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VpnGatewayGeneration != nil {
			var temp string
			temp = string(*typedInput.Properties.VpnGatewayGeneration)
			vpnGatewayGeneration := VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS(temp)
			gateway.VpnGatewayGeneration = &vpnGatewayGeneration
		}
	}

	// Set property "VpnType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VpnType != nil {
			var temp string
			temp = string(*typedInput.Properties.VpnType)
			vpnType := VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS(temp)
			gateway.VpnType = &vpnType
		}
	}

	// No error
	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 *storage.VirtualNetworkGateway_STATUS) error {

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

	// AdminState
	if source.AdminState != nil {
		adminState := *source.AdminState
		adminStateTemp := genruntime.ToEnum(adminState, virtualNetworkGatewayPropertiesFormat_AdminState_STATUS_Values)
		gateway.AdminState = &adminStateTemp
	} else {
		gateway.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if source.AllowRemoteVnetTraffic != nil {
		allowRemoteVnetTraffic := *source.AllowRemoteVnetTraffic
		gateway.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		gateway.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if source.AllowVirtualWanTraffic != nil {
		allowVirtualWanTraffic := *source.AllowVirtualWanTraffic
		gateway.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		gateway.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if source.AutoScaleConfiguration != nil {
		var autoScaleConfiguration VirtualNetworkGatewayAutoScaleConfiguration_STATUS
		err := autoScaleConfiguration.AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS(source.AutoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS() to populate field AutoScaleConfiguration")
		}
		gateway.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		gateway.AutoScaleConfiguration = nil
	}

	// 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 {
		disableIPSecReplayProtection := *source.DisableIPSecReplayProtection
		gateway.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		gateway.DisableIPSecReplayProtection = nil
	}

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

	// EnableBgpRouteTranslationForNat
	if source.EnableBgpRouteTranslationForNat != nil {
		enableBgpRouteTranslationForNat := *source.EnableBgpRouteTranslationForNat
		gateway.EnableBgpRouteTranslationForNat = &enableBgpRouteTranslationForNat
	} else {
		gateway.EnableBgpRouteTranslationForNat = nil
	}

	// 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 extendedLocation ExtendedLocation_STATUS
		err := extendedLocation.AssignProperties_From_ExtendedLocation_STATUS(source.ExtendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation")
		}
		gateway.ExtendedLocation = &extendedLocation
	} else {
		gateway.ExtendedLocation = nil
	}

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

	// GatewayType
	if source.GatewayType != nil {
		gatewayType := *source.GatewayType
		gatewayTypeTemp := genruntime.ToEnum(gatewayType, virtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_Values)
		gateway.GatewayType = &gatewayTypeTemp
	} else {
		gateway.GatewayType = nil
	}

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

	// Identity
	if source.Identity != nil {
		var identity ManagedServiceIdentity_STATUS
		err := identity.AssignProperties_From_ManagedServiceIdentity_STATUS(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedServiceIdentity_STATUS() to populate field Identity")
		}
		gateway.Identity = &identity
	} else {
		gateway.Identity = nil
	}

	// 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 source.NatRules != nil {
		natRuleList := make([]VirtualNetworkGatewayNatRule_STATUS, len(source.NatRules))
		for natRuleIndex, natRuleItem := range source.NatRules {
			var natRule VirtualNetworkGatewayNatRule_STATUS
			err := natRule.AssignProperties_From_VirtualNetworkGatewayNatRule_STATUS(&natRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayNatRule_STATUS() to populate field NatRules")
			}
			natRuleList[natRuleIndex] = natRule
		}
		gateway.NatRules = natRuleList
	} else {
		gateway.NatRules = nil
	}

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		gateway.ProvisioningState = &provisioningStateTemp
	} else {
		gateway.ProvisioningState = nil
	}

	// ResiliencyModel
	if source.ResiliencyModel != nil {
		resiliencyModel := *source.ResiliencyModel
		resiliencyModelTemp := genruntime.ToEnum(resiliencyModel, virtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS_Values)
		gateway.ResiliencyModel = &resiliencyModelTemp
	} else {
		gateway.ResiliencyModel = nil
	}

	// 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 source.VirtualNetworkGatewayPolicyGroups != nil {
		virtualNetworkGatewayPolicyGroupList := make([]VirtualNetworkGatewayPolicyGroup_STATUS, len(source.VirtualNetworkGatewayPolicyGroups))
		for virtualNetworkGatewayPolicyGroupIndex, virtualNetworkGatewayPolicyGroupItem := range source.VirtualNetworkGatewayPolicyGroups {
			var virtualNetworkGatewayPolicyGroup VirtualNetworkGatewayPolicyGroup_STATUS
			err := virtualNetworkGatewayPolicyGroup.AssignProperties_From_VirtualNetworkGatewayPolicyGroup_STATUS(&virtualNetworkGatewayPolicyGroupItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayPolicyGroup_STATUS() to populate field VirtualNetworkGatewayPolicyGroups")
			}
			virtualNetworkGatewayPolicyGroupList[virtualNetworkGatewayPolicyGroupIndex] = virtualNetworkGatewayPolicyGroup
		}
		gateway.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroupList
	} else {
		gateway.VirtualNetworkGatewayPolicyGroups = nil
	}

	// 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
	if source.VpnGatewayGeneration != nil {
		vpnGatewayGeneration := *source.VpnGatewayGeneration
		vpnGatewayGenerationTemp := genruntime.ToEnum(vpnGatewayGeneration, virtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_Values)
		gateway.VpnGatewayGeneration = &vpnGatewayGenerationTemp
	} else {
		gateway.VpnGatewayGeneration = nil
	}

	// VpnType
	if source.VpnType != nil {
		vpnType := *source.VpnType
		vpnTypeTemp := genruntime.ToEnum(vpnType, virtualNetworkGatewayPropertiesFormat_VpnType_STATUS_Values)
		gateway.VpnType = &vpnTypeTemp
	} else {
		gateway.VpnType = nil
	}

	// 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 *storage.VirtualNetworkGateway_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// AdminState
	if gateway.AdminState != nil {
		adminState := string(*gateway.AdminState)
		destination.AdminState = &adminState
	} else {
		destination.AdminState = nil
	}

	// AllowRemoteVnetTraffic
	if gateway.AllowRemoteVnetTraffic != nil {
		allowRemoteVnetTraffic := *gateway.AllowRemoteVnetTraffic
		destination.AllowRemoteVnetTraffic = &allowRemoteVnetTraffic
	} else {
		destination.AllowRemoteVnetTraffic = nil
	}

	// AllowVirtualWanTraffic
	if gateway.AllowVirtualWanTraffic != nil {
		allowVirtualWanTraffic := *gateway.AllowVirtualWanTraffic
		destination.AllowVirtualWanTraffic = &allowVirtualWanTraffic
	} else {
		destination.AllowVirtualWanTraffic = nil
	}

	// AutoScaleConfiguration
	if gateway.AutoScaleConfiguration != nil {
		var autoScaleConfiguration storage.VirtualNetworkGatewayAutoScaleConfiguration_STATUS
		err := gateway.AutoScaleConfiguration.AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration_STATUS(&autoScaleConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration_STATUS() to populate field AutoScaleConfiguration")
		}
		destination.AutoScaleConfiguration = &autoScaleConfiguration
	} else {
		destination.AutoScaleConfiguration = nil
	}

	// BgpSettings
	if gateway.BgpSettings != nil {
		var bgpSetting storage.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 storage.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 gateway.DisableIPSecReplayProtection != nil {
		disableIPSecReplayProtection := *gateway.DisableIPSecReplayProtection
		destination.DisableIPSecReplayProtection = &disableIPSecReplayProtection
	} else {
		destination.DisableIPSecReplayProtection = nil
	}

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

	// EnableBgpRouteTranslationForNat
	if gateway.EnableBgpRouteTranslationForNat != nil {
		enableBgpRouteTranslationForNat := *gateway.EnableBgpRouteTranslationForNat
		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 extendedLocation storage.ExtendedLocation_STATUS
		err := gateway.ExtendedLocation.AssignProperties_To_ExtendedLocation_STATUS(&extendedLocation)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ExtendedLocation_STATUS() to populate field ExtendedLocation")
		}
		destination.ExtendedLocation = &extendedLocation
	} else {
		destination.ExtendedLocation = nil
	}

	// GatewayDefaultSite
	if gateway.GatewayDefaultSite != nil {
		var gatewayDefaultSite storage.SubResource_STATUS
		err := gateway.GatewayDefaultSite.AssignProperties_To_SubResource_STATUS(&gatewayDefaultSite)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field GatewayDefaultSite")
		}
		destination.GatewayDefaultSite = &gatewayDefaultSite
	} else {
		destination.GatewayDefaultSite = nil
	}

	// GatewayType
	if gateway.GatewayType != nil {
		gatewayType := string(*gateway.GatewayType)
		destination.GatewayType = &gatewayType
	} else {
		destination.GatewayType = nil
	}

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

	// Identity
	if gateway.Identity != nil {
		var identity storage.ManagedServiceIdentity_STATUS
		err := gateway.Identity.AssignProperties_To_ManagedServiceIdentity_STATUS(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedServiceIdentity_STATUS() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

	// IpConfigurations
	if gateway.IpConfigurations != nil {
		ipConfigurationList := make([]storage.VirtualNetworkGatewayIPConfiguration_STATUS, len(gateway.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range gateway.IpConfigurations {
			var ipConfiguration storage.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 gateway.NatRules != nil {
		natRuleList := make([]storage.VirtualNetworkGatewayNatRule_STATUS, len(gateway.NatRules))
		for natRuleIndex, natRuleItem := range gateway.NatRules {
			var natRule storage.VirtualNetworkGatewayNatRule_STATUS
			err := natRuleItem.AssignProperties_To_VirtualNetworkGatewayNatRule_STATUS(&natRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayNatRule_STATUS() to populate field NatRules")
			}
			natRuleList[natRuleIndex] = natRule
		}
		destination.NatRules = natRuleList
	} else {
		destination.NatRules = nil
	}

	// ProvisioningState
	if gateway.ProvisioningState != nil {
		provisioningState := string(*gateway.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

	// ResiliencyModel
	if gateway.ResiliencyModel != nil {
		resiliencyModel := string(*gateway.ResiliencyModel)
		destination.ResiliencyModel = &resiliencyModel
	} else {
		destination.ResiliencyModel = nil
	}

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

	// Sku
	if gateway.Sku != nil {
		var sku storage.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 gateway.VirtualNetworkGatewayPolicyGroups != nil {
		virtualNetworkGatewayPolicyGroupList := make([]storage.VirtualNetworkGatewayPolicyGroup_STATUS, len(gateway.VirtualNetworkGatewayPolicyGroups))
		for virtualNetworkGatewayPolicyGroupIndex, virtualNetworkGatewayPolicyGroupItem := range gateway.VirtualNetworkGatewayPolicyGroups {
			var virtualNetworkGatewayPolicyGroup storage.VirtualNetworkGatewayPolicyGroup_STATUS
			err := virtualNetworkGatewayPolicyGroupItem.AssignProperties_To_VirtualNetworkGatewayPolicyGroup_STATUS(&virtualNetworkGatewayPolicyGroup)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayPolicyGroup_STATUS() to populate field VirtualNetworkGatewayPolicyGroups")
			}
			virtualNetworkGatewayPolicyGroupList[virtualNetworkGatewayPolicyGroupIndex] = virtualNetworkGatewayPolicyGroup
		}
		destination.VirtualNetworkGatewayPolicyGroups = virtualNetworkGatewayPolicyGroupList
	} else {
		destination.VirtualNetworkGatewayPolicyGroups = nil
	}

	// VpnClientConfiguration
	if gateway.VpnClientConfiguration != nil {
		var vpnClientConfiguration storage.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
	if gateway.VpnGatewayGeneration != nil {
		vpnGatewayGeneration := string(*gateway.VpnGatewayGeneration)
		destination.VpnGatewayGeneration = &vpnGatewayGeneration
	} else {
		destination.VpnGatewayGeneration = nil
	}

	// VpnType
	if gateway.VpnType != nil {
		vpnType := string(*gateway.VpnType)
		destination.VpnType = &vpnType
	} else {
		destination.VpnType = nil
	}

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

	// No error
	return nil
}

// BGP settings details.
type BgpSettings struct {
	// Asn: The BGP speaker's ASN.
	Asn *uint32 `json:"asn,omitempty"`

	// BgpPeeringAddress: The BGP peering address and BGP identifier of this BGP speaker.
	BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`

	// BgpPeeringAddresses: BGP peering address with IP configuration ID for virtual network gateway.
	BgpPeeringAddresses []IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"`

	// PeerWeight: The weight added to routes learned from this BGP speaker.
	PeerWeight *int `json:"peerWeight,omitempty"`
}

var _ genruntime.ARMTransformer = &BgpSettings{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (settings *BgpSettings) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if settings == nil {
		return nil, nil
	}
	result := &arm.BgpSettings{}

	// Set property "Asn":
	if settings.Asn != nil {
		asn := *settings.Asn
		result.Asn = &asn
	}

	// Set property "BgpPeeringAddress":
	if settings.BgpPeeringAddress != nil {
		bgpPeeringAddress := *settings.BgpPeeringAddress
		result.BgpPeeringAddress = &bgpPeeringAddress
	}

	// Set property "BgpPeeringAddresses":
	for _, item := range settings.BgpPeeringAddresses {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.BgpPeeringAddresses = append(result.BgpPeeringAddresses, *item_ARM.(*arm.IPConfigurationBgpPeeringAddress))
	}

	// Set property "PeerWeight":
	if settings.PeerWeight != nil {
		peerWeight := *settings.PeerWeight
		result.PeerWeight = &peerWeight
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (settings *BgpSettings) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.BgpSettings{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (settings *BgpSettings) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.BgpSettings)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.BgpSettings, got %T", armInput)
	}

	// Set property "Asn":
	if typedInput.Asn != nil {
		asn := *typedInput.Asn
		settings.Asn = &asn
	}

	// Set property "BgpPeeringAddress":
	if typedInput.BgpPeeringAddress != nil {
		bgpPeeringAddress := *typedInput.BgpPeeringAddress
		settings.BgpPeeringAddress = &bgpPeeringAddress
	}

	// Set property "BgpPeeringAddresses":
	for _, item := range typedInput.BgpPeeringAddresses {
		var item1 IPConfigurationBgpPeeringAddress
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		settings.BgpPeeringAddresses = append(settings.BgpPeeringAddresses, item1)
	}

	// Set property "PeerWeight":
	if typedInput.PeerWeight != nil {
		peerWeight := *typedInput.PeerWeight
		settings.PeerWeight = &peerWeight
	}

	// No error
	return nil
}

// AssignProperties_From_BgpSettings populates our BgpSettings from the provided source BgpSettings
func (settings *BgpSettings) AssignProperties_From_BgpSettings(source *storage.BgpSettings) error {

	// 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)

	// No error
	return nil
}

// AssignProperties_To_BgpSettings populates the provided destination BgpSettings from our BgpSettings
func (settings *BgpSettings) AssignProperties_To_BgpSettings(destination *storage.BgpSettings) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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([]storage.IPConfigurationBgpPeeringAddress, len(settings.BgpPeeringAddresses))
		for bgpPeeringAddressIndex, bgpPeeringAddressItem := range settings.BgpPeeringAddresses {
			var bgpPeeringAddress storage.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
	}

	// No error
	return nil
}

// Initialize_From_BgpSettings_STATUS populates our BgpSettings from the provided source BgpSettings_STATUS
func (settings *BgpSettings) Initialize_From_BgpSettings_STATUS(source *BgpSettings_STATUS) error {

	// 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.Initialize_From_IPConfigurationBgpPeeringAddress_STATUS(&bgpPeeringAddressItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_IPConfigurationBgpPeeringAddress_STATUS() to populate field BgpPeeringAddresses")
			}
			bgpPeeringAddressList[bgpPeeringAddressIndex] = bgpPeeringAddress
		}
		settings.BgpPeeringAddresses = bgpPeeringAddressList
	} else {
		settings.BgpPeeringAddresses = nil
	}

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

	// No error
	return nil
}

// BGP settings details.
type BgpSettings_STATUS struct {
	// Asn: The BGP speaker's ASN.
	Asn *uint32 `json:"asn,omitempty"`

	// BgpPeeringAddress: The BGP peering address and BGP identifier of this BGP speaker.
	BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`

	// BgpPeeringAddresses: BGP peering address with IP configuration ID for virtual network gateway.
	BgpPeeringAddresses []IPConfigurationBgpPeeringAddress_STATUS `json:"bgpPeeringAddresses,omitempty"`

	// PeerWeight: The weight added to routes learned from this BGP speaker.
	PeerWeight *int `json:"peerWeight,omitempty"`
}

var _ genruntime.FromARMConverter = &BgpSettings_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (settings *BgpSettings_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.BgpSettings_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (settings *BgpSettings_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.BgpSettings_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.BgpSettings_STATUS, got %T", armInput)
	}

	// Set property "Asn":
	if typedInput.Asn != nil {
		asn := *typedInput.Asn
		settings.Asn = &asn
	}

	// Set property "BgpPeeringAddress":
	if typedInput.BgpPeeringAddress != nil {
		bgpPeeringAddress := *typedInput.BgpPeeringAddress
		settings.BgpPeeringAddress = &bgpPeeringAddress
	}

	// Set property "BgpPeeringAddresses":
	for _, item := range typedInput.BgpPeeringAddresses {
		var item1 IPConfigurationBgpPeeringAddress_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		settings.BgpPeeringAddresses = append(settings.BgpPeeringAddresses, item1)
	}

	// Set property "PeerWeight":
	if typedInput.PeerWeight != nil {
		peerWeight := *typedInput.PeerWeight
		settings.PeerWeight = &peerWeight
	}

	// No error
	return nil
}

// AssignProperties_From_BgpSettings_STATUS populates our BgpSettings_STATUS from the provided source BgpSettings_STATUS
func (settings *BgpSettings_STATUS) AssignProperties_From_BgpSettings_STATUS(source *storage.BgpSettings_STATUS) error {

	// 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)

	// 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 *storage.BgpSettings_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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([]storage.IPConfigurationBgpPeeringAddress_STATUS, len(settings.BgpPeeringAddresses))
		for bgpPeeringAddressIndex, bgpPeeringAddressItem := range settings.BgpPeeringAddresses {
			var bgpPeeringAddress storage.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
	}

	// No error
	return nil
}

// Virtual Network Gateway Autoscale Configuration details
type VirtualNetworkGatewayAutoScaleConfiguration struct {
	// Bounds: The bounds of the autoscale configuration
	Bounds *VirtualNetworkGatewayAutoScaleBounds `json:"bounds,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewayAutoScaleConfiguration{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if configuration == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewayAutoScaleConfiguration{}

	// Set property "Bounds":
	if configuration.Bounds != nil {
		bounds_ARM, err := configuration.Bounds.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		bounds := *bounds_ARM.(*arm.VirtualNetworkGatewayAutoScaleBounds)
		result.Bounds = &bounds
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayAutoScaleConfiguration{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayAutoScaleConfiguration)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayAutoScaleConfiguration, got %T", armInput)
	}

	// Set property "Bounds":
	if typedInput.Bounds != nil {
		var bounds1 VirtualNetworkGatewayAutoScaleBounds
		err := bounds1.PopulateFromARM(owner, *typedInput.Bounds)
		if err != nil {
			return err
		}
		bounds := bounds1
		configuration.Bounds = &bounds
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration populates our VirtualNetworkGatewayAutoScaleConfiguration from the provided source VirtualNetworkGatewayAutoScaleConfiguration
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration) AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration(source *storage.VirtualNetworkGatewayAutoScaleConfiguration) error {

	// Bounds
	if source.Bounds != nil {
		var bound VirtualNetworkGatewayAutoScaleBounds
		err := bound.AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds(source.Bounds)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds() to populate field Bounds")
		}
		configuration.Bounds = &bound
	} else {
		configuration.Bounds = nil
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration populates the provided destination VirtualNetworkGatewayAutoScaleConfiguration from our VirtualNetworkGatewayAutoScaleConfiguration
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration) AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration(destination *storage.VirtualNetworkGatewayAutoScaleConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Bounds
	if configuration.Bounds != nil {
		var bound storage.VirtualNetworkGatewayAutoScaleBounds
		err := configuration.Bounds.AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds(&bound)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds() to populate field Bounds")
		}
		destination.Bounds = &bound
	} else {
		destination.Bounds = nil
	}

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS populates our VirtualNetworkGatewayAutoScaleConfiguration from the provided source VirtualNetworkGatewayAutoScaleConfiguration_STATUS
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration) Initialize_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS(source *VirtualNetworkGatewayAutoScaleConfiguration_STATUS) error {

	// Bounds
	if source.Bounds != nil {
		var bound VirtualNetworkGatewayAutoScaleBounds
		err := bound.Initialize_From_VirtualNetworkGatewayAutoScaleBounds_STATUS(source.Bounds)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_VirtualNetworkGatewayAutoScaleBounds_STATUS() to populate field Bounds")
		}
		configuration.Bounds = &bound
	} else {
		configuration.Bounds = nil
	}

	// No error
	return nil
}

// Virtual Network Gateway Autoscale Configuration details
type VirtualNetworkGatewayAutoScaleConfiguration_STATUS struct {
	// Bounds: The bounds of the autoscale configuration
	Bounds *VirtualNetworkGatewayAutoScaleBounds_STATUS `json:"bounds,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewayAutoScaleConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayAutoScaleConfiguration_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayAutoScaleConfiguration_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayAutoScaleConfiguration_STATUS, got %T", armInput)
	}

	// Set property "Bounds":
	if typedInput.Bounds != nil {
		var bounds1 VirtualNetworkGatewayAutoScaleBounds_STATUS
		err := bounds1.PopulateFromARM(owner, *typedInput.Bounds)
		if err != nil {
			return err
		}
		bounds := bounds1
		configuration.Bounds = &bounds
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS populates our VirtualNetworkGatewayAutoScaleConfiguration_STATUS from the provided source VirtualNetworkGatewayAutoScaleConfiguration_STATUS
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration_STATUS) AssignProperties_From_VirtualNetworkGatewayAutoScaleConfiguration_STATUS(source *storage.VirtualNetworkGatewayAutoScaleConfiguration_STATUS) error {

	// Bounds
	if source.Bounds != nil {
		var bound VirtualNetworkGatewayAutoScaleBounds_STATUS
		err := bound.AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds_STATUS(source.Bounds)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds_STATUS() to populate field Bounds")
		}
		configuration.Bounds = &bound
	} else {
		configuration.Bounds = nil
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration_STATUS populates the provided destination VirtualNetworkGatewayAutoScaleConfiguration_STATUS from our VirtualNetworkGatewayAutoScaleConfiguration_STATUS
func (configuration *VirtualNetworkGatewayAutoScaleConfiguration_STATUS) AssignProperties_To_VirtualNetworkGatewayAutoScaleConfiguration_STATUS(destination *storage.VirtualNetworkGatewayAutoScaleConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Bounds
	if configuration.Bounds != nil {
		var bound storage.VirtualNetworkGatewayAutoScaleBounds_STATUS
		err := configuration.Bounds.AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds_STATUS(&bound)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds_STATUS() to populate field Bounds")
		}
		destination.Bounds = &bound
	} else {
		destination.Bounds = nil
	}

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

	// No error
	return nil
}

// IP configuration for virtual network gateway.
type VirtualNetworkGatewayIPConfiguration struct {
	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// PrivateIPAllocationMethod: The private IP address allocation method.
	PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`

	// PublicIPAddress: The reference to the public IP resource.
	PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`

	// Subnet: The reference to the subnet resource.
	Subnet *SubResource `json:"subnet,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewayIPConfiguration{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (configuration *VirtualNetworkGatewayIPConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if configuration == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewayIPConfiguration{}

	// Set property "Name":
	if configuration.Name != nil {
		name := *configuration.Name
		result.Name = &name
	}

	// Set property "Properties":
	if configuration.PrivateIPAllocationMethod != nil ||
		configuration.PublicIPAddress != nil ||
		configuration.Subnet != nil {
		result.Properties = &arm.VirtualNetworkGatewayIPConfigurationPropertiesFormat{}
	}
	if configuration.PrivateIPAllocationMethod != nil {
		var temp string
		temp = string(*configuration.PrivateIPAllocationMethod)
		privateIPAllocationMethod := arm.IPAllocationMethod(temp)
		result.Properties.PrivateIPAllocationMethod = &privateIPAllocationMethod
	}
	if configuration.PublicIPAddress != nil {
		publicIPAddress_ARM, err := configuration.PublicIPAddress.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		publicIPAddress := *publicIPAddress_ARM.(*arm.SubResource)
		result.Properties.PublicIPAddress = &publicIPAddress
	}
	if configuration.Subnet != nil {
		subnet_ARM, err := configuration.Subnet.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		subnet := *subnet_ARM.(*arm.SubResource)
		result.Properties.Subnet = &subnet
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VirtualNetworkGatewayIPConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayIPConfiguration{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VirtualNetworkGatewayIPConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayIPConfiguration)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayIPConfiguration, got %T", armInput)
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		configuration.Name = &name
	}

	// Set property "PrivateIPAllocationMethod":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateIPAllocationMethod != nil {
			var temp string
			temp = string(*typedInput.Properties.PrivateIPAllocationMethod)
			privateIPAllocationMethod := IPAllocationMethod(temp)
			configuration.PrivateIPAllocationMethod = &privateIPAllocationMethod
		}
	}

	// Set property "PublicIPAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAddress != nil {
			var publicIPAddress1 SubResource
			err := publicIPAddress1.PopulateFromARM(owner, *typedInput.Properties.PublicIPAddress)
			if err != nil {
				return err
			}
			publicIPAddress := publicIPAddress1
			configuration.PublicIPAddress = &publicIPAddress
		}
	}

	// Set property "Subnet":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Subnet != nil {
			var subnet1 SubResource
			err := subnet1.PopulateFromARM(owner, *typedInput.Properties.Subnet)
			if err != nil {
				return err
			}
			subnet := subnet1
			configuration.Subnet = &subnet
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayIPConfiguration populates our VirtualNetworkGatewayIPConfiguration from the provided source VirtualNetworkGatewayIPConfiguration
func (configuration *VirtualNetworkGatewayIPConfiguration) AssignProperties_From_VirtualNetworkGatewayIPConfiguration(source *storage.VirtualNetworkGatewayIPConfiguration) error {

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

	// PrivateIPAllocationMethod
	if source.PrivateIPAllocationMethod != nil {
		privateIPAllocationMethod := *source.PrivateIPAllocationMethod
		privateIPAllocationMethodTemp := genruntime.ToEnum(privateIPAllocationMethod, iPAllocationMethod_Values)
		configuration.PrivateIPAllocationMethod = &privateIPAllocationMethodTemp
	} else {
		configuration.PrivateIPAllocationMethod = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayIPConfiguration populates the provided destination VirtualNetworkGatewayIPConfiguration from our VirtualNetworkGatewayIPConfiguration
func (configuration *VirtualNetworkGatewayIPConfiguration) AssignProperties_To_VirtualNetworkGatewayIPConfiguration(destination *storage.VirtualNetworkGatewayIPConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// PrivateIPAllocationMethod
	if configuration.PrivateIPAllocationMethod != nil {
		privateIPAllocationMethod := string(*configuration.PrivateIPAllocationMethod)
		destination.PrivateIPAllocationMethod = &privateIPAllocationMethod
	} else {
		destination.PrivateIPAllocationMethod = nil
	}

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

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

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewayIPConfiguration_STATUS populates our VirtualNetworkGatewayIPConfiguration from the provided source VirtualNetworkGatewayIPConfiguration_STATUS
func (configuration *VirtualNetworkGatewayIPConfiguration) Initialize_From_VirtualNetworkGatewayIPConfiguration_STATUS(source *VirtualNetworkGatewayIPConfiguration_STATUS) error {

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

	// PrivateIPAllocationMethod
	if source.PrivateIPAllocationMethod != nil {
		privateIPAllocationMethod := genruntime.ToEnum(string(*source.PrivateIPAllocationMethod), iPAllocationMethod_Values)
		configuration.PrivateIPAllocationMethod = &privateIPAllocationMethod
	} else {
		configuration.PrivateIPAllocationMethod = nil
	}

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

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

	// No error
	return nil
}

// IP configuration for virtual network gateway.
type VirtualNetworkGatewayIPConfiguration_STATUS struct {
	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// PrivateIPAddress: Private IP Address for this gateway.
	PrivateIPAddress *string `json:"privateIPAddress,omitempty"`

	// PrivateIPAllocationMethod: The private IP address allocation method.
	PrivateIPAllocationMethod *IPAllocationMethod_STATUS `json:"privateIPAllocationMethod,omitempty"`

	// ProvisioningState: The provisioning state of the virtual network gateway IP configuration resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicIPAddress: The reference to the public IP resource.
	PublicIPAddress *SubResource_STATUS `json:"publicIPAddress,omitempty"`

	// Subnet: The reference to the subnet resource.
	Subnet *SubResource_STATUS `json:"subnet,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewayIPConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VirtualNetworkGatewayIPConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayIPConfiguration_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VirtualNetworkGatewayIPConfiguration_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayIPConfiguration_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayIPConfiguration_STATUS, got %T", armInput)
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		configuration.Etag = &etag
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		configuration.Id = &id
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		configuration.Name = &name
	}

	// Set property "PrivateIPAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateIPAddress != nil {
			privateIPAddress := *typedInput.Properties.PrivateIPAddress
			configuration.PrivateIPAddress = &privateIPAddress
		}
	}

	// Set property "PrivateIPAllocationMethod":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateIPAllocationMethod != nil {
			var temp string
			temp = string(*typedInput.Properties.PrivateIPAllocationMethod)
			privateIPAllocationMethod := IPAllocationMethod_STATUS(temp)
			configuration.PrivateIPAllocationMethod = &privateIPAllocationMethod
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			configuration.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicIPAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAddress != nil {
			var publicIPAddress1 SubResource_STATUS
			err := publicIPAddress1.PopulateFromARM(owner, *typedInput.Properties.PublicIPAddress)
			if err != nil {
				return err
			}
			publicIPAddress := publicIPAddress1
			configuration.PublicIPAddress = &publicIPAddress
		}
	}

	// Set property "Subnet":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Subnet != nil {
			var subnet1 SubResource_STATUS
			err := subnet1.PopulateFromARM(owner, *typedInput.Properties.Subnet)
			if err != nil {
				return err
			}
			subnet := subnet1
			configuration.Subnet = &subnet
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayIPConfiguration_STATUS populates our VirtualNetworkGatewayIPConfiguration_STATUS from the provided source VirtualNetworkGatewayIPConfiguration_STATUS
func (configuration *VirtualNetworkGatewayIPConfiguration_STATUS) AssignProperties_From_VirtualNetworkGatewayIPConfiguration_STATUS(source *storage.VirtualNetworkGatewayIPConfiguration_STATUS) error {

	// 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
	if source.PrivateIPAllocationMethod != nil {
		privateIPAllocationMethod := *source.PrivateIPAllocationMethod
		privateIPAllocationMethodTemp := genruntime.ToEnum(privateIPAllocationMethod, iPAllocationMethod_STATUS_Values)
		configuration.PrivateIPAllocationMethod = &privateIPAllocationMethodTemp
	} else {
		configuration.PrivateIPAllocationMethod = nil
	}

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		configuration.ProvisioningState = &provisioningStateTemp
	} else {
		configuration.ProvisioningState = nil
	}

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

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

	// 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 *storage.VirtualNetworkGatewayIPConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	if configuration.PrivateIPAllocationMethod != nil {
		privateIPAllocationMethod := string(*configuration.PrivateIPAllocationMethod)
		destination.PrivateIPAllocationMethod = &privateIPAllocationMethod
	} else {
		destination.PrivateIPAllocationMethod = nil
	}

	// ProvisioningState
	if configuration.ProvisioningState != nil {
		provisioningState := string(*configuration.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

	// PublicIPAddress
	if configuration.PublicIPAddress != nil {
		var publicIPAddress storage.SubResource_STATUS
		err := configuration.PublicIPAddress.AssignProperties_To_SubResource_STATUS(&publicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field PublicIPAddress")
		}
		destination.PublicIPAddress = &publicIPAddress
	} else {
		destination.PublicIPAddress = nil
	}

	// Subnet
	if configuration.Subnet != nil {
		var subnet storage.SubResource_STATUS
		err := configuration.Subnet.AssignProperties_To_SubResource_STATUS(&subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field Subnet")
		}
		destination.Subnet = &subnet
	} else {
		destination.Subnet = nil
	}

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

	// No error
	return nil
}

// VirtualNetworkGatewayNatRule Resource.
type VirtualNetworkGatewayNatRule struct {
	// ExternalMappings: The private IP address external mapping for NAT.
	ExternalMappings []VpnNatRuleMapping `json:"externalMappings,omitempty"`

	// InternalMappings: The private IP address internal mapping for NAT.
	InternalMappings []VpnNatRuleMapping `json:"internalMappings,omitempty"`

	// IpConfigurationId: The IP Configuration ID this NAT rule applies to.
	IpConfigurationId *string `json:"ipConfigurationId,omitempty"`

	// Mode: The Source NAT direction of a VPN NAT.
	Mode *VirtualNetworkGatewayNatRuleProperties_Mode `json:"mode,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// Type: The type of NAT rule for VPN NAT.
	Type *VirtualNetworkGatewayNatRuleProperties_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewayNatRule{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (rule *VirtualNetworkGatewayNatRule) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if rule == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewayNatRule{}

	// Set property "Name":
	if rule.Name != nil {
		name := *rule.Name
		result.Name = &name
	}

	// Set property "Properties":
	if rule.ExternalMappings != nil ||
		rule.InternalMappings != nil ||
		rule.IpConfigurationId != nil ||
		rule.Mode != nil ||
		rule.Type != nil {
		result.Properties = &arm.VirtualNetworkGatewayNatRuleProperties{}
	}
	for _, item := range rule.ExternalMappings {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.ExternalMappings = append(result.Properties.ExternalMappings, *item_ARM.(*arm.VpnNatRuleMapping))
	}
	for _, item := range rule.InternalMappings {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.InternalMappings = append(result.Properties.InternalMappings, *item_ARM.(*arm.VpnNatRuleMapping))
	}
	if rule.IpConfigurationId != nil {
		ipConfigurationId := *rule.IpConfigurationId
		result.Properties.IpConfigurationId = &ipConfigurationId
	}
	if rule.Mode != nil {
		var temp string
		temp = string(*rule.Mode)
		mode := arm.VirtualNetworkGatewayNatRuleProperties_Mode(temp)
		result.Properties.Mode = &mode
	}
	if rule.Type != nil {
		var temp string
		temp = string(*rule.Type)
		typeVar := arm.VirtualNetworkGatewayNatRuleProperties_Type(temp)
		result.Properties.Type = &typeVar
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (rule *VirtualNetworkGatewayNatRule) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayNatRule{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (rule *VirtualNetworkGatewayNatRule) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayNatRule)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayNatRule, got %T", armInput)
	}

	// Set property "ExternalMappings":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.ExternalMappings {
			var item1 VpnNatRuleMapping
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			rule.ExternalMappings = append(rule.ExternalMappings, item1)
		}
	}

	// Set property "InternalMappings":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.InternalMappings {
			var item1 VpnNatRuleMapping
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			rule.InternalMappings = append(rule.InternalMappings, item1)
		}
	}

	// Set property "IpConfigurationId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IpConfigurationId != nil {
			ipConfigurationId := *typedInput.Properties.IpConfigurationId
			rule.IpConfigurationId = &ipConfigurationId
		}
	}

	// Set property "Mode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Mode != nil {
			var temp string
			temp = string(*typedInput.Properties.Mode)
			mode := VirtualNetworkGatewayNatRuleProperties_Mode(temp)
			rule.Mode = &mode
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		rule.Name = &name
	}

	// Set property "Type":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Type != nil {
			var temp string
			temp = string(*typedInput.Properties.Type)
			typeVar := VirtualNetworkGatewayNatRuleProperties_Type(temp)
			rule.Type = &typeVar
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayNatRule populates our VirtualNetworkGatewayNatRule from the provided source VirtualNetworkGatewayNatRule
func (rule *VirtualNetworkGatewayNatRule) AssignProperties_From_VirtualNetworkGatewayNatRule(source *storage.VirtualNetworkGatewayNatRule) error {

	// ExternalMappings
	if source.ExternalMappings != nil {
		externalMappingList := make([]VpnNatRuleMapping, len(source.ExternalMappings))
		for externalMappingIndex, externalMappingItem := range source.ExternalMappings {
			var externalMapping VpnNatRuleMapping
			err := externalMapping.AssignProperties_From_VpnNatRuleMapping(&externalMappingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnNatRuleMapping() to populate field ExternalMappings")
			}
			externalMappingList[externalMappingIndex] = externalMapping
		}
		rule.ExternalMappings = externalMappingList
	} else {
		rule.ExternalMappings = nil
	}

	// InternalMappings
	if source.InternalMappings != nil {
		internalMappingList := make([]VpnNatRuleMapping, len(source.InternalMappings))
		for internalMappingIndex, internalMappingItem := range source.InternalMappings {
			var internalMapping VpnNatRuleMapping
			err := internalMapping.AssignProperties_From_VpnNatRuleMapping(&internalMappingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnNatRuleMapping() to populate field InternalMappings")
			}
			internalMappingList[internalMappingIndex] = internalMapping
		}
		rule.InternalMappings = internalMappingList
	} else {
		rule.InternalMappings = nil
	}

	// IpConfigurationId
	rule.IpConfigurationId = genruntime.ClonePointerToString(source.IpConfigurationId)

	// Mode
	if source.Mode != nil {
		mode := *source.Mode
		modeTemp := genruntime.ToEnum(mode, virtualNetworkGatewayNatRuleProperties_Mode_Values)
		rule.Mode = &modeTemp
	} else {
		rule.Mode = nil
	}

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

	// Type
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, virtualNetworkGatewayNatRuleProperties_Type_Values)
		rule.Type = &typeTemp
	} else {
		rule.Type = nil
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayNatRule populates the provided destination VirtualNetworkGatewayNatRule from our VirtualNetworkGatewayNatRule
func (rule *VirtualNetworkGatewayNatRule) AssignProperties_To_VirtualNetworkGatewayNatRule(destination *storage.VirtualNetworkGatewayNatRule) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// ExternalMappings
	if rule.ExternalMappings != nil {
		externalMappingList := make([]storage.VpnNatRuleMapping, len(rule.ExternalMappings))
		for externalMappingIndex, externalMappingItem := range rule.ExternalMappings {
			var externalMapping storage.VpnNatRuleMapping
			err := externalMappingItem.AssignProperties_To_VpnNatRuleMapping(&externalMapping)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnNatRuleMapping() to populate field ExternalMappings")
			}
			externalMappingList[externalMappingIndex] = externalMapping
		}
		destination.ExternalMappings = externalMappingList
	} else {
		destination.ExternalMappings = nil
	}

	// InternalMappings
	if rule.InternalMappings != nil {
		internalMappingList := make([]storage.VpnNatRuleMapping, len(rule.InternalMappings))
		for internalMappingIndex, internalMappingItem := range rule.InternalMappings {
			var internalMapping storage.VpnNatRuleMapping
			err := internalMappingItem.AssignProperties_To_VpnNatRuleMapping(&internalMapping)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnNatRuleMapping() to populate field InternalMappings")
			}
			internalMappingList[internalMappingIndex] = internalMapping
		}
		destination.InternalMappings = internalMappingList
	} else {
		destination.InternalMappings = nil
	}

	// IpConfigurationId
	destination.IpConfigurationId = genruntime.ClonePointerToString(rule.IpConfigurationId)

	// Mode
	if rule.Mode != nil {
		mode := string(*rule.Mode)
		destination.Mode = &mode
	} else {
		destination.Mode = nil
	}

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

	// Type
	if rule.Type != nil {
		typeVar := string(*rule.Type)
		destination.Type = &typeVar
	} else {
		destination.Type = nil
	}

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewayNatRule_STATUS populates our VirtualNetworkGatewayNatRule from the provided source VirtualNetworkGatewayNatRule_STATUS
func (rule *VirtualNetworkGatewayNatRule) Initialize_From_VirtualNetworkGatewayNatRule_STATUS(source *VirtualNetworkGatewayNatRule_STATUS) error {

	// ExternalMappings
	if source.ExternalMappings != nil {
		externalMappingList := make([]VpnNatRuleMapping, len(source.ExternalMappings))
		for externalMappingIndex, externalMappingItem := range source.ExternalMappings {
			var externalMapping VpnNatRuleMapping
			err := externalMapping.Initialize_From_VpnNatRuleMapping_STATUS(&externalMappingItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VpnNatRuleMapping_STATUS() to populate field ExternalMappings")
			}
			externalMappingList[externalMappingIndex] = externalMapping
		}
		rule.ExternalMappings = externalMappingList
	} else {
		rule.ExternalMappings = nil
	}

	// InternalMappings
	if source.InternalMappings != nil {
		internalMappingList := make([]VpnNatRuleMapping, len(source.InternalMappings))
		for internalMappingIndex, internalMappingItem := range source.InternalMappings {
			var internalMapping VpnNatRuleMapping
			err := internalMapping.Initialize_From_VpnNatRuleMapping_STATUS(&internalMappingItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VpnNatRuleMapping_STATUS() to populate field InternalMappings")
			}
			internalMappingList[internalMappingIndex] = internalMapping
		}
		rule.InternalMappings = internalMappingList
	} else {
		rule.InternalMappings = nil
	}

	// IpConfigurationId
	rule.IpConfigurationId = genruntime.ClonePointerToString(source.IpConfigurationId)

	// Mode
	if source.Mode != nil {
		mode := genruntime.ToEnum(string(*source.Mode), virtualNetworkGatewayNatRuleProperties_Mode_Values)
		rule.Mode = &mode
	} else {
		rule.Mode = nil
	}

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

	// Type
	if source.PropertiesType != nil {
		typeVar := genruntime.ToEnum(string(*source.PropertiesType), virtualNetworkGatewayNatRuleProperties_Type_Values)
		rule.Type = &typeVar
	} else {
		rule.Type = nil
	}

	// No error
	return nil
}

// VirtualNetworkGatewayNatRule Resource.
type VirtualNetworkGatewayNatRule_STATUS struct {
	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// ExternalMappings: The private IP address external mapping for NAT.
	ExternalMappings []VpnNatRuleMapping_STATUS `json:"externalMappings,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// InternalMappings: The private IP address internal mapping for NAT.
	InternalMappings []VpnNatRuleMapping_STATUS `json:"internalMappings,omitempty"`

	// IpConfigurationId: The IP Configuration ID this NAT rule applies to.
	IpConfigurationId *string `json:"ipConfigurationId,omitempty"`

	// Mode: The Source NAT direction of a VPN NAT.
	Mode *VirtualNetworkGatewayNatRuleProperties_Mode_STATUS `json:"mode,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// PropertiesType: The type of NAT rule for VPN NAT.
	PropertiesType *VirtualNetworkGatewayNatRuleProperties_Type_STATUS `json:"properties_type,omitempty"`

	// ProvisioningState: The provisioning state of the NAT Rule resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// Type: Resource type.
	Type *string `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewayNatRule_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (rule *VirtualNetworkGatewayNatRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayNatRule_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (rule *VirtualNetworkGatewayNatRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayNatRule_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayNatRule_STATUS, got %T", armInput)
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		rule.Etag = &etag
	}

	// Set property "ExternalMappings":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.ExternalMappings {
			var item1 VpnNatRuleMapping_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			rule.ExternalMappings = append(rule.ExternalMappings, item1)
		}
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		rule.Id = &id
	}

	// Set property "InternalMappings":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.InternalMappings {
			var item1 VpnNatRuleMapping_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			rule.InternalMappings = append(rule.InternalMappings, item1)
		}
	}

	// Set property "IpConfigurationId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IpConfigurationId != nil {
			ipConfigurationId := *typedInput.Properties.IpConfigurationId
			rule.IpConfigurationId = &ipConfigurationId
		}
	}

	// Set property "Mode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Mode != nil {
			var temp string
			temp = string(*typedInput.Properties.Mode)
			mode := VirtualNetworkGatewayNatRuleProperties_Mode_STATUS(temp)
			rule.Mode = &mode
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		rule.Name = &name
	}

	// Set property "PropertiesType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Type != nil {
			var temp string
			temp = string(*typedInput.Properties.Type)
			propertiesType := VirtualNetworkGatewayNatRuleProperties_Type_STATUS(temp)
			rule.PropertiesType = &propertiesType
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			rule.ProvisioningState = &provisioningState
		}
	}

	// Set property "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		rule.Type = &typeVar
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayNatRule_STATUS populates our VirtualNetworkGatewayNatRule_STATUS from the provided source VirtualNetworkGatewayNatRule_STATUS
func (rule *VirtualNetworkGatewayNatRule_STATUS) AssignProperties_From_VirtualNetworkGatewayNatRule_STATUS(source *storage.VirtualNetworkGatewayNatRule_STATUS) error {

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

	// ExternalMappings
	if source.ExternalMappings != nil {
		externalMappingList := make([]VpnNatRuleMapping_STATUS, len(source.ExternalMappings))
		for externalMappingIndex, externalMappingItem := range source.ExternalMappings {
			var externalMapping VpnNatRuleMapping_STATUS
			err := externalMapping.AssignProperties_From_VpnNatRuleMapping_STATUS(&externalMappingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnNatRuleMapping_STATUS() to populate field ExternalMappings")
			}
			externalMappingList[externalMappingIndex] = externalMapping
		}
		rule.ExternalMappings = externalMappingList
	} else {
		rule.ExternalMappings = nil
	}

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

	// InternalMappings
	if source.InternalMappings != nil {
		internalMappingList := make([]VpnNatRuleMapping_STATUS, len(source.InternalMappings))
		for internalMappingIndex, internalMappingItem := range source.InternalMappings {
			var internalMapping VpnNatRuleMapping_STATUS
			err := internalMapping.AssignProperties_From_VpnNatRuleMapping_STATUS(&internalMappingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VpnNatRuleMapping_STATUS() to populate field InternalMappings")
			}
			internalMappingList[internalMappingIndex] = internalMapping
		}
		rule.InternalMappings = internalMappingList
	} else {
		rule.InternalMappings = nil
	}

	// IpConfigurationId
	rule.IpConfigurationId = genruntime.ClonePointerToString(source.IpConfigurationId)

	// Mode
	if source.Mode != nil {
		mode := *source.Mode
		modeTemp := genruntime.ToEnum(mode, virtualNetworkGatewayNatRuleProperties_Mode_STATUS_Values)
		rule.Mode = &modeTemp
	} else {
		rule.Mode = nil
	}

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

	// PropertiesType
	if source.PropertiesType != nil {
		propertiesType := *source.PropertiesType
		propertiesTypeTemp := genruntime.ToEnum(propertiesType, virtualNetworkGatewayNatRuleProperties_Type_STATUS_Values)
		rule.PropertiesType = &propertiesTypeTemp
	} else {
		rule.PropertiesType = nil
	}

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		rule.ProvisioningState = &provisioningStateTemp
	} else {
		rule.ProvisioningState = nil
	}

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

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayNatRule_STATUS populates the provided destination VirtualNetworkGatewayNatRule_STATUS from our VirtualNetworkGatewayNatRule_STATUS
func (rule *VirtualNetworkGatewayNatRule_STATUS) AssignProperties_To_VirtualNetworkGatewayNatRule_STATUS(destination *storage.VirtualNetworkGatewayNatRule_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// ExternalMappings
	if rule.ExternalMappings != nil {
		externalMappingList := make([]storage.VpnNatRuleMapping_STATUS, len(rule.ExternalMappings))
		for externalMappingIndex, externalMappingItem := range rule.ExternalMappings {
			var externalMapping storage.VpnNatRuleMapping_STATUS
			err := externalMappingItem.AssignProperties_To_VpnNatRuleMapping_STATUS(&externalMapping)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnNatRuleMapping_STATUS() to populate field ExternalMappings")
			}
			externalMappingList[externalMappingIndex] = externalMapping
		}
		destination.ExternalMappings = externalMappingList
	} else {
		destination.ExternalMappings = nil
	}

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

	// InternalMappings
	if rule.InternalMappings != nil {
		internalMappingList := make([]storage.VpnNatRuleMapping_STATUS, len(rule.InternalMappings))
		for internalMappingIndex, internalMappingItem := range rule.InternalMappings {
			var internalMapping storage.VpnNatRuleMapping_STATUS
			err := internalMappingItem.AssignProperties_To_VpnNatRuleMapping_STATUS(&internalMapping)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VpnNatRuleMapping_STATUS() to populate field InternalMappings")
			}
			internalMappingList[internalMappingIndex] = internalMapping
		}
		destination.InternalMappings = internalMappingList
	} else {
		destination.InternalMappings = nil
	}

	// IpConfigurationId
	destination.IpConfigurationId = genruntime.ClonePointerToString(rule.IpConfigurationId)

	// Mode
	if rule.Mode != nil {
		mode := string(*rule.Mode)
		destination.Mode = &mode
	} else {
		destination.Mode = nil
	}

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

	// PropertiesType
	if rule.PropertiesType != nil {
		propertiesType := string(*rule.PropertiesType)
		destination.PropertiesType = &propertiesType
	} else {
		destination.PropertiesType = nil
	}

	// ProvisioningState
	if rule.ProvisioningState != nil {
		provisioningState := string(*rule.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

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

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

	// No error
	return nil
}

// 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: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

	// SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions).
	SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_VirtualNetworkGatewayOperatorSpec populates our VirtualNetworkGatewayOperatorSpec from the provided source VirtualNetworkGatewayOperatorSpec
func (operator *VirtualNetworkGatewayOperatorSpec) AssignProperties_From_VirtualNetworkGatewayOperatorSpec(source *storage.VirtualNetworkGatewayOperatorSpec) error {

	// 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
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayOperatorSpec populates the provided destination VirtualNetworkGatewayOperatorSpec from our VirtualNetworkGatewayOperatorSpec
func (operator *VirtualNetworkGatewayOperatorSpec) AssignProperties_To_VirtualNetworkGatewayOperatorSpec(destination *storage.VirtualNetworkGatewayOperatorSpec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// Parameters for VirtualNetworkGatewayPolicyGroup.
type VirtualNetworkGatewayPolicyGroup struct {
	// +kubebuilder:validation:Required
	// IsDefault: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not.
	IsDefault *bool `json:"isDefault,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// PolicyMembers: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup.
	PolicyMembers []VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers,omitempty"`

	// +kubebuilder:validation:Required
	// Priority: Priority for VirtualNetworkGatewayPolicyGroup.
	Priority *int `json:"priority,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewayPolicyGroup{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (group *VirtualNetworkGatewayPolicyGroup) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if group == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewayPolicyGroup{}

	// Set property "Name":
	if group.Name != nil {
		name := *group.Name
		result.Name = &name
	}

	// Set property "Properties":
	if group.IsDefault != nil ||
		group.PolicyMembers != nil ||
		group.Priority != nil {
		result.Properties = &arm.VirtualNetworkGatewayPolicyGroupProperties{}
	}
	if group.IsDefault != nil {
		isDefault := *group.IsDefault
		result.Properties.IsDefault = &isDefault
	}
	for _, item := range group.PolicyMembers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.PolicyMembers = append(result.Properties.PolicyMembers, *item_ARM.(*arm.VirtualNetworkGatewayPolicyGroupMember))
	}
	if group.Priority != nil {
		priority := *group.Priority
		result.Properties.Priority = &priority
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (group *VirtualNetworkGatewayPolicyGroup) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayPolicyGroup{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (group *VirtualNetworkGatewayPolicyGroup) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayPolicyGroup)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayPolicyGroup, got %T", armInput)
	}

	// Set property "IsDefault":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsDefault != nil {
			isDefault := *typedInput.Properties.IsDefault
			group.IsDefault = &isDefault
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		group.Name = &name
	}

	// Set property "PolicyMembers":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.PolicyMembers {
			var item1 VirtualNetworkGatewayPolicyGroupMember
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			group.PolicyMembers = append(group.PolicyMembers, item1)
		}
	}

	// Set property "Priority":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Priority != nil {
			priority := *typedInput.Properties.Priority
			group.Priority = &priority
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayPolicyGroup populates our VirtualNetworkGatewayPolicyGroup from the provided source VirtualNetworkGatewayPolicyGroup
func (group *VirtualNetworkGatewayPolicyGroup) AssignProperties_From_VirtualNetworkGatewayPolicyGroup(source *storage.VirtualNetworkGatewayPolicyGroup) error {

	// IsDefault
	if source.IsDefault != nil {
		isDefault := *source.IsDefault
		group.IsDefault = &isDefault
	} else {
		group.IsDefault = nil
	}

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

	// PolicyMembers
	if source.PolicyMembers != nil {
		policyMemberList := make([]VirtualNetworkGatewayPolicyGroupMember, len(source.PolicyMembers))
		for policyMemberIndex, policyMemberItem := range source.PolicyMembers {
			var policyMember VirtualNetworkGatewayPolicyGroupMember
			err := policyMember.AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember(&policyMemberItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember() to populate field PolicyMembers")
			}
			policyMemberList[policyMemberIndex] = policyMember
		}
		group.PolicyMembers = policyMemberList
	} else {
		group.PolicyMembers = nil
	}

	// Priority
	group.Priority = genruntime.ClonePointerToInt(source.Priority)

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayPolicyGroup populates the provided destination VirtualNetworkGatewayPolicyGroup from our VirtualNetworkGatewayPolicyGroup
func (group *VirtualNetworkGatewayPolicyGroup) AssignProperties_To_VirtualNetworkGatewayPolicyGroup(destination *storage.VirtualNetworkGatewayPolicyGroup) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// IsDefault
	if group.IsDefault != nil {
		isDefault := *group.IsDefault
		destination.IsDefault = &isDefault
	} else {
		destination.IsDefault = nil
	}

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

	// PolicyMembers
	if group.PolicyMembers != nil {
		policyMemberList := make([]storage.VirtualNetworkGatewayPolicyGroupMember, len(group.PolicyMembers))
		for policyMemberIndex, policyMemberItem := range group.PolicyMembers {
			var policyMember storage.VirtualNetworkGatewayPolicyGroupMember
			err := policyMemberItem.AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember(&policyMember)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember() to populate field PolicyMembers")
			}
			policyMemberList[policyMemberIndex] = policyMember
		}
		destination.PolicyMembers = policyMemberList
	} else {
		destination.PolicyMembers = nil
	}

	// Priority
	destination.Priority = genruntime.ClonePointerToInt(group.Priority)

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewayPolicyGroup_STATUS populates our VirtualNetworkGatewayPolicyGroup from the provided source VirtualNetworkGatewayPolicyGroup_STATUS
func (group *VirtualNetworkGatewayPolicyGroup) Initialize_From_VirtualNetworkGatewayPolicyGroup_STATUS(source *VirtualNetworkGatewayPolicyGroup_STATUS) error {

	// IsDefault
	if source.IsDefault != nil {
		isDefault := *source.IsDefault
		group.IsDefault = &isDefault
	} else {
		group.IsDefault = nil
	}

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

	// PolicyMembers
	if source.PolicyMembers != nil {
		policyMemberList := make([]VirtualNetworkGatewayPolicyGroupMember, len(source.PolicyMembers))
		for policyMemberIndex, policyMemberItem := range source.PolicyMembers {
			var policyMember VirtualNetworkGatewayPolicyGroupMember
			err := policyMember.Initialize_From_VirtualNetworkGatewayPolicyGroupMember_STATUS(&policyMemberItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VirtualNetworkGatewayPolicyGroupMember_STATUS() to populate field PolicyMembers")
			}
			policyMemberList[policyMemberIndex] = policyMember
		}
		group.PolicyMembers = policyMemberList
	} else {
		group.PolicyMembers = nil
	}

	// Priority
	group.Priority = genruntime.ClonePointerToInt(source.Priority)

	// No error
	return nil
}

// Parameters for VirtualNetworkGatewayPolicyGroup.
type VirtualNetworkGatewayPolicyGroup_STATUS struct {
	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// IsDefault: Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not.
	IsDefault *bool `json:"isDefault,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// PolicyMembers: Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup.
	PolicyMembers []VirtualNetworkGatewayPolicyGroupMember_STATUS `json:"policyMembers,omitempty"`

	// Priority: Priority for VirtualNetworkGatewayPolicyGroup.
	Priority *int `json:"priority,omitempty"`

	// ProvisioningState: The provisioning state of the VirtualNetworkGatewayPolicyGroup resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// VngClientConnectionConfigurations: List of references to vngClientConnectionConfigurations.
	VngClientConnectionConfigurations []SubResource_STATUS `json:"vngClientConnectionConfigurations,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewayPolicyGroup_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (group *VirtualNetworkGatewayPolicyGroup_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayPolicyGroup_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (group *VirtualNetworkGatewayPolicyGroup_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayPolicyGroup_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayPolicyGroup_STATUS, got %T", armInput)
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		group.Etag = &etag
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		group.Id = &id
	}

	// Set property "IsDefault":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsDefault != nil {
			isDefault := *typedInput.Properties.IsDefault
			group.IsDefault = &isDefault
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		group.Name = &name
	}

	// Set property "PolicyMembers":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.PolicyMembers {
			var item1 VirtualNetworkGatewayPolicyGroupMember_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			group.PolicyMembers = append(group.PolicyMembers, item1)
		}
	}

	// Set property "Priority":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Priority != nil {
			priority := *typedInput.Properties.Priority
			group.Priority = &priority
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			group.ProvisioningState = &provisioningState
		}
	}

	// Set property "VngClientConnectionConfigurations":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.VngClientConnectionConfigurations {
			var item1 SubResource_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			group.VngClientConnectionConfigurations = append(group.VngClientConnectionConfigurations, item1)
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayPolicyGroup_STATUS populates our VirtualNetworkGatewayPolicyGroup_STATUS from the provided source VirtualNetworkGatewayPolicyGroup_STATUS
func (group *VirtualNetworkGatewayPolicyGroup_STATUS) AssignProperties_From_VirtualNetworkGatewayPolicyGroup_STATUS(source *storage.VirtualNetworkGatewayPolicyGroup_STATUS) error {

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

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

	// IsDefault
	if source.IsDefault != nil {
		isDefault := *source.IsDefault
		group.IsDefault = &isDefault
	} else {
		group.IsDefault = nil
	}

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

	// PolicyMembers
	if source.PolicyMembers != nil {
		policyMemberList := make([]VirtualNetworkGatewayPolicyGroupMember_STATUS, len(source.PolicyMembers))
		for policyMemberIndex, policyMemberItem := range source.PolicyMembers {
			var policyMember VirtualNetworkGatewayPolicyGroupMember_STATUS
			err := policyMember.AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember_STATUS(&policyMemberItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember_STATUS() to populate field PolicyMembers")
			}
			policyMemberList[policyMemberIndex] = policyMember
		}
		group.PolicyMembers = policyMemberList
	} else {
		group.PolicyMembers = nil
	}

	// Priority
	group.Priority = genruntime.ClonePointerToInt(source.Priority)

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		group.ProvisioningState = &provisioningStateTemp
	} else {
		group.ProvisioningState = nil
	}

	// VngClientConnectionConfigurations
	if source.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]SubResource_STATUS, len(source.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range source.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration SubResource_STATUS
			err := vngClientConnectionConfiguration.AssignProperties_From_SubResource_STATUS(&vngClientConnectionConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		group.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		group.VngClientConnectionConfigurations = nil
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayPolicyGroup_STATUS populates the provided destination VirtualNetworkGatewayPolicyGroup_STATUS from our VirtualNetworkGatewayPolicyGroup_STATUS
func (group *VirtualNetworkGatewayPolicyGroup_STATUS) AssignProperties_To_VirtualNetworkGatewayPolicyGroup_STATUS(destination *storage.VirtualNetworkGatewayPolicyGroup_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

	// IsDefault
	if group.IsDefault != nil {
		isDefault := *group.IsDefault
		destination.IsDefault = &isDefault
	} else {
		destination.IsDefault = nil
	}

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

	// PolicyMembers
	if group.PolicyMembers != nil {
		policyMemberList := make([]storage.VirtualNetworkGatewayPolicyGroupMember_STATUS, len(group.PolicyMembers))
		for policyMemberIndex, policyMemberItem := range group.PolicyMembers {
			var policyMember storage.VirtualNetworkGatewayPolicyGroupMember_STATUS
			err := policyMemberItem.AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember_STATUS(&policyMember)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember_STATUS() to populate field PolicyMembers")
			}
			policyMemberList[policyMemberIndex] = policyMember
		}
		destination.PolicyMembers = policyMemberList
	} else {
		destination.PolicyMembers = nil
	}

	// Priority
	destination.Priority = genruntime.ClonePointerToInt(group.Priority)

	// ProvisioningState
	if group.ProvisioningState != nil {
		provisioningState := string(*group.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

	// VngClientConnectionConfigurations
	if group.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]storage.SubResource_STATUS, len(group.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range group.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration storage.SubResource_STATUS
			err := vngClientConnectionConfigurationItem.AssignProperties_To_SubResource_STATUS(&vngClientConnectionConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		destination.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		destination.VngClientConnectionConfigurations = nil
	}

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type VirtualNetworkGatewayPropertiesFormat_AdminState string

const (
	VirtualNetworkGatewayPropertiesFormat_AdminState_Disabled = VirtualNetworkGatewayPropertiesFormat_AdminState("Disabled")
	VirtualNetworkGatewayPropertiesFormat_AdminState_Enabled  = VirtualNetworkGatewayPropertiesFormat_AdminState("Enabled")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_AdminState
var virtualNetworkGatewayPropertiesFormat_AdminState_Values = map[string]VirtualNetworkGatewayPropertiesFormat_AdminState{
	"disabled": VirtualNetworkGatewayPropertiesFormat_AdminState_Disabled,
	"enabled":  VirtualNetworkGatewayPropertiesFormat_AdminState_Enabled,
}

type VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS string

const (
	VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS_Disabled = VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS("Disabled")
	VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS_Enabled  = VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS("Enabled")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS
var virtualNetworkGatewayPropertiesFormat_AdminState_STATUS_Values = map[string]VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS{
	"disabled": VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS_Disabled,
	"enabled":  VirtualNetworkGatewayPropertiesFormat_AdminState_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"ExpressRoute","LocalGateway","Vpn"}
type VirtualNetworkGatewayPropertiesFormat_GatewayType string

const (
	VirtualNetworkGatewayPropertiesFormat_GatewayType_ExpressRoute = VirtualNetworkGatewayPropertiesFormat_GatewayType("ExpressRoute")
	VirtualNetworkGatewayPropertiesFormat_GatewayType_LocalGateway = VirtualNetworkGatewayPropertiesFormat_GatewayType("LocalGateway")
	VirtualNetworkGatewayPropertiesFormat_GatewayType_Vpn          = VirtualNetworkGatewayPropertiesFormat_GatewayType("Vpn")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_GatewayType
var virtualNetworkGatewayPropertiesFormat_GatewayType_Values = map[string]VirtualNetworkGatewayPropertiesFormat_GatewayType{
	"expressroute": VirtualNetworkGatewayPropertiesFormat_GatewayType_ExpressRoute,
	"localgateway": VirtualNetworkGatewayPropertiesFormat_GatewayType_LocalGateway,
	"vpn":          VirtualNetworkGatewayPropertiesFormat_GatewayType_Vpn,
}

type VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS string

const (
	VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_ExpressRoute = VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS("ExpressRoute")
	VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_LocalGateway = VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS("LocalGateway")
	VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_Vpn          = VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS("Vpn")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS
var virtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_Values = map[string]VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS{
	"expressroute": VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_ExpressRoute,
	"localgateway": VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_LocalGateway,
	"vpn":          VirtualNetworkGatewayPropertiesFormat_GatewayType_STATUS_Vpn,
}

// +kubebuilder:validation:Enum={"MultiHomed","SingleHomed"}
type VirtualNetworkGatewayPropertiesFormat_ResiliencyModel string

const (
	VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_MultiHomed  = VirtualNetworkGatewayPropertiesFormat_ResiliencyModel("MultiHomed")
	VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_SingleHomed = VirtualNetworkGatewayPropertiesFormat_ResiliencyModel("SingleHomed")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_ResiliencyModel
var virtualNetworkGatewayPropertiesFormat_ResiliencyModel_Values = map[string]VirtualNetworkGatewayPropertiesFormat_ResiliencyModel{
	"multihomed":  VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_MultiHomed,
	"singlehomed": VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_SingleHomed,
}

type VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS string

const (
	VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS_MultiHomed  = VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS("MultiHomed")
	VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS_SingleHomed = VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS("SingleHomed")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS
var virtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS_Values = map[string]VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS{
	"multihomed":  VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS_MultiHomed,
	"singlehomed": VirtualNetworkGatewayPropertiesFormat_ResiliencyModel_STATUS_SingleHomed,
}

// +kubebuilder:validation:Enum={"Generation1","Generation2","None"}
type VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration string

const (
	VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Generation1 = VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration("Generation1")
	VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Generation2 = VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration("Generation2")
	VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_None        = VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration("None")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration
var virtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Values = map[string]VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration{
	"generation1": VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Generation1,
	"generation2": VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_Generation2,
	"none":        VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_None,
}

type VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS string

const (
	VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_Generation1 = VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS("Generation1")
	VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_Generation2 = VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS("Generation2")
	VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_None        = VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS("None")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS
var virtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_Values = map[string]VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS{
	"generation1": VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_Generation1,
	"generation2": VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_Generation2,
	"none":        VirtualNetworkGatewayPropertiesFormat_VpnGatewayGeneration_STATUS_None,
}

// +kubebuilder:validation:Enum={"PolicyBased","RouteBased"}
type VirtualNetworkGatewayPropertiesFormat_VpnType string

const (
	VirtualNetworkGatewayPropertiesFormat_VpnType_PolicyBased = VirtualNetworkGatewayPropertiesFormat_VpnType("PolicyBased")
	VirtualNetworkGatewayPropertiesFormat_VpnType_RouteBased  = VirtualNetworkGatewayPropertiesFormat_VpnType("RouteBased")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_VpnType
var virtualNetworkGatewayPropertiesFormat_VpnType_Values = map[string]VirtualNetworkGatewayPropertiesFormat_VpnType{
	"policybased": VirtualNetworkGatewayPropertiesFormat_VpnType_PolicyBased,
	"routebased":  VirtualNetworkGatewayPropertiesFormat_VpnType_RouteBased,
}

type VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS string

const (
	VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS_PolicyBased = VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS("PolicyBased")
	VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS_RouteBased  = VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS("RouteBased")
)

// Mapping from string to VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS
var virtualNetworkGatewayPropertiesFormat_VpnType_STATUS_Values = map[string]VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS{
	"policybased": VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS_PolicyBased,
	"routebased":  VirtualNetworkGatewayPropertiesFormat_VpnType_STATUS_RouteBased,
}

// VirtualNetworkGatewaySku details.
type VirtualNetworkGatewaySku struct {
	// Name: Gateway SKU name.
	Name *VirtualNetworkGatewaySku_Name `json:"name,omitempty"`

	// Tier: Gateway SKU tier.
	Tier *VirtualNetworkGatewaySku_Tier `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewaySku{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (gatewaySku *VirtualNetworkGatewaySku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if gatewaySku == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewaySku{}

	// Set property "Name":
	if gatewaySku.Name != nil {
		var temp string
		temp = string(*gatewaySku.Name)
		name := arm.VirtualNetworkGatewaySku_Name(temp)
		result.Name = &name
	}

	// Set property "Tier":
	if gatewaySku.Tier != nil {
		var temp string
		temp = string(*gatewaySku.Tier)
		tier := arm.VirtualNetworkGatewaySku_Tier(temp)
		result.Tier = &tier
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (gatewaySku *VirtualNetworkGatewaySku) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewaySku{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (gatewaySku *VirtualNetworkGatewaySku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewaySku)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewaySku, got %T", armInput)
	}

	// Set property "Name":
	if typedInput.Name != nil {
		var temp string
		temp = string(*typedInput.Name)
		name := VirtualNetworkGatewaySku_Name(temp)
		gatewaySku.Name = &name
	}

	// Set property "Tier":
	if typedInput.Tier != nil {
		var temp string
		temp = string(*typedInput.Tier)
		tier := VirtualNetworkGatewaySku_Tier(temp)
		gatewaySku.Tier = &tier
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewaySku populates our VirtualNetworkGatewaySku from the provided source VirtualNetworkGatewaySku
func (gatewaySku *VirtualNetworkGatewaySku) AssignProperties_From_VirtualNetworkGatewaySku(source *storage.VirtualNetworkGatewaySku) error {

	// Name
	if source.Name != nil {
		name := *source.Name
		nameTemp := genruntime.ToEnum(name, virtualNetworkGatewaySku_Name_Values)
		gatewaySku.Name = &nameTemp
	} else {
		gatewaySku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := *source.Tier
		tierTemp := genruntime.ToEnum(tier, virtualNetworkGatewaySku_Tier_Values)
		gatewaySku.Tier = &tierTemp
	} else {
		gatewaySku.Tier = nil
	}

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewaySku populates the provided destination VirtualNetworkGatewaySku from our VirtualNetworkGatewaySku
func (gatewaySku *VirtualNetworkGatewaySku) AssignProperties_To_VirtualNetworkGatewaySku(destination *storage.VirtualNetworkGatewaySku) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Name
	if gatewaySku.Name != nil {
		name := string(*gatewaySku.Name)
		destination.Name = &name
	} else {
		destination.Name = nil
	}

	// Tier
	if gatewaySku.Tier != nil {
		tier := string(*gatewaySku.Tier)
		destination.Tier = &tier
	} else {
		destination.Tier = nil
	}

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewaySku_STATUS populates our VirtualNetworkGatewaySku from the provided source VirtualNetworkGatewaySku_STATUS
func (gatewaySku *VirtualNetworkGatewaySku) Initialize_From_VirtualNetworkGatewaySku_STATUS(source *VirtualNetworkGatewaySku_STATUS) error {

	// Name
	if source.Name != nil {
		name := genruntime.ToEnum(string(*source.Name), virtualNetworkGatewaySku_Name_Values)
		gatewaySku.Name = &name
	} else {
		gatewaySku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := genruntime.ToEnum(string(*source.Tier), virtualNetworkGatewaySku_Tier_Values)
		gatewaySku.Tier = &tier
	} else {
		gatewaySku.Tier = nil
	}

	// No error
	return nil
}

// VirtualNetworkGatewaySku details.
type VirtualNetworkGatewaySku_STATUS struct {
	// Capacity: The capacity.
	Capacity *int `json:"capacity,omitempty"`

	// Name: Gateway SKU name.
	Name *VirtualNetworkGatewaySku_Name_STATUS `json:"name,omitempty"`

	// Tier: Gateway SKU tier.
	Tier *VirtualNetworkGatewaySku_Tier_STATUS `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewaySku_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (gatewaySku *VirtualNetworkGatewaySku_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewaySku_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (gatewaySku *VirtualNetworkGatewaySku_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewaySku_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewaySku_STATUS, got %T", armInput)
	}

	// Set property "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		gatewaySku.Capacity = &capacity
	}

	// Set property "Name":
	if typedInput.Name != nil {
		var temp string
		temp = string(*typedInput.Name)
		name := VirtualNetworkGatewaySku_Name_STATUS(temp)
		gatewaySku.Name = &name
	}

	// Set property "Tier":
	if typedInput.Tier != nil {
		var temp string
		temp = string(*typedInput.Tier)
		tier := VirtualNetworkGatewaySku_Tier_STATUS(temp)
		gatewaySku.Tier = &tier
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewaySku_STATUS populates our VirtualNetworkGatewaySku_STATUS from the provided source VirtualNetworkGatewaySku_STATUS
func (gatewaySku *VirtualNetworkGatewaySku_STATUS) AssignProperties_From_VirtualNetworkGatewaySku_STATUS(source *storage.VirtualNetworkGatewaySku_STATUS) error {

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

	// Name
	if source.Name != nil {
		name := *source.Name
		nameTemp := genruntime.ToEnum(name, virtualNetworkGatewaySku_Name_STATUS_Values)
		gatewaySku.Name = &nameTemp
	} else {
		gatewaySku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := *source.Tier
		tierTemp := genruntime.ToEnum(tier, virtualNetworkGatewaySku_Tier_STATUS_Values)
		gatewaySku.Tier = &tierTemp
	} else {
		gatewaySku.Tier = nil
	}

	// 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 *storage.VirtualNetworkGatewaySku_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// Name
	if gatewaySku.Name != nil {
		name := string(*gatewaySku.Name)
		destination.Name = &name
	} else {
		destination.Name = nil
	}

	// Tier
	if gatewaySku.Tier != nil {
		tier := string(*gatewaySku.Tier)
		destination.Tier = &tier
	} else {
		destination.Tier = nil
	}

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

	// No error
	return nil
}

// VpnClientConfiguration for P2S client.
type VpnClientConfiguration struct {
	// AadAudience: The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD
	// authentication.
	AadAudience *string `json:"aadAudience,omitempty"`

	// AadIssuer: The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD
	// authentication.
	AadIssuer *string `json:"aadIssuer,omitempty"`

	// AadTenant: The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD
	// authentication.
	AadTenant *string `json:"aadTenant,omitempty"`

	// RadiusServerAddress: The radius server address property of the VirtualNetworkGateway resource for vpn client connection.
	RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`

	// RadiusServerSecret: The radius secret property of the VirtualNetworkGateway resource for vpn client connection.
	RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`

	// RadiusServers: The radiusServers property for multiple radius server configuration.
	RadiusServers []RadiusServer `json:"radiusServers,omitempty"`

	// VngClientConnectionConfigurations: per ip address pool connection policy for virtual network gateway P2S client.
	VngClientConnectionConfigurations []VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"`

	// VpnAuthenticationTypes: VPN authentication types for the virtual network gateway..
	VpnAuthenticationTypes []VpnClientConfiguration_VpnAuthenticationTypes `json:"vpnAuthenticationTypes,omitempty"`

	// VpnClientAddressPool: The reference to the address space resource which represents Address space for P2S VpnClient.
	VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"`

	// VpnClientIpsecPolicies: VpnClientIpsecPolicies for virtual network gateway P2S client.
	VpnClientIpsecPolicies []IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"`

	// VpnClientProtocols: VpnClientProtocols for Virtual network gateway.
	VpnClientProtocols []VpnClientConfiguration_VpnClientProtocols `json:"vpnClientProtocols,omitempty"`

	// VpnClientRevokedCertificates: VpnClientRevokedCertificate for Virtual network gateway.
	VpnClientRevokedCertificates []VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"`

	// VpnClientRootCertificates: VpnClientRootCertificate for virtual network gateway.
	VpnClientRootCertificates []VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"`
}

var _ genruntime.ARMTransformer = &VpnClientConfiguration{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (configuration *VpnClientConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if configuration == nil {
		return nil, nil
	}
	result := &arm.VpnClientConfiguration{}

	// Set property "AadAudience":
	if configuration.AadAudience != nil {
		aadAudience := *configuration.AadAudience
		result.AadAudience = &aadAudience
	}

	// Set property "AadIssuer":
	if configuration.AadIssuer != nil {
		aadIssuer := *configuration.AadIssuer
		result.AadIssuer = &aadIssuer
	}

	// Set property "AadTenant":
	if configuration.AadTenant != nil {
		aadTenant := *configuration.AadTenant
		result.AadTenant = &aadTenant
	}

	// Set property "RadiusServerAddress":
	if configuration.RadiusServerAddress != nil {
		radiusServerAddress := *configuration.RadiusServerAddress
		result.RadiusServerAddress = &radiusServerAddress
	}

	// Set property "RadiusServerSecret":
	if configuration.RadiusServerSecret != nil {
		radiusServerSecret := *configuration.RadiusServerSecret
		result.RadiusServerSecret = &radiusServerSecret
	}

	// Set property "RadiusServers":
	for _, item := range configuration.RadiusServers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.RadiusServers = append(result.RadiusServers, *item_ARM.(*arm.RadiusServer))
	}

	// Set property "VngClientConnectionConfigurations":
	for _, item := range configuration.VngClientConnectionConfigurations {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.VngClientConnectionConfigurations = append(result.VngClientConnectionConfigurations, *item_ARM.(*arm.VngClientConnectionConfiguration))
	}

	// Set property "VpnAuthenticationTypes":
	for _, item := range configuration.VpnAuthenticationTypes {
		var temp string
		temp = string(item)
		result.VpnAuthenticationTypes = append(result.VpnAuthenticationTypes, arm.VpnClientConfiguration_VpnAuthenticationTypes(temp))
	}

	// Set property "VpnClientAddressPool":
	if configuration.VpnClientAddressPool != nil {
		vpnClientAddressPool_ARM, err := configuration.VpnClientAddressPool.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		vpnClientAddressPool := *vpnClientAddressPool_ARM.(*arm.AddressSpace)
		result.VpnClientAddressPool = &vpnClientAddressPool
	}

	// Set property "VpnClientIpsecPolicies":
	for _, item := range configuration.VpnClientIpsecPolicies {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.VpnClientIpsecPolicies = append(result.VpnClientIpsecPolicies, *item_ARM.(*arm.IpsecPolicy))
	}

	// Set property "VpnClientProtocols":
	for _, item := range configuration.VpnClientProtocols {
		var temp string
		temp = string(item)
		result.VpnClientProtocols = append(result.VpnClientProtocols, arm.VpnClientConfiguration_VpnClientProtocols(temp))
	}

	// Set property "VpnClientRevokedCertificates":
	for _, item := range configuration.VpnClientRevokedCertificates {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.VpnClientRevokedCertificates = append(result.VpnClientRevokedCertificates, *item_ARM.(*arm.VpnClientRevokedCertificate))
	}

	// Set property "VpnClientRootCertificates":
	for _, item := range configuration.VpnClientRootCertificates {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.VpnClientRootCertificates = append(result.VpnClientRootCertificates, *item_ARM.(*arm.VpnClientRootCertificate))
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VpnClientConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnClientConfiguration{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VpnClientConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnClientConfiguration)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnClientConfiguration, got %T", armInput)
	}

	// Set property "AadAudience":
	if typedInput.AadAudience != nil {
		aadAudience := *typedInput.AadAudience
		configuration.AadAudience = &aadAudience
	}

	// Set property "AadIssuer":
	if typedInput.AadIssuer != nil {
		aadIssuer := *typedInput.AadIssuer
		configuration.AadIssuer = &aadIssuer
	}

	// Set property "AadTenant":
	if typedInput.AadTenant != nil {
		aadTenant := *typedInput.AadTenant
		configuration.AadTenant = &aadTenant
	}

	// Set property "RadiusServerAddress":
	if typedInput.RadiusServerAddress != nil {
		radiusServerAddress := *typedInput.RadiusServerAddress
		configuration.RadiusServerAddress = &radiusServerAddress
	}

	// Set property "RadiusServerSecret":
	if typedInput.RadiusServerSecret != nil {
		radiusServerSecret := *typedInput.RadiusServerSecret
		configuration.RadiusServerSecret = &radiusServerSecret
	}

	// Set property "RadiusServers":
	for _, item := range typedInput.RadiusServers {
		var item1 RadiusServer
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.RadiusServers = append(configuration.RadiusServers, item1)
	}

	// Set property "VngClientConnectionConfigurations":
	for _, item := range typedInput.VngClientConnectionConfigurations {
		var item1 VngClientConnectionConfiguration
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VngClientConnectionConfigurations = append(configuration.VngClientConnectionConfigurations, item1)
	}

	// Set property "VpnAuthenticationTypes":
	for _, item := range typedInput.VpnAuthenticationTypes {
		var temp string
		temp = string(item)
		configuration.VpnAuthenticationTypes = append(configuration.VpnAuthenticationTypes, VpnClientConfiguration_VpnAuthenticationTypes(temp))
	}

	// Set property "VpnClientAddressPool":
	if typedInput.VpnClientAddressPool != nil {
		var vpnClientAddressPool1 AddressSpace
		err := vpnClientAddressPool1.PopulateFromARM(owner, *typedInput.VpnClientAddressPool)
		if err != nil {
			return err
		}
		vpnClientAddressPool := vpnClientAddressPool1
		configuration.VpnClientAddressPool = &vpnClientAddressPool
	}

	// Set property "VpnClientIpsecPolicies":
	for _, item := range typedInput.VpnClientIpsecPolicies {
		var item1 IpsecPolicy
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VpnClientIpsecPolicies = append(configuration.VpnClientIpsecPolicies, item1)
	}

	// Set property "VpnClientProtocols":
	for _, item := range typedInput.VpnClientProtocols {
		var temp string
		temp = string(item)
		configuration.VpnClientProtocols = append(configuration.VpnClientProtocols, VpnClientConfiguration_VpnClientProtocols(temp))
	}

	// Set property "VpnClientRevokedCertificates":
	for _, item := range typedInput.VpnClientRevokedCertificates {
		var item1 VpnClientRevokedCertificate
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VpnClientRevokedCertificates = append(configuration.VpnClientRevokedCertificates, item1)
	}

	// Set property "VpnClientRootCertificates":
	for _, item := range typedInput.VpnClientRootCertificates {
		var item1 VpnClientRootCertificate
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VpnClientRootCertificates = append(configuration.VpnClientRootCertificates, item1)
	}

	// No error
	return nil
}

// AssignProperties_From_VpnClientConfiguration populates our VpnClientConfiguration from the provided source VpnClientConfiguration
func (configuration *VpnClientConfiguration) AssignProperties_From_VpnClientConfiguration(source *storage.VpnClientConfiguration) error {

	// 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 source.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]VngClientConnectionConfiguration, len(source.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range source.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration VngClientConnectionConfiguration
			err := vngClientConnectionConfiguration.AssignProperties_From_VngClientConnectionConfiguration(&vngClientConnectionConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VngClientConnectionConfiguration() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		configuration.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		configuration.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	if source.VpnAuthenticationTypes != nil {
		vpnAuthenticationTypeList := make([]VpnClientConfiguration_VpnAuthenticationTypes, len(source.VpnAuthenticationTypes))
		for vpnAuthenticationTypeIndex, vpnAuthenticationTypeItem := range source.VpnAuthenticationTypes {
			vpnAuthenticationTypeList[vpnAuthenticationTypeIndex] = genruntime.ToEnum(vpnAuthenticationTypeItem, vpnClientConfiguration_VpnAuthenticationTypes_Values)
		}
		configuration.VpnAuthenticationTypes = vpnAuthenticationTypeList
	} else {
		configuration.VpnAuthenticationTypes = nil
	}

	// 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
	if source.VpnClientProtocols != nil {
		vpnClientProtocolList := make([]VpnClientConfiguration_VpnClientProtocols, len(source.VpnClientProtocols))
		for vpnClientProtocolIndex, vpnClientProtocolItem := range source.VpnClientProtocols {
			vpnClientProtocolList[vpnClientProtocolIndex] = genruntime.ToEnum(vpnClientProtocolItem, vpnClientConfiguration_VpnClientProtocols_Values)
		}
		configuration.VpnClientProtocols = vpnClientProtocolList
	} else {
		configuration.VpnClientProtocols = nil
	}

	// 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
	}

	// No error
	return nil
}

// AssignProperties_To_VpnClientConfiguration populates the provided destination VpnClientConfiguration from our VpnClientConfiguration
func (configuration *VpnClientConfiguration) AssignProperties_To_VpnClientConfiguration(destination *storage.VpnClientConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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([]storage.RadiusServer, len(configuration.RadiusServers))
		for radiusServerIndex, radiusServerItem := range configuration.RadiusServers {
			var radiusServer storage.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 configuration.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]storage.VngClientConnectionConfiguration, len(configuration.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range configuration.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration storage.VngClientConnectionConfiguration
			err := vngClientConnectionConfigurationItem.AssignProperties_To_VngClientConnectionConfiguration(&vngClientConnectionConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VngClientConnectionConfiguration() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		destination.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		destination.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	if configuration.VpnAuthenticationTypes != nil {
		vpnAuthenticationTypeList := make([]string, len(configuration.VpnAuthenticationTypes))
		for vpnAuthenticationTypeIndex, vpnAuthenticationTypeItem := range configuration.VpnAuthenticationTypes {
			vpnAuthenticationTypeList[vpnAuthenticationTypeIndex] = string(vpnAuthenticationTypeItem)
		}
		destination.VpnAuthenticationTypes = vpnAuthenticationTypeList
	} else {
		destination.VpnAuthenticationTypes = nil
	}

	// VpnClientAddressPool
	if configuration.VpnClientAddressPool != nil {
		var vpnClientAddressPool storage.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([]storage.IpsecPolicy, len(configuration.VpnClientIpsecPolicies))
		for vpnClientIpsecPolicyIndex, vpnClientIpsecPolicyItem := range configuration.VpnClientIpsecPolicies {
			var vpnClientIpsecPolicy storage.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
	if configuration.VpnClientProtocols != nil {
		vpnClientProtocolList := make([]string, len(configuration.VpnClientProtocols))
		for vpnClientProtocolIndex, vpnClientProtocolItem := range configuration.VpnClientProtocols {
			vpnClientProtocolList[vpnClientProtocolIndex] = string(vpnClientProtocolItem)
		}
		destination.VpnClientProtocols = vpnClientProtocolList
	} else {
		destination.VpnClientProtocols = nil
	}

	// VpnClientRevokedCertificates
	if configuration.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]storage.VpnClientRevokedCertificate, len(configuration.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range configuration.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate storage.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([]storage.VpnClientRootCertificate, len(configuration.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range configuration.VpnClientRootCertificates {
			var vpnClientRootCertificate storage.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
	}

	// No error
	return nil
}

// Initialize_From_VpnClientConfiguration_STATUS populates our VpnClientConfiguration from the provided source VpnClientConfiguration_STATUS
func (configuration *VpnClientConfiguration) Initialize_From_VpnClientConfiguration_STATUS(source *VpnClientConfiguration_STATUS) error {

	// 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.Initialize_From_RadiusServer_STATUS(&radiusServerItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_RadiusServer_STATUS() to populate field RadiusServers")
			}
			radiusServerList[radiusServerIndex] = radiusServer
		}
		configuration.RadiusServers = radiusServerList
	} else {
		configuration.RadiusServers = nil
	}

	// VngClientConnectionConfigurations
	if source.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]VngClientConnectionConfiguration, len(source.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range source.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration VngClientConnectionConfiguration
			err := vngClientConnectionConfiguration.Initialize_From_VngClientConnectionConfiguration_STATUS(&vngClientConnectionConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VngClientConnectionConfiguration_STATUS() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		configuration.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		configuration.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	if source.VpnAuthenticationTypes != nil {
		vpnAuthenticationTypeList := make([]VpnClientConfiguration_VpnAuthenticationTypes, len(source.VpnAuthenticationTypes))
		for vpnAuthenticationTypeIndex, vpnAuthenticationTypeItem := range source.VpnAuthenticationTypes {
			vpnAuthenticationType := genruntime.ToEnum(string(vpnAuthenticationTypeItem), vpnClientConfiguration_VpnAuthenticationTypes_Values)
			vpnAuthenticationTypeList[vpnAuthenticationTypeIndex] = vpnAuthenticationType
		}
		configuration.VpnAuthenticationTypes = vpnAuthenticationTypeList
	} else {
		configuration.VpnAuthenticationTypes = nil
	}

	// VpnClientAddressPool
	if source.VpnClientAddressPool != nil {
		var vpnClientAddressPool AddressSpace
		err := vpnClientAddressPool.Initialize_From_AddressSpace_STATUS(source.VpnClientAddressPool)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_AddressSpace_STATUS() 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.Initialize_From_IpsecPolicy_STATUS(&vpnClientIpsecPolicyItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_IpsecPolicy_STATUS() to populate field VpnClientIpsecPolicies")
			}
			vpnClientIpsecPolicyList[vpnClientIpsecPolicyIndex] = vpnClientIpsecPolicy
		}
		configuration.VpnClientIpsecPolicies = vpnClientIpsecPolicyList
	} else {
		configuration.VpnClientIpsecPolicies = nil
	}

	// VpnClientProtocols
	if source.VpnClientProtocols != nil {
		vpnClientProtocolList := make([]VpnClientConfiguration_VpnClientProtocols, len(source.VpnClientProtocols))
		for vpnClientProtocolIndex, vpnClientProtocolItem := range source.VpnClientProtocols {
			vpnClientProtocol := genruntime.ToEnum(string(vpnClientProtocolItem), vpnClientConfiguration_VpnClientProtocols_Values)
			vpnClientProtocolList[vpnClientProtocolIndex] = vpnClientProtocol
		}
		configuration.VpnClientProtocols = vpnClientProtocolList
	} else {
		configuration.VpnClientProtocols = nil
	}

	// VpnClientRevokedCertificates
	if source.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]VpnClientRevokedCertificate, len(source.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range source.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate VpnClientRevokedCertificate
			err := vpnClientRevokedCertificate.Initialize_From_VpnClientRevokedCertificate_STATUS(&vpnClientRevokedCertificateItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_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, len(source.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range source.VpnClientRootCertificates {
			var vpnClientRootCertificate VpnClientRootCertificate
			err := vpnClientRootCertificate.Initialize_From_VpnClientRootCertificate_STATUS(&vpnClientRootCertificateItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VpnClientRootCertificate_STATUS() to populate field VpnClientRootCertificates")
			}
			vpnClientRootCertificateList[vpnClientRootCertificateIndex] = vpnClientRootCertificate
		}
		configuration.VpnClientRootCertificates = vpnClientRootCertificateList
	} else {
		configuration.VpnClientRootCertificates = nil
	}

	// No error
	return nil
}

// VpnClientConfiguration for P2S client.
type VpnClientConfiguration_STATUS struct {
	// AadAudience: The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD
	// authentication.
	AadAudience *string `json:"aadAudience,omitempty"`

	// AadIssuer: The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD
	// authentication.
	AadIssuer *string `json:"aadIssuer,omitempty"`

	// AadTenant: The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD
	// authentication.
	AadTenant *string `json:"aadTenant,omitempty"`

	// RadiusServerAddress: The radius server address property of the VirtualNetworkGateway resource for vpn client connection.
	RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`

	// RadiusServerSecret: The radius secret property of the VirtualNetworkGateway resource for vpn client connection.
	RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`

	// RadiusServers: The radiusServers property for multiple radius server configuration.
	RadiusServers []RadiusServer_STATUS `json:"radiusServers,omitempty"`

	// VngClientConnectionConfigurations: per ip address pool connection policy for virtual network gateway P2S client.
	VngClientConnectionConfigurations []VngClientConnectionConfiguration_STATUS `json:"vngClientConnectionConfigurations,omitempty"`

	// VpnAuthenticationTypes: VPN authentication types for the virtual network gateway..
	VpnAuthenticationTypes []VpnClientConfiguration_VpnAuthenticationTypes_STATUS `json:"vpnAuthenticationTypes,omitempty"`

	// VpnClientAddressPool: The reference to the address space resource which represents Address space for P2S VpnClient.
	VpnClientAddressPool *AddressSpace_STATUS `json:"vpnClientAddressPool,omitempty"`

	// VpnClientIpsecPolicies: VpnClientIpsecPolicies for virtual network gateway P2S client.
	VpnClientIpsecPolicies []IpsecPolicy_STATUS `json:"vpnClientIpsecPolicies,omitempty"`

	// VpnClientProtocols: VpnClientProtocols for Virtual network gateway.
	VpnClientProtocols []VpnClientConfiguration_VpnClientProtocols_STATUS `json:"vpnClientProtocols,omitempty"`

	// VpnClientRevokedCertificates: VpnClientRevokedCertificate for Virtual network gateway.
	VpnClientRevokedCertificates []VpnClientRevokedCertificate_STATUS `json:"vpnClientRevokedCertificates,omitempty"`

	// VpnClientRootCertificates: VpnClientRootCertificate for virtual network gateway.
	VpnClientRootCertificates []VpnClientRootCertificate_STATUS `json:"vpnClientRootCertificates,omitempty"`
}

var _ genruntime.FromARMConverter = &VpnClientConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VpnClientConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnClientConfiguration_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VpnClientConfiguration_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnClientConfiguration_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnClientConfiguration_STATUS, got %T", armInput)
	}

	// Set property "AadAudience":
	if typedInput.AadAudience != nil {
		aadAudience := *typedInput.AadAudience
		configuration.AadAudience = &aadAudience
	}

	// Set property "AadIssuer":
	if typedInput.AadIssuer != nil {
		aadIssuer := *typedInput.AadIssuer
		configuration.AadIssuer = &aadIssuer
	}

	// Set property "AadTenant":
	if typedInput.AadTenant != nil {
		aadTenant := *typedInput.AadTenant
		configuration.AadTenant = &aadTenant
	}

	// Set property "RadiusServerAddress":
	if typedInput.RadiusServerAddress != nil {
		radiusServerAddress := *typedInput.RadiusServerAddress
		configuration.RadiusServerAddress = &radiusServerAddress
	}

	// Set property "RadiusServerSecret":
	if typedInput.RadiusServerSecret != nil {
		radiusServerSecret := *typedInput.RadiusServerSecret
		configuration.RadiusServerSecret = &radiusServerSecret
	}

	// Set property "RadiusServers":
	for _, item := range typedInput.RadiusServers {
		var item1 RadiusServer_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.RadiusServers = append(configuration.RadiusServers, item1)
	}

	// Set property "VngClientConnectionConfigurations":
	for _, item := range typedInput.VngClientConnectionConfigurations {
		var item1 VngClientConnectionConfiguration_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VngClientConnectionConfigurations = append(configuration.VngClientConnectionConfigurations, item1)
	}

	// Set property "VpnAuthenticationTypes":
	for _, item := range typedInput.VpnAuthenticationTypes {
		var temp string
		temp = string(item)
		configuration.VpnAuthenticationTypes = append(configuration.VpnAuthenticationTypes, VpnClientConfiguration_VpnAuthenticationTypes_STATUS(temp))
	}

	// Set property "VpnClientAddressPool":
	if typedInput.VpnClientAddressPool != nil {
		var vpnClientAddressPool1 AddressSpace_STATUS
		err := vpnClientAddressPool1.PopulateFromARM(owner, *typedInput.VpnClientAddressPool)
		if err != nil {
			return err
		}
		vpnClientAddressPool := vpnClientAddressPool1
		configuration.VpnClientAddressPool = &vpnClientAddressPool
	}

	// Set property "VpnClientIpsecPolicies":
	for _, item := range typedInput.VpnClientIpsecPolicies {
		var item1 IpsecPolicy_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VpnClientIpsecPolicies = append(configuration.VpnClientIpsecPolicies, item1)
	}

	// Set property "VpnClientProtocols":
	for _, item := range typedInput.VpnClientProtocols {
		var temp string
		temp = string(item)
		configuration.VpnClientProtocols = append(configuration.VpnClientProtocols, VpnClientConfiguration_VpnClientProtocols_STATUS(temp))
	}

	// Set property "VpnClientRevokedCertificates":
	for _, item := range typedInput.VpnClientRevokedCertificates {
		var item1 VpnClientRevokedCertificate_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VpnClientRevokedCertificates = append(configuration.VpnClientRevokedCertificates, item1)
	}

	// Set property "VpnClientRootCertificates":
	for _, item := range typedInput.VpnClientRootCertificates {
		var item1 VpnClientRootCertificate_STATUS
		err := item1.PopulateFromARM(owner, item)
		if err != nil {
			return err
		}
		configuration.VpnClientRootCertificates = append(configuration.VpnClientRootCertificates, item1)
	}

	// No error
	return nil
}

// AssignProperties_From_VpnClientConfiguration_STATUS populates our VpnClientConfiguration_STATUS from the provided source VpnClientConfiguration_STATUS
func (configuration *VpnClientConfiguration_STATUS) AssignProperties_From_VpnClientConfiguration_STATUS(source *storage.VpnClientConfiguration_STATUS) error {

	// 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 source.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]VngClientConnectionConfiguration_STATUS, len(source.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range source.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration VngClientConnectionConfiguration_STATUS
			err := vngClientConnectionConfiguration.AssignProperties_From_VngClientConnectionConfiguration_STATUS(&vngClientConnectionConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VngClientConnectionConfiguration_STATUS() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		configuration.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		configuration.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	if source.VpnAuthenticationTypes != nil {
		vpnAuthenticationTypeList := make([]VpnClientConfiguration_VpnAuthenticationTypes_STATUS, len(source.VpnAuthenticationTypes))
		for vpnAuthenticationTypeIndex, vpnAuthenticationTypeItem := range source.VpnAuthenticationTypes {
			vpnAuthenticationTypeList[vpnAuthenticationTypeIndex] = genruntime.ToEnum(vpnAuthenticationTypeItem, vpnClientConfiguration_VpnAuthenticationTypes_STATUS_Values)
		}
		configuration.VpnAuthenticationTypes = vpnAuthenticationTypeList
	} else {
		configuration.VpnAuthenticationTypes = nil
	}

	// 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
	if source.VpnClientProtocols != nil {
		vpnClientProtocolList := make([]VpnClientConfiguration_VpnClientProtocols_STATUS, len(source.VpnClientProtocols))
		for vpnClientProtocolIndex, vpnClientProtocolItem := range source.VpnClientProtocols {
			vpnClientProtocolList[vpnClientProtocolIndex] = genruntime.ToEnum(vpnClientProtocolItem, vpnClientConfiguration_VpnClientProtocols_STATUS_Values)
		}
		configuration.VpnClientProtocols = vpnClientProtocolList
	} else {
		configuration.VpnClientProtocols = nil
	}

	// 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
	}

	// 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 *storage.VpnClientConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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([]storage.RadiusServer_STATUS, len(configuration.RadiusServers))
		for radiusServerIndex, radiusServerItem := range configuration.RadiusServers {
			var radiusServer storage.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 configuration.VngClientConnectionConfigurations != nil {
		vngClientConnectionConfigurationList := make([]storage.VngClientConnectionConfiguration_STATUS, len(configuration.VngClientConnectionConfigurations))
		for vngClientConnectionConfigurationIndex, vngClientConnectionConfigurationItem := range configuration.VngClientConnectionConfigurations {
			var vngClientConnectionConfiguration storage.VngClientConnectionConfiguration_STATUS
			err := vngClientConnectionConfigurationItem.AssignProperties_To_VngClientConnectionConfiguration_STATUS(&vngClientConnectionConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VngClientConnectionConfiguration_STATUS() to populate field VngClientConnectionConfigurations")
			}
			vngClientConnectionConfigurationList[vngClientConnectionConfigurationIndex] = vngClientConnectionConfiguration
		}
		destination.VngClientConnectionConfigurations = vngClientConnectionConfigurationList
	} else {
		destination.VngClientConnectionConfigurations = nil
	}

	// VpnAuthenticationTypes
	if configuration.VpnAuthenticationTypes != nil {
		vpnAuthenticationTypeList := make([]string, len(configuration.VpnAuthenticationTypes))
		for vpnAuthenticationTypeIndex, vpnAuthenticationTypeItem := range configuration.VpnAuthenticationTypes {
			vpnAuthenticationTypeList[vpnAuthenticationTypeIndex] = string(vpnAuthenticationTypeItem)
		}
		destination.VpnAuthenticationTypes = vpnAuthenticationTypeList
	} else {
		destination.VpnAuthenticationTypes = nil
	}

	// VpnClientAddressPool
	if configuration.VpnClientAddressPool != nil {
		var vpnClientAddressPool storage.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([]storage.IpsecPolicy_STATUS, len(configuration.VpnClientIpsecPolicies))
		for vpnClientIpsecPolicyIndex, vpnClientIpsecPolicyItem := range configuration.VpnClientIpsecPolicies {
			var vpnClientIpsecPolicy storage.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
	if configuration.VpnClientProtocols != nil {
		vpnClientProtocolList := make([]string, len(configuration.VpnClientProtocols))
		for vpnClientProtocolIndex, vpnClientProtocolItem := range configuration.VpnClientProtocols {
			vpnClientProtocolList[vpnClientProtocolIndex] = string(vpnClientProtocolItem)
		}
		destination.VpnClientProtocols = vpnClientProtocolList
	} else {
		destination.VpnClientProtocols = nil
	}

	// VpnClientRevokedCertificates
	if configuration.VpnClientRevokedCertificates != nil {
		vpnClientRevokedCertificateList := make([]storage.VpnClientRevokedCertificate_STATUS, len(configuration.VpnClientRevokedCertificates))
		for vpnClientRevokedCertificateIndex, vpnClientRevokedCertificateItem := range configuration.VpnClientRevokedCertificates {
			var vpnClientRevokedCertificate storage.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([]storage.VpnClientRootCertificate_STATUS, len(configuration.VpnClientRootCertificates))
		for vpnClientRootCertificateIndex, vpnClientRootCertificateItem := range configuration.VpnClientRootCertificates {
			var vpnClientRootCertificate storage.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
	}

	// No error
	return nil
}

// Properties of IPConfigurationBgpPeeringAddress.
type IPConfigurationBgpPeeringAddress struct {
	// CustomBgpIpAddresses: The list of custom BGP peering addresses which belong to IP configuration.
	CustomBgpIpAddresses []string `json:"customBgpIpAddresses,omitempty"`

	// IpconfigurationId: The ID of IP configuration which belongs to gateway.
	IpconfigurationId *string `json:"ipconfigurationId,omitempty"`
}

var _ genruntime.ARMTransformer = &IPConfigurationBgpPeeringAddress{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (address *IPConfigurationBgpPeeringAddress) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if address == nil {
		return nil, nil
	}
	result := &arm.IPConfigurationBgpPeeringAddress{}

	// Set property "CustomBgpIpAddresses":
	for _, item := range address.CustomBgpIpAddresses {
		result.CustomBgpIpAddresses = append(result.CustomBgpIpAddresses, item)
	}

	// Set property "IpconfigurationId":
	if address.IpconfigurationId != nil {
		ipconfigurationId := *address.IpconfigurationId
		result.IpconfigurationId = &ipconfigurationId
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (address *IPConfigurationBgpPeeringAddress) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.IPConfigurationBgpPeeringAddress{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (address *IPConfigurationBgpPeeringAddress) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.IPConfigurationBgpPeeringAddress)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IPConfigurationBgpPeeringAddress, got %T", armInput)
	}

	// Set property "CustomBgpIpAddresses":
	for _, item := range typedInput.CustomBgpIpAddresses {
		address.CustomBgpIpAddresses = append(address.CustomBgpIpAddresses, item)
	}

	// Set property "IpconfigurationId":
	if typedInput.IpconfigurationId != nil {
		ipconfigurationId := *typedInput.IpconfigurationId
		address.IpconfigurationId = &ipconfigurationId
	}

	// No error
	return nil
}

// AssignProperties_From_IPConfigurationBgpPeeringAddress populates our IPConfigurationBgpPeeringAddress from the provided source IPConfigurationBgpPeeringAddress
func (address *IPConfigurationBgpPeeringAddress) AssignProperties_From_IPConfigurationBgpPeeringAddress(source *storage.IPConfigurationBgpPeeringAddress) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_IPConfigurationBgpPeeringAddress populates the provided destination IPConfigurationBgpPeeringAddress from our IPConfigurationBgpPeeringAddress
func (address *IPConfigurationBgpPeeringAddress) AssignProperties_To_IPConfigurationBgpPeeringAddress(destination *storage.IPConfigurationBgpPeeringAddress) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// Initialize_From_IPConfigurationBgpPeeringAddress_STATUS populates our IPConfigurationBgpPeeringAddress from the provided source IPConfigurationBgpPeeringAddress_STATUS
func (address *IPConfigurationBgpPeeringAddress) Initialize_From_IPConfigurationBgpPeeringAddress_STATUS(source *IPConfigurationBgpPeeringAddress_STATUS) error {

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

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

	// No error
	return nil
}

// Properties of IPConfigurationBgpPeeringAddress.
type IPConfigurationBgpPeeringAddress_STATUS struct {
	// CustomBgpIpAddresses: The list of custom BGP peering addresses which belong to IP configuration.
	CustomBgpIpAddresses []string `json:"customBgpIpAddresses,omitempty"`

	// DefaultBgpIpAddresses: The list of default BGP peering addresses which belong to IP configuration.
	DefaultBgpIpAddresses []string `json:"defaultBgpIpAddresses,omitempty"`

	// IpconfigurationId: The ID of IP configuration which belongs to gateway.
	IpconfigurationId *string `json:"ipconfigurationId,omitempty"`

	// TunnelIpAddresses: The list of tunnel public IP addresses which belong to IP configuration.
	TunnelIpAddresses []string `json:"tunnelIpAddresses,omitempty"`
}

var _ genruntime.FromARMConverter = &IPConfigurationBgpPeeringAddress_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (address *IPConfigurationBgpPeeringAddress_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.IPConfigurationBgpPeeringAddress_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (address *IPConfigurationBgpPeeringAddress_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.IPConfigurationBgpPeeringAddress_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IPConfigurationBgpPeeringAddress_STATUS, got %T", armInput)
	}

	// Set property "CustomBgpIpAddresses":
	for _, item := range typedInput.CustomBgpIpAddresses {
		address.CustomBgpIpAddresses = append(address.CustomBgpIpAddresses, item)
	}

	// Set property "DefaultBgpIpAddresses":
	for _, item := range typedInput.DefaultBgpIpAddresses {
		address.DefaultBgpIpAddresses = append(address.DefaultBgpIpAddresses, item)
	}

	// Set property "IpconfigurationId":
	if typedInput.IpconfigurationId != nil {
		ipconfigurationId := *typedInput.IpconfigurationId
		address.IpconfigurationId = &ipconfigurationId
	}

	// Set property "TunnelIpAddresses":
	for _, item := range typedInput.TunnelIpAddresses {
		address.TunnelIpAddresses = append(address.TunnelIpAddresses, item)
	}

	// No error
	return nil
}

// AssignProperties_From_IPConfigurationBgpPeeringAddress_STATUS populates our IPConfigurationBgpPeeringAddress_STATUS from the provided source IPConfigurationBgpPeeringAddress_STATUS
func (address *IPConfigurationBgpPeeringAddress_STATUS) AssignProperties_From_IPConfigurationBgpPeeringAddress_STATUS(source *storage.IPConfigurationBgpPeeringAddress_STATUS) error {

	// 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)

	// 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 *storage.IPConfigurationBgpPeeringAddress_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// An IPSec Policy configuration for a virtual network gateway connection.
type IpsecPolicy struct {
	// +kubebuilder:validation:Required
	// DhGroup: The DH Group used in IKE Phase 1 for initial SA.
	DhGroup *DhGroup `json:"dhGroup,omitempty"`

	// +kubebuilder:validation:Required
	// IkeEncryption: The IKE encryption algorithm (IKE phase 2).
	IkeEncryption *IkeEncryption `json:"ikeEncryption,omitempty"`

	// +kubebuilder:validation:Required
	// IkeIntegrity: The IKE integrity algorithm (IKE phase 2).
	IkeIntegrity *IkeIntegrity `json:"ikeIntegrity,omitempty"`

	// +kubebuilder:validation:Required
	// IpsecEncryption: The IPSec encryption algorithm (IKE phase 1).
	IpsecEncryption *IpsecEncryption `json:"ipsecEncryption,omitempty"`

	// +kubebuilder:validation:Required
	// IpsecIntegrity: The IPSec integrity algorithm (IKE phase 1).
	IpsecIntegrity *IpsecIntegrity `json:"ipsecIntegrity,omitempty"`

	// +kubebuilder:validation:Required
	// PfsGroup: The Pfs Group used in IKE Phase 2 for new child SA.
	PfsGroup *PfsGroup `json:"pfsGroup,omitempty"`

	// +kubebuilder:validation:Required
	// SaDataSizeKilobytes: The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site
	// to site VPN tunnel.
	SaDataSizeKilobytes *int `json:"saDataSizeKilobytes,omitempty"`

	// +kubebuilder:validation:Required
	// SaLifeTimeSeconds: The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site
	// to site VPN tunnel.
	SaLifeTimeSeconds *int `json:"saLifeTimeSeconds,omitempty"`
}

var _ genruntime.ARMTransformer = &IpsecPolicy{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (policy *IpsecPolicy) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if policy == nil {
		return nil, nil
	}
	result := &arm.IpsecPolicy{}

	// Set property "DhGroup":
	if policy.DhGroup != nil {
		var temp string
		temp = string(*policy.DhGroup)
		dhGroup := arm.DhGroup(temp)
		result.DhGroup = &dhGroup
	}

	// Set property "IkeEncryption":
	if policy.IkeEncryption != nil {
		var temp string
		temp = string(*policy.IkeEncryption)
		ikeEncryption := arm.IkeEncryption(temp)
		result.IkeEncryption = &ikeEncryption
	}

	// Set property "IkeIntegrity":
	if policy.IkeIntegrity != nil {
		var temp string
		temp = string(*policy.IkeIntegrity)
		ikeIntegrity := arm.IkeIntegrity(temp)
		result.IkeIntegrity = &ikeIntegrity
	}

	// Set property "IpsecEncryption":
	if policy.IpsecEncryption != nil {
		var temp string
		temp = string(*policy.IpsecEncryption)
		ipsecEncryption := arm.IpsecEncryption(temp)
		result.IpsecEncryption = &ipsecEncryption
	}

	// Set property "IpsecIntegrity":
	if policy.IpsecIntegrity != nil {
		var temp string
		temp = string(*policy.IpsecIntegrity)
		ipsecIntegrity := arm.IpsecIntegrity(temp)
		result.IpsecIntegrity = &ipsecIntegrity
	}

	// Set property "PfsGroup":
	if policy.PfsGroup != nil {
		var temp string
		temp = string(*policy.PfsGroup)
		pfsGroup := arm.PfsGroup(temp)
		result.PfsGroup = &pfsGroup
	}

	// Set property "SaDataSizeKilobytes":
	if policy.SaDataSizeKilobytes != nil {
		saDataSizeKilobytes := *policy.SaDataSizeKilobytes
		result.SaDataSizeKilobytes = &saDataSizeKilobytes
	}

	// Set property "SaLifeTimeSeconds":
	if policy.SaLifeTimeSeconds != nil {
		saLifeTimeSeconds := *policy.SaLifeTimeSeconds
		result.SaLifeTimeSeconds = &saLifeTimeSeconds
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (policy *IpsecPolicy) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.IpsecPolicy{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (policy *IpsecPolicy) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.IpsecPolicy)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IpsecPolicy, got %T", armInput)
	}

	// Set property "DhGroup":
	if typedInput.DhGroup != nil {
		var temp string
		temp = string(*typedInput.DhGroup)
		dhGroup := DhGroup(temp)
		policy.DhGroup = &dhGroup
	}

	// Set property "IkeEncryption":
	if typedInput.IkeEncryption != nil {
		var temp string
		temp = string(*typedInput.IkeEncryption)
		ikeEncryption := IkeEncryption(temp)
		policy.IkeEncryption = &ikeEncryption
	}

	// Set property "IkeIntegrity":
	if typedInput.IkeIntegrity != nil {
		var temp string
		temp = string(*typedInput.IkeIntegrity)
		ikeIntegrity := IkeIntegrity(temp)
		policy.IkeIntegrity = &ikeIntegrity
	}

	// Set property "IpsecEncryption":
	if typedInput.IpsecEncryption != nil {
		var temp string
		temp = string(*typedInput.IpsecEncryption)
		ipsecEncryption := IpsecEncryption(temp)
		policy.IpsecEncryption = &ipsecEncryption
	}

	// Set property "IpsecIntegrity":
	if typedInput.IpsecIntegrity != nil {
		var temp string
		temp = string(*typedInput.IpsecIntegrity)
		ipsecIntegrity := IpsecIntegrity(temp)
		policy.IpsecIntegrity = &ipsecIntegrity
	}

	// Set property "PfsGroup":
	if typedInput.PfsGroup != nil {
		var temp string
		temp = string(*typedInput.PfsGroup)
		pfsGroup := PfsGroup(temp)
		policy.PfsGroup = &pfsGroup
	}

	// Set property "SaDataSizeKilobytes":
	if typedInput.SaDataSizeKilobytes != nil {
		saDataSizeKilobytes := *typedInput.SaDataSizeKilobytes
		policy.SaDataSizeKilobytes = &saDataSizeKilobytes
	}

	// Set property "SaLifeTimeSeconds":
	if typedInput.SaLifeTimeSeconds != nil {
		saLifeTimeSeconds := *typedInput.SaLifeTimeSeconds
		policy.SaLifeTimeSeconds = &saLifeTimeSeconds
	}

	// No error
	return nil
}

// AssignProperties_From_IpsecPolicy populates our IpsecPolicy from the provided source IpsecPolicy
func (policy *IpsecPolicy) AssignProperties_From_IpsecPolicy(source *storage.IpsecPolicy) error {

	// DhGroup
	if source.DhGroup != nil {
		dhGroup := *source.DhGroup
		dhGroupTemp := genruntime.ToEnum(dhGroup, dhGroup_Values)
		policy.DhGroup = &dhGroupTemp
	} else {
		policy.DhGroup = nil
	}

	// IkeEncryption
	if source.IkeEncryption != nil {
		ikeEncryption := *source.IkeEncryption
		ikeEncryptionTemp := genruntime.ToEnum(ikeEncryption, ikeEncryption_Values)
		policy.IkeEncryption = &ikeEncryptionTemp
	} else {
		policy.IkeEncryption = nil
	}

	// IkeIntegrity
	if source.IkeIntegrity != nil {
		ikeIntegrity := *source.IkeIntegrity
		ikeIntegrityTemp := genruntime.ToEnum(ikeIntegrity, ikeIntegrity_Values)
		policy.IkeIntegrity = &ikeIntegrityTemp
	} else {
		policy.IkeIntegrity = nil
	}

	// IpsecEncryption
	if source.IpsecEncryption != nil {
		ipsecEncryption := *source.IpsecEncryption
		ipsecEncryptionTemp := genruntime.ToEnum(ipsecEncryption, ipsecEncryption_Values)
		policy.IpsecEncryption = &ipsecEncryptionTemp
	} else {
		policy.IpsecEncryption = nil
	}

	// IpsecIntegrity
	if source.IpsecIntegrity != nil {
		ipsecIntegrity := *source.IpsecIntegrity
		ipsecIntegrityTemp := genruntime.ToEnum(ipsecIntegrity, ipsecIntegrity_Values)
		policy.IpsecIntegrity = &ipsecIntegrityTemp
	} else {
		policy.IpsecIntegrity = nil
	}

	// PfsGroup
	if source.PfsGroup != nil {
		pfsGroup := *source.PfsGroup
		pfsGroupTemp := genruntime.ToEnum(pfsGroup, pfsGroup_Values)
		policy.PfsGroup = &pfsGroupTemp
	} else {
		policy.PfsGroup = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_IpsecPolicy populates the provided destination IpsecPolicy from our IpsecPolicy
func (policy *IpsecPolicy) AssignProperties_To_IpsecPolicy(destination *storage.IpsecPolicy) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// DhGroup
	if policy.DhGroup != nil {
		dhGroup := string(*policy.DhGroup)
		destination.DhGroup = &dhGroup
	} else {
		destination.DhGroup = nil
	}

	// IkeEncryption
	if policy.IkeEncryption != nil {
		ikeEncryption := string(*policy.IkeEncryption)
		destination.IkeEncryption = &ikeEncryption
	} else {
		destination.IkeEncryption = nil
	}

	// IkeIntegrity
	if policy.IkeIntegrity != nil {
		ikeIntegrity := string(*policy.IkeIntegrity)
		destination.IkeIntegrity = &ikeIntegrity
	} else {
		destination.IkeIntegrity = nil
	}

	// IpsecEncryption
	if policy.IpsecEncryption != nil {
		ipsecEncryption := string(*policy.IpsecEncryption)
		destination.IpsecEncryption = &ipsecEncryption
	} else {
		destination.IpsecEncryption = nil
	}

	// IpsecIntegrity
	if policy.IpsecIntegrity != nil {
		ipsecIntegrity := string(*policy.IpsecIntegrity)
		destination.IpsecIntegrity = &ipsecIntegrity
	} else {
		destination.IpsecIntegrity = nil
	}

	// PfsGroup
	if policy.PfsGroup != nil {
		pfsGroup := string(*policy.PfsGroup)
		destination.PfsGroup = &pfsGroup
	} else {
		destination.PfsGroup = nil
	}

	// 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
	}

	// No error
	return nil
}

// Initialize_From_IpsecPolicy_STATUS populates our IpsecPolicy from the provided source IpsecPolicy_STATUS
func (policy *IpsecPolicy) Initialize_From_IpsecPolicy_STATUS(source *IpsecPolicy_STATUS) error {

	// DhGroup
	if source.DhGroup != nil {
		dhGroup := genruntime.ToEnum(string(*source.DhGroup), dhGroup_Values)
		policy.DhGroup = &dhGroup
	} else {
		policy.DhGroup = nil
	}

	// IkeEncryption
	if source.IkeEncryption != nil {
		ikeEncryption := genruntime.ToEnum(string(*source.IkeEncryption), ikeEncryption_Values)
		policy.IkeEncryption = &ikeEncryption
	} else {
		policy.IkeEncryption = nil
	}

	// IkeIntegrity
	if source.IkeIntegrity != nil {
		ikeIntegrity := genruntime.ToEnum(string(*source.IkeIntegrity), ikeIntegrity_Values)
		policy.IkeIntegrity = &ikeIntegrity
	} else {
		policy.IkeIntegrity = nil
	}

	// IpsecEncryption
	if source.IpsecEncryption != nil {
		ipsecEncryption := genruntime.ToEnum(string(*source.IpsecEncryption), ipsecEncryption_Values)
		policy.IpsecEncryption = &ipsecEncryption
	} else {
		policy.IpsecEncryption = nil
	}

	// IpsecIntegrity
	if source.IpsecIntegrity != nil {
		ipsecIntegrity := genruntime.ToEnum(string(*source.IpsecIntegrity), ipsecIntegrity_Values)
		policy.IpsecIntegrity = &ipsecIntegrity
	} else {
		policy.IpsecIntegrity = nil
	}

	// PfsGroup
	if source.PfsGroup != nil {
		pfsGroup := genruntime.ToEnum(string(*source.PfsGroup), pfsGroup_Values)
		policy.PfsGroup = &pfsGroup
	} else {
		policy.PfsGroup = nil
	}

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

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

	// No error
	return nil
}

// An IPSec Policy configuration for a virtual network gateway connection.
type IpsecPolicy_STATUS struct {
	// DhGroup: The DH Group used in IKE Phase 1 for initial SA.
	DhGroup *DhGroup_STATUS `json:"dhGroup,omitempty"`

	// IkeEncryption: The IKE encryption algorithm (IKE phase 2).
	IkeEncryption *IkeEncryption_STATUS `json:"ikeEncryption,omitempty"`

	// IkeIntegrity: The IKE integrity algorithm (IKE phase 2).
	IkeIntegrity *IkeIntegrity_STATUS `json:"ikeIntegrity,omitempty"`

	// IpsecEncryption: The IPSec encryption algorithm (IKE phase 1).
	IpsecEncryption *IpsecEncryption_STATUS `json:"ipsecEncryption,omitempty"`

	// IpsecIntegrity: The IPSec integrity algorithm (IKE phase 1).
	IpsecIntegrity *IpsecIntegrity_STATUS `json:"ipsecIntegrity,omitempty"`

	// PfsGroup: The Pfs Group used in IKE Phase 2 for new child SA.
	PfsGroup *PfsGroup_STATUS `json:"pfsGroup,omitempty"`

	// SaDataSizeKilobytes: The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site
	// to site VPN tunnel.
	SaDataSizeKilobytes *int `json:"saDataSizeKilobytes,omitempty"`

	// SaLifeTimeSeconds: The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site
	// to site VPN tunnel.
	SaLifeTimeSeconds *int `json:"saLifeTimeSeconds,omitempty"`
}

var _ genruntime.FromARMConverter = &IpsecPolicy_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (policy *IpsecPolicy_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.IpsecPolicy_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (policy *IpsecPolicy_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.IpsecPolicy_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IpsecPolicy_STATUS, got %T", armInput)
	}

	// Set property "DhGroup":
	if typedInput.DhGroup != nil {
		var temp string
		temp = string(*typedInput.DhGroup)
		dhGroup := DhGroup_STATUS(temp)
		policy.DhGroup = &dhGroup
	}

	// Set property "IkeEncryption":
	if typedInput.IkeEncryption != nil {
		var temp string
		temp = string(*typedInput.IkeEncryption)
		ikeEncryption := IkeEncryption_STATUS(temp)
		policy.IkeEncryption = &ikeEncryption
	}

	// Set property "IkeIntegrity":
	if typedInput.IkeIntegrity != nil {
		var temp string
		temp = string(*typedInput.IkeIntegrity)
		ikeIntegrity := IkeIntegrity_STATUS(temp)
		policy.IkeIntegrity = &ikeIntegrity
	}

	// Set property "IpsecEncryption":
	if typedInput.IpsecEncryption != nil {
		var temp string
		temp = string(*typedInput.IpsecEncryption)
		ipsecEncryption := IpsecEncryption_STATUS(temp)
		policy.IpsecEncryption = &ipsecEncryption
	}

	// Set property "IpsecIntegrity":
	if typedInput.IpsecIntegrity != nil {
		var temp string
		temp = string(*typedInput.IpsecIntegrity)
		ipsecIntegrity := IpsecIntegrity_STATUS(temp)
		policy.IpsecIntegrity = &ipsecIntegrity
	}

	// Set property "PfsGroup":
	if typedInput.PfsGroup != nil {
		var temp string
		temp = string(*typedInput.PfsGroup)
		pfsGroup := PfsGroup_STATUS(temp)
		policy.PfsGroup = &pfsGroup
	}

	// Set property "SaDataSizeKilobytes":
	if typedInput.SaDataSizeKilobytes != nil {
		saDataSizeKilobytes := *typedInput.SaDataSizeKilobytes
		policy.SaDataSizeKilobytes = &saDataSizeKilobytes
	}

	// Set property "SaLifeTimeSeconds":
	if typedInput.SaLifeTimeSeconds != nil {
		saLifeTimeSeconds := *typedInput.SaLifeTimeSeconds
		policy.SaLifeTimeSeconds = &saLifeTimeSeconds
	}

	// No error
	return nil
}

// AssignProperties_From_IpsecPolicy_STATUS populates our IpsecPolicy_STATUS from the provided source IpsecPolicy_STATUS
func (policy *IpsecPolicy_STATUS) AssignProperties_From_IpsecPolicy_STATUS(source *storage.IpsecPolicy_STATUS) error {

	// DhGroup
	if source.DhGroup != nil {
		dhGroup := *source.DhGroup
		dhGroupTemp := genruntime.ToEnum(dhGroup, dhGroup_STATUS_Values)
		policy.DhGroup = &dhGroupTemp
	} else {
		policy.DhGroup = nil
	}

	// IkeEncryption
	if source.IkeEncryption != nil {
		ikeEncryption := *source.IkeEncryption
		ikeEncryptionTemp := genruntime.ToEnum(ikeEncryption, ikeEncryption_STATUS_Values)
		policy.IkeEncryption = &ikeEncryptionTemp
	} else {
		policy.IkeEncryption = nil
	}

	// IkeIntegrity
	if source.IkeIntegrity != nil {
		ikeIntegrity := *source.IkeIntegrity
		ikeIntegrityTemp := genruntime.ToEnum(ikeIntegrity, ikeIntegrity_STATUS_Values)
		policy.IkeIntegrity = &ikeIntegrityTemp
	} else {
		policy.IkeIntegrity = nil
	}

	// IpsecEncryption
	if source.IpsecEncryption != nil {
		ipsecEncryption := *source.IpsecEncryption
		ipsecEncryptionTemp := genruntime.ToEnum(ipsecEncryption, ipsecEncryption_STATUS_Values)
		policy.IpsecEncryption = &ipsecEncryptionTemp
	} else {
		policy.IpsecEncryption = nil
	}

	// IpsecIntegrity
	if source.IpsecIntegrity != nil {
		ipsecIntegrity := *source.IpsecIntegrity
		ipsecIntegrityTemp := genruntime.ToEnum(ipsecIntegrity, ipsecIntegrity_STATUS_Values)
		policy.IpsecIntegrity = &ipsecIntegrityTemp
	} else {
		policy.IpsecIntegrity = nil
	}

	// PfsGroup
	if source.PfsGroup != nil {
		pfsGroup := *source.PfsGroup
		pfsGroupTemp := genruntime.ToEnum(pfsGroup, pfsGroup_STATUS_Values)
		policy.PfsGroup = &pfsGroupTemp
	} else {
		policy.PfsGroup = nil
	}

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

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

	// 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 *storage.IpsecPolicy_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// DhGroup
	if policy.DhGroup != nil {
		dhGroup := string(*policy.DhGroup)
		destination.DhGroup = &dhGroup
	} else {
		destination.DhGroup = nil
	}

	// IkeEncryption
	if policy.IkeEncryption != nil {
		ikeEncryption := string(*policy.IkeEncryption)
		destination.IkeEncryption = &ikeEncryption
	} else {
		destination.IkeEncryption = nil
	}

	// IkeIntegrity
	if policy.IkeIntegrity != nil {
		ikeIntegrity := string(*policy.IkeIntegrity)
		destination.IkeIntegrity = &ikeIntegrity
	} else {
		destination.IkeIntegrity = nil
	}

	// IpsecEncryption
	if policy.IpsecEncryption != nil {
		ipsecEncryption := string(*policy.IpsecEncryption)
		destination.IpsecEncryption = &ipsecEncryption
	} else {
		destination.IpsecEncryption = nil
	}

	// IpsecIntegrity
	if policy.IpsecIntegrity != nil {
		ipsecIntegrity := string(*policy.IpsecIntegrity)
		destination.IpsecIntegrity = &ipsecIntegrity
	} else {
		destination.IpsecIntegrity = nil
	}

	// PfsGroup
	if policy.PfsGroup != nil {
		pfsGroup := string(*policy.PfsGroup)
		destination.PfsGroup = &pfsGroup
	} else {
		destination.PfsGroup = nil
	}

	// 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
	}

	// No error
	return nil
}

// Radius Server Settings.
type RadiusServer struct {
	// +kubebuilder:validation:Required
	// RadiusServerAddress: The address of this radius server.
	RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`

	// RadiusServerScore: The initial score assigned to this radius server.
	RadiusServerScore *int `json:"radiusServerScore,omitempty"`

	// RadiusServerSecret: The secret used for this radius server.
	RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`
}

var _ genruntime.ARMTransformer = &RadiusServer{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (server *RadiusServer) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if server == nil {
		return nil, nil
	}
	result := &arm.RadiusServer{}

	// Set property "RadiusServerAddress":
	if server.RadiusServerAddress != nil {
		radiusServerAddress := *server.RadiusServerAddress
		result.RadiusServerAddress = &radiusServerAddress
	}

	// Set property "RadiusServerScore":
	if server.RadiusServerScore != nil {
		radiusServerScore := *server.RadiusServerScore
		result.RadiusServerScore = &radiusServerScore
	}

	// Set property "RadiusServerSecret":
	if server.RadiusServerSecret != nil {
		radiusServerSecret := *server.RadiusServerSecret
		result.RadiusServerSecret = &radiusServerSecret
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (server *RadiusServer) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.RadiusServer{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (server *RadiusServer) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.RadiusServer)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.RadiusServer, got %T", armInput)
	}

	// Set property "RadiusServerAddress":
	if typedInput.RadiusServerAddress != nil {
		radiusServerAddress := *typedInput.RadiusServerAddress
		server.RadiusServerAddress = &radiusServerAddress
	}

	// Set property "RadiusServerScore":
	if typedInput.RadiusServerScore != nil {
		radiusServerScore := *typedInput.RadiusServerScore
		server.RadiusServerScore = &radiusServerScore
	}

	// Set property "RadiusServerSecret":
	if typedInput.RadiusServerSecret != nil {
		radiusServerSecret := *typedInput.RadiusServerSecret
		server.RadiusServerSecret = &radiusServerSecret
	}

	// No error
	return nil
}

// AssignProperties_From_RadiusServer populates our RadiusServer from the provided source RadiusServer
func (server *RadiusServer) AssignProperties_From_RadiusServer(source *storage.RadiusServer) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_RadiusServer populates the provided destination RadiusServer from our RadiusServer
func (server *RadiusServer) AssignProperties_To_RadiusServer(destination *storage.RadiusServer) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// Initialize_From_RadiusServer_STATUS populates our RadiusServer from the provided source RadiusServer_STATUS
func (server *RadiusServer) Initialize_From_RadiusServer_STATUS(source *RadiusServer_STATUS) error {

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

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

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

	// No error
	return nil
}

// Radius Server Settings.
type RadiusServer_STATUS struct {
	// RadiusServerAddress: The address of this radius server.
	RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`

	// RadiusServerScore: The initial score assigned to this radius server.
	RadiusServerScore *int `json:"radiusServerScore,omitempty"`

	// RadiusServerSecret: The secret used for this radius server.
	RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`
}

var _ genruntime.FromARMConverter = &RadiusServer_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (server *RadiusServer_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.RadiusServer_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (server *RadiusServer_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.RadiusServer_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.RadiusServer_STATUS, got %T", armInput)
	}

	// Set property "RadiusServerAddress":
	if typedInput.RadiusServerAddress != nil {
		radiusServerAddress := *typedInput.RadiusServerAddress
		server.RadiusServerAddress = &radiusServerAddress
	}

	// Set property "RadiusServerScore":
	if typedInput.RadiusServerScore != nil {
		radiusServerScore := *typedInput.RadiusServerScore
		server.RadiusServerScore = &radiusServerScore
	}

	// Set property "RadiusServerSecret":
	if typedInput.RadiusServerSecret != nil {
		radiusServerSecret := *typedInput.RadiusServerSecret
		server.RadiusServerSecret = &radiusServerSecret
	}

	// No error
	return nil
}

// AssignProperties_From_RadiusServer_STATUS populates our RadiusServer_STATUS from the provided source RadiusServer_STATUS
func (server *RadiusServer_STATUS) AssignProperties_From_RadiusServer_STATUS(source *storage.RadiusServer_STATUS) error {

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

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

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

	// 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 *storage.RadiusServer_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

type VirtualNetworkGatewayAutoScaleBounds struct {
	// Max: Maximum Scale Units for Autoscale configuration
	Max *int `json:"max,omitempty"`

	// Min: Minimum scale Units for Autoscale configuration
	Min *int `json:"min,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewayAutoScaleBounds{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (bounds *VirtualNetworkGatewayAutoScaleBounds) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if bounds == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewayAutoScaleBounds{}

	// Set property "Max":
	if bounds.Max != nil {
		max := *bounds.Max
		result.Max = &max
	}

	// Set property "Min":
	if bounds.Min != nil {
		min := *bounds.Min
		result.Min = &min
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (bounds *VirtualNetworkGatewayAutoScaleBounds) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayAutoScaleBounds{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (bounds *VirtualNetworkGatewayAutoScaleBounds) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayAutoScaleBounds)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayAutoScaleBounds, got %T", armInput)
	}

	// Set property "Max":
	if typedInput.Max != nil {
		max := *typedInput.Max
		bounds.Max = &max
	}

	// Set property "Min":
	if typedInput.Min != nil {
		min := *typedInput.Min
		bounds.Min = &min
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds populates our VirtualNetworkGatewayAutoScaleBounds from the provided source VirtualNetworkGatewayAutoScaleBounds
func (bounds *VirtualNetworkGatewayAutoScaleBounds) AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds(source *storage.VirtualNetworkGatewayAutoScaleBounds) error {

	// Max
	bounds.Max = genruntime.ClonePointerToInt(source.Max)

	// Min
	bounds.Min = genruntime.ClonePointerToInt(source.Min)

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds populates the provided destination VirtualNetworkGatewayAutoScaleBounds from our VirtualNetworkGatewayAutoScaleBounds
func (bounds *VirtualNetworkGatewayAutoScaleBounds) AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds(destination *storage.VirtualNetworkGatewayAutoScaleBounds) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Max
	destination.Max = genruntime.ClonePointerToInt(bounds.Max)

	// Min
	destination.Min = genruntime.ClonePointerToInt(bounds.Min)

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewayAutoScaleBounds_STATUS populates our VirtualNetworkGatewayAutoScaleBounds from the provided source VirtualNetworkGatewayAutoScaleBounds_STATUS
func (bounds *VirtualNetworkGatewayAutoScaleBounds) Initialize_From_VirtualNetworkGatewayAutoScaleBounds_STATUS(source *VirtualNetworkGatewayAutoScaleBounds_STATUS) error {

	// Max
	bounds.Max = genruntime.ClonePointerToInt(source.Max)

	// Min
	bounds.Min = genruntime.ClonePointerToInt(source.Min)

	// No error
	return nil
}

type VirtualNetworkGatewayAutoScaleBounds_STATUS struct {
	// Max: Maximum Scale Units for Autoscale configuration
	Max *int `json:"max,omitempty"`

	// Min: Minimum scale Units for Autoscale configuration
	Min *int `json:"min,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewayAutoScaleBounds_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (bounds *VirtualNetworkGatewayAutoScaleBounds_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayAutoScaleBounds_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (bounds *VirtualNetworkGatewayAutoScaleBounds_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayAutoScaleBounds_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayAutoScaleBounds_STATUS, got %T", armInput)
	}

	// Set property "Max":
	if typedInput.Max != nil {
		max := *typedInput.Max
		bounds.Max = &max
	}

	// Set property "Min":
	if typedInput.Min != nil {
		min := *typedInput.Min
		bounds.Min = &min
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds_STATUS populates our VirtualNetworkGatewayAutoScaleBounds_STATUS from the provided source VirtualNetworkGatewayAutoScaleBounds_STATUS
func (bounds *VirtualNetworkGatewayAutoScaleBounds_STATUS) AssignProperties_From_VirtualNetworkGatewayAutoScaleBounds_STATUS(source *storage.VirtualNetworkGatewayAutoScaleBounds_STATUS) error {

	// Max
	bounds.Max = genruntime.ClonePointerToInt(source.Max)

	// Min
	bounds.Min = genruntime.ClonePointerToInt(source.Min)

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds_STATUS populates the provided destination VirtualNetworkGatewayAutoScaleBounds_STATUS from our VirtualNetworkGatewayAutoScaleBounds_STATUS
func (bounds *VirtualNetworkGatewayAutoScaleBounds_STATUS) AssignProperties_To_VirtualNetworkGatewayAutoScaleBounds_STATUS(destination *storage.VirtualNetworkGatewayAutoScaleBounds_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Max
	destination.Max = genruntime.ClonePointerToInt(bounds.Max)

	// Min
	destination.Min = genruntime.ClonePointerToInt(bounds.Min)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"EgressSnat","IngressSnat"}
type VirtualNetworkGatewayNatRuleProperties_Mode string

const (
	VirtualNetworkGatewayNatRuleProperties_Mode_EgressSnat  = VirtualNetworkGatewayNatRuleProperties_Mode("EgressSnat")
	VirtualNetworkGatewayNatRuleProperties_Mode_IngressSnat = VirtualNetworkGatewayNatRuleProperties_Mode("IngressSnat")
)

// Mapping from string to VirtualNetworkGatewayNatRuleProperties_Mode
var virtualNetworkGatewayNatRuleProperties_Mode_Values = map[string]VirtualNetworkGatewayNatRuleProperties_Mode{
	"egresssnat":  VirtualNetworkGatewayNatRuleProperties_Mode_EgressSnat,
	"ingresssnat": VirtualNetworkGatewayNatRuleProperties_Mode_IngressSnat,
}

type VirtualNetworkGatewayNatRuleProperties_Mode_STATUS string

const (
	VirtualNetworkGatewayNatRuleProperties_Mode_STATUS_EgressSnat  = VirtualNetworkGatewayNatRuleProperties_Mode_STATUS("EgressSnat")
	VirtualNetworkGatewayNatRuleProperties_Mode_STATUS_IngressSnat = VirtualNetworkGatewayNatRuleProperties_Mode_STATUS("IngressSnat")
)

// Mapping from string to VirtualNetworkGatewayNatRuleProperties_Mode_STATUS
var virtualNetworkGatewayNatRuleProperties_Mode_STATUS_Values = map[string]VirtualNetworkGatewayNatRuleProperties_Mode_STATUS{
	"egresssnat":  VirtualNetworkGatewayNatRuleProperties_Mode_STATUS_EgressSnat,
	"ingresssnat": VirtualNetworkGatewayNatRuleProperties_Mode_STATUS_IngressSnat,
}

// +kubebuilder:validation:Enum={"Dynamic","Static"}
type VirtualNetworkGatewayNatRuleProperties_Type string

const (
	VirtualNetworkGatewayNatRuleProperties_Type_Dynamic = VirtualNetworkGatewayNatRuleProperties_Type("Dynamic")
	VirtualNetworkGatewayNatRuleProperties_Type_Static  = VirtualNetworkGatewayNatRuleProperties_Type("Static")
)

// Mapping from string to VirtualNetworkGatewayNatRuleProperties_Type
var virtualNetworkGatewayNatRuleProperties_Type_Values = map[string]VirtualNetworkGatewayNatRuleProperties_Type{
	"dynamic": VirtualNetworkGatewayNatRuleProperties_Type_Dynamic,
	"static":  VirtualNetworkGatewayNatRuleProperties_Type_Static,
}

type VirtualNetworkGatewayNatRuleProperties_Type_STATUS string

const (
	VirtualNetworkGatewayNatRuleProperties_Type_STATUS_Dynamic = VirtualNetworkGatewayNatRuleProperties_Type_STATUS("Dynamic")
	VirtualNetworkGatewayNatRuleProperties_Type_STATUS_Static  = VirtualNetworkGatewayNatRuleProperties_Type_STATUS("Static")
)

// Mapping from string to VirtualNetworkGatewayNatRuleProperties_Type_STATUS
var virtualNetworkGatewayNatRuleProperties_Type_STATUS_Values = map[string]VirtualNetworkGatewayNatRuleProperties_Type_STATUS{
	"dynamic": VirtualNetworkGatewayNatRuleProperties_Type_STATUS_Dynamic,
	"static":  VirtualNetworkGatewayNatRuleProperties_Type_STATUS_Static,
}

// Vpn Client Connection configuration PolicyGroup member
type VirtualNetworkGatewayPolicyGroupMember struct {
	// AttributeType: The Vpn Policy member attribute type.
	AttributeType *VirtualNetworkGatewayPolicyGroupMember_AttributeType `json:"attributeType,omitempty"`

	// AttributeValue: The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember.
	AttributeValue *string `json:"attributeValue,omitempty"`

	// Name: Name of the VirtualNetworkGatewayPolicyGroupMember.
	Name *string `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkGatewayPolicyGroupMember{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (member *VirtualNetworkGatewayPolicyGroupMember) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if member == nil {
		return nil, nil
	}
	result := &arm.VirtualNetworkGatewayPolicyGroupMember{}

	// Set property "AttributeType":
	if member.AttributeType != nil {
		var temp string
		temp = string(*member.AttributeType)
		attributeType := arm.VirtualNetworkGatewayPolicyGroupMember_AttributeType(temp)
		result.AttributeType = &attributeType
	}

	// Set property "AttributeValue":
	if member.AttributeValue != nil {
		attributeValue := *member.AttributeValue
		result.AttributeValue = &attributeValue
	}

	// Set property "Name":
	if member.Name != nil {
		name := *member.Name
		result.Name = &name
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (member *VirtualNetworkGatewayPolicyGroupMember) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayPolicyGroupMember{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (member *VirtualNetworkGatewayPolicyGroupMember) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayPolicyGroupMember)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayPolicyGroupMember, got %T", armInput)
	}

	// Set property "AttributeType":
	if typedInput.AttributeType != nil {
		var temp string
		temp = string(*typedInput.AttributeType)
		attributeType := VirtualNetworkGatewayPolicyGroupMember_AttributeType(temp)
		member.AttributeType = &attributeType
	}

	// Set property "AttributeValue":
	if typedInput.AttributeValue != nil {
		attributeValue := *typedInput.AttributeValue
		member.AttributeValue = &attributeValue
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		member.Name = &name
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember populates our VirtualNetworkGatewayPolicyGroupMember from the provided source VirtualNetworkGatewayPolicyGroupMember
func (member *VirtualNetworkGatewayPolicyGroupMember) AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember(source *storage.VirtualNetworkGatewayPolicyGroupMember) error {

	// AttributeType
	if source.AttributeType != nil {
		attributeType := *source.AttributeType
		attributeTypeTemp := genruntime.ToEnum(attributeType, virtualNetworkGatewayPolicyGroupMember_AttributeType_Values)
		member.AttributeType = &attributeTypeTemp
	} else {
		member.AttributeType = nil
	}

	// AttributeValue
	member.AttributeValue = genruntime.ClonePointerToString(source.AttributeValue)

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

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember populates the provided destination VirtualNetworkGatewayPolicyGroupMember from our VirtualNetworkGatewayPolicyGroupMember
func (member *VirtualNetworkGatewayPolicyGroupMember) AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember(destination *storage.VirtualNetworkGatewayPolicyGroupMember) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AttributeType
	if member.AttributeType != nil {
		attributeType := string(*member.AttributeType)
		destination.AttributeType = &attributeType
	} else {
		destination.AttributeType = nil
	}

	// AttributeValue
	destination.AttributeValue = genruntime.ClonePointerToString(member.AttributeValue)

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

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkGatewayPolicyGroupMember_STATUS populates our VirtualNetworkGatewayPolicyGroupMember from the provided source VirtualNetworkGatewayPolicyGroupMember_STATUS
func (member *VirtualNetworkGatewayPolicyGroupMember) Initialize_From_VirtualNetworkGatewayPolicyGroupMember_STATUS(source *VirtualNetworkGatewayPolicyGroupMember_STATUS) error {

	// AttributeType
	if source.AttributeType != nil {
		attributeType := genruntime.ToEnum(string(*source.AttributeType), virtualNetworkGatewayPolicyGroupMember_AttributeType_Values)
		member.AttributeType = &attributeType
	} else {
		member.AttributeType = nil
	}

	// AttributeValue
	member.AttributeValue = genruntime.ClonePointerToString(source.AttributeValue)

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

	// No error
	return nil
}

// Vpn Client Connection configuration PolicyGroup member
type VirtualNetworkGatewayPolicyGroupMember_STATUS struct {
	// AttributeType: The Vpn Policy member attribute type.
	AttributeType *VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS `json:"attributeType,omitempty"`

	// AttributeValue: The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember.
	AttributeValue *string `json:"attributeValue,omitempty"`

	// Name: Name of the VirtualNetworkGatewayPolicyGroupMember.
	Name *string `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkGatewayPolicyGroupMember_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (member *VirtualNetworkGatewayPolicyGroupMember_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VirtualNetworkGatewayPolicyGroupMember_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (member *VirtualNetworkGatewayPolicyGroupMember_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VirtualNetworkGatewayPolicyGroupMember_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VirtualNetworkGatewayPolicyGroupMember_STATUS, got %T", armInput)
	}

	// Set property "AttributeType":
	if typedInput.AttributeType != nil {
		var temp string
		temp = string(*typedInput.AttributeType)
		attributeType := VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS(temp)
		member.AttributeType = &attributeType
	}

	// Set property "AttributeValue":
	if typedInput.AttributeValue != nil {
		attributeValue := *typedInput.AttributeValue
		member.AttributeValue = &attributeValue
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		member.Name = &name
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember_STATUS populates our VirtualNetworkGatewayPolicyGroupMember_STATUS from the provided source VirtualNetworkGatewayPolicyGroupMember_STATUS
func (member *VirtualNetworkGatewayPolicyGroupMember_STATUS) AssignProperties_From_VirtualNetworkGatewayPolicyGroupMember_STATUS(source *storage.VirtualNetworkGatewayPolicyGroupMember_STATUS) error {

	// AttributeType
	if source.AttributeType != nil {
		attributeType := *source.AttributeType
		attributeTypeTemp := genruntime.ToEnum(attributeType, virtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_Values)
		member.AttributeType = &attributeTypeTemp
	} else {
		member.AttributeType = nil
	}

	// AttributeValue
	member.AttributeValue = genruntime.ClonePointerToString(source.AttributeValue)

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

	// No error
	return nil
}

// AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember_STATUS populates the provided destination VirtualNetworkGatewayPolicyGroupMember_STATUS from our VirtualNetworkGatewayPolicyGroupMember_STATUS
func (member *VirtualNetworkGatewayPolicyGroupMember_STATUS) AssignProperties_To_VirtualNetworkGatewayPolicyGroupMember_STATUS(destination *storage.VirtualNetworkGatewayPolicyGroupMember_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AttributeType
	if member.AttributeType != nil {
		attributeType := string(*member.AttributeType)
		destination.AttributeType = &attributeType
	} else {
		destination.AttributeType = nil
	}

	// AttributeValue
	destination.AttributeValue = genruntime.ClonePointerToString(member.AttributeValue)

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Basic","ErGw1AZ","ErGw2AZ","ErGw3AZ","ErGwScale","HighPerformance","Standard","UltraPerformance","VpnGw1","VpnGw1AZ","VpnGw2","VpnGw2AZ","VpnGw3","VpnGw3AZ","VpnGw4","VpnGw4AZ","VpnGw5","VpnGw5AZ"}
type VirtualNetworkGatewaySku_Name string

const (
	VirtualNetworkGatewaySku_Name_Basic            = VirtualNetworkGatewaySku_Name("Basic")
	VirtualNetworkGatewaySku_Name_ErGw1AZ          = VirtualNetworkGatewaySku_Name("ErGw1AZ")
	VirtualNetworkGatewaySku_Name_ErGw2AZ          = VirtualNetworkGatewaySku_Name("ErGw2AZ")
	VirtualNetworkGatewaySku_Name_ErGw3AZ          = VirtualNetworkGatewaySku_Name("ErGw3AZ")
	VirtualNetworkGatewaySku_Name_ErGwScale        = VirtualNetworkGatewaySku_Name("ErGwScale")
	VirtualNetworkGatewaySku_Name_HighPerformance  = VirtualNetworkGatewaySku_Name("HighPerformance")
	VirtualNetworkGatewaySku_Name_Standard         = VirtualNetworkGatewaySku_Name("Standard")
	VirtualNetworkGatewaySku_Name_UltraPerformance = VirtualNetworkGatewaySku_Name("UltraPerformance")
	VirtualNetworkGatewaySku_Name_VpnGw1           = VirtualNetworkGatewaySku_Name("VpnGw1")
	VirtualNetworkGatewaySku_Name_VpnGw1AZ         = VirtualNetworkGatewaySku_Name("VpnGw1AZ")
	VirtualNetworkGatewaySku_Name_VpnGw2           = VirtualNetworkGatewaySku_Name("VpnGw2")
	VirtualNetworkGatewaySku_Name_VpnGw2AZ         = VirtualNetworkGatewaySku_Name("VpnGw2AZ")
	VirtualNetworkGatewaySku_Name_VpnGw3           = VirtualNetworkGatewaySku_Name("VpnGw3")
	VirtualNetworkGatewaySku_Name_VpnGw3AZ         = VirtualNetworkGatewaySku_Name("VpnGw3AZ")
	VirtualNetworkGatewaySku_Name_VpnGw4           = VirtualNetworkGatewaySku_Name("VpnGw4")
	VirtualNetworkGatewaySku_Name_VpnGw4AZ         = VirtualNetworkGatewaySku_Name("VpnGw4AZ")
	VirtualNetworkGatewaySku_Name_VpnGw5           = VirtualNetworkGatewaySku_Name("VpnGw5")
	VirtualNetworkGatewaySku_Name_VpnGw5AZ         = VirtualNetworkGatewaySku_Name("VpnGw5AZ")
)

// Mapping from string to VirtualNetworkGatewaySku_Name
var virtualNetworkGatewaySku_Name_Values = map[string]VirtualNetworkGatewaySku_Name{
	"basic":            VirtualNetworkGatewaySku_Name_Basic,
	"ergw1az":          VirtualNetworkGatewaySku_Name_ErGw1AZ,
	"ergw2az":          VirtualNetworkGatewaySku_Name_ErGw2AZ,
	"ergw3az":          VirtualNetworkGatewaySku_Name_ErGw3AZ,
	"ergwscale":        VirtualNetworkGatewaySku_Name_ErGwScale,
	"highperformance":  VirtualNetworkGatewaySku_Name_HighPerformance,
	"standard":         VirtualNetworkGatewaySku_Name_Standard,
	"ultraperformance": VirtualNetworkGatewaySku_Name_UltraPerformance,
	"vpngw1":           VirtualNetworkGatewaySku_Name_VpnGw1,
	"vpngw1az":         VirtualNetworkGatewaySku_Name_VpnGw1AZ,
	"vpngw2":           VirtualNetworkGatewaySku_Name_VpnGw2,
	"vpngw2az":         VirtualNetworkGatewaySku_Name_VpnGw2AZ,
	"vpngw3":           VirtualNetworkGatewaySku_Name_VpnGw3,
	"vpngw3az":         VirtualNetworkGatewaySku_Name_VpnGw3AZ,
	"vpngw4":           VirtualNetworkGatewaySku_Name_VpnGw4,
	"vpngw4az":         VirtualNetworkGatewaySku_Name_VpnGw4AZ,
	"vpngw5":           VirtualNetworkGatewaySku_Name_VpnGw5,
	"vpngw5az":         VirtualNetworkGatewaySku_Name_VpnGw5AZ,
}

type VirtualNetworkGatewaySku_Name_STATUS string

const (
	VirtualNetworkGatewaySku_Name_STATUS_Basic            = VirtualNetworkGatewaySku_Name_STATUS("Basic")
	VirtualNetworkGatewaySku_Name_STATUS_ErGw1AZ          = VirtualNetworkGatewaySku_Name_STATUS("ErGw1AZ")
	VirtualNetworkGatewaySku_Name_STATUS_ErGw2AZ          = VirtualNetworkGatewaySku_Name_STATUS("ErGw2AZ")
	VirtualNetworkGatewaySku_Name_STATUS_ErGw3AZ          = VirtualNetworkGatewaySku_Name_STATUS("ErGw3AZ")
	VirtualNetworkGatewaySku_Name_STATUS_ErGwScale        = VirtualNetworkGatewaySku_Name_STATUS("ErGwScale")
	VirtualNetworkGatewaySku_Name_STATUS_HighPerformance  = VirtualNetworkGatewaySku_Name_STATUS("HighPerformance")
	VirtualNetworkGatewaySku_Name_STATUS_Standard         = VirtualNetworkGatewaySku_Name_STATUS("Standard")
	VirtualNetworkGatewaySku_Name_STATUS_UltraPerformance = VirtualNetworkGatewaySku_Name_STATUS("UltraPerformance")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw1           = VirtualNetworkGatewaySku_Name_STATUS("VpnGw1")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw1AZ         = VirtualNetworkGatewaySku_Name_STATUS("VpnGw1AZ")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw2           = VirtualNetworkGatewaySku_Name_STATUS("VpnGw2")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw2AZ         = VirtualNetworkGatewaySku_Name_STATUS("VpnGw2AZ")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw3           = VirtualNetworkGatewaySku_Name_STATUS("VpnGw3")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw3AZ         = VirtualNetworkGatewaySku_Name_STATUS("VpnGw3AZ")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw4           = VirtualNetworkGatewaySku_Name_STATUS("VpnGw4")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw4AZ         = VirtualNetworkGatewaySku_Name_STATUS("VpnGw4AZ")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw5           = VirtualNetworkGatewaySku_Name_STATUS("VpnGw5")
	VirtualNetworkGatewaySku_Name_STATUS_VpnGw5AZ         = VirtualNetworkGatewaySku_Name_STATUS("VpnGw5AZ")
)

// Mapping from string to VirtualNetworkGatewaySku_Name_STATUS
var virtualNetworkGatewaySku_Name_STATUS_Values = map[string]VirtualNetworkGatewaySku_Name_STATUS{
	"basic":            VirtualNetworkGatewaySku_Name_STATUS_Basic,
	"ergw1az":          VirtualNetworkGatewaySku_Name_STATUS_ErGw1AZ,
	"ergw2az":          VirtualNetworkGatewaySku_Name_STATUS_ErGw2AZ,
	"ergw3az":          VirtualNetworkGatewaySku_Name_STATUS_ErGw3AZ,
	"ergwscale":        VirtualNetworkGatewaySku_Name_STATUS_ErGwScale,
	"highperformance":  VirtualNetworkGatewaySku_Name_STATUS_HighPerformance,
	"standard":         VirtualNetworkGatewaySku_Name_STATUS_Standard,
	"ultraperformance": VirtualNetworkGatewaySku_Name_STATUS_UltraPerformance,
	"vpngw1":           VirtualNetworkGatewaySku_Name_STATUS_VpnGw1,
	"vpngw1az":         VirtualNetworkGatewaySku_Name_STATUS_VpnGw1AZ,
	"vpngw2":           VirtualNetworkGatewaySku_Name_STATUS_VpnGw2,
	"vpngw2az":         VirtualNetworkGatewaySku_Name_STATUS_VpnGw2AZ,
	"vpngw3":           VirtualNetworkGatewaySku_Name_STATUS_VpnGw3,
	"vpngw3az":         VirtualNetworkGatewaySku_Name_STATUS_VpnGw3AZ,
	"vpngw4":           VirtualNetworkGatewaySku_Name_STATUS_VpnGw4,
	"vpngw4az":         VirtualNetworkGatewaySku_Name_STATUS_VpnGw4AZ,
	"vpngw5":           VirtualNetworkGatewaySku_Name_STATUS_VpnGw5,
	"vpngw5az":         VirtualNetworkGatewaySku_Name_STATUS_VpnGw5AZ,
}

// +kubebuilder:validation:Enum={"Basic","ErGw1AZ","ErGw2AZ","ErGw3AZ","ErGwScale","HighPerformance","Standard","UltraPerformance","VpnGw1","VpnGw1AZ","VpnGw2","VpnGw2AZ","VpnGw3","VpnGw3AZ","VpnGw4","VpnGw4AZ","VpnGw5","VpnGw5AZ"}
type VirtualNetworkGatewaySku_Tier string

const (
	VirtualNetworkGatewaySku_Tier_Basic            = VirtualNetworkGatewaySku_Tier("Basic")
	VirtualNetworkGatewaySku_Tier_ErGw1AZ          = VirtualNetworkGatewaySku_Tier("ErGw1AZ")
	VirtualNetworkGatewaySku_Tier_ErGw2AZ          = VirtualNetworkGatewaySku_Tier("ErGw2AZ")
	VirtualNetworkGatewaySku_Tier_ErGw3AZ          = VirtualNetworkGatewaySku_Tier("ErGw3AZ")
	VirtualNetworkGatewaySku_Tier_ErGwScale        = VirtualNetworkGatewaySku_Tier("ErGwScale")
	VirtualNetworkGatewaySku_Tier_HighPerformance  = VirtualNetworkGatewaySku_Tier("HighPerformance")
	VirtualNetworkGatewaySku_Tier_Standard         = VirtualNetworkGatewaySku_Tier("Standard")
	VirtualNetworkGatewaySku_Tier_UltraPerformance = VirtualNetworkGatewaySku_Tier("UltraPerformance")
	VirtualNetworkGatewaySku_Tier_VpnGw1           = VirtualNetworkGatewaySku_Tier("VpnGw1")
	VirtualNetworkGatewaySku_Tier_VpnGw1AZ         = VirtualNetworkGatewaySku_Tier("VpnGw1AZ")
	VirtualNetworkGatewaySku_Tier_VpnGw2           = VirtualNetworkGatewaySku_Tier("VpnGw2")
	VirtualNetworkGatewaySku_Tier_VpnGw2AZ         = VirtualNetworkGatewaySku_Tier("VpnGw2AZ")
	VirtualNetworkGatewaySku_Tier_VpnGw3           = VirtualNetworkGatewaySku_Tier("VpnGw3")
	VirtualNetworkGatewaySku_Tier_VpnGw3AZ         = VirtualNetworkGatewaySku_Tier("VpnGw3AZ")
	VirtualNetworkGatewaySku_Tier_VpnGw4           = VirtualNetworkGatewaySku_Tier("VpnGw4")
	VirtualNetworkGatewaySku_Tier_VpnGw4AZ         = VirtualNetworkGatewaySku_Tier("VpnGw4AZ")
	VirtualNetworkGatewaySku_Tier_VpnGw5           = VirtualNetworkGatewaySku_Tier("VpnGw5")
	VirtualNetworkGatewaySku_Tier_VpnGw5AZ         = VirtualNetworkGatewaySku_Tier("VpnGw5AZ")
)

// Mapping from string to VirtualNetworkGatewaySku_Tier
var virtualNetworkGatewaySku_Tier_Values = map[string]VirtualNetworkGatewaySku_Tier{
	"basic":            VirtualNetworkGatewaySku_Tier_Basic,
	"ergw1az":          VirtualNetworkGatewaySku_Tier_ErGw1AZ,
	"ergw2az":          VirtualNetworkGatewaySku_Tier_ErGw2AZ,
	"ergw3az":          VirtualNetworkGatewaySku_Tier_ErGw3AZ,
	"ergwscale":        VirtualNetworkGatewaySku_Tier_ErGwScale,
	"highperformance":  VirtualNetworkGatewaySku_Tier_HighPerformance,
	"standard":         VirtualNetworkGatewaySku_Tier_Standard,
	"ultraperformance": VirtualNetworkGatewaySku_Tier_UltraPerformance,
	"vpngw1":           VirtualNetworkGatewaySku_Tier_VpnGw1,
	"vpngw1az":         VirtualNetworkGatewaySku_Tier_VpnGw1AZ,
	"vpngw2":           VirtualNetworkGatewaySku_Tier_VpnGw2,
	"vpngw2az":         VirtualNetworkGatewaySku_Tier_VpnGw2AZ,
	"vpngw3":           VirtualNetworkGatewaySku_Tier_VpnGw3,
	"vpngw3az":         VirtualNetworkGatewaySku_Tier_VpnGw3AZ,
	"vpngw4":           VirtualNetworkGatewaySku_Tier_VpnGw4,
	"vpngw4az":         VirtualNetworkGatewaySku_Tier_VpnGw4AZ,
	"vpngw5":           VirtualNetworkGatewaySku_Tier_VpnGw5,
	"vpngw5az":         VirtualNetworkGatewaySku_Tier_VpnGw5AZ,
}

type VirtualNetworkGatewaySku_Tier_STATUS string

const (
	VirtualNetworkGatewaySku_Tier_STATUS_Basic            = VirtualNetworkGatewaySku_Tier_STATUS("Basic")
	VirtualNetworkGatewaySku_Tier_STATUS_ErGw1AZ          = VirtualNetworkGatewaySku_Tier_STATUS("ErGw1AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_ErGw2AZ          = VirtualNetworkGatewaySku_Tier_STATUS("ErGw2AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_ErGw3AZ          = VirtualNetworkGatewaySku_Tier_STATUS("ErGw3AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_ErGwScale        = VirtualNetworkGatewaySku_Tier_STATUS("ErGwScale")
	VirtualNetworkGatewaySku_Tier_STATUS_HighPerformance  = VirtualNetworkGatewaySku_Tier_STATUS("HighPerformance")
	VirtualNetworkGatewaySku_Tier_STATUS_Standard         = VirtualNetworkGatewaySku_Tier_STATUS("Standard")
	VirtualNetworkGatewaySku_Tier_STATUS_UltraPerformance = VirtualNetworkGatewaySku_Tier_STATUS("UltraPerformance")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw1           = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw1")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw1AZ         = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw1AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw2           = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw2")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw2AZ         = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw2AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw3           = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw3")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw3AZ         = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw3AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw4           = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw4")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw4AZ         = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw4AZ")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw5           = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw5")
	VirtualNetworkGatewaySku_Tier_STATUS_VpnGw5AZ         = VirtualNetworkGatewaySku_Tier_STATUS("VpnGw5AZ")
)

// Mapping from string to VirtualNetworkGatewaySku_Tier_STATUS
var virtualNetworkGatewaySku_Tier_STATUS_Values = map[string]VirtualNetworkGatewaySku_Tier_STATUS{
	"basic":            VirtualNetworkGatewaySku_Tier_STATUS_Basic,
	"ergw1az":          VirtualNetworkGatewaySku_Tier_STATUS_ErGw1AZ,
	"ergw2az":          VirtualNetworkGatewaySku_Tier_STATUS_ErGw2AZ,
	"ergw3az":          VirtualNetworkGatewaySku_Tier_STATUS_ErGw3AZ,
	"ergwscale":        VirtualNetworkGatewaySku_Tier_STATUS_ErGwScale,
	"highperformance":  VirtualNetworkGatewaySku_Tier_STATUS_HighPerformance,
	"standard":         VirtualNetworkGatewaySku_Tier_STATUS_Standard,
	"ultraperformance": VirtualNetworkGatewaySku_Tier_STATUS_UltraPerformance,
	"vpngw1":           VirtualNetworkGatewaySku_Tier_STATUS_VpnGw1,
	"vpngw1az":         VirtualNetworkGatewaySku_Tier_STATUS_VpnGw1AZ,
	"vpngw2":           VirtualNetworkGatewaySku_Tier_STATUS_VpnGw2,
	"vpngw2az":         VirtualNetworkGatewaySku_Tier_STATUS_VpnGw2AZ,
	"vpngw3":           VirtualNetworkGatewaySku_Tier_STATUS_VpnGw3,
	"vpngw3az":         VirtualNetworkGatewaySku_Tier_STATUS_VpnGw3AZ,
	"vpngw4":           VirtualNetworkGatewaySku_Tier_STATUS_VpnGw4,
	"vpngw4az":         VirtualNetworkGatewaySku_Tier_STATUS_VpnGw4AZ,
	"vpngw5":           VirtualNetworkGatewaySku_Tier_STATUS_VpnGw5,
	"vpngw5az":         VirtualNetworkGatewaySku_Tier_STATUS_VpnGw5AZ,
}

// A vpn client connection configuration for client connection configuration.
type VngClientConnectionConfiguration struct {
	// Reference: Resource ID.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &VngClientConnectionConfiguration{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (configuration *VngClientConnectionConfiguration) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if configuration == nil {
		return nil, nil
	}
	result := &arm.VngClientConnectionConfiguration{}

	// Set property "Id":
	if configuration.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*configuration.Reference)
		if err != nil {
			return nil, err
		}
		reference := referenceARMID
		result.Id = &reference
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VngClientConnectionConfiguration) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VngClientConnectionConfiguration{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VngClientConnectionConfiguration) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	_, ok := armInput.(arm.VngClientConnectionConfiguration)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VngClientConnectionConfiguration, got %T", armInput)
	}

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_VngClientConnectionConfiguration populates our VngClientConnectionConfiguration from the provided source VngClientConnectionConfiguration
func (configuration *VngClientConnectionConfiguration) AssignProperties_From_VngClientConnectionConfiguration(source *storage.VngClientConnectionConfiguration) error {

	// Reference
	if source.Reference != nil {
		reference := source.Reference.Copy()
		configuration.Reference = &reference
	} else {
		configuration.Reference = nil
	}

	// No error
	return nil
}

// AssignProperties_To_VngClientConnectionConfiguration populates the provided destination VngClientConnectionConfiguration from our VngClientConnectionConfiguration
func (configuration *VngClientConnectionConfiguration) AssignProperties_To_VngClientConnectionConfiguration(destination *storage.VngClientConnectionConfiguration) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Reference
	if configuration.Reference != nil {
		reference := configuration.Reference.Copy()
		destination.Reference = &reference
	} else {
		destination.Reference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_VngClientConnectionConfiguration_STATUS populates our VngClientConnectionConfiguration from the provided source VngClientConnectionConfiguration_STATUS
func (configuration *VngClientConnectionConfiguration) Initialize_From_VngClientConnectionConfiguration_STATUS(source *VngClientConnectionConfiguration_STATUS) error {

	// Reference
	if source.Id != nil {
		reference := genruntime.CreateResourceReferenceFromARMID(*source.Id)
		configuration.Reference = &reference
	} else {
		configuration.Reference = nil
	}

	// No error
	return nil
}

// A vpn client connection configuration for client connection configuration.
type VngClientConnectionConfiguration_STATUS struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &VngClientConnectionConfiguration_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (configuration *VngClientConnectionConfiguration_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VngClientConnectionConfiguration_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (configuration *VngClientConnectionConfiguration_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VngClientConnectionConfiguration_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VngClientConnectionConfiguration_STATUS, got %T", armInput)
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		configuration.Id = &id
	}

	// No error
	return nil
}

// AssignProperties_From_VngClientConnectionConfiguration_STATUS populates our VngClientConnectionConfiguration_STATUS from the provided source VngClientConnectionConfiguration_STATUS
func (configuration *VngClientConnectionConfiguration_STATUS) AssignProperties_From_VngClientConnectionConfiguration_STATUS(source *storage.VngClientConnectionConfiguration_STATUS) error {

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

	// No error
	return nil
}

// AssignProperties_To_VngClientConnectionConfiguration_STATUS populates the provided destination VngClientConnectionConfiguration_STATUS from our VngClientConnectionConfiguration_STATUS
func (configuration *VngClientConnectionConfiguration_STATUS) AssignProperties_To_VngClientConnectionConfiguration_STATUS(destination *storage.VngClientConnectionConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"AAD","Certificate","Radius"}
type VpnClientConfiguration_VpnAuthenticationTypes string

const (
	VpnClientConfiguration_VpnAuthenticationTypes_AAD         = VpnClientConfiguration_VpnAuthenticationTypes("AAD")
	VpnClientConfiguration_VpnAuthenticationTypes_Certificate = VpnClientConfiguration_VpnAuthenticationTypes("Certificate")
	VpnClientConfiguration_VpnAuthenticationTypes_Radius      = VpnClientConfiguration_VpnAuthenticationTypes("Radius")
)

// Mapping from string to VpnClientConfiguration_VpnAuthenticationTypes
var vpnClientConfiguration_VpnAuthenticationTypes_Values = map[string]VpnClientConfiguration_VpnAuthenticationTypes{
	"aad":         VpnClientConfiguration_VpnAuthenticationTypes_AAD,
	"certificate": VpnClientConfiguration_VpnAuthenticationTypes_Certificate,
	"radius":      VpnClientConfiguration_VpnAuthenticationTypes_Radius,
}

type VpnClientConfiguration_VpnAuthenticationTypes_STATUS string

const (
	VpnClientConfiguration_VpnAuthenticationTypes_STATUS_AAD         = VpnClientConfiguration_VpnAuthenticationTypes_STATUS("AAD")
	VpnClientConfiguration_VpnAuthenticationTypes_STATUS_Certificate = VpnClientConfiguration_VpnAuthenticationTypes_STATUS("Certificate")
	VpnClientConfiguration_VpnAuthenticationTypes_STATUS_Radius      = VpnClientConfiguration_VpnAuthenticationTypes_STATUS("Radius")
)

// Mapping from string to VpnClientConfiguration_VpnAuthenticationTypes_STATUS
var vpnClientConfiguration_VpnAuthenticationTypes_STATUS_Values = map[string]VpnClientConfiguration_VpnAuthenticationTypes_STATUS{
	"aad":         VpnClientConfiguration_VpnAuthenticationTypes_STATUS_AAD,
	"certificate": VpnClientConfiguration_VpnAuthenticationTypes_STATUS_Certificate,
	"radius":      VpnClientConfiguration_VpnAuthenticationTypes_STATUS_Radius,
}

// +kubebuilder:validation:Enum={"IkeV2","OpenVPN","SSTP"}
type VpnClientConfiguration_VpnClientProtocols string

const (
	VpnClientConfiguration_VpnClientProtocols_IkeV2   = VpnClientConfiguration_VpnClientProtocols("IkeV2")
	VpnClientConfiguration_VpnClientProtocols_OpenVPN = VpnClientConfiguration_VpnClientProtocols("OpenVPN")
	VpnClientConfiguration_VpnClientProtocols_SSTP    = VpnClientConfiguration_VpnClientProtocols("SSTP")
)

// Mapping from string to VpnClientConfiguration_VpnClientProtocols
var vpnClientConfiguration_VpnClientProtocols_Values = map[string]VpnClientConfiguration_VpnClientProtocols{
	"ikev2":   VpnClientConfiguration_VpnClientProtocols_IkeV2,
	"openvpn": VpnClientConfiguration_VpnClientProtocols_OpenVPN,
	"sstp":    VpnClientConfiguration_VpnClientProtocols_SSTP,
}

type VpnClientConfiguration_VpnClientProtocols_STATUS string

const (
	VpnClientConfiguration_VpnClientProtocols_STATUS_IkeV2   = VpnClientConfiguration_VpnClientProtocols_STATUS("IkeV2")
	VpnClientConfiguration_VpnClientProtocols_STATUS_OpenVPN = VpnClientConfiguration_VpnClientProtocols_STATUS("OpenVPN")
	VpnClientConfiguration_VpnClientProtocols_STATUS_SSTP    = VpnClientConfiguration_VpnClientProtocols_STATUS("SSTP")
)

// Mapping from string to VpnClientConfiguration_VpnClientProtocols_STATUS
var vpnClientConfiguration_VpnClientProtocols_STATUS_Values = map[string]VpnClientConfiguration_VpnClientProtocols_STATUS{
	"ikev2":   VpnClientConfiguration_VpnClientProtocols_STATUS_IkeV2,
	"openvpn": VpnClientConfiguration_VpnClientProtocols_STATUS_OpenVPN,
	"sstp":    VpnClientConfiguration_VpnClientProtocols_STATUS_SSTP,
}

// VPN client revoked certificate of virtual network gateway.
type VpnClientRevokedCertificate struct {
	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// Thumbprint: The revoked VPN client certificate thumbprint.
	Thumbprint *string `json:"thumbprint,omitempty"`
}

var _ genruntime.ARMTransformer = &VpnClientRevokedCertificate{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (certificate *VpnClientRevokedCertificate) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if certificate == nil {
		return nil, nil
	}
	result := &arm.VpnClientRevokedCertificate{}

	// Set property "Name":
	if certificate.Name != nil {
		name := *certificate.Name
		result.Name = &name
	}

	// Set property "Properties":
	if certificate.Thumbprint != nil {
		result.Properties = &arm.VpnClientRevokedCertificatePropertiesFormat{}
	}
	if certificate.Thumbprint != nil {
		thumbprint := *certificate.Thumbprint
		result.Properties.Thumbprint = &thumbprint
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (certificate *VpnClientRevokedCertificate) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnClientRevokedCertificate{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (certificate *VpnClientRevokedCertificate) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnClientRevokedCertificate)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnClientRevokedCertificate, got %T", armInput)
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		certificate.Name = &name
	}

	// Set property "Thumbprint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Thumbprint != nil {
			thumbprint := *typedInput.Properties.Thumbprint
			certificate.Thumbprint = &thumbprint
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VpnClientRevokedCertificate populates our VpnClientRevokedCertificate from the provided source VpnClientRevokedCertificate
func (certificate *VpnClientRevokedCertificate) AssignProperties_From_VpnClientRevokedCertificate(source *storage.VpnClientRevokedCertificate) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_VpnClientRevokedCertificate populates the provided destination VpnClientRevokedCertificate from our VpnClientRevokedCertificate
func (certificate *VpnClientRevokedCertificate) AssignProperties_To_VpnClientRevokedCertificate(destination *storage.VpnClientRevokedCertificate) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// Initialize_From_VpnClientRevokedCertificate_STATUS populates our VpnClientRevokedCertificate from the provided source VpnClientRevokedCertificate_STATUS
func (certificate *VpnClientRevokedCertificate) Initialize_From_VpnClientRevokedCertificate_STATUS(source *VpnClientRevokedCertificate_STATUS) error {

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

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

	// No error
	return nil
}

// VPN client revoked certificate of virtual network gateway.
type VpnClientRevokedCertificate_STATUS struct {
	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// ProvisioningState: The provisioning state of the VPN client revoked certificate resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// Thumbprint: The revoked VPN client certificate thumbprint.
	Thumbprint *string `json:"thumbprint,omitempty"`
}

var _ genruntime.FromARMConverter = &VpnClientRevokedCertificate_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (certificate *VpnClientRevokedCertificate_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnClientRevokedCertificate_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (certificate *VpnClientRevokedCertificate_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnClientRevokedCertificate_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnClientRevokedCertificate_STATUS, got %T", armInput)
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		certificate.Etag = &etag
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		certificate.Id = &id
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		certificate.Name = &name
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			certificate.ProvisioningState = &provisioningState
		}
	}

	// Set property "Thumbprint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Thumbprint != nil {
			thumbprint := *typedInput.Properties.Thumbprint
			certificate.Thumbprint = &thumbprint
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VpnClientRevokedCertificate_STATUS populates our VpnClientRevokedCertificate_STATUS from the provided source VpnClientRevokedCertificate_STATUS
func (certificate *VpnClientRevokedCertificate_STATUS) AssignProperties_From_VpnClientRevokedCertificate_STATUS(source *storage.VpnClientRevokedCertificate_STATUS) error {

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

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

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

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		certificate.ProvisioningState = &provisioningStateTemp
	} else {
		certificate.ProvisioningState = nil
	}

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

	// 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 *storage.VpnClientRevokedCertificate_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// ProvisioningState
	if certificate.ProvisioningState != nil {
		provisioningState := string(*certificate.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

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

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

	// No error
	return nil
}

// VPN client root certificate of virtual network gateway.
type VpnClientRootCertificate struct {
	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// PublicCertData: The certificate public data.
	PublicCertData *string `json:"publicCertData,omitempty"`
}

var _ genruntime.ARMTransformer = &VpnClientRootCertificate{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (certificate *VpnClientRootCertificate) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if certificate == nil {
		return nil, nil
	}
	result := &arm.VpnClientRootCertificate{}

	// Set property "Name":
	if certificate.Name != nil {
		name := *certificate.Name
		result.Name = &name
	}

	// Set property "Properties":
	if certificate.PublicCertData != nil {
		result.Properties = &arm.VpnClientRootCertificatePropertiesFormat{}
	}
	if certificate.PublicCertData != nil {
		publicCertData := *certificate.PublicCertData
		result.Properties.PublicCertData = &publicCertData
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (certificate *VpnClientRootCertificate) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnClientRootCertificate{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (certificate *VpnClientRootCertificate) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnClientRootCertificate)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnClientRootCertificate, got %T", armInput)
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		certificate.Name = &name
	}

	// Set property "PublicCertData":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicCertData != nil {
			publicCertData := *typedInput.Properties.PublicCertData
			certificate.PublicCertData = &publicCertData
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VpnClientRootCertificate populates our VpnClientRootCertificate from the provided source VpnClientRootCertificate
func (certificate *VpnClientRootCertificate) AssignProperties_From_VpnClientRootCertificate(source *storage.VpnClientRootCertificate) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_VpnClientRootCertificate populates the provided destination VpnClientRootCertificate from our VpnClientRootCertificate
func (certificate *VpnClientRootCertificate) AssignProperties_To_VpnClientRootCertificate(destination *storage.VpnClientRootCertificate) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	}

	// No error
	return nil
}

// Initialize_From_VpnClientRootCertificate_STATUS populates our VpnClientRootCertificate from the provided source VpnClientRootCertificate_STATUS
func (certificate *VpnClientRootCertificate) Initialize_From_VpnClientRootCertificate_STATUS(source *VpnClientRootCertificate_STATUS) error {

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

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

	// No error
	return nil
}

// VPN client root certificate of virtual network gateway.
type VpnClientRootCertificate_STATUS struct {
	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// Name: The name of the resource that is unique within a resource group. This name can be used to access the resource.
	Name *string `json:"name,omitempty"`

	// ProvisioningState: The provisioning state of the VPN client root certificate resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicCertData: The certificate public data.
	PublicCertData *string `json:"publicCertData,omitempty"`
}

var _ genruntime.FromARMConverter = &VpnClientRootCertificate_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (certificate *VpnClientRootCertificate_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnClientRootCertificate_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (certificate *VpnClientRootCertificate_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnClientRootCertificate_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnClientRootCertificate_STATUS, got %T", armInput)
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		certificate.Etag = &etag
	}

	// Set property "Id":
	if typedInput.Id != nil {
		id := *typedInput.Id
		certificate.Id = &id
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		certificate.Name = &name
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ProvisioningState_STATUS(temp)
			certificate.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicCertData":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicCertData != nil {
			publicCertData := *typedInput.Properties.PublicCertData
			certificate.PublicCertData = &publicCertData
		}
	}

	// No error
	return nil
}

// AssignProperties_From_VpnClientRootCertificate_STATUS populates our VpnClientRootCertificate_STATUS from the provided source VpnClientRootCertificate_STATUS
func (certificate *VpnClientRootCertificate_STATUS) AssignProperties_From_VpnClientRootCertificate_STATUS(source *storage.VpnClientRootCertificate_STATUS) error {

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

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

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

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		certificate.ProvisioningState = &provisioningStateTemp
	} else {
		certificate.ProvisioningState = nil
	}

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

	// 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 *storage.VpnClientRootCertificate_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// ProvisioningState
	if certificate.ProvisioningState != nil {
		provisioningState := string(*certificate.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

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

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

	// No error
	return nil
}

// Vpn NatRule mapping.
type VpnNatRuleMapping struct {
	// AddressSpace: Address space for Vpn NatRule mapping.
	AddressSpace *string `json:"addressSpace,omitempty"`

	// PortRange: Port range for Vpn NatRule mapping.
	PortRange *string `json:"portRange,omitempty"`
}

var _ genruntime.ARMTransformer = &VpnNatRuleMapping{}

// ConvertToARM converts from a Kubernetes CRD object to an ARM object
func (mapping *VpnNatRuleMapping) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) {
	if mapping == nil {
		return nil, nil
	}
	result := &arm.VpnNatRuleMapping{}

	// Set property "AddressSpace":
	if mapping.AddressSpace != nil {
		addressSpace := *mapping.AddressSpace
		result.AddressSpace = &addressSpace
	}

	// Set property "PortRange":
	if mapping.PortRange != nil {
		portRange := *mapping.PortRange
		result.PortRange = &portRange
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (mapping *VpnNatRuleMapping) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnNatRuleMapping{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (mapping *VpnNatRuleMapping) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnNatRuleMapping)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnNatRuleMapping, got %T", armInput)
	}

	// Set property "AddressSpace":
	if typedInput.AddressSpace != nil {
		addressSpace := *typedInput.AddressSpace
		mapping.AddressSpace = &addressSpace
	}

	// Set property "PortRange":
	if typedInput.PortRange != nil {
		portRange := *typedInput.PortRange
		mapping.PortRange = &portRange
	}

	// No error
	return nil
}

// AssignProperties_From_VpnNatRuleMapping populates our VpnNatRuleMapping from the provided source VpnNatRuleMapping
func (mapping *VpnNatRuleMapping) AssignProperties_From_VpnNatRuleMapping(source *storage.VpnNatRuleMapping) error {

	// AddressSpace
	mapping.AddressSpace = genruntime.ClonePointerToString(source.AddressSpace)

	// PortRange
	mapping.PortRange = genruntime.ClonePointerToString(source.PortRange)

	// No error
	return nil
}

// AssignProperties_To_VpnNatRuleMapping populates the provided destination VpnNatRuleMapping from our VpnNatRuleMapping
func (mapping *VpnNatRuleMapping) AssignProperties_To_VpnNatRuleMapping(destination *storage.VpnNatRuleMapping) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AddressSpace
	destination.AddressSpace = genruntime.ClonePointerToString(mapping.AddressSpace)

	// PortRange
	destination.PortRange = genruntime.ClonePointerToString(mapping.PortRange)

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

	// No error
	return nil
}

// Initialize_From_VpnNatRuleMapping_STATUS populates our VpnNatRuleMapping from the provided source VpnNatRuleMapping_STATUS
func (mapping *VpnNatRuleMapping) Initialize_From_VpnNatRuleMapping_STATUS(source *VpnNatRuleMapping_STATUS) error {

	// AddressSpace
	mapping.AddressSpace = genruntime.ClonePointerToString(source.AddressSpace)

	// PortRange
	mapping.PortRange = genruntime.ClonePointerToString(source.PortRange)

	// No error
	return nil
}

// Vpn NatRule mapping.
type VpnNatRuleMapping_STATUS struct {
	// AddressSpace: Address space for Vpn NatRule mapping.
	AddressSpace *string `json:"addressSpace,omitempty"`

	// PortRange: Port range for Vpn NatRule mapping.
	PortRange *string `json:"portRange,omitempty"`
}

var _ genruntime.FromARMConverter = &VpnNatRuleMapping_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (mapping *VpnNatRuleMapping_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.VpnNatRuleMapping_STATUS{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (mapping *VpnNatRuleMapping_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.VpnNatRuleMapping_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.VpnNatRuleMapping_STATUS, got %T", armInput)
	}

	// Set property "AddressSpace":
	if typedInput.AddressSpace != nil {
		addressSpace := *typedInput.AddressSpace
		mapping.AddressSpace = &addressSpace
	}

	// Set property "PortRange":
	if typedInput.PortRange != nil {
		portRange := *typedInput.PortRange
		mapping.PortRange = &portRange
	}

	// No error
	return nil
}

// AssignProperties_From_VpnNatRuleMapping_STATUS populates our VpnNatRuleMapping_STATUS from the provided source VpnNatRuleMapping_STATUS
func (mapping *VpnNatRuleMapping_STATUS) AssignProperties_From_VpnNatRuleMapping_STATUS(source *storage.VpnNatRuleMapping_STATUS) error {

	// AddressSpace
	mapping.AddressSpace = genruntime.ClonePointerToString(source.AddressSpace)

	// PortRange
	mapping.PortRange = genruntime.ClonePointerToString(source.PortRange)

	// No error
	return nil
}

// AssignProperties_To_VpnNatRuleMapping_STATUS populates the provided destination VpnNatRuleMapping_STATUS from our VpnNatRuleMapping_STATUS
func (mapping *VpnNatRuleMapping_STATUS) AssignProperties_To_VpnNatRuleMapping_STATUS(destination *storage.VpnNatRuleMapping_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AddressSpace
	destination.AddressSpace = genruntime.ClonePointerToString(mapping.AddressSpace)

	// PortRange
	destination.PortRange = genruntime.ClonePointerToString(mapping.PortRange)

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

	// No error
	return nil
}

// The DH Groups used in IKE Phase 1 for initial SA.
// +kubebuilder:validation:Enum={"DHGroup1","DHGroup14","DHGroup2","DHGroup2048","DHGroup24","ECP256","ECP384","None"}
type DhGroup string

const (
	DhGroup_DHGroup1    = DhGroup("DHGroup1")
	DhGroup_DHGroup14   = DhGroup("DHGroup14")
	DhGroup_DHGroup2    = DhGroup("DHGroup2")
	DhGroup_DHGroup2048 = DhGroup("DHGroup2048")
	DhGroup_DHGroup24   = DhGroup("DHGroup24")
	DhGroup_ECP256      = DhGroup("ECP256")
	DhGroup_ECP384      = DhGroup("ECP384")
	DhGroup_None        = DhGroup("None")
)

// Mapping from string to DhGroup
var dhGroup_Values = map[string]DhGroup{
	"dhgroup1":    DhGroup_DHGroup1,
	"dhgroup14":   DhGroup_DHGroup14,
	"dhgroup2":    DhGroup_DHGroup2,
	"dhgroup2048": DhGroup_DHGroup2048,
	"dhgroup24":   DhGroup_DHGroup24,
	"ecp256":      DhGroup_ECP256,
	"ecp384":      DhGroup_ECP384,
	"none":        DhGroup_None,
}

// The DH Groups used in IKE Phase 1 for initial SA.
type DhGroup_STATUS string

const (
	DhGroup_STATUS_DHGroup1    = DhGroup_STATUS("DHGroup1")
	DhGroup_STATUS_DHGroup14   = DhGroup_STATUS("DHGroup14")
	DhGroup_STATUS_DHGroup2    = DhGroup_STATUS("DHGroup2")
	DhGroup_STATUS_DHGroup2048 = DhGroup_STATUS("DHGroup2048")
	DhGroup_STATUS_DHGroup24   = DhGroup_STATUS("DHGroup24")
	DhGroup_STATUS_ECP256      = DhGroup_STATUS("ECP256")
	DhGroup_STATUS_ECP384      = DhGroup_STATUS("ECP384")
	DhGroup_STATUS_None        = DhGroup_STATUS("None")
)

// Mapping from string to DhGroup_STATUS
var dhGroup_STATUS_Values = map[string]DhGroup_STATUS{
	"dhgroup1":    DhGroup_STATUS_DHGroup1,
	"dhgroup14":   DhGroup_STATUS_DHGroup14,
	"dhgroup2":    DhGroup_STATUS_DHGroup2,
	"dhgroup2048": DhGroup_STATUS_DHGroup2048,
	"dhgroup24":   DhGroup_STATUS_DHGroup24,
	"ecp256":      DhGroup_STATUS_ECP256,
	"ecp384":      DhGroup_STATUS_ECP384,
	"none":        DhGroup_STATUS_None,
}

// The IKE encryption algorithm (IKE phase 2).
// +kubebuilder:validation:Enum={"AES128","AES192","AES256","DES","DES3","GCMAES128","GCMAES256"}
type IkeEncryption string

const (
	IkeEncryption_AES128    = IkeEncryption("AES128")
	IkeEncryption_AES192    = IkeEncryption("AES192")
	IkeEncryption_AES256    = IkeEncryption("AES256")
	IkeEncryption_DES       = IkeEncryption("DES")
	IkeEncryption_DES3      = IkeEncryption("DES3")
	IkeEncryption_GCMAES128 = IkeEncryption("GCMAES128")
	IkeEncryption_GCMAES256 = IkeEncryption("GCMAES256")
)

// Mapping from string to IkeEncryption
var ikeEncryption_Values = map[string]IkeEncryption{
	"aes128":    IkeEncryption_AES128,
	"aes192":    IkeEncryption_AES192,
	"aes256":    IkeEncryption_AES256,
	"des":       IkeEncryption_DES,
	"des3":      IkeEncryption_DES3,
	"gcmaes128": IkeEncryption_GCMAES128,
	"gcmaes256": IkeEncryption_GCMAES256,
}

// The IKE encryption algorithm (IKE phase 2).
type IkeEncryption_STATUS string

const (
	IkeEncryption_STATUS_AES128    = IkeEncryption_STATUS("AES128")
	IkeEncryption_STATUS_AES192    = IkeEncryption_STATUS("AES192")
	IkeEncryption_STATUS_AES256    = IkeEncryption_STATUS("AES256")
	IkeEncryption_STATUS_DES       = IkeEncryption_STATUS("DES")
	IkeEncryption_STATUS_DES3      = IkeEncryption_STATUS("DES3")
	IkeEncryption_STATUS_GCMAES128 = IkeEncryption_STATUS("GCMAES128")
	IkeEncryption_STATUS_GCMAES256 = IkeEncryption_STATUS("GCMAES256")
)

// Mapping from string to IkeEncryption_STATUS
var ikeEncryption_STATUS_Values = map[string]IkeEncryption_STATUS{
	"aes128":    IkeEncryption_STATUS_AES128,
	"aes192":    IkeEncryption_STATUS_AES192,
	"aes256":    IkeEncryption_STATUS_AES256,
	"des":       IkeEncryption_STATUS_DES,
	"des3":      IkeEncryption_STATUS_DES3,
	"gcmaes128": IkeEncryption_STATUS_GCMAES128,
	"gcmaes256": IkeEncryption_STATUS_GCMAES256,
}

// The IKE integrity algorithm (IKE phase 2).
// +kubebuilder:validation:Enum={"GCMAES128","GCMAES256","MD5","SHA1","SHA256","SHA384"}
type IkeIntegrity string

const (
	IkeIntegrity_GCMAES128 = IkeIntegrity("GCMAES128")
	IkeIntegrity_GCMAES256 = IkeIntegrity("GCMAES256")
	IkeIntegrity_MD5       = IkeIntegrity("MD5")
	IkeIntegrity_SHA1      = IkeIntegrity("SHA1")
	IkeIntegrity_SHA256    = IkeIntegrity("SHA256")
	IkeIntegrity_SHA384    = IkeIntegrity("SHA384")
)

// Mapping from string to IkeIntegrity
var ikeIntegrity_Values = map[string]IkeIntegrity{
	"gcmaes128": IkeIntegrity_GCMAES128,
	"gcmaes256": IkeIntegrity_GCMAES256,
	"md5":       IkeIntegrity_MD5,
	"sha1":      IkeIntegrity_SHA1,
	"sha256":    IkeIntegrity_SHA256,
	"sha384":    IkeIntegrity_SHA384,
}

// The IKE integrity algorithm (IKE phase 2).
type IkeIntegrity_STATUS string

const (
	IkeIntegrity_STATUS_GCMAES128 = IkeIntegrity_STATUS("GCMAES128")
	IkeIntegrity_STATUS_GCMAES256 = IkeIntegrity_STATUS("GCMAES256")
	IkeIntegrity_STATUS_MD5       = IkeIntegrity_STATUS("MD5")
	IkeIntegrity_STATUS_SHA1      = IkeIntegrity_STATUS("SHA1")
	IkeIntegrity_STATUS_SHA256    = IkeIntegrity_STATUS("SHA256")
	IkeIntegrity_STATUS_SHA384    = IkeIntegrity_STATUS("SHA384")
)

// Mapping from string to IkeIntegrity_STATUS
var ikeIntegrity_STATUS_Values = map[string]IkeIntegrity_STATUS{
	"gcmaes128": IkeIntegrity_STATUS_GCMAES128,
	"gcmaes256": IkeIntegrity_STATUS_GCMAES256,
	"md5":       IkeIntegrity_STATUS_MD5,
	"sha1":      IkeIntegrity_STATUS_SHA1,
	"sha256":    IkeIntegrity_STATUS_SHA256,
	"sha384":    IkeIntegrity_STATUS_SHA384,
}

// The IPSec encryption algorithm (IKE phase 1).
// +kubebuilder:validation:Enum={"AES128","AES192","AES256","DES","DES3","GCMAES128","GCMAES192","GCMAES256","None"}
type IpsecEncryption string

const (
	IpsecEncryption_AES128    = IpsecEncryption("AES128")
	IpsecEncryption_AES192    = IpsecEncryption("AES192")
	IpsecEncryption_AES256    = IpsecEncryption("AES256")
	IpsecEncryption_DES       = IpsecEncryption("DES")
	IpsecEncryption_DES3      = IpsecEncryption("DES3")
	IpsecEncryption_GCMAES128 = IpsecEncryption("GCMAES128")
	IpsecEncryption_GCMAES192 = IpsecEncryption("GCMAES192")
	IpsecEncryption_GCMAES256 = IpsecEncryption("GCMAES256")
	IpsecEncryption_None      = IpsecEncryption("None")
)

// Mapping from string to IpsecEncryption
var ipsecEncryption_Values = map[string]IpsecEncryption{
	"aes128":    IpsecEncryption_AES128,
	"aes192":    IpsecEncryption_AES192,
	"aes256":    IpsecEncryption_AES256,
	"des":       IpsecEncryption_DES,
	"des3":      IpsecEncryption_DES3,
	"gcmaes128": IpsecEncryption_GCMAES128,
	"gcmaes192": IpsecEncryption_GCMAES192,
	"gcmaes256": IpsecEncryption_GCMAES256,
	"none":      IpsecEncryption_None,
}

// The IPSec encryption algorithm (IKE phase 1).
type IpsecEncryption_STATUS string

const (
	IpsecEncryption_STATUS_AES128    = IpsecEncryption_STATUS("AES128")
	IpsecEncryption_STATUS_AES192    = IpsecEncryption_STATUS("AES192")
	IpsecEncryption_STATUS_AES256    = IpsecEncryption_STATUS("AES256")
	IpsecEncryption_STATUS_DES       = IpsecEncryption_STATUS("DES")
	IpsecEncryption_STATUS_DES3      = IpsecEncryption_STATUS("DES3")
	IpsecEncryption_STATUS_GCMAES128 = IpsecEncryption_STATUS("GCMAES128")
	IpsecEncryption_STATUS_GCMAES192 = IpsecEncryption_STATUS("GCMAES192")
	IpsecEncryption_STATUS_GCMAES256 = IpsecEncryption_STATUS("GCMAES256")
	IpsecEncryption_STATUS_None      = IpsecEncryption_STATUS("None")
)

// Mapping from string to IpsecEncryption_STATUS
var ipsecEncryption_STATUS_Values = map[string]IpsecEncryption_STATUS{
	"aes128":    IpsecEncryption_STATUS_AES128,
	"aes192":    IpsecEncryption_STATUS_AES192,
	"aes256":    IpsecEncryption_STATUS_AES256,
	"des":       IpsecEncryption_STATUS_DES,
	"des3":      IpsecEncryption_STATUS_DES3,
	"gcmaes128": IpsecEncryption_STATUS_GCMAES128,
	"gcmaes192": IpsecEncryption_STATUS_GCMAES192,
	"gcmaes256": IpsecEncryption_STATUS_GCMAES256,
	"none":      IpsecEncryption_STATUS_None,
}

// The IPSec integrity algorithm (IKE phase 1).
// +kubebuilder:validation:Enum={"GCMAES128","GCMAES192","GCMAES256","MD5","SHA1","SHA256"}
type IpsecIntegrity string

const (
	IpsecIntegrity_GCMAES128 = IpsecIntegrity("GCMAES128")
	IpsecIntegrity_GCMAES192 = IpsecIntegrity("GCMAES192")
	IpsecIntegrity_GCMAES256 = IpsecIntegrity("GCMAES256")
	IpsecIntegrity_MD5       = IpsecIntegrity("MD5")
	IpsecIntegrity_SHA1      = IpsecIntegrity("SHA1")
	IpsecIntegrity_SHA256    = IpsecIntegrity("SHA256")
)

// Mapping from string to IpsecIntegrity
var ipsecIntegrity_Values = map[string]IpsecIntegrity{
	"gcmaes128": IpsecIntegrity_GCMAES128,
	"gcmaes192": IpsecIntegrity_GCMAES192,
	"gcmaes256": IpsecIntegrity_GCMAES256,
	"md5":       IpsecIntegrity_MD5,
	"sha1":      IpsecIntegrity_SHA1,
	"sha256":    IpsecIntegrity_SHA256,
}

// The IPSec integrity algorithm (IKE phase 1).
type IpsecIntegrity_STATUS string

const (
	IpsecIntegrity_STATUS_GCMAES128 = IpsecIntegrity_STATUS("GCMAES128")
	IpsecIntegrity_STATUS_GCMAES192 = IpsecIntegrity_STATUS("GCMAES192")
	IpsecIntegrity_STATUS_GCMAES256 = IpsecIntegrity_STATUS("GCMAES256")
	IpsecIntegrity_STATUS_MD5       = IpsecIntegrity_STATUS("MD5")
	IpsecIntegrity_STATUS_SHA1      = IpsecIntegrity_STATUS("SHA1")
	IpsecIntegrity_STATUS_SHA256    = IpsecIntegrity_STATUS("SHA256")
)

// Mapping from string to IpsecIntegrity_STATUS
var ipsecIntegrity_STATUS_Values = map[string]IpsecIntegrity_STATUS{
	"gcmaes128": IpsecIntegrity_STATUS_GCMAES128,
	"gcmaes192": IpsecIntegrity_STATUS_GCMAES192,
	"gcmaes256": IpsecIntegrity_STATUS_GCMAES256,
	"md5":       IpsecIntegrity_STATUS_MD5,
	"sha1":      IpsecIntegrity_STATUS_SHA1,
	"sha256":    IpsecIntegrity_STATUS_SHA256,
}

// The Pfs Groups used in IKE Phase 2 for new child SA.
// +kubebuilder:validation:Enum={"ECP256","ECP384","None","PFS1","PFS14","PFS2","PFS2048","PFS24","PFSMM"}
type PfsGroup string

const (
	PfsGroup_ECP256  = PfsGroup("ECP256")
	PfsGroup_ECP384  = PfsGroup("ECP384")
	PfsGroup_None    = PfsGroup("None")
	PfsGroup_PFS1    = PfsGroup("PFS1")
	PfsGroup_PFS14   = PfsGroup("PFS14")
	PfsGroup_PFS2    = PfsGroup("PFS2")
	PfsGroup_PFS2048 = PfsGroup("PFS2048")
	PfsGroup_PFS24   = PfsGroup("PFS24")
	PfsGroup_PFSMM   = PfsGroup("PFSMM")
)

// Mapping from string to PfsGroup
var pfsGroup_Values = map[string]PfsGroup{
	"ecp256":  PfsGroup_ECP256,
	"ecp384":  PfsGroup_ECP384,
	"none":    PfsGroup_None,
	"pfs1":    PfsGroup_PFS1,
	"pfs14":   PfsGroup_PFS14,
	"pfs2":    PfsGroup_PFS2,
	"pfs2048": PfsGroup_PFS2048,
	"pfs24":   PfsGroup_PFS24,
	"pfsmm":   PfsGroup_PFSMM,
}

// The Pfs Groups used in IKE Phase 2 for new child SA.
type PfsGroup_STATUS string

const (
	PfsGroup_STATUS_ECP256  = PfsGroup_STATUS("ECP256")
	PfsGroup_STATUS_ECP384  = PfsGroup_STATUS("ECP384")
	PfsGroup_STATUS_None    = PfsGroup_STATUS("None")
	PfsGroup_STATUS_PFS1    = PfsGroup_STATUS("PFS1")
	PfsGroup_STATUS_PFS14   = PfsGroup_STATUS("PFS14")
	PfsGroup_STATUS_PFS2    = PfsGroup_STATUS("PFS2")
	PfsGroup_STATUS_PFS2048 = PfsGroup_STATUS("PFS2048")
	PfsGroup_STATUS_PFS24   = PfsGroup_STATUS("PFS24")
	PfsGroup_STATUS_PFSMM   = PfsGroup_STATUS("PFSMM")
)

// Mapping from string to PfsGroup_STATUS
var pfsGroup_STATUS_Values = map[string]PfsGroup_STATUS{
	"ecp256":  PfsGroup_STATUS_ECP256,
	"ecp384":  PfsGroup_STATUS_ECP384,
	"none":    PfsGroup_STATUS_None,
	"pfs1":    PfsGroup_STATUS_PFS1,
	"pfs14":   PfsGroup_STATUS_PFS14,
	"pfs2":    PfsGroup_STATUS_PFS2,
	"pfs2048": PfsGroup_STATUS_PFS2048,
	"pfs24":   PfsGroup_STATUS_PFS24,
	"pfsmm":   PfsGroup_STATUS_PFSMM,
}

// +kubebuilder:validation:Enum={"AADGroupId","CertificateGroupId","RadiusAzureGroupId"}
type VirtualNetworkGatewayPolicyGroupMember_AttributeType string

const (
	VirtualNetworkGatewayPolicyGroupMember_AttributeType_AADGroupId         = VirtualNetworkGatewayPolicyGroupMember_AttributeType("AADGroupId")
	VirtualNetworkGatewayPolicyGroupMember_AttributeType_CertificateGroupId = VirtualNetworkGatewayPolicyGroupMember_AttributeType("CertificateGroupId")
	VirtualNetworkGatewayPolicyGroupMember_AttributeType_RadiusAzureGroupId = VirtualNetworkGatewayPolicyGroupMember_AttributeType("RadiusAzureGroupId")
)

// Mapping from string to VirtualNetworkGatewayPolicyGroupMember_AttributeType
var virtualNetworkGatewayPolicyGroupMember_AttributeType_Values = map[string]VirtualNetworkGatewayPolicyGroupMember_AttributeType{
	"aadgroupid":         VirtualNetworkGatewayPolicyGroupMember_AttributeType_AADGroupId,
	"certificategroupid": VirtualNetworkGatewayPolicyGroupMember_AttributeType_CertificateGroupId,
	"radiusazuregroupid": VirtualNetworkGatewayPolicyGroupMember_AttributeType_RadiusAzureGroupId,
}

type VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS string

const (
	VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_AADGroupId         = VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS("AADGroupId")
	VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_CertificateGroupId = VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS("CertificateGroupId")
	VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_RadiusAzureGroupId = VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS("RadiusAzureGroupId")
)

// Mapping from string to VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS
var virtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_Values = map[string]VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS{
	"aadgroupid":         VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_AADGroupId,
	"certificategroupid": VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_CertificateGroupId,
	"radiusazuregroupid": VirtualNetworkGatewayPolicyGroupMember_AttributeType_STATUS_RadiusAzureGroupId,
}

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