// 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/privateEndpoint.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}
type PrivateEndpoint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              PrivateEndpoint_Spec   `json:"spec,omitempty"`
	Status            PrivateEndpoint_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &PrivateEndpoint{}

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

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

var _ conversion.Convertible = &PrivateEndpoint{}

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

	return endpoint.AssignProperties_From_PrivateEndpoint(source)
}

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

	return endpoint.AssignProperties_To_PrivateEndpoint(destination)
}

var _ configmaps.Exporter = &PrivateEndpoint{}

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

var _ secrets.Exporter = &PrivateEndpoint{}

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

var _ genruntime.ImportableResource = &PrivateEndpoint{}

// InitializeSpec initializes the spec for this resource from the given status
func (endpoint *PrivateEndpoint) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*PrivateEndpoint_STATUS); ok {
		return endpoint.Spec.Initialize_From_PrivateEndpoint_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &PrivateEndpoint{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-03-01"
func (endpoint PrivateEndpoint) GetAPIVersion() string {
	return "2024-03-01"
}

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

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

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

// GetSupportedOperations returns the operations supported by the resource
func (endpoint *PrivateEndpoint) 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/privateEndpoints"
func (endpoint *PrivateEndpoint) GetType() string {
	return "Microsoft.Network/privateEndpoints"
}

// NewEmptyStatus returns a new empty (blank) status
func (endpoint *PrivateEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &PrivateEndpoint_STATUS{}
}

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

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

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

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

	endpoint.Status = st
	return nil
}

// AssignProperties_From_PrivateEndpoint populates our PrivateEndpoint from the provided source PrivateEndpoint
func (endpoint *PrivateEndpoint) AssignProperties_From_PrivateEndpoint(source *storage.PrivateEndpoint) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_PrivateEndpoint populates the provided destination PrivateEndpoint from our PrivateEndpoint
func (endpoint *PrivateEndpoint) AssignProperties_To_PrivateEndpoint(destination *storage.PrivateEndpoint) error {

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

	// Spec
	var spec storage.PrivateEndpoint_Spec
	err := endpoint.Spec.AssignProperties_To_PrivateEndpoint_Spec(&spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_PrivateEndpoint_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status storage.PrivateEndpoint_STATUS
	err = endpoint.Status.AssignProperties_To_PrivateEndpoint_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_PrivateEndpoint_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 (endpoint *PrivateEndpoint) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: endpoint.Spec.OriginalVersion(),
		Kind:    "PrivateEndpoint",
	}
}

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2024-03-01/privateEndpoint.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}
type PrivateEndpointList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PrivateEndpoint `json:"items"`
}

type PrivateEndpoint_Spec struct {
	// ApplicationSecurityGroups: Application security groups in which the private endpoint IP configuration is included.
	ApplicationSecurityGroups []ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded `json:"applicationSecurityGroups,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"`

	// CustomNetworkInterfaceName: The custom name of the network interface attached to the private endpoint.
	CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"`

	// ExtendedLocation: The extended location of the load balancer.
	ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`

	// IpConfigurations: A list of IP configurations of the private endpoint. This will be used to map to the First Party
	// Service's endpoints.
	IpConfigurations []PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"`

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

	// ManualPrivateLinkServiceConnections: A grouping of information about the connection to the remote resource. Used when
	// the network admin does not have access to approve connections to the remote resource.
	ManualPrivateLinkServiceConnections []PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"`

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

	// PrivateLinkServiceConnections: A grouping of information about the connection to the remote resource.
	PrivateLinkServiceConnections []PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"`

	// Subnet: The ID of the subnet from which the private IP will be allocated.
	Subnet *Subnet_PrivateEndpoint_SubResourceEmbedded `json:"subnet,omitempty"`

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

var _ genruntime.ARMTransformer = &PrivateEndpoint_Spec{}

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

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

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

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

	// Set property "Properties":
	if endpoint.ApplicationSecurityGroups != nil ||
		endpoint.CustomNetworkInterfaceName != nil ||
		endpoint.IpConfigurations != nil ||
		endpoint.ManualPrivateLinkServiceConnections != nil ||
		endpoint.PrivateLinkServiceConnections != nil ||
		endpoint.Subnet != nil {
		result.Properties = &arm.PrivateEndpointProperties{}
	}
	for _, item := range endpoint.ApplicationSecurityGroups {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.ApplicationSecurityGroups = append(result.Properties.ApplicationSecurityGroups, *item_ARM.(*arm.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded))
	}
	if endpoint.CustomNetworkInterfaceName != nil {
		customNetworkInterfaceName := *endpoint.CustomNetworkInterfaceName
		result.Properties.CustomNetworkInterfaceName = &customNetworkInterfaceName
	}
	for _, item := range endpoint.IpConfigurations {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.IpConfigurations = append(result.Properties.IpConfigurations, *item_ARM.(*arm.PrivateEndpointIPConfiguration))
	}
	for _, item := range endpoint.ManualPrivateLinkServiceConnections {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.ManualPrivateLinkServiceConnections = append(result.Properties.ManualPrivateLinkServiceConnections, *item_ARM.(*arm.PrivateLinkServiceConnection))
	}
	for _, item := range endpoint.PrivateLinkServiceConnections {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.PrivateLinkServiceConnections = append(result.Properties.PrivateLinkServiceConnections, *item_ARM.(*arm.PrivateLinkServiceConnection))
	}
	if endpoint.Subnet != nil {
		subnet_ARM, err := endpoint.Subnet.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		subnet := *subnet_ARM.(*arm.Subnet_PrivateEndpoint_SubResourceEmbedded)
		result.Properties.Subnet = &subnet
	}

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

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

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

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

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

	// Set property "CustomNetworkInterfaceName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomNetworkInterfaceName != nil {
			customNetworkInterfaceName := *typedInput.Properties.CustomNetworkInterfaceName
			endpoint.CustomNetworkInterfaceName = &customNetworkInterfaceName
		}
	}

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

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

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

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

	// no assignment for property "OperatorSpec"

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

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

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &PrivateEndpoint_Spec{}

// ConvertSpecFrom populates our PrivateEndpoint_Spec from the provided source
func (endpoint *PrivateEndpoint_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*storage.PrivateEndpoint_Spec)
	if ok {
		// Populate our instance from source
		return endpoint.AssignProperties_From_PrivateEndpoint_Spec(src)
	}

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

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

	return nil
}

// ConvertSpecTo populates the provided destination from our PrivateEndpoint_Spec
func (endpoint *PrivateEndpoint_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*storage.PrivateEndpoint_Spec)
	if ok {
		// Populate destination from our instance
		return endpoint.AssignProperties_To_PrivateEndpoint_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &storage.PrivateEndpoint_Spec{}
	err := endpoint.AssignProperties_To_PrivateEndpoint_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_PrivateEndpoint_Spec populates our PrivateEndpoint_Spec from the provided source PrivateEndpoint_Spec
func (endpoint *PrivateEndpoint_Spec) AssignProperties_From_PrivateEndpoint_Spec(source *storage.PrivateEndpoint_Spec) error {

	// ApplicationSecurityGroups
	if source.ApplicationSecurityGroups != nil {
		applicationSecurityGroupList := make([]ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded, len(source.ApplicationSecurityGroups))
		for applicationSecurityGroupIndex, applicationSecurityGroupItem := range source.ApplicationSecurityGroups {
			var applicationSecurityGroup ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded
			err := applicationSecurityGroup.AssignProperties_From_ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded(&applicationSecurityGroupItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded() to populate field ApplicationSecurityGroups")
			}
			applicationSecurityGroupList[applicationSecurityGroupIndex] = applicationSecurityGroup
		}
		endpoint.ApplicationSecurityGroups = applicationSecurityGroupList
	} else {
		endpoint.ApplicationSecurityGroups = nil
	}

	// AzureName
	endpoint.AzureName = source.AzureName

	// CustomNetworkInterfaceName
	endpoint.CustomNetworkInterfaceName = genruntime.ClonePointerToString(source.CustomNetworkInterfaceName)

	// 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")
		}
		endpoint.ExtendedLocation = &extendedLocation
	} else {
		endpoint.ExtendedLocation = nil
	}

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

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

	// ManualPrivateLinkServiceConnections
	if source.ManualPrivateLinkServiceConnections != nil {
		manualPrivateLinkServiceConnectionList := make([]PrivateLinkServiceConnection, len(source.ManualPrivateLinkServiceConnections))
		for manualPrivateLinkServiceConnectionIndex, manualPrivateLinkServiceConnectionItem := range source.ManualPrivateLinkServiceConnections {
			var manualPrivateLinkServiceConnection PrivateLinkServiceConnection
			err := manualPrivateLinkServiceConnection.AssignProperties_From_PrivateLinkServiceConnection(&manualPrivateLinkServiceConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnection() to populate field ManualPrivateLinkServiceConnections")
			}
			manualPrivateLinkServiceConnectionList[manualPrivateLinkServiceConnectionIndex] = manualPrivateLinkServiceConnection
		}
		endpoint.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnectionList
	} else {
		endpoint.ManualPrivateLinkServiceConnections = nil
	}

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

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

	// PrivateLinkServiceConnections
	if source.PrivateLinkServiceConnections != nil {
		privateLinkServiceConnectionList := make([]PrivateLinkServiceConnection, len(source.PrivateLinkServiceConnections))
		for privateLinkServiceConnectionIndex, privateLinkServiceConnectionItem := range source.PrivateLinkServiceConnections {
			var privateLinkServiceConnection PrivateLinkServiceConnection
			err := privateLinkServiceConnection.AssignProperties_From_PrivateLinkServiceConnection(&privateLinkServiceConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnection() to populate field PrivateLinkServiceConnections")
			}
			privateLinkServiceConnectionList[privateLinkServiceConnectionIndex] = privateLinkServiceConnection
		}
		endpoint.PrivateLinkServiceConnections = privateLinkServiceConnectionList
	} else {
		endpoint.PrivateLinkServiceConnections = nil
	}

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

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

	// No error
	return nil
}

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

	// ApplicationSecurityGroups
	if endpoint.ApplicationSecurityGroups != nil {
		applicationSecurityGroupList := make([]storage.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded, len(endpoint.ApplicationSecurityGroups))
		for applicationSecurityGroupIndex, applicationSecurityGroupItem := range endpoint.ApplicationSecurityGroups {
			var applicationSecurityGroup storage.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded
			err := applicationSecurityGroupItem.AssignProperties_To_ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded(&applicationSecurityGroup)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded() to populate field ApplicationSecurityGroups")
			}
			applicationSecurityGroupList[applicationSecurityGroupIndex] = applicationSecurityGroup
		}
		destination.ApplicationSecurityGroups = applicationSecurityGroupList
	} else {
		destination.ApplicationSecurityGroups = nil
	}

	// AzureName
	destination.AzureName = endpoint.AzureName

	// CustomNetworkInterfaceName
	destination.CustomNetworkInterfaceName = genruntime.ClonePointerToString(endpoint.CustomNetworkInterfaceName)

	// ExtendedLocation
	if endpoint.ExtendedLocation != nil {
		var extendedLocation storage.ExtendedLocation
		err := endpoint.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
	}

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

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

	// ManualPrivateLinkServiceConnections
	if endpoint.ManualPrivateLinkServiceConnections != nil {
		manualPrivateLinkServiceConnectionList := make([]storage.PrivateLinkServiceConnection, len(endpoint.ManualPrivateLinkServiceConnections))
		for manualPrivateLinkServiceConnectionIndex, manualPrivateLinkServiceConnectionItem := range endpoint.ManualPrivateLinkServiceConnections {
			var manualPrivateLinkServiceConnection storage.PrivateLinkServiceConnection
			err := manualPrivateLinkServiceConnectionItem.AssignProperties_To_PrivateLinkServiceConnection(&manualPrivateLinkServiceConnection)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnection() to populate field ManualPrivateLinkServiceConnections")
			}
			manualPrivateLinkServiceConnectionList[manualPrivateLinkServiceConnectionIndex] = manualPrivateLinkServiceConnection
		}
		destination.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnectionList
	} else {
		destination.ManualPrivateLinkServiceConnections = nil
	}

	// OperatorSpec
	if endpoint.OperatorSpec != nil {
		var operatorSpec storage.PrivateEndpointOperatorSpec
		err := endpoint.OperatorSpec.AssignProperties_To_PrivateEndpointOperatorSpec(&operatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PrivateEndpointOperatorSpec() to populate field OperatorSpec")
		}
		destination.OperatorSpec = &operatorSpec
	} else {
		destination.OperatorSpec = nil
	}

	// OriginalVersion
	destination.OriginalVersion = endpoint.OriginalVersion()

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

	// PrivateLinkServiceConnections
	if endpoint.PrivateLinkServiceConnections != nil {
		privateLinkServiceConnectionList := make([]storage.PrivateLinkServiceConnection, len(endpoint.PrivateLinkServiceConnections))
		for privateLinkServiceConnectionIndex, privateLinkServiceConnectionItem := range endpoint.PrivateLinkServiceConnections {
			var privateLinkServiceConnection storage.PrivateLinkServiceConnection
			err := privateLinkServiceConnectionItem.AssignProperties_To_PrivateLinkServiceConnection(&privateLinkServiceConnection)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnection() to populate field PrivateLinkServiceConnections")
			}
			privateLinkServiceConnectionList[privateLinkServiceConnectionIndex] = privateLinkServiceConnection
		}
		destination.PrivateLinkServiceConnections = privateLinkServiceConnectionList
	} else {
		destination.PrivateLinkServiceConnections = nil
	}

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

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

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

	// No error
	return nil
}

// Initialize_From_PrivateEndpoint_STATUS populates our PrivateEndpoint_Spec from the provided source PrivateEndpoint_STATUS
func (endpoint *PrivateEndpoint_Spec) Initialize_From_PrivateEndpoint_STATUS(source *PrivateEndpoint_STATUS) error {

	// ApplicationSecurityGroups
	if source.ApplicationSecurityGroups != nil {
		applicationSecurityGroupList := make([]ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded, len(source.ApplicationSecurityGroups))
		for applicationSecurityGroupIndex, applicationSecurityGroupItem := range source.ApplicationSecurityGroups {
			var applicationSecurityGroup ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded
			err := applicationSecurityGroup.Initialize_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded(&applicationSecurityGroupItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded() to populate field ApplicationSecurityGroups")
			}
			applicationSecurityGroupList[applicationSecurityGroupIndex] = applicationSecurityGroup
		}
		endpoint.ApplicationSecurityGroups = applicationSecurityGroupList
	} else {
		endpoint.ApplicationSecurityGroups = nil
	}

	// CustomNetworkInterfaceName
	endpoint.CustomNetworkInterfaceName = genruntime.ClonePointerToString(source.CustomNetworkInterfaceName)

	// 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")
		}
		endpoint.ExtendedLocation = &extendedLocation
	} else {
		endpoint.ExtendedLocation = nil
	}

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

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

	// ManualPrivateLinkServiceConnections
	if source.ManualPrivateLinkServiceConnections != nil {
		manualPrivateLinkServiceConnectionList := make([]PrivateLinkServiceConnection, len(source.ManualPrivateLinkServiceConnections))
		for manualPrivateLinkServiceConnectionIndex, manualPrivateLinkServiceConnectionItem := range source.ManualPrivateLinkServiceConnections {
			var manualPrivateLinkServiceConnection PrivateLinkServiceConnection
			err := manualPrivateLinkServiceConnection.Initialize_From_PrivateLinkServiceConnection_STATUS(&manualPrivateLinkServiceConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_PrivateLinkServiceConnection_STATUS() to populate field ManualPrivateLinkServiceConnections")
			}
			manualPrivateLinkServiceConnectionList[manualPrivateLinkServiceConnectionIndex] = manualPrivateLinkServiceConnection
		}
		endpoint.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnectionList
	} else {
		endpoint.ManualPrivateLinkServiceConnections = nil
	}

	// PrivateLinkServiceConnections
	if source.PrivateLinkServiceConnections != nil {
		privateLinkServiceConnectionList := make([]PrivateLinkServiceConnection, len(source.PrivateLinkServiceConnections))
		for privateLinkServiceConnectionIndex, privateLinkServiceConnectionItem := range source.PrivateLinkServiceConnections {
			var privateLinkServiceConnection PrivateLinkServiceConnection
			err := privateLinkServiceConnection.Initialize_From_PrivateLinkServiceConnection_STATUS(&privateLinkServiceConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_PrivateLinkServiceConnection_STATUS() to populate field PrivateLinkServiceConnections")
			}
			privateLinkServiceConnectionList[privateLinkServiceConnectionIndex] = privateLinkServiceConnection
		}
		endpoint.PrivateLinkServiceConnections = privateLinkServiceConnectionList
	} else {
		endpoint.PrivateLinkServiceConnections = nil
	}

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

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

	// No error
	return nil
}

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

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

// Private endpoint resource.
type PrivateEndpoint_STATUS struct {
	// ApplicationSecurityGroups: Application security groups in which the private endpoint IP configuration is included.
	ApplicationSecurityGroups []ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded `json:"applicationSecurityGroups,omitempty"`

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

	// CustomDnsConfigs: An array of custom dns configurations.
	CustomDnsConfigs []CustomDnsConfigPropertiesFormat_STATUS `json:"customDnsConfigs,omitempty"`

	// CustomNetworkInterfaceName: The custom name of the network interface attached to the private endpoint.
	CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"`

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

	// ExtendedLocation: The extended location of the load balancer.
	ExtendedLocation *ExtendedLocation_STATUS `json:"extendedLocation,omitempty"`

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

	// IpConfigurations: A list of IP configurations of the private endpoint. This will be used to map to the First Party
	// Service's endpoints.
	IpConfigurations []PrivateEndpointIPConfiguration_STATUS `json:"ipConfigurations,omitempty"`

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

	// ManualPrivateLinkServiceConnections: A grouping of information about the connection to the remote resource. Used when
	// the network admin does not have access to approve connections to the remote resource.
	ManualPrivateLinkServiceConnections []PrivateLinkServiceConnection_STATUS `json:"manualPrivateLinkServiceConnections,omitempty"`

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

	// NetworkInterfaces: An array of references to the network interfaces created for this private endpoint.
	NetworkInterfaces []NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded `json:"networkInterfaces,omitempty"`

	// PrivateLinkServiceConnections: A grouping of information about the connection to the remote resource.
	PrivateLinkServiceConnections []PrivateLinkServiceConnection_STATUS `json:"privateLinkServiceConnections,omitempty"`

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

	// Subnet: The ID of the subnet from which the private IP will be allocated.
	Subnet *Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded `json:"subnet,omitempty"`

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

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

var _ genruntime.ConvertibleStatus = &PrivateEndpoint_STATUS{}

// ConvertStatusFrom populates our PrivateEndpoint_STATUS from the provided source
func (endpoint *PrivateEndpoint_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*storage.PrivateEndpoint_STATUS)
	if ok {
		// Populate our instance from source
		return endpoint.AssignProperties_From_PrivateEndpoint_STATUS(src)
	}

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

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

	return nil
}

// ConvertStatusTo populates the provided destination from our PrivateEndpoint_STATUS
func (endpoint *PrivateEndpoint_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*storage.PrivateEndpoint_STATUS)
	if ok {
		// Populate destination from our instance
		return endpoint.AssignProperties_To_PrivateEndpoint_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &storage.PrivateEndpoint_STATUS{}
	err := endpoint.AssignProperties_To_PrivateEndpoint_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 = &PrivateEndpoint_STATUS{}

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

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

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

	// no assignment for property "Conditions"

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

	// Set property "CustomNetworkInterfaceName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomNetworkInterfaceName != nil {
			customNetworkInterfaceName := *typedInput.Properties.CustomNetworkInterfaceName
			endpoint.CustomNetworkInterfaceName = &customNetworkInterfaceName
		}
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		endpoint.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
		endpoint.ExtendedLocation = &extendedLocation
	}

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

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

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

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

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

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

	// Set property "PrivateLinkServiceConnections":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.PrivateLinkServiceConnections {
			var item1 PrivateLinkServiceConnection_STATUS
			err := item1.PopulateFromARM(owner, item)
			if err != nil {
				return err
			}
			endpoint.PrivateLinkServiceConnections = append(endpoint.PrivateLinkServiceConnections, 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)
			endpoint.ProvisioningState = &provisioningState
		}
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PrivateEndpoint_STATUS populates our PrivateEndpoint_STATUS from the provided source PrivateEndpoint_STATUS
func (endpoint *PrivateEndpoint_STATUS) AssignProperties_From_PrivateEndpoint_STATUS(source *storage.PrivateEndpoint_STATUS) error {

	// ApplicationSecurityGroups
	if source.ApplicationSecurityGroups != nil {
		applicationSecurityGroupList := make([]ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded, len(source.ApplicationSecurityGroups))
		for applicationSecurityGroupIndex, applicationSecurityGroupItem := range source.ApplicationSecurityGroups {
			var applicationSecurityGroup ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded
			err := applicationSecurityGroup.AssignProperties_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded(&applicationSecurityGroupItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded() to populate field ApplicationSecurityGroups")
			}
			applicationSecurityGroupList[applicationSecurityGroupIndex] = applicationSecurityGroup
		}
		endpoint.ApplicationSecurityGroups = applicationSecurityGroupList
	} else {
		endpoint.ApplicationSecurityGroups = nil
	}

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

	// CustomDnsConfigs
	if source.CustomDnsConfigs != nil {
		customDnsConfigList := make([]CustomDnsConfigPropertiesFormat_STATUS, len(source.CustomDnsConfigs))
		for customDnsConfigIndex, customDnsConfigItem := range source.CustomDnsConfigs {
			var customDnsConfig CustomDnsConfigPropertiesFormat_STATUS
			err := customDnsConfig.AssignProperties_From_CustomDnsConfigPropertiesFormat_STATUS(&customDnsConfigItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CustomDnsConfigPropertiesFormat_STATUS() to populate field CustomDnsConfigs")
			}
			customDnsConfigList[customDnsConfigIndex] = customDnsConfig
		}
		endpoint.CustomDnsConfigs = customDnsConfigList
	} else {
		endpoint.CustomDnsConfigs = nil
	}

	// CustomNetworkInterfaceName
	endpoint.CustomNetworkInterfaceName = genruntime.ClonePointerToString(source.CustomNetworkInterfaceName)

	// Etag
	endpoint.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")
		}
		endpoint.ExtendedLocation = &extendedLocation
	} else {
		endpoint.ExtendedLocation = nil
	}

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

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

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

	// ManualPrivateLinkServiceConnections
	if source.ManualPrivateLinkServiceConnections != nil {
		manualPrivateLinkServiceConnectionList := make([]PrivateLinkServiceConnection_STATUS, len(source.ManualPrivateLinkServiceConnections))
		for manualPrivateLinkServiceConnectionIndex, manualPrivateLinkServiceConnectionItem := range source.ManualPrivateLinkServiceConnections {
			var manualPrivateLinkServiceConnection PrivateLinkServiceConnection_STATUS
			err := manualPrivateLinkServiceConnection.AssignProperties_From_PrivateLinkServiceConnection_STATUS(&manualPrivateLinkServiceConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnection_STATUS() to populate field ManualPrivateLinkServiceConnections")
			}
			manualPrivateLinkServiceConnectionList[manualPrivateLinkServiceConnectionIndex] = manualPrivateLinkServiceConnection
		}
		endpoint.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnectionList
	} else {
		endpoint.ManualPrivateLinkServiceConnections = nil
	}

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

	// NetworkInterfaces
	if source.NetworkInterfaces != nil {
		networkInterfaceList := make([]NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded, len(source.NetworkInterfaces))
		for networkInterfaceIndex, networkInterfaceItem := range source.NetworkInterfaces {
			var networkInterface NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded
			err := networkInterface.AssignProperties_From_NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded(&networkInterfaceItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded() to populate field NetworkInterfaces")
			}
			networkInterfaceList[networkInterfaceIndex] = networkInterface
		}
		endpoint.NetworkInterfaces = networkInterfaceList
	} else {
		endpoint.NetworkInterfaces = nil
	}

	// PrivateLinkServiceConnections
	if source.PrivateLinkServiceConnections != nil {
		privateLinkServiceConnectionList := make([]PrivateLinkServiceConnection_STATUS, len(source.PrivateLinkServiceConnections))
		for privateLinkServiceConnectionIndex, privateLinkServiceConnectionItem := range source.PrivateLinkServiceConnections {
			var privateLinkServiceConnection PrivateLinkServiceConnection_STATUS
			err := privateLinkServiceConnection.AssignProperties_From_PrivateLinkServiceConnection_STATUS(&privateLinkServiceConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnection_STATUS() to populate field PrivateLinkServiceConnections")
			}
			privateLinkServiceConnectionList[privateLinkServiceConnectionIndex] = privateLinkServiceConnection
		}
		endpoint.PrivateLinkServiceConnections = privateLinkServiceConnectionList
	} else {
		endpoint.PrivateLinkServiceConnections = nil
	}

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

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

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

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

	// No error
	return nil
}

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

	// ApplicationSecurityGroups
	if endpoint.ApplicationSecurityGroups != nil {
		applicationSecurityGroupList := make([]storage.ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded, len(endpoint.ApplicationSecurityGroups))
		for applicationSecurityGroupIndex, applicationSecurityGroupItem := range endpoint.ApplicationSecurityGroups {
			var applicationSecurityGroup storage.ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded
			err := applicationSecurityGroupItem.AssignProperties_To_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded(&applicationSecurityGroup)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded() to populate field ApplicationSecurityGroups")
			}
			applicationSecurityGroupList[applicationSecurityGroupIndex] = applicationSecurityGroup
		}
		destination.ApplicationSecurityGroups = applicationSecurityGroupList
	} else {
		destination.ApplicationSecurityGroups = nil
	}

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

	// CustomDnsConfigs
	if endpoint.CustomDnsConfigs != nil {
		customDnsConfigList := make([]storage.CustomDnsConfigPropertiesFormat_STATUS, len(endpoint.CustomDnsConfigs))
		for customDnsConfigIndex, customDnsConfigItem := range endpoint.CustomDnsConfigs {
			var customDnsConfig storage.CustomDnsConfigPropertiesFormat_STATUS
			err := customDnsConfigItem.AssignProperties_To_CustomDnsConfigPropertiesFormat_STATUS(&customDnsConfig)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CustomDnsConfigPropertiesFormat_STATUS() to populate field CustomDnsConfigs")
			}
			customDnsConfigList[customDnsConfigIndex] = customDnsConfig
		}
		destination.CustomDnsConfigs = customDnsConfigList
	} else {
		destination.CustomDnsConfigs = nil
	}

	// CustomNetworkInterfaceName
	destination.CustomNetworkInterfaceName = genruntime.ClonePointerToString(endpoint.CustomNetworkInterfaceName)

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

	// ExtendedLocation
	if endpoint.ExtendedLocation != nil {
		var extendedLocation storage.ExtendedLocation_STATUS
		err := endpoint.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
	}

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

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

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

	// ManualPrivateLinkServiceConnections
	if endpoint.ManualPrivateLinkServiceConnections != nil {
		manualPrivateLinkServiceConnectionList := make([]storage.PrivateLinkServiceConnection_STATUS, len(endpoint.ManualPrivateLinkServiceConnections))
		for manualPrivateLinkServiceConnectionIndex, manualPrivateLinkServiceConnectionItem := range endpoint.ManualPrivateLinkServiceConnections {
			var manualPrivateLinkServiceConnection storage.PrivateLinkServiceConnection_STATUS
			err := manualPrivateLinkServiceConnectionItem.AssignProperties_To_PrivateLinkServiceConnection_STATUS(&manualPrivateLinkServiceConnection)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnection_STATUS() to populate field ManualPrivateLinkServiceConnections")
			}
			manualPrivateLinkServiceConnectionList[manualPrivateLinkServiceConnectionIndex] = manualPrivateLinkServiceConnection
		}
		destination.ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnectionList
	} else {
		destination.ManualPrivateLinkServiceConnections = nil
	}

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

	// NetworkInterfaces
	if endpoint.NetworkInterfaces != nil {
		networkInterfaceList := make([]storage.NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded, len(endpoint.NetworkInterfaces))
		for networkInterfaceIndex, networkInterfaceItem := range endpoint.NetworkInterfaces {
			var networkInterface storage.NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded
			err := networkInterfaceItem.AssignProperties_To_NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded(&networkInterface)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded() to populate field NetworkInterfaces")
			}
			networkInterfaceList[networkInterfaceIndex] = networkInterface
		}
		destination.NetworkInterfaces = networkInterfaceList
	} else {
		destination.NetworkInterfaces = nil
	}

	// PrivateLinkServiceConnections
	if endpoint.PrivateLinkServiceConnections != nil {
		privateLinkServiceConnectionList := make([]storage.PrivateLinkServiceConnection_STATUS, len(endpoint.PrivateLinkServiceConnections))
		for privateLinkServiceConnectionIndex, privateLinkServiceConnectionItem := range endpoint.PrivateLinkServiceConnections {
			var privateLinkServiceConnection storage.PrivateLinkServiceConnection_STATUS
			err := privateLinkServiceConnectionItem.AssignProperties_To_PrivateLinkServiceConnection_STATUS(&privateLinkServiceConnection)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnection_STATUS() to populate field PrivateLinkServiceConnections")
			}
			privateLinkServiceConnectionList[privateLinkServiceConnectionIndex] = privateLinkServiceConnection
		}
		destination.PrivateLinkServiceConnections = privateLinkServiceConnectionList
	} else {
		destination.PrivateLinkServiceConnections = nil
	}

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

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

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

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

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

	// No error
	return nil
}

// An application security group in a resource group.
type ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded populates our ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded from the provided source ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded
func (embedded *ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded) AssignProperties_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded(source *storage.ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// An application security group in a resource group.
type ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded struct {
	// Reference: Resource ID.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded{}

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

	// Set property "Id":
	if embedded.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*embedded.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 (embedded *ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded{}
}

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

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded populates our ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded from the provided source ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded
func (embedded *ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded) AssignProperties_From_ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded(source *storage.ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded) error {

	// Reference
	if source.Reference != nil {
		reference := source.Reference.Copy()
		embedded.Reference = &reference
	} else {
		embedded.Reference = nil
	}

	// No error
	return nil
}

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

	// Reference
	if embedded.Reference != nil {
		reference := embedded.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_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded populates our ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded from the provided source ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded
func (embedded *ApplicationSecurityGroupSpec_PrivateEndpoint_SubResourceEmbedded) Initialize_From_ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded(source *ApplicationSecurityGroup_STATUS_PrivateEndpoint_SubResourceEmbedded) error {

	// Reference
	if source.Id != nil {
		reference := genruntime.CreateResourceReferenceFromARMID(*source.Id)
		embedded.Reference = &reference
	} else {
		embedded.Reference = nil
	}

	// No error
	return nil
}

// Contains custom Dns resolution configuration from customer.
type CustomDnsConfigPropertiesFormat_STATUS struct {
	// Fqdn: Fqdn that resolves to private endpoint ip address.
	Fqdn *string `json:"fqdn,omitempty"`

	// IpAddresses: A list of private ip addresses of the private endpoint.
	IpAddresses []string `json:"ipAddresses,omitempty"`
}

var _ genruntime.FromARMConverter = &CustomDnsConfigPropertiesFormat_STATUS{}

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

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

	// Set property "Fqdn":
	if typedInput.Fqdn != nil {
		fqdn := *typedInput.Fqdn
		format.Fqdn = &fqdn
	}

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

	// No error
	return nil
}

// AssignProperties_From_CustomDnsConfigPropertiesFormat_STATUS populates our CustomDnsConfigPropertiesFormat_STATUS from the provided source CustomDnsConfigPropertiesFormat_STATUS
func (format *CustomDnsConfigPropertiesFormat_STATUS) AssignProperties_From_CustomDnsConfigPropertiesFormat_STATUS(source *storage.CustomDnsConfigPropertiesFormat_STATUS) error {

	// Fqdn
	format.Fqdn = genruntime.ClonePointerToString(source.Fqdn)

	// IpAddresses
	format.IpAddresses = genruntime.CloneSliceOfString(source.IpAddresses)

	// No error
	return nil
}

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

	// Fqdn
	destination.Fqdn = genruntime.ClonePointerToString(format.Fqdn)

	// IpAddresses
	destination.IpAddresses = genruntime.CloneSliceOfString(format.IpAddresses)

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

	// No error
	return nil
}

// A network interface in a resource group.
type NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded populates our NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded from the provided source NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded
func (embedded *NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded) AssignProperties_From_NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded(source *storage.NetworkInterface_STATUS_PrivateEndpoint_SubResourceEmbedded) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// An IP Configuration of the private endpoint.
type PrivateEndpointIPConfiguration struct {
	// GroupId: The ID of a group obtained from the remote resource that this private endpoint should connect to.
	GroupId *string `json:"groupId,omitempty"`

	// MemberName: The member name of a group obtained from the remote resource that this private endpoint should connect to.
	MemberName *string `json:"memberName,omitempty"`

	// Name: The name of the resource that is unique within a resource group.
	Name *string `json:"name,omitempty"`

	// PrivateIPAddress: A private ip address obtained from the private endpoint's subnet.
	PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
}

var _ genruntime.ARMTransformer = &PrivateEndpointIPConfiguration{}

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

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

	// Set property "Properties":
	if configuration.GroupId != nil ||
		configuration.MemberName != nil ||
		configuration.PrivateIPAddress != nil {
		result.Properties = &arm.PrivateEndpointIPConfigurationProperties{}
	}
	if configuration.GroupId != nil {
		groupId := *configuration.GroupId
		result.Properties.GroupId = &groupId
	}
	if configuration.MemberName != nil {
		memberName := *configuration.MemberName
		result.Properties.MemberName = &memberName
	}
	if configuration.PrivateIPAddress != nil {
		privateIPAddress := *configuration.PrivateIPAddress
		result.Properties.PrivateIPAddress = &privateIPAddress
	}
	return result, nil
}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

	// No error
	return nil
}

// Initialize_From_PrivateEndpointIPConfiguration_STATUS populates our PrivateEndpointIPConfiguration from the provided source PrivateEndpointIPConfiguration_STATUS
func (configuration *PrivateEndpointIPConfiguration) Initialize_From_PrivateEndpointIPConfiguration_STATUS(source *PrivateEndpointIPConfiguration_STATUS) error {

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

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

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

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

	// No error
	return nil
}

// An IP Configuration of the private endpoint.
type PrivateEndpointIPConfiguration_STATUS struct {
	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

	// GroupId: The ID of a group obtained from the remote resource that this private endpoint should connect to.
	GroupId *string `json:"groupId,omitempty"`

	// MemberName: The member name of a group obtained from the remote resource that this private endpoint should connect to.
	MemberName *string `json:"memberName,omitempty"`

	// Name: The name of the resource that is unique within a resource group.
	Name *string `json:"name,omitempty"`

	// PrivateIPAddress: A private ip address obtained from the private endpoint's subnet.
	PrivateIPAddress *string `json:"privateIPAddress,omitempty"`

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

var _ genruntime.FromARMConverter = &PrivateEndpointIPConfiguration_STATUS{}

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

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

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

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

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

	// 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 "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		configuration.Type = &typeVar
	}

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// ConfigMaps: configures where to place operator written ConfigMaps.
	ConfigMaps *PrivateEndpointOperatorConfigMaps `json:"configMaps,omitempty"`

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

// AssignProperties_From_PrivateEndpointOperatorSpec populates our PrivateEndpointOperatorSpec from the provided source PrivateEndpointOperatorSpec
func (operator *PrivateEndpointOperatorSpec) AssignProperties_From_PrivateEndpointOperatorSpec(source *storage.PrivateEndpointOperatorSpec) 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
	}

	// ConfigMaps
	if source.ConfigMaps != nil {
		var configMap PrivateEndpointOperatorConfigMaps
		err := configMap.AssignProperties_From_PrivateEndpointOperatorConfigMaps(source.ConfigMaps)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PrivateEndpointOperatorConfigMaps() to populate field ConfigMaps")
		}
		operator.ConfigMaps = &configMap
	} else {
		operator.ConfigMaps = 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_PrivateEndpointOperatorSpec populates the provided destination PrivateEndpointOperatorSpec from our PrivateEndpointOperatorSpec
func (operator *PrivateEndpointOperatorSpec) AssignProperties_To_PrivateEndpointOperatorSpec(destination *storage.PrivateEndpointOperatorSpec) 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
	}

	// ConfigMaps
	if operator.ConfigMaps != nil {
		var configMap storage.PrivateEndpointOperatorConfigMaps
		err := operator.ConfigMaps.AssignProperties_To_PrivateEndpointOperatorConfigMaps(&configMap)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PrivateEndpointOperatorConfigMaps() to populate field ConfigMaps")
		}
		destination.ConfigMaps = &configMap
	} else {
		destination.ConfigMaps = 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
}

// PrivateLinkServiceConnection resource.
type PrivateLinkServiceConnection struct {
	// GroupIds: The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to.
	GroupIds []string `json:"groupIds,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"`

	// PrivateLinkServiceConnectionState: A collection of read-only information about the state of the connection to the remote
	// resource.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`

	// PrivateLinkServiceReference: The resource id of private link service.
	PrivateLinkServiceReference *genruntime.ResourceReference `armReference:"PrivateLinkServiceId" json:"privateLinkServiceReference,omitempty"`

	// RequestMessage: A message passed to the owner of the remote resource with this connection request. Restricted to 140
	// chars.
	RequestMessage *string `json:"requestMessage,omitempty"`
}

var _ genruntime.ARMTransformer = &PrivateLinkServiceConnection{}

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

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

	// Set property "Properties":
	if connection.GroupIds != nil ||
		connection.PrivateLinkServiceConnectionState != nil ||
		connection.PrivateLinkServiceReference != nil ||
		connection.RequestMessage != nil {
		result.Properties = &arm.PrivateLinkServiceConnectionProperties{}
	}
	for _, item := range connection.GroupIds {
		result.Properties.GroupIds = append(result.Properties.GroupIds, item)
	}
	if connection.PrivateLinkServiceConnectionState != nil {
		privateLinkServiceConnectionState_ARM, err := connection.PrivateLinkServiceConnectionState.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		privateLinkServiceConnectionState := *privateLinkServiceConnectionState_ARM.(*arm.PrivateLinkServiceConnectionState)
		result.Properties.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	}
	if connection.PrivateLinkServiceReference != nil {
		privateLinkServiceIdARMID, err := resolved.ResolvedReferences.Lookup(*connection.PrivateLinkServiceReference)
		if err != nil {
			return nil, err
		}
		privateLinkServiceId := privateLinkServiceIdARMID
		result.Properties.PrivateLinkServiceId = &privateLinkServiceId
	}
	if connection.RequestMessage != nil {
		requestMessage := *connection.RequestMessage
		result.Properties.RequestMessage = &requestMessage
	}
	return result, nil
}

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

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

	// Set property "GroupIds":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.GroupIds {
			connection.GroupIds = append(connection.GroupIds, item)
		}
	}

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

	// Set property "PrivateLinkServiceConnectionState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateLinkServiceConnectionState != nil {
			var privateLinkServiceConnectionState1 PrivateLinkServiceConnectionState
			err := privateLinkServiceConnectionState1.PopulateFromARM(owner, *typedInput.Properties.PrivateLinkServiceConnectionState)
			if err != nil {
				return err
			}
			privateLinkServiceConnectionState := privateLinkServiceConnectionState1
			connection.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
		}
	}

	// no assignment for property "PrivateLinkServiceReference"

	// Set property "RequestMessage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RequestMessage != nil {
			requestMessage := *typedInput.Properties.RequestMessage
			connection.RequestMessage = &requestMessage
		}
	}

	// No error
	return nil
}

// AssignProperties_From_PrivateLinkServiceConnection populates our PrivateLinkServiceConnection from the provided source PrivateLinkServiceConnection
func (connection *PrivateLinkServiceConnection) AssignProperties_From_PrivateLinkServiceConnection(source *storage.PrivateLinkServiceConnection) error {

	// GroupIds
	connection.GroupIds = genruntime.CloneSliceOfString(source.GroupIds)

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

	// PrivateLinkServiceConnectionState
	if source.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState PrivateLinkServiceConnectionState
		err := privateLinkServiceConnectionState.AssignProperties_From_PrivateLinkServiceConnectionState(source.PrivateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnectionState() to populate field PrivateLinkServiceConnectionState")
		}
		connection.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		connection.PrivateLinkServiceConnectionState = nil
	}

	// PrivateLinkServiceReference
	if source.PrivateLinkServiceReference != nil {
		privateLinkServiceReference := source.PrivateLinkServiceReference.Copy()
		connection.PrivateLinkServiceReference = &privateLinkServiceReference
	} else {
		connection.PrivateLinkServiceReference = nil
	}

	// RequestMessage
	connection.RequestMessage = genruntime.ClonePointerToString(source.RequestMessage)

	// No error
	return nil
}

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

	// GroupIds
	destination.GroupIds = genruntime.CloneSliceOfString(connection.GroupIds)

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

	// PrivateLinkServiceConnectionState
	if connection.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState storage.PrivateLinkServiceConnectionState
		err := connection.PrivateLinkServiceConnectionState.AssignProperties_To_PrivateLinkServiceConnectionState(&privateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnectionState() to populate field PrivateLinkServiceConnectionState")
		}
		destination.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		destination.PrivateLinkServiceConnectionState = nil
	}

	// PrivateLinkServiceReference
	if connection.PrivateLinkServiceReference != nil {
		privateLinkServiceReference := connection.PrivateLinkServiceReference.Copy()
		destination.PrivateLinkServiceReference = &privateLinkServiceReference
	} else {
		destination.PrivateLinkServiceReference = nil
	}

	// RequestMessage
	destination.RequestMessage = genruntime.ClonePointerToString(connection.RequestMessage)

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

	// No error
	return nil
}

// Initialize_From_PrivateLinkServiceConnection_STATUS populates our PrivateLinkServiceConnection from the provided source PrivateLinkServiceConnection_STATUS
func (connection *PrivateLinkServiceConnection) Initialize_From_PrivateLinkServiceConnection_STATUS(source *PrivateLinkServiceConnection_STATUS) error {

	// GroupIds
	connection.GroupIds = genruntime.CloneSliceOfString(source.GroupIds)

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

	// PrivateLinkServiceConnectionState
	if source.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState PrivateLinkServiceConnectionState
		err := privateLinkServiceConnectionState.Initialize_From_PrivateLinkServiceConnectionState_STATUS(source.PrivateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_PrivateLinkServiceConnectionState_STATUS() to populate field PrivateLinkServiceConnectionState")
		}
		connection.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		connection.PrivateLinkServiceConnectionState = nil
	}

	// PrivateLinkServiceReference
	if source.PrivateLinkServiceId != nil {
		privateLinkServiceReference := genruntime.CreateResourceReferenceFromARMID(*source.PrivateLinkServiceId)
		connection.PrivateLinkServiceReference = &privateLinkServiceReference
	} else {
		connection.PrivateLinkServiceReference = nil
	}

	// RequestMessage
	connection.RequestMessage = genruntime.ClonePointerToString(source.RequestMessage)

	// No error
	return nil
}

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

	// GroupIds: The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to.
	GroupIds []string `json:"groupIds,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"`

	// PrivateLinkServiceConnectionState: A collection of read-only information about the state of the connection to the remote
	// resource.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState_STATUS `json:"privateLinkServiceConnectionState,omitempty"`

	// PrivateLinkServiceId: The resource id of private link service.
	PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"`

	// ProvisioningState: The provisioning state of the private link service connection resource.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// RequestMessage: A message passed to the owner of the remote resource with this connection request. Restricted to 140
	// chars.
	RequestMessage *string `json:"requestMessage,omitempty"`

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

var _ genruntime.FromARMConverter = &PrivateLinkServiceConnection_STATUS{}

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

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

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

	// Set property "GroupIds":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.GroupIds {
			connection.GroupIds = append(connection.GroupIds, item)
		}
	}

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

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

	// Set property "PrivateLinkServiceConnectionState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateLinkServiceConnectionState != nil {
			var privateLinkServiceConnectionState1 PrivateLinkServiceConnectionState_STATUS
			err := privateLinkServiceConnectionState1.PopulateFromARM(owner, *typedInput.Properties.PrivateLinkServiceConnectionState)
			if err != nil {
				return err
			}
			privateLinkServiceConnectionState := privateLinkServiceConnectionState1
			connection.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
		}
	}

	// Set property "PrivateLinkServiceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateLinkServiceId != nil {
			privateLinkServiceId := *typedInput.Properties.PrivateLinkServiceId
			connection.PrivateLinkServiceId = &privateLinkServiceId
		}
	}

	// 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)
			connection.ProvisioningState = &provisioningState
		}
	}

	// Set property "RequestMessage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RequestMessage != nil {
			requestMessage := *typedInput.Properties.RequestMessage
			connection.RequestMessage = &requestMessage
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_PrivateLinkServiceConnection_STATUS populates our PrivateLinkServiceConnection_STATUS from the provided source PrivateLinkServiceConnection_STATUS
func (connection *PrivateLinkServiceConnection_STATUS) AssignProperties_From_PrivateLinkServiceConnection_STATUS(source *storage.PrivateLinkServiceConnection_STATUS) error {

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

	// GroupIds
	connection.GroupIds = genruntime.CloneSliceOfString(source.GroupIds)

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

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

	// PrivateLinkServiceConnectionState
	if source.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState PrivateLinkServiceConnectionState_STATUS
		err := privateLinkServiceConnectionState.AssignProperties_From_PrivateLinkServiceConnectionState_STATUS(source.PrivateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnectionState_STATUS() to populate field PrivateLinkServiceConnectionState")
		}
		connection.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		connection.PrivateLinkServiceConnectionState = nil
	}

	// PrivateLinkServiceId
	connection.PrivateLinkServiceId = genruntime.ClonePointerToString(source.PrivateLinkServiceId)

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

	// RequestMessage
	connection.RequestMessage = genruntime.ClonePointerToString(source.RequestMessage)

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

	// No error
	return nil
}

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

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

	// GroupIds
	destination.GroupIds = genruntime.CloneSliceOfString(connection.GroupIds)

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

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

	// PrivateLinkServiceConnectionState
	if connection.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState storage.PrivateLinkServiceConnectionState_STATUS
		err := connection.PrivateLinkServiceConnectionState.AssignProperties_To_PrivateLinkServiceConnectionState_STATUS(&privateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnectionState_STATUS() to populate field PrivateLinkServiceConnectionState")
		}
		destination.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		destination.PrivateLinkServiceConnectionState = nil
	}

	// PrivateLinkServiceId
	destination.PrivateLinkServiceId = genruntime.ClonePointerToString(connection.PrivateLinkServiceId)

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

	// RequestMessage
	destination.RequestMessage = genruntime.ClonePointerToString(connection.RequestMessage)

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

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

	// No error
	return nil
}

// Subnet in a virtual network resource.
type Subnet_PrivateEndpoint_SubResourceEmbedded struct {
	// Reference: Resource ID.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &Subnet_PrivateEndpoint_SubResourceEmbedded{}

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

	// Set property "Id":
	if embedded.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*embedded.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 (embedded *Subnet_PrivateEndpoint_SubResourceEmbedded) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.Subnet_PrivateEndpoint_SubResourceEmbedded{}
}

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

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_Subnet_PrivateEndpoint_SubResourceEmbedded populates our Subnet_PrivateEndpoint_SubResourceEmbedded from the provided source Subnet_PrivateEndpoint_SubResourceEmbedded
func (embedded *Subnet_PrivateEndpoint_SubResourceEmbedded) AssignProperties_From_Subnet_PrivateEndpoint_SubResourceEmbedded(source *storage.Subnet_PrivateEndpoint_SubResourceEmbedded) error {

	// Reference
	if source.Reference != nil {
		reference := source.Reference.Copy()
		embedded.Reference = &reference
	} else {
		embedded.Reference = nil
	}

	// No error
	return nil
}

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

	// Reference
	if embedded.Reference != nil {
		reference := embedded.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_Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded populates our Subnet_PrivateEndpoint_SubResourceEmbedded from the provided source Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded
func (embedded *Subnet_PrivateEndpoint_SubResourceEmbedded) Initialize_From_Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded(source *Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded) error {

	// Reference
	if source.Id != nil {
		reference := genruntime.CreateResourceReferenceFromARMID(*source.Id)
		embedded.Reference = &reference
	} else {
		embedded.Reference = nil
	}

	// No error
	return nil
}

// Subnet in a virtual network resource.
type Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded populates our Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded from the provided source Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded
func (embedded *Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded) AssignProperties_From_Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded(source *storage.Subnet_STATUS_PrivateEndpoint_SubResourceEmbedded) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

type PrivateEndpointOperatorConfigMaps struct {
	// PrimaryNicPrivateIpAddress: indicates where the PrimaryNicPrivateIpAddress config map should be placed. If omitted, no
	// config map will be created.
	PrimaryNicPrivateIpAddress *genruntime.ConfigMapDestination `json:"primaryNicPrivateIpAddress,omitempty"`
}

// AssignProperties_From_PrivateEndpointOperatorConfigMaps populates our PrivateEndpointOperatorConfigMaps from the provided source PrivateEndpointOperatorConfigMaps
func (maps *PrivateEndpointOperatorConfigMaps) AssignProperties_From_PrivateEndpointOperatorConfigMaps(source *storage.PrivateEndpointOperatorConfigMaps) error {

	// PrimaryNicPrivateIpAddress
	if source.PrimaryNicPrivateIpAddress != nil {
		primaryNicPrivateIpAddress := source.PrimaryNicPrivateIpAddress.Copy()
		maps.PrimaryNicPrivateIpAddress = &primaryNicPrivateIpAddress
	} else {
		maps.PrimaryNicPrivateIpAddress = nil
	}

	// No error
	return nil
}

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

	// PrimaryNicPrivateIpAddress
	if maps.PrimaryNicPrivateIpAddress != nil {
		primaryNicPrivateIpAddress := maps.PrimaryNicPrivateIpAddress.Copy()
		destination.PrimaryNicPrivateIpAddress = &primaryNicPrivateIpAddress
	} else {
		destination.PrimaryNicPrivateIpAddress = nil
	}

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

	// No error
	return nil
}

// A collection of information about the state of the connection between service consumer and provider.
type PrivateLinkServiceConnectionState struct {
	// ActionsRequired: A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *string `json:"actionsRequired,omitempty"`

	// Description: The reason for approval/rejection of the connection.
	Description *string `json:"description,omitempty"`

	// Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
	Status *string `json:"status,omitempty"`
}

var _ genruntime.ARMTransformer = &PrivateLinkServiceConnectionState{}

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

	// Set property "ActionsRequired":
	if state.ActionsRequired != nil {
		actionsRequired := *state.ActionsRequired
		result.ActionsRequired = &actionsRequired
	}

	// Set property "Description":
	if state.Description != nil {
		description := *state.Description
		result.Description = &description
	}

	// Set property "Status":
	if state.Status != nil {
		status := *state.Status
		result.Status = &status
	}
	return result, nil
}

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

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

	// Set property "ActionsRequired":
	if typedInput.ActionsRequired != nil {
		actionsRequired := *typedInput.ActionsRequired
		state.ActionsRequired = &actionsRequired
	}

	// Set property "Description":
	if typedInput.Description != nil {
		description := *typedInput.Description
		state.Description = &description
	}

	// Set property "Status":
	if typedInput.Status != nil {
		status := *typedInput.Status
		state.Status = &status
	}

	// No error
	return nil
}

// AssignProperties_From_PrivateLinkServiceConnectionState populates our PrivateLinkServiceConnectionState from the provided source PrivateLinkServiceConnectionState
func (state *PrivateLinkServiceConnectionState) AssignProperties_From_PrivateLinkServiceConnectionState(source *storage.PrivateLinkServiceConnectionState) error {

	// ActionsRequired
	state.ActionsRequired = genruntime.ClonePointerToString(source.ActionsRequired)

	// Description
	state.Description = genruntime.ClonePointerToString(source.Description)

	// Status
	state.Status = genruntime.ClonePointerToString(source.Status)

	// No error
	return nil
}

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

	// ActionsRequired
	destination.ActionsRequired = genruntime.ClonePointerToString(state.ActionsRequired)

	// Description
	destination.Description = genruntime.ClonePointerToString(state.Description)

	// Status
	destination.Status = genruntime.ClonePointerToString(state.Status)

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

	// No error
	return nil
}

// Initialize_From_PrivateLinkServiceConnectionState_STATUS populates our PrivateLinkServiceConnectionState from the provided source PrivateLinkServiceConnectionState_STATUS
func (state *PrivateLinkServiceConnectionState) Initialize_From_PrivateLinkServiceConnectionState_STATUS(source *PrivateLinkServiceConnectionState_STATUS) error {

	// ActionsRequired
	state.ActionsRequired = genruntime.ClonePointerToString(source.ActionsRequired)

	// Description
	state.Description = genruntime.ClonePointerToString(source.Description)

	// Status
	state.Status = genruntime.ClonePointerToString(source.Status)

	// No error
	return nil
}

// A collection of information about the state of the connection between service consumer and provider.
type PrivateLinkServiceConnectionState_STATUS struct {
	// ActionsRequired: A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *string `json:"actionsRequired,omitempty"`

	// Description: The reason for approval/rejection of the connection.
	Description *string `json:"description,omitempty"`

	// Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
	Status *string `json:"status,omitempty"`
}

var _ genruntime.FromARMConverter = &PrivateLinkServiceConnectionState_STATUS{}

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

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

	// Set property "ActionsRequired":
	if typedInput.ActionsRequired != nil {
		actionsRequired := *typedInput.ActionsRequired
		state.ActionsRequired = &actionsRequired
	}

	// Set property "Description":
	if typedInput.Description != nil {
		description := *typedInput.Description
		state.Description = &description
	}

	// Set property "Status":
	if typedInput.Status != nil {
		status := *typedInput.Status
		state.Status = &status
	}

	// No error
	return nil
}

// AssignProperties_From_PrivateLinkServiceConnectionState_STATUS populates our PrivateLinkServiceConnectionState_STATUS from the provided source PrivateLinkServiceConnectionState_STATUS
func (state *PrivateLinkServiceConnectionState_STATUS) AssignProperties_From_PrivateLinkServiceConnectionState_STATUS(source *storage.PrivateLinkServiceConnectionState_STATUS) error {

	// ActionsRequired
	state.ActionsRequired = genruntime.ClonePointerToString(source.ActionsRequired)

	// Description
	state.Description = genruntime.ClonePointerToString(source.Description)

	// Status
	state.Status = genruntime.ClonePointerToString(source.Status)

	// No error
	return nil
}

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

	// ActionsRequired
	destination.ActionsRequired = genruntime.ClonePointerToString(state.ActionsRequired)

	// Description
	destination.Description = genruntime.ClonePointerToString(state.Description)

	// Status
	destination.Status = genruntime.ClonePointerToString(state.Status)

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&PrivateEndpoint{}, &PrivateEndpointList{})
}
