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

import (
	"fmt"
	v20201101s "github.com/Azure/azure-service-operator/v2/api/network/v1api20201101/storage"
	"github.com/Azure/azure-service-operator/v2/internal/reflecthelpers"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
	"github.com/pkg/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
	"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

// +kubebuilder:object:root=true
// +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/2020-11-01/publicIpAddress.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}
type PublicIPAddress struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              PublicIPAddress_Spec                                       `json:"spec,omitempty"`
	Status            PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded `json:"status,omitempty"`
}

var _ conditions.Conditioner = &PublicIPAddress{}

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

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

var _ conversion.Convertible = &PublicIPAddress{}

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

	return address.AssignProperties_From_PublicIPAddress(source)
}

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

	return address.AssignProperties_To_PublicIPAddress(destination)
}

// +kubebuilder:webhook:path=/mutate-network-azure-com-v1api20201101-publicipaddress,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=network.azure.com,resources=publicipaddresses,verbs=create;update,versions=v1api20201101,name=default.v1api20201101.publicipaddresses.network.azure.com,admissionReviewVersions=v1

var _ admission.Defaulter = &PublicIPAddress{}

// Default applies defaults to the PublicIPAddress resource
func (address *PublicIPAddress) Default() {
	address.defaultImpl()
	var temp any = address
	if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok {
		runtimeDefaulter.CustomDefault()
	}
}

// defaultAzureName defaults the Azure name of the resource to the Kubernetes name
func (address *PublicIPAddress) defaultAzureName() {
	if address.Spec.AzureName == "" {
		address.Spec.AzureName = address.Name
	}
}

// defaultImpl applies the code generated defaults to the PublicIPAddress resource
func (address *PublicIPAddress) defaultImpl() { address.defaultAzureName() }

var _ genruntime.ImportableResource = &PublicIPAddress{}

// InitializeSpec initializes the spec for this resource from the given status
func (address *PublicIPAddress) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded); ok {
		return address.Spec.Initialize_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(s)
	}

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

var _ genruntime.KubernetesResource = &PublicIPAddress{}

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

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

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

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

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

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

// NewEmptyStatus returns a new empty (blank) status
func (address *PublicIPAddress) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded{}
}

// Owner returns the ResourceReference of the owner
func (address *PublicIPAddress) Owner() *genruntime.ResourceReference {
	group, kind := genruntime.LookupOwnerGroupKind(address.Spec)
	return address.Spec.Owner.AsResourceReference(group, kind)
}

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

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

	address.Status = st
	return nil
}

// +kubebuilder:webhook:path=/validate-network-azure-com-v1api20201101-publicipaddress,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=network.azure.com,resources=publicipaddresses,verbs=create;update,versions=v1api20201101,name=validate.v1api20201101.publicipaddresses.network.azure.com,admissionReviewVersions=v1

var _ admission.Validator = &PublicIPAddress{}

// ValidateCreate validates the creation of the resource
func (address *PublicIPAddress) ValidateCreate() (admission.Warnings, error) {
	validations := address.createValidations()
	var temp any = address
	if runtimeValidator, ok := temp.(genruntime.Validator); ok {
		validations = append(validations, runtimeValidator.CreateValidations()...)
	}
	return genruntime.ValidateCreate(validations)
}

// ValidateDelete validates the deletion of the resource
func (address *PublicIPAddress) ValidateDelete() (admission.Warnings, error) {
	validations := address.deleteValidations()
	var temp any = address
	if runtimeValidator, ok := temp.(genruntime.Validator); ok {
		validations = append(validations, runtimeValidator.DeleteValidations()...)
	}
	return genruntime.ValidateDelete(validations)
}

// ValidateUpdate validates an update of the resource
func (address *PublicIPAddress) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
	validations := address.updateValidations()
	var temp any = address
	if runtimeValidator, ok := temp.(genruntime.Validator); ok {
		validations = append(validations, runtimeValidator.UpdateValidations()...)
	}
	return genruntime.ValidateUpdate(old, validations)
}

// createValidations validates the creation of the resource
func (address *PublicIPAddress) createValidations() []func() (admission.Warnings, error) {
	return []func() (admission.Warnings, error){address.validateResourceReferences, address.validateOwnerReference}
}

// deleteValidations validates the deletion of the resource
func (address *PublicIPAddress) deleteValidations() []func() (admission.Warnings, error) {
	return nil
}

// updateValidations validates the update of the resource
func (address *PublicIPAddress) updateValidations() []func(old runtime.Object) (admission.Warnings, error) {
	return []func(old runtime.Object) (admission.Warnings, error){
		func(old runtime.Object) (admission.Warnings, error) {
			return address.validateResourceReferences()
		},
		address.validateWriteOnceProperties,
		func(old runtime.Object) (admission.Warnings, error) {
			return address.validateOwnerReference()
		},
	}
}

// validateOwnerReference validates the owner field
func (address *PublicIPAddress) validateOwnerReference() (admission.Warnings, error) {
	return genruntime.ValidateOwner(address)
}

// validateResourceReferences validates all resource references
func (address *PublicIPAddress) validateResourceReferences() (admission.Warnings, error) {
	refs, err := reflecthelpers.FindResourceReferences(&address.Spec)
	if err != nil {
		return nil, err
	}
	return genruntime.ValidateResourceReferences(refs)
}

// validateWriteOnceProperties validates all WriteOnce properties
func (address *PublicIPAddress) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) {
	oldObj, ok := old.(*PublicIPAddress)
	if !ok {
		return nil, nil
	}

	return genruntime.ValidateWriteOnceProperties(oldObj, address)
}

// AssignProperties_From_PublicIPAddress populates our PublicIPAddress from the provided source PublicIPAddress
func (address *PublicIPAddress) AssignProperties_From_PublicIPAddress(source *v20201101s.PublicIPAddress) error {

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

	// Spec
	var spec PublicIPAddress_Spec
	err := spec.AssignProperties_From_PublicIPAddress_Spec(&source.Spec)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddress_Spec() to populate field Spec")
	}
	address.Spec = spec

	// Status
	var status PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded
	err = status.AssignProperties_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(&source.Status)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field Status")
	}
	address.Status = status

	// No error
	return nil
}

// AssignProperties_To_PublicIPAddress populates the provided destination PublicIPAddress from our PublicIPAddress
func (address *PublicIPAddress) AssignProperties_To_PublicIPAddress(destination *v20201101s.PublicIPAddress) error {

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

	// Spec
	var spec v20201101s.PublicIPAddress_Spec
	err := address.Spec.AssignProperties_To_PublicIPAddress_Spec(&spec)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddress_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status v20201101s.PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded
	err = address.Status.AssignProperties_To_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(&status)
	if err != nil {
		return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded() 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 (address *PublicIPAddress) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: address.Spec.OriginalVersion(),
		Kind:    "PublicIPAddress",
	}
}

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2020-11-01/publicIpAddress.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}
type PublicIPAddressList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PublicIPAddress `json:"items"`
}

type PublicIPAddress_Spec struct {
	// 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"`

	// DdosSettings: The DDoS protection custom policy associated with the public IP address.
	DdosSettings *DdosSettings `json:"ddosSettings,omitempty"`

	// DnsSettings: The FQDN of the DNS record associated with the public IP address.
	DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"`

	// ExtendedLocation: The extended location of the public ip address.
	ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`

	// IdleTimeoutInMinutes: The idle timeout of the public IP address.
	IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`

	// IpAddress: The IP address associated with the public IP address resource.
	IpAddress *string `json:"ipAddress,omitempty"`

	// IpTags: The list of tags associated with the public IP address.
	IpTags []IpTag `json:"ipTags,omitempty"`

	// LinkedPublicIPAddress: The linked public IP address of the public IP address resource.
	LinkedPublicIPAddress *PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded `json:"linkedPublicIPAddress,omitempty"`

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

	// NatGateway: The NatGateway for the Public IP address.
	NatGateway *NatGatewaySpec_PublicIPAddress_SubResourceEmbedded `json:"natGateway,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"`

	// PublicIPAddressVersion: The public IP address version.
	PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"`

	// PublicIPAllocationMethod: The public IP address allocation method.
	PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"`

	// PublicIPPrefix: The Public IP Prefix this Public IP Address should be allocated from.
	PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"`

	// ServicePublicIPAddress: The service public IP address of the public IP address resource.
	ServicePublicIPAddress *PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded `json:"servicePublicIPAddress,omitempty"`

	// Sku: The public IP address SKU.
	Sku *PublicIPAddressSku `json:"sku,omitempty"`

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

	// Zones: A list of availability zones denoting the IP allocated for the resource needs to come from.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ARMTransformer = &PublicIPAddress_Spec{}

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

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

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

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

	// Set property "Properties":
	if address.DdosSettings != nil ||
		address.DnsSettings != nil ||
		address.IdleTimeoutInMinutes != nil ||
		address.IpAddress != nil ||
		address.IpTags != nil ||
		address.LinkedPublicIPAddress != nil ||
		address.NatGateway != nil ||
		address.PublicIPAddressVersion != nil ||
		address.PublicIPAllocationMethod != nil ||
		address.PublicIPPrefix != nil ||
		address.ServicePublicIPAddress != nil {
		result.Properties = &PublicIPAddressPropertiesFormat_ARM{}
	}
	if address.DdosSettings != nil {
		ddosSettings_ARM, err := (*address.DdosSettings).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		ddosSettings := *ddosSettings_ARM.(*DdosSettings_ARM)
		result.Properties.DdosSettings = &ddosSettings
	}
	if address.DnsSettings != nil {
		dnsSettings_ARM, err := (*address.DnsSettings).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		dnsSettings := *dnsSettings_ARM.(*PublicIPAddressDnsSettings_ARM)
		result.Properties.DnsSettings = &dnsSettings
	}
	if address.IdleTimeoutInMinutes != nil {
		idleTimeoutInMinutes := *address.IdleTimeoutInMinutes
		result.Properties.IdleTimeoutInMinutes = &idleTimeoutInMinutes
	}
	if address.IpAddress != nil {
		ipAddress := *address.IpAddress
		result.Properties.IpAddress = &ipAddress
	}
	for _, item := range address.IpTags {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.IpTags = append(result.Properties.IpTags, *item_ARM.(*IpTag_ARM))
	}
	if address.LinkedPublicIPAddress != nil {
		linkedPublicIPAddress_ARM, err := (*address.LinkedPublicIPAddress).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		linkedPublicIPAddress := *linkedPublicIPAddress_ARM.(*PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded_ARM)
		result.Properties.LinkedPublicIPAddress = &linkedPublicIPAddress
	}
	if address.NatGateway != nil {
		natGateway_ARM, err := (*address.NatGateway).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		natGateway := *natGateway_ARM.(*NatGatewaySpec_PublicIPAddress_SubResourceEmbedded_ARM)
		result.Properties.NatGateway = &natGateway
	}
	if address.PublicIPAddressVersion != nil {
		publicIPAddressVersion := *address.PublicIPAddressVersion
		result.Properties.PublicIPAddressVersion = &publicIPAddressVersion
	}
	if address.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := *address.PublicIPAllocationMethod
		result.Properties.PublicIPAllocationMethod = &publicIPAllocationMethod
	}
	if address.PublicIPPrefix != nil {
		publicIPPrefix_ARM, err := (*address.PublicIPPrefix).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		publicIPPrefix := *publicIPPrefix_ARM.(*SubResource_ARM)
		result.Properties.PublicIPPrefix = &publicIPPrefix
	}
	if address.ServicePublicIPAddress != nil {
		servicePublicIPAddress_ARM, err := (*address.ServicePublicIPAddress).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		servicePublicIPAddress := *servicePublicIPAddress_ARM.(*PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded_ARM)
		result.Properties.ServicePublicIPAddress = &servicePublicIPAddress
	}

	// Set property "Sku":
	if address.Sku != nil {
		sku_ARM, err := (*address.Sku).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sku := *sku_ARM.(*PublicIPAddressSku_ARM)
		result.Sku = &sku
	}

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

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

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

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

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

	// Set property "DdosSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DdosSettings != nil {
			var ddosSettings1 DdosSettings
			err := ddosSettings1.PopulateFromARM(owner, *typedInput.Properties.DdosSettings)
			if err != nil {
				return err
			}
			ddosSettings := ddosSettings1
			address.DdosSettings = &ddosSettings
		}
	}

	// Set property "DnsSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DnsSettings != nil {
			var dnsSettings1 PublicIPAddressDnsSettings
			err := dnsSettings1.PopulateFromARM(owner, *typedInput.Properties.DnsSettings)
			if err != nil {
				return err
			}
			dnsSettings := dnsSettings1
			address.DnsSettings = &dnsSettings
		}
	}

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

	// Set property "IdleTimeoutInMinutes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IdleTimeoutInMinutes != nil {
			idleTimeoutInMinutes := *typedInput.Properties.IdleTimeoutInMinutes
			address.IdleTimeoutInMinutes = &idleTimeoutInMinutes
		}
	}

	// Set property "IpAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IpAddress != nil {
			ipAddress := *typedInput.Properties.IpAddress
			address.IpAddress = &ipAddress
		}
	}

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

	// Set property "LinkedPublicIPAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LinkedPublicIPAddress != nil {
			var linkedPublicIPAddress1 PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
			err := linkedPublicIPAddress1.PopulateFromARM(owner, *typedInput.Properties.LinkedPublicIPAddress)
			if err != nil {
				return err
			}
			linkedPublicIPAddress := linkedPublicIPAddress1
			address.LinkedPublicIPAddress = &linkedPublicIPAddress
		}
	}

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

	// Set property "NatGateway":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NatGateway != nil {
			var natGateway1 NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
			err := natGateway1.PopulateFromARM(owner, *typedInput.Properties.NatGateway)
			if err != nil {
				return err
			}
			natGateway := natGateway1
			address.NatGateway = &natGateway
		}
	}

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

	// Set property "PublicIPAddressVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAddressVersion != nil {
			publicIPAddressVersion := *typedInput.Properties.PublicIPAddressVersion
			address.PublicIPAddressVersion = &publicIPAddressVersion
		}
	}

	// Set property "PublicIPAllocationMethod":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAllocationMethod != nil {
			publicIPAllocationMethod := *typedInput.Properties.PublicIPAllocationMethod
			address.PublicIPAllocationMethod = &publicIPAllocationMethod
		}
	}

	// Set property "PublicIPPrefix":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPPrefix != nil {
			var publicIPPrefix1 SubResource
			err := publicIPPrefix1.PopulateFromARM(owner, *typedInput.Properties.PublicIPPrefix)
			if err != nil {
				return err
			}
			publicIPPrefix := publicIPPrefix1
			address.PublicIPPrefix = &publicIPPrefix
		}
	}

	// Set property "ServicePublicIPAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServicePublicIPAddress != nil {
			var servicePublicIPAddress1 PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
			err := servicePublicIPAddress1.PopulateFromARM(owner, *typedInput.Properties.ServicePublicIPAddress)
			if err != nil {
				return err
			}
			servicePublicIPAddress := servicePublicIPAddress1
			address.ServicePublicIPAddress = &servicePublicIPAddress
		}
	}

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 PublicIPAddressSku
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		address.Sku = &sku
	}

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &PublicIPAddress_Spec{}

// ConvertSpecFrom populates our PublicIPAddress_Spec from the provided source
func (address *PublicIPAddress_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*v20201101s.PublicIPAddress_Spec)
	if ok {
		// Populate our instance from source
		return address.AssignProperties_From_PublicIPAddress_Spec(src)
	}

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

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

	return nil
}

// ConvertSpecTo populates the provided destination from our PublicIPAddress_Spec
func (address *PublicIPAddress_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*v20201101s.PublicIPAddress_Spec)
	if ok {
		// Populate destination from our instance
		return address.AssignProperties_To_PublicIPAddress_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &v20201101s.PublicIPAddress_Spec{}
	err := address.AssignProperties_To_PublicIPAddress_Spec(dst)
	if err != nil {
		return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()")
	}

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

	return nil
}

// AssignProperties_From_PublicIPAddress_Spec populates our PublicIPAddress_Spec from the provided source PublicIPAddress_Spec
func (address *PublicIPAddress_Spec) AssignProperties_From_PublicIPAddress_Spec(source *v20201101s.PublicIPAddress_Spec) error {

	// AzureName
	address.AzureName = source.AzureName

	// DdosSettings
	if source.DdosSettings != nil {
		var ddosSetting DdosSettings
		err := ddosSetting.AssignProperties_From_DdosSettings(source.DdosSettings)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_DdosSettings() to populate field DdosSettings")
		}
		address.DdosSettings = &ddosSetting
	} else {
		address.DdosSettings = nil
	}

	// DnsSettings
	if source.DnsSettings != nil {
		var dnsSetting PublicIPAddressDnsSettings
		err := dnsSetting.AssignProperties_From_PublicIPAddressDnsSettings(source.DnsSettings)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddressDnsSettings() to populate field DnsSettings")
		}
		address.DnsSettings = &dnsSetting
	} else {
		address.DnsSettings = nil
	}

	// ExtendedLocation
	if source.ExtendedLocation != nil {
		var extendedLocation ExtendedLocation
		err := extendedLocation.AssignProperties_From_ExtendedLocation(source.ExtendedLocation)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocation")
		}
		address.ExtendedLocation = &extendedLocation
	} else {
		address.ExtendedLocation = nil
	}

	// IdleTimeoutInMinutes
	address.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(source.IdleTimeoutInMinutes)

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

	// IpTags
	if source.IpTags != nil {
		ipTagList := make([]IpTag, len(source.IpTags))
		for ipTagIndex, ipTagItem := range source.IpTags {
			// Shadow the loop variable to avoid aliasing
			ipTagItem := ipTagItem
			var ipTag IpTag
			err := ipTag.AssignProperties_From_IpTag(&ipTagItem)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_From_IpTag() to populate field IpTags")
			}
			ipTagList[ipTagIndex] = ipTag
		}
		address.IpTags = ipTagList
	} else {
		address.IpTags = nil
	}

	// LinkedPublicIPAddress
	if source.LinkedPublicIPAddress != nil {
		var linkedPublicIPAddress PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
		err := linkedPublicIPAddress.AssignProperties_From_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(source.LinkedPublicIPAddress)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded() to populate field LinkedPublicIPAddress")
		}
		address.LinkedPublicIPAddress = &linkedPublicIPAddress
	} else {
		address.LinkedPublicIPAddress = nil
	}

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

	// NatGateway
	if source.NatGateway != nil {
		var natGateway NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
		err := natGateway.AssignProperties_From_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded(source.NatGateway)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		address.NatGateway = &natGateway
	} else {
		address.NatGateway = nil
	}

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

	// PublicIPAddressVersion
	if source.PublicIPAddressVersion != nil {
		publicIPAddressVersion := IPVersion(*source.PublicIPAddressVersion)
		address.PublicIPAddressVersion = &publicIPAddressVersion
	} else {
		address.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if source.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := IPAllocationMethod(*source.PublicIPAllocationMethod)
		address.PublicIPAllocationMethod = &publicIPAllocationMethod
	} else {
		address.PublicIPAllocationMethod = nil
	}

	// PublicIPPrefix
	if source.PublicIPPrefix != nil {
		var publicIPPrefix SubResource
		err := publicIPPrefix.AssignProperties_From_SubResource(source.PublicIPPrefix)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_SubResource() to populate field PublicIPPrefix")
		}
		address.PublicIPPrefix = &publicIPPrefix
	} else {
		address.PublicIPPrefix = nil
	}

	// ServicePublicIPAddress
	if source.ServicePublicIPAddress != nil {
		var servicePublicIPAddress PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
		err := servicePublicIPAddress.AssignProperties_From_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(source.ServicePublicIPAddress)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded() to populate field ServicePublicIPAddress")
		}
		address.ServicePublicIPAddress = &servicePublicIPAddress
	} else {
		address.ServicePublicIPAddress = nil
	}

	// Sku
	if source.Sku != nil {
		var sku PublicIPAddressSku
		err := sku.AssignProperties_From_PublicIPAddressSku(source.Sku)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddressSku() to populate field Sku")
		}
		address.Sku = &sku
	} else {
		address.Sku = nil
	}

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = address.AzureName

	// DdosSettings
	if address.DdosSettings != nil {
		var ddosSetting v20201101s.DdosSettings
		err := address.DdosSettings.AssignProperties_To_DdosSettings(&ddosSetting)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_DdosSettings() to populate field DdosSettings")
		}
		destination.DdosSettings = &ddosSetting
	} else {
		destination.DdosSettings = nil
	}

	// DnsSettings
	if address.DnsSettings != nil {
		var dnsSetting v20201101s.PublicIPAddressDnsSettings
		err := address.DnsSettings.AssignProperties_To_PublicIPAddressDnsSettings(&dnsSetting)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddressDnsSettings() to populate field DnsSettings")
		}
		destination.DnsSettings = &dnsSetting
	} else {
		destination.DnsSettings = nil
	}

	// ExtendedLocation
	if address.ExtendedLocation != nil {
		var extendedLocation v20201101s.ExtendedLocation
		err := address.ExtendedLocation.AssignProperties_To_ExtendedLocation(&extendedLocation)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocation")
		}
		destination.ExtendedLocation = &extendedLocation
	} else {
		destination.ExtendedLocation = nil
	}

	// IdleTimeoutInMinutes
	destination.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(address.IdleTimeoutInMinutes)

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

	// IpTags
	if address.IpTags != nil {
		ipTagList := make([]v20201101s.IpTag, len(address.IpTags))
		for ipTagIndex, ipTagItem := range address.IpTags {
			// Shadow the loop variable to avoid aliasing
			ipTagItem := ipTagItem
			var ipTag v20201101s.IpTag
			err := ipTagItem.AssignProperties_To_IpTag(&ipTag)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_To_IpTag() to populate field IpTags")
			}
			ipTagList[ipTagIndex] = ipTag
		}
		destination.IpTags = ipTagList
	} else {
		destination.IpTags = nil
	}

	// LinkedPublicIPAddress
	if address.LinkedPublicIPAddress != nil {
		var linkedPublicIPAddress v20201101s.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
		err := address.LinkedPublicIPAddress.AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(&linkedPublicIPAddress)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded() to populate field LinkedPublicIPAddress")
		}
		destination.LinkedPublicIPAddress = &linkedPublicIPAddress
	} else {
		destination.LinkedPublicIPAddress = nil
	}

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

	// NatGateway
	if address.NatGateway != nil {
		var natGateway v20201101s.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
		err := address.NatGateway.AssignProperties_To_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded(&natGateway)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		destination.NatGateway = &natGateway
	} else {
		destination.NatGateway = nil
	}

	// OriginalVersion
	destination.OriginalVersion = address.OriginalVersion()

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

	// PublicIPAddressVersion
	if address.PublicIPAddressVersion != nil {
		publicIPAddressVersion := string(*address.PublicIPAddressVersion)
		destination.PublicIPAddressVersion = &publicIPAddressVersion
	} else {
		destination.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if address.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := string(*address.PublicIPAllocationMethod)
		destination.PublicIPAllocationMethod = &publicIPAllocationMethod
	} else {
		destination.PublicIPAllocationMethod = nil
	}

	// PublicIPPrefix
	if address.PublicIPPrefix != nil {
		var publicIPPrefix v20201101s.SubResource
		err := address.PublicIPPrefix.AssignProperties_To_SubResource(&publicIPPrefix)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_SubResource() to populate field PublicIPPrefix")
		}
		destination.PublicIPPrefix = &publicIPPrefix
	} else {
		destination.PublicIPPrefix = nil
	}

	// ServicePublicIPAddress
	if address.ServicePublicIPAddress != nil {
		var servicePublicIPAddress v20201101s.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
		err := address.ServicePublicIPAddress.AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(&servicePublicIPAddress)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded() to populate field ServicePublicIPAddress")
		}
		destination.ServicePublicIPAddress = &servicePublicIPAddress
	} else {
		destination.ServicePublicIPAddress = nil
	}

	// Sku
	if address.Sku != nil {
		var sku v20201101s.PublicIPAddressSku
		err := address.Sku.AssignProperties_To_PublicIPAddressSku(&sku)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddressSku() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

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

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

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

	// No error
	return nil
}

// Initialize_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded populates our PublicIPAddress_Spec from the provided source PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded
func (address *PublicIPAddress_Spec) Initialize_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(source *PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded) error {

	// DdosSettings
	if source.DdosSettings != nil {
		var ddosSetting DdosSettings
		err := ddosSetting.Initialize_From_DdosSettings_STATUS(source.DdosSettings)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_DdosSettings_STATUS() to populate field DdosSettings")
		}
		address.DdosSettings = &ddosSetting
	} else {
		address.DdosSettings = nil
	}

	// DnsSettings
	if source.DnsSettings != nil {
		var dnsSetting PublicIPAddressDnsSettings
		err := dnsSetting.Initialize_From_PublicIPAddressDnsSettings_STATUS(source.DnsSettings)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_PublicIPAddressDnsSettings_STATUS() to populate field DnsSettings")
		}
		address.DnsSettings = &dnsSetting
	} else {
		address.DnsSettings = nil
	}

	// ExtendedLocation
	if source.ExtendedLocation != nil {
		var extendedLocation ExtendedLocation
		err := extendedLocation.Initialize_From_ExtendedLocation_STATUS(source.ExtendedLocation)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_ExtendedLocation_STATUS() to populate field ExtendedLocation")
		}
		address.ExtendedLocation = &extendedLocation
	} else {
		address.ExtendedLocation = nil
	}

	// IdleTimeoutInMinutes
	address.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(source.IdleTimeoutInMinutes)

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

	// IpTags
	if source.IpTags != nil {
		ipTagList := make([]IpTag, len(source.IpTags))
		for ipTagIndex, ipTagItem := range source.IpTags {
			// Shadow the loop variable to avoid aliasing
			ipTagItem := ipTagItem
			var ipTag IpTag
			err := ipTag.Initialize_From_IpTag_STATUS(&ipTagItem)
			if err != nil {
				return errors.Wrap(err, "calling Initialize_From_IpTag_STATUS() to populate field IpTags")
			}
			ipTagList[ipTagIndex] = ipTag
		}
		address.IpTags = ipTagList
	} else {
		address.IpTags = nil
	}

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

	// NatGateway
	if source.NatGateway != nil {
		var natGateway NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
		err := natGateway.Initialize_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded(source.NatGateway)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		address.NatGateway = &natGateway
	} else {
		address.NatGateway = nil
	}

	// PublicIPAddressVersion
	if source.PublicIPAddressVersion != nil {
		publicIPAddressVersion := IPVersion(*source.PublicIPAddressVersion)
		address.PublicIPAddressVersion = &publicIPAddressVersion
	} else {
		address.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if source.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := IPAllocationMethod(*source.PublicIPAllocationMethod)
		address.PublicIPAllocationMethod = &publicIPAllocationMethod
	} else {
		address.PublicIPAllocationMethod = nil
	}

	// PublicIPPrefix
	if source.PublicIPPrefix != nil {
		var publicIPPrefix SubResource
		err := publicIPPrefix.Initialize_From_SubResource_STATUS(source.PublicIPPrefix)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_SubResource_STATUS() to populate field PublicIPPrefix")
		}
		address.PublicIPPrefix = &publicIPPrefix
	} else {
		address.PublicIPPrefix = nil
	}

	// Sku
	if source.Sku != nil {
		var sku PublicIPAddressSku
		err := sku.Initialize_From_PublicIPAddressSku_STATUS(source.Sku)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_PublicIPAddressSku_STATUS() to populate field Sku")
		}
		address.Sku = &sku
	} else {
		address.Sku = nil
	}

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

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

	// No error
	return nil
}

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

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

// Public IP address resource.
type PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// DdosSettings: The DDoS protection custom policy associated with the public IP address.
	DdosSettings *DdosSettings_STATUS `json:"ddosSettings,omitempty"`

	// DnsSettings: The FQDN of the DNS record associated with the public IP address.
	DnsSettings *PublicIPAddressDnsSettings_STATUS `json:"dnsSettings,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 public ip address.
	ExtendedLocation *ExtendedLocation_STATUS `json:"extendedLocation,omitempty"`

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

	// IdleTimeoutInMinutes: The idle timeout of the public IP address.
	IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`

	// IpAddress: The IP address associated with the public IP address resource.
	IpAddress *string `json:"ipAddress,omitempty"`

	// IpConfiguration: The IP configuration associated with the public IP address.
	IpConfiguration *IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded `json:"ipConfiguration,omitempty"`

	// IpTags: The list of tags associated with the public IP address.
	IpTags []IpTag_STATUS `json:"ipTags,omitempty"`

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

	// MigrationPhase: Migration phase of Public IP Address.
	MigrationPhase *PublicIPAddressPropertiesFormat_MigrationPhase_STATUS `json:"migrationPhase,omitempty"`

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

	// NatGateway: The NatGateway for the Public IP address.
	NatGateway *NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded `json:"natGateway,omitempty"`

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

	// PublicIPAddressVersion: The public IP address version.
	PublicIPAddressVersion *IPVersion_STATUS `json:"publicIPAddressVersion,omitempty"`

	// PublicIPAllocationMethod: The public IP address allocation method.
	PublicIPAllocationMethod *IPAllocationMethod_STATUS `json:"publicIPAllocationMethod,omitempty"`

	// PublicIPPrefix: The Public IP Prefix this Public IP Address should be allocated from.
	PublicIPPrefix *SubResource_STATUS `json:"publicIPPrefix,omitempty"`

	// ResourceGuid: The resource GUID property of the public IP address resource.
	ResourceGuid *string `json:"resourceGuid,omitempty"`

	// Sku: The public IP address SKU.
	Sku *PublicIPAddressSku_STATUS `json:"sku,omitempty"`

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

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

	// Zones: A list of availability zones denoting the IP allocated for the resource needs to come from.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ConvertibleStatus = &PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded{}

// ConvertStatusFrom populates our PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded from the provided source
func (embedded *PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*v20201101s.PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded)
	if ok {
		// Populate our instance from source
		return embedded.AssignProperties_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(src)
	}

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

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

	return nil
}

// ConvertStatusTo populates the provided destination from our PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*v20201101s.PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded)
	if ok {
		// Populate destination from our instance
		return embedded.AssignProperties_To_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(dst)
	}

	// Convert to an intermediate form
	dst = &v20201101s.PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded{}
	err := embedded.AssignProperties_To_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(dst)
	if err != nil {
		return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()")
	}

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

	return nil
}

var _ genruntime.FromARMConverter = &PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded{}

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

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

	// no assignment for property "Conditions"

	// Set property "DdosSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DdosSettings != nil {
			var ddosSettings1 DdosSettings_STATUS
			err := ddosSettings1.PopulateFromARM(owner, *typedInput.Properties.DdosSettings)
			if err != nil {
				return err
			}
			ddosSettings := ddosSettings1
			embedded.DdosSettings = &ddosSettings
		}
	}

	// Set property "DnsSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DnsSettings != nil {
			var dnsSettings1 PublicIPAddressDnsSettings_STATUS
			err := dnsSettings1.PopulateFromARM(owner, *typedInput.Properties.DnsSettings)
			if err != nil {
				return err
			}
			dnsSettings := dnsSettings1
			embedded.DnsSettings = &dnsSettings
		}
	}

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

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

	// Set property "IdleTimeoutInMinutes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IdleTimeoutInMinutes != nil {
			idleTimeoutInMinutes := *typedInput.Properties.IdleTimeoutInMinutes
			embedded.IdleTimeoutInMinutes = &idleTimeoutInMinutes
		}
	}

	// Set property "IpAddress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IpAddress != nil {
			ipAddress := *typedInput.Properties.IpAddress
			embedded.IpAddress = &ipAddress
		}
	}

	// Set property "IpConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IpConfiguration != nil {
			var ipConfiguration1 IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded
			err := ipConfiguration1.PopulateFromARM(owner, *typedInput.Properties.IpConfiguration)
			if err != nil {
				return err
			}
			ipConfiguration := ipConfiguration1
			embedded.IpConfiguration = &ipConfiguration
		}
	}

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

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

	// Set property "MigrationPhase":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MigrationPhase != nil {
			migrationPhase := *typedInput.Properties.MigrationPhase
			embedded.MigrationPhase = &migrationPhase
		}
	}

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

	// Set property "NatGateway":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NatGateway != nil {
			var natGateway1 NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded
			err := natGateway1.PopulateFromARM(owner, *typedInput.Properties.NatGateway)
			if err != nil {
				return err
			}
			natGateway := natGateway1
			embedded.NatGateway = &natGateway
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			provisioningState := *typedInput.Properties.ProvisioningState
			embedded.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicIPAddressVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAddressVersion != nil {
			publicIPAddressVersion := *typedInput.Properties.PublicIPAddressVersion
			embedded.PublicIPAddressVersion = &publicIPAddressVersion
		}
	}

	// Set property "PublicIPAllocationMethod":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAllocationMethod != nil {
			publicIPAllocationMethod := *typedInput.Properties.PublicIPAllocationMethod
			embedded.PublicIPAllocationMethod = &publicIPAllocationMethod
		}
	}

	// Set property "PublicIPPrefix":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPPrefix != nil {
			var publicIPPrefix1 SubResource_STATUS
			err := publicIPPrefix1.PopulateFromARM(owner, *typedInput.Properties.PublicIPPrefix)
			if err != nil {
				return err
			}
			publicIPPrefix := publicIPPrefix1
			embedded.PublicIPPrefix = &publicIPPrefix
		}
	}

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

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 PublicIPAddressSku_STATUS
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		embedded.Sku = &sku
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded populates our PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded from the provided source PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded) AssignProperties_From_PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded(source *v20201101s.PublicIPAddress_STATUS_PublicIPAddress_SubResourceEmbedded) error {

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

	// DdosSettings
	if source.DdosSettings != nil {
		var ddosSetting DdosSettings_STATUS
		err := ddosSetting.AssignProperties_From_DdosSettings_STATUS(source.DdosSettings)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_DdosSettings_STATUS() to populate field DdosSettings")
		}
		embedded.DdosSettings = &ddosSetting
	} else {
		embedded.DdosSettings = nil
	}

	// DnsSettings
	if source.DnsSettings != nil {
		var dnsSetting PublicIPAddressDnsSettings_STATUS
		err := dnsSetting.AssignProperties_From_PublicIPAddressDnsSettings_STATUS(source.DnsSettings)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddressDnsSettings_STATUS() to populate field DnsSettings")
		}
		embedded.DnsSettings = &dnsSetting
	} else {
		embedded.DnsSettings = nil
	}

	// Etag
	embedded.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 errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation")
		}
		embedded.ExtendedLocation = &extendedLocation
	} else {
		embedded.ExtendedLocation = nil
	}

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

	// IdleTimeoutInMinutes
	embedded.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(source.IdleTimeoutInMinutes)

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

	// IpConfiguration
	if source.IpConfiguration != nil {
		var ipConfiguration IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded
		err := ipConfiguration.AssignProperties_From_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded(source.IpConfiguration)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field IpConfiguration")
		}
		embedded.IpConfiguration = &ipConfiguration
	} else {
		embedded.IpConfiguration = nil
	}

	// IpTags
	if source.IpTags != nil {
		ipTagList := make([]IpTag_STATUS, len(source.IpTags))
		for ipTagIndex, ipTagItem := range source.IpTags {
			// Shadow the loop variable to avoid aliasing
			ipTagItem := ipTagItem
			var ipTag IpTag_STATUS
			err := ipTag.AssignProperties_From_IpTag_STATUS(&ipTagItem)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_From_IpTag_STATUS() to populate field IpTags")
			}
			ipTagList[ipTagIndex] = ipTag
		}
		embedded.IpTags = ipTagList
	} else {
		embedded.IpTags = nil
	}

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

	// MigrationPhase
	if source.MigrationPhase != nil {
		migrationPhase := PublicIPAddressPropertiesFormat_MigrationPhase_STATUS(*source.MigrationPhase)
		embedded.MigrationPhase = &migrationPhase
	} else {
		embedded.MigrationPhase = nil
	}

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

	// NatGateway
	if source.NatGateway != nil {
		var natGateway NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded
		err := natGateway.AssignProperties_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded(source.NatGateway)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		embedded.NatGateway = &natGateway
	} else {
		embedded.NatGateway = nil
	}

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := ProvisioningState_STATUS(*source.ProvisioningState)
		embedded.ProvisioningState = &provisioningState
	} else {
		embedded.ProvisioningState = nil
	}

	// PublicIPAddressVersion
	if source.PublicIPAddressVersion != nil {
		publicIPAddressVersion := IPVersion_STATUS(*source.PublicIPAddressVersion)
		embedded.PublicIPAddressVersion = &publicIPAddressVersion
	} else {
		embedded.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if source.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := IPAllocationMethod_STATUS(*source.PublicIPAllocationMethod)
		embedded.PublicIPAllocationMethod = &publicIPAllocationMethod
	} else {
		embedded.PublicIPAllocationMethod = nil
	}

	// PublicIPPrefix
	if source.PublicIPPrefix != nil {
		var publicIPPrefix SubResource_STATUS
		err := publicIPPrefix.AssignProperties_From_SubResource_STATUS(source.PublicIPPrefix)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field PublicIPPrefix")
		}
		embedded.PublicIPPrefix = &publicIPPrefix
	} else {
		embedded.PublicIPPrefix = nil
	}

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

	// Sku
	if source.Sku != nil {
		var sku PublicIPAddressSku_STATUS
		err := sku.AssignProperties_From_PublicIPAddressSku_STATUS(source.Sku)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_PublicIPAddressSku_STATUS() to populate field Sku")
		}
		embedded.Sku = &sku
	} else {
		embedded.Sku = nil
	}

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

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

	// Zones
	embedded.Zones = genruntime.CloneSliceOfString(source.Zones)

	// No error
	return nil
}

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

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

	// DdosSettings
	if embedded.DdosSettings != nil {
		var ddosSetting v20201101s.DdosSettings_STATUS
		err := embedded.DdosSettings.AssignProperties_To_DdosSettings_STATUS(&ddosSetting)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_DdosSettings_STATUS() to populate field DdosSettings")
		}
		destination.DdosSettings = &ddosSetting
	} else {
		destination.DdosSettings = nil
	}

	// DnsSettings
	if embedded.DnsSettings != nil {
		var dnsSetting v20201101s.PublicIPAddressDnsSettings_STATUS
		err := embedded.DnsSettings.AssignProperties_To_PublicIPAddressDnsSettings_STATUS(&dnsSetting)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddressDnsSettings_STATUS() to populate field DnsSettings")
		}
		destination.DnsSettings = &dnsSetting
	} else {
		destination.DnsSettings = nil
	}

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

	// ExtendedLocation
	if embedded.ExtendedLocation != nil {
		var extendedLocation v20201101s.ExtendedLocation_STATUS
		err := embedded.ExtendedLocation.AssignProperties_To_ExtendedLocation_STATUS(&extendedLocation)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_ExtendedLocation_STATUS() to populate field ExtendedLocation")
		}
		destination.ExtendedLocation = &extendedLocation
	} else {
		destination.ExtendedLocation = nil
	}

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

	// IdleTimeoutInMinutes
	destination.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(embedded.IdleTimeoutInMinutes)

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

	// IpConfiguration
	if embedded.IpConfiguration != nil {
		var ipConfiguration v20201101s.IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded
		err := embedded.IpConfiguration.AssignProperties_To_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded(&ipConfiguration)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field IpConfiguration")
		}
		destination.IpConfiguration = &ipConfiguration
	} else {
		destination.IpConfiguration = nil
	}

	// IpTags
	if embedded.IpTags != nil {
		ipTagList := make([]v20201101s.IpTag_STATUS, len(embedded.IpTags))
		for ipTagIndex, ipTagItem := range embedded.IpTags {
			// Shadow the loop variable to avoid aliasing
			ipTagItem := ipTagItem
			var ipTag v20201101s.IpTag_STATUS
			err := ipTagItem.AssignProperties_To_IpTag_STATUS(&ipTag)
			if err != nil {
				return errors.Wrap(err, "calling AssignProperties_To_IpTag_STATUS() to populate field IpTags")
			}
			ipTagList[ipTagIndex] = ipTag
		}
		destination.IpTags = ipTagList
	} else {
		destination.IpTags = nil
	}

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

	// MigrationPhase
	if embedded.MigrationPhase != nil {
		migrationPhase := string(*embedded.MigrationPhase)
		destination.MigrationPhase = &migrationPhase
	} else {
		destination.MigrationPhase = nil
	}

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

	// NatGateway
	if embedded.NatGateway != nil {
		var natGateway v20201101s.NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded
		err := embedded.NatGateway.AssignProperties_To_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded(&natGateway)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		destination.NatGateway = &natGateway
	} else {
		destination.NatGateway = nil
	}

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

	// PublicIPAddressVersion
	if embedded.PublicIPAddressVersion != nil {
		publicIPAddressVersion := string(*embedded.PublicIPAddressVersion)
		destination.PublicIPAddressVersion = &publicIPAddressVersion
	} else {
		destination.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if embedded.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := string(*embedded.PublicIPAllocationMethod)
		destination.PublicIPAllocationMethod = &publicIPAllocationMethod
	} else {
		destination.PublicIPAllocationMethod = nil
	}

	// PublicIPPrefix
	if embedded.PublicIPPrefix != nil {
		var publicIPPrefix v20201101s.SubResource_STATUS
		err := embedded.PublicIPPrefix.AssignProperties_To_SubResource_STATUS(&publicIPPrefix)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field PublicIPPrefix")
		}
		destination.PublicIPPrefix = &publicIPPrefix
	} else {
		destination.PublicIPPrefix = nil
	}

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

	// Sku
	if embedded.Sku != nil {
		var sku v20201101s.PublicIPAddressSku_STATUS
		err := embedded.Sku.AssignProperties_To_PublicIPAddressSku_STATUS(&sku)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_PublicIPAddressSku_STATUS() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

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

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

	// Zones
	destination.Zones = genruntime.CloneSliceOfString(embedded.Zones)

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

	// No error
	return nil
}

// Contains the DDoS protection settings of the public IP.
type DdosSettings struct {
	// DdosCustomPolicy: The DDoS custom policy associated with the public IP.
	DdosCustomPolicy *SubResource `json:"ddosCustomPolicy,omitempty"`

	// ProtectedIP: Enables DDoS protection on the public IP.
	ProtectedIP *bool `json:"protectedIP,omitempty"`

	// ProtectionCoverage: The DDoS protection policy customizability of the public IP. Only standard coverage will have the
	// ability to be customized.
	ProtectionCoverage *DdosSettings_ProtectionCoverage `json:"protectionCoverage,omitempty"`
}

var _ genruntime.ARMTransformer = &DdosSettings{}

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

	// Set property "DdosCustomPolicy":
	if settings.DdosCustomPolicy != nil {
		ddosCustomPolicy_ARM, err := (*settings.DdosCustomPolicy).ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		ddosCustomPolicy := *ddosCustomPolicy_ARM.(*SubResource_ARM)
		result.DdosCustomPolicy = &ddosCustomPolicy
	}

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

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

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

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

	// Set property "DdosCustomPolicy":
	if typedInput.DdosCustomPolicy != nil {
		var ddosCustomPolicy1 SubResource
		err := ddosCustomPolicy1.PopulateFromARM(owner, *typedInput.DdosCustomPolicy)
		if err != nil {
			return err
		}
		ddosCustomPolicy := ddosCustomPolicy1
		settings.DdosCustomPolicy = &ddosCustomPolicy
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_DdosSettings populates our DdosSettings from the provided source DdosSettings
func (settings *DdosSettings) AssignProperties_From_DdosSettings(source *v20201101s.DdosSettings) error {

	// DdosCustomPolicy
	if source.DdosCustomPolicy != nil {
		var ddosCustomPolicy SubResource
		err := ddosCustomPolicy.AssignProperties_From_SubResource(source.DdosCustomPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_SubResource() to populate field DdosCustomPolicy")
		}
		settings.DdosCustomPolicy = &ddosCustomPolicy
	} else {
		settings.DdosCustomPolicy = nil
	}

	// ProtectedIP
	if source.ProtectedIP != nil {
		protectedIP := *source.ProtectedIP
		settings.ProtectedIP = &protectedIP
	} else {
		settings.ProtectedIP = nil
	}

	// ProtectionCoverage
	if source.ProtectionCoverage != nil {
		protectionCoverage := DdosSettings_ProtectionCoverage(*source.ProtectionCoverage)
		settings.ProtectionCoverage = &protectionCoverage
	} else {
		settings.ProtectionCoverage = nil
	}

	// No error
	return nil
}

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

	// DdosCustomPolicy
	if settings.DdosCustomPolicy != nil {
		var ddosCustomPolicy v20201101s.SubResource
		err := settings.DdosCustomPolicy.AssignProperties_To_SubResource(&ddosCustomPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_SubResource() to populate field DdosCustomPolicy")
		}
		destination.DdosCustomPolicy = &ddosCustomPolicy
	} else {
		destination.DdosCustomPolicy = nil
	}

	// ProtectedIP
	if settings.ProtectedIP != nil {
		protectedIP := *settings.ProtectedIP
		destination.ProtectedIP = &protectedIP
	} else {
		destination.ProtectedIP = nil
	}

	// ProtectionCoverage
	if settings.ProtectionCoverage != nil {
		protectionCoverage := string(*settings.ProtectionCoverage)
		destination.ProtectionCoverage = &protectionCoverage
	} else {
		destination.ProtectionCoverage = nil
	}

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

	// No error
	return nil
}

// Initialize_From_DdosSettings_STATUS populates our DdosSettings from the provided source DdosSettings_STATUS
func (settings *DdosSettings) Initialize_From_DdosSettings_STATUS(source *DdosSettings_STATUS) error {

	// DdosCustomPolicy
	if source.DdosCustomPolicy != nil {
		var ddosCustomPolicy SubResource
		err := ddosCustomPolicy.Initialize_From_SubResource_STATUS(source.DdosCustomPolicy)
		if err != nil {
			return errors.Wrap(err, "calling Initialize_From_SubResource_STATUS() to populate field DdosCustomPolicy")
		}
		settings.DdosCustomPolicy = &ddosCustomPolicy
	} else {
		settings.DdosCustomPolicy = nil
	}

	// ProtectedIP
	if source.ProtectedIP != nil {
		protectedIP := *source.ProtectedIP
		settings.ProtectedIP = &protectedIP
	} else {
		settings.ProtectedIP = nil
	}

	// ProtectionCoverage
	if source.ProtectionCoverage != nil {
		protectionCoverage := DdosSettings_ProtectionCoverage(*source.ProtectionCoverage)
		settings.ProtectionCoverage = &protectionCoverage
	} else {
		settings.ProtectionCoverage = nil
	}

	// No error
	return nil
}

// Contains the DDoS protection settings of the public IP.
type DdosSettings_STATUS struct {
	// DdosCustomPolicy: The DDoS custom policy associated with the public IP.
	DdosCustomPolicy *SubResource_STATUS `json:"ddosCustomPolicy,omitempty"`

	// ProtectedIP: Enables DDoS protection on the public IP.
	ProtectedIP *bool `json:"protectedIP,omitempty"`

	// ProtectionCoverage: The DDoS protection policy customizability of the public IP. Only standard coverage will have the
	// ability to be customized.
	ProtectionCoverage *DdosSettings_ProtectionCoverage_STATUS `json:"protectionCoverage,omitempty"`
}

var _ genruntime.FromARMConverter = &DdosSettings_STATUS{}

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

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

	// Set property "DdosCustomPolicy":
	if typedInput.DdosCustomPolicy != nil {
		var ddosCustomPolicy1 SubResource_STATUS
		err := ddosCustomPolicy1.PopulateFromARM(owner, *typedInput.DdosCustomPolicy)
		if err != nil {
			return err
		}
		ddosCustomPolicy := ddosCustomPolicy1
		settings.DdosCustomPolicy = &ddosCustomPolicy
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_DdosSettings_STATUS populates our DdosSettings_STATUS from the provided source DdosSettings_STATUS
func (settings *DdosSettings_STATUS) AssignProperties_From_DdosSettings_STATUS(source *v20201101s.DdosSettings_STATUS) error {

	// DdosCustomPolicy
	if source.DdosCustomPolicy != nil {
		var ddosCustomPolicy SubResource_STATUS
		err := ddosCustomPolicy.AssignProperties_From_SubResource_STATUS(source.DdosCustomPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field DdosCustomPolicy")
		}
		settings.DdosCustomPolicy = &ddosCustomPolicy
	} else {
		settings.DdosCustomPolicy = nil
	}

	// ProtectedIP
	if source.ProtectedIP != nil {
		protectedIP := *source.ProtectedIP
		settings.ProtectedIP = &protectedIP
	} else {
		settings.ProtectedIP = nil
	}

	// ProtectionCoverage
	if source.ProtectionCoverage != nil {
		protectionCoverage := DdosSettings_ProtectionCoverage_STATUS(*source.ProtectionCoverage)
		settings.ProtectionCoverage = &protectionCoverage
	} else {
		settings.ProtectionCoverage = nil
	}

	// No error
	return nil
}

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

	// DdosCustomPolicy
	if settings.DdosCustomPolicy != nil {
		var ddosCustomPolicy v20201101s.SubResource_STATUS
		err := settings.DdosCustomPolicy.AssignProperties_To_SubResource_STATUS(&ddosCustomPolicy)
		if err != nil {
			return errors.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field DdosCustomPolicy")
		}
		destination.DdosCustomPolicy = &ddosCustomPolicy
	} else {
		destination.DdosCustomPolicy = nil
	}

	// ProtectedIP
	if settings.ProtectedIP != nil {
		protectedIP := *settings.ProtectedIP
		destination.ProtectedIP = &protectedIP
	} else {
		destination.ProtectedIP = nil
	}

	// ProtectionCoverage
	if settings.ProtectionCoverage != nil {
		protectionCoverage := string(*settings.ProtectionCoverage)
		destination.ProtectionCoverage = &protectionCoverage
	} else {
		destination.ProtectionCoverage = nil
	}

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

	// No error
	return nil
}

// IP address allocation method.
// +kubebuilder:validation:Enum={"Dynamic","Static"}
type IPAllocationMethod string

const (
	IPAllocationMethod_Dynamic = IPAllocationMethod("Dynamic")
	IPAllocationMethod_Static  = IPAllocationMethod("Static")
)

// IP address allocation method.
type IPAllocationMethod_STATUS string

const (
	IPAllocationMethod_STATUS_Dynamic = IPAllocationMethod_STATUS("Dynamic")
	IPAllocationMethod_STATUS_Static  = IPAllocationMethod_STATUS("Static")
)

// IP configuration.
type IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded populates our IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded from the provided source IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded) AssignProperties_From_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded(source *v20201101s.IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded) error {

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

	// No error
	return nil
}

// AssignProperties_To_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded populates the provided destination IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded from our IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded) AssignProperties_To_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded(destination *v20201101s.IPConfiguration_STATUS_PublicIPAddress_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
}

// Contains the IpTag associated with the object.
type IpTag struct {
	// IpTagType: The IP tag type. Example: FirstPartyUsage.
	IpTagType *string `json:"ipTagType,omitempty"`

	// Tag: The value of the IP tag associated with the public IP. Example: SQL.
	Tag *string `json:"tag,omitempty"`
}

var _ genruntime.ARMTransformer = &IpTag{}

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

	// Set property "IpTagType":
	if ipTag.IpTagType != nil {
		ipTagType := *ipTag.IpTagType
		result.IpTagType = &ipTagType
	}

	// Set property "Tag":
	if ipTag.Tag != nil {
		tag := *ipTag.Tag
		result.Tag = &tag
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (ipTag *IpTag) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &IpTag_ARM{}
}

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

	// Set property "IpTagType":
	if typedInput.IpTagType != nil {
		ipTagType := *typedInput.IpTagType
		ipTag.IpTagType = &ipTagType
	}

	// Set property "Tag":
	if typedInput.Tag != nil {
		tag := *typedInput.Tag
		ipTag.Tag = &tag
	}

	// No error
	return nil
}

// AssignProperties_From_IpTag populates our IpTag from the provided source IpTag
func (ipTag *IpTag) AssignProperties_From_IpTag(source *v20201101s.IpTag) error {

	// IpTagType
	ipTag.IpTagType = genruntime.ClonePointerToString(source.IpTagType)

	// Tag
	ipTag.Tag = genruntime.ClonePointerToString(source.Tag)

	// No error
	return nil
}

// AssignProperties_To_IpTag populates the provided destination IpTag from our IpTag
func (ipTag *IpTag) AssignProperties_To_IpTag(destination *v20201101s.IpTag) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// IpTagType
	destination.IpTagType = genruntime.ClonePointerToString(ipTag.IpTagType)

	// Tag
	destination.Tag = genruntime.ClonePointerToString(ipTag.Tag)

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

	// No error
	return nil
}

// Initialize_From_IpTag_STATUS populates our IpTag from the provided source IpTag_STATUS
func (ipTag *IpTag) Initialize_From_IpTag_STATUS(source *IpTag_STATUS) error {

	// IpTagType
	ipTag.IpTagType = genruntime.ClonePointerToString(source.IpTagType)

	// Tag
	ipTag.Tag = genruntime.ClonePointerToString(source.Tag)

	// No error
	return nil
}

// Contains the IpTag associated with the object.
type IpTag_STATUS struct {
	// IpTagType: The IP tag type. Example: FirstPartyUsage.
	IpTagType *string `json:"ipTagType,omitempty"`

	// Tag: The value of the IP tag associated with the public IP. Example: SQL.
	Tag *string `json:"tag,omitempty"`
}

var _ genruntime.FromARMConverter = &IpTag_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (ipTag *IpTag_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &IpTag_STATUS_ARM{}
}

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

	// Set property "IpTagType":
	if typedInput.IpTagType != nil {
		ipTagType := *typedInput.IpTagType
		ipTag.IpTagType = &ipTagType
	}

	// Set property "Tag":
	if typedInput.Tag != nil {
		tag := *typedInput.Tag
		ipTag.Tag = &tag
	}

	// No error
	return nil
}

// AssignProperties_From_IpTag_STATUS populates our IpTag_STATUS from the provided source IpTag_STATUS
func (ipTag *IpTag_STATUS) AssignProperties_From_IpTag_STATUS(source *v20201101s.IpTag_STATUS) error {

	// IpTagType
	ipTag.IpTagType = genruntime.ClonePointerToString(source.IpTagType)

	// Tag
	ipTag.Tag = genruntime.ClonePointerToString(source.Tag)

	// No error
	return nil
}

// AssignProperties_To_IpTag_STATUS populates the provided destination IpTag_STATUS from our IpTag_STATUS
func (ipTag *IpTag_STATUS) AssignProperties_To_IpTag_STATUS(destination *v20201101s.IpTag_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// IpTagType
	destination.IpTagType = genruntime.ClonePointerToString(ipTag.IpTagType)

	// Tag
	destination.Tag = genruntime.ClonePointerToString(ipTag.Tag)

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

	// No error
	return nil
}

// IP address version.
// +kubebuilder:validation:Enum={"IPv4","IPv6"}
type IPVersion string

const (
	IPVersion_IPv4 = IPVersion("IPv4")
	IPVersion_IPv6 = IPVersion("IPv6")
)

// IP address version.
type IPVersion_STATUS string

const (
	IPVersion_STATUS_IPv4 = IPVersion_STATUS("IPv4")
	IPVersion_STATUS_IPv6 = IPVersion_STATUS("IPv6")
)

// Nat Gateway resource.
type NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded populates our NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded from the provided source NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded) AssignProperties_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded(source *v20201101s.NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded) error {

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

	// No error
	return nil
}

// AssignProperties_To_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded populates the provided destination NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded from our NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded) AssignProperties_To_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded(destination *v20201101s.NatGateway_STATUS_PublicIPAddress_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
}

// Nat Gateway resource.
type NatGatewaySpec_PublicIPAddress_SubResourceEmbedded struct {
	// Reference: Resource ID.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &NatGatewaySpec_PublicIPAddress_SubResourceEmbedded{}

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

	// 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 *NatGatewaySpec_PublicIPAddress_SubResourceEmbedded) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &NatGatewaySpec_PublicIPAddress_SubResourceEmbedded_ARM{}
}

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

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded populates our NatGatewaySpec_PublicIPAddress_SubResourceEmbedded from the provided source NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
func (embedded *NatGatewaySpec_PublicIPAddress_SubResourceEmbedded) AssignProperties_From_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded(source *v20201101s.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded) error {

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

	// No error
	return nil
}

// AssignProperties_To_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded populates the provided destination NatGatewaySpec_PublicIPAddress_SubResourceEmbedded from our NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
func (embedded *NatGatewaySpec_PublicIPAddress_SubResourceEmbedded) AssignProperties_To_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded(destination *v20201101s.NatGatewaySpec_PublicIPAddress_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_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded populates our NatGatewaySpec_PublicIPAddress_SubResourceEmbedded from the provided source NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded
func (embedded *NatGatewaySpec_PublicIPAddress_SubResourceEmbedded) Initialize_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded(source *NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded) error {

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

	// No error
	return nil
}

// Contains FQDN of the DNS record associated with the public IP address.
type PublicIPAddressDnsSettings struct {
	// DomainNameLabel: The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up
	// the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS
	// record is created for the public IP in the Microsoft Azure DNS system.
	DomainNameLabel *string `json:"domainNameLabel,omitempty"`

	// Fqdn: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of
	// the domainNameLabel and the regionalized DNS zone.
	Fqdn *string `json:"fqdn,omitempty"`

	// ReverseFqdn: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If
	// the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain
	// to the reverse FQDN.
	ReverseFqdn *string `json:"reverseFqdn,omitempty"`
}

var _ genruntime.ARMTransformer = &PublicIPAddressDnsSettings{}

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PublicIPAddressDnsSettings populates our PublicIPAddressDnsSettings from the provided source PublicIPAddressDnsSettings
func (settings *PublicIPAddressDnsSettings) AssignProperties_From_PublicIPAddressDnsSettings(source *v20201101s.PublicIPAddressDnsSettings) error {

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// Initialize_From_PublicIPAddressDnsSettings_STATUS populates our PublicIPAddressDnsSettings from the provided source PublicIPAddressDnsSettings_STATUS
func (settings *PublicIPAddressDnsSettings) Initialize_From_PublicIPAddressDnsSettings_STATUS(source *PublicIPAddressDnsSettings_STATUS) error {

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

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

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

	// No error
	return nil
}

// Contains FQDN of the DNS record associated with the public IP address.
type PublicIPAddressDnsSettings_STATUS struct {
	// DomainNameLabel: The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up
	// the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS
	// record is created for the public IP in the Microsoft Azure DNS system.
	DomainNameLabel *string `json:"domainNameLabel,omitempty"`

	// Fqdn: The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of
	// the domainNameLabel and the regionalized DNS zone.
	Fqdn *string `json:"fqdn,omitempty"`

	// ReverseFqdn: The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If
	// the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain
	// to the reverse FQDN.
	ReverseFqdn *string `json:"reverseFqdn,omitempty"`
}

var _ genruntime.FromARMConverter = &PublicIPAddressDnsSettings_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PublicIPAddressDnsSettings_STATUS populates our PublicIPAddressDnsSettings_STATUS from the provided source PublicIPAddressDnsSettings_STATUS
func (settings *PublicIPAddressDnsSettings_STATUS) AssignProperties_From_PublicIPAddressDnsSettings_STATUS(source *v20201101s.PublicIPAddressDnsSettings_STATUS) error {

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

type PublicIPAddressPropertiesFormat_MigrationPhase_STATUS string

const (
	PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Abort     = PublicIPAddressPropertiesFormat_MigrationPhase_STATUS("Abort")
	PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Commit    = PublicIPAddressPropertiesFormat_MigrationPhase_STATUS("Commit")
	PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Committed = PublicIPAddressPropertiesFormat_MigrationPhase_STATUS("Committed")
	PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_None      = PublicIPAddressPropertiesFormat_MigrationPhase_STATUS("None")
	PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Prepare   = PublicIPAddressPropertiesFormat_MigrationPhase_STATUS("Prepare")
)

// SKU of a public IP address.
type PublicIPAddressSku struct {
	// Name: Name of a public IP address SKU.
	Name *PublicIPAddressSku_Name `json:"name,omitempty"`

	// Tier: Tier of a public IP address SKU.
	Tier *PublicIPAddressSku_Tier `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &PublicIPAddressSku{}

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

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

	// Set property "Tier":
	if addressSku.Tier != nil {
		tier := *addressSku.Tier
		result.Tier = &tier
	}
	return result, nil
}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (addressSku *PublicIPAddressSku) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &PublicIPAddressSku_ARM{}
}

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

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

	// Set property "Tier":
	if typedInput.Tier != nil {
		tier := *typedInput.Tier
		addressSku.Tier = &tier
	}

	// No error
	return nil
}

// AssignProperties_From_PublicIPAddressSku populates our PublicIPAddressSku from the provided source PublicIPAddressSku
func (addressSku *PublicIPAddressSku) AssignProperties_From_PublicIPAddressSku(source *v20201101s.PublicIPAddressSku) error {

	// Name
	if source.Name != nil {
		name := PublicIPAddressSku_Name(*source.Name)
		addressSku.Name = &name
	} else {
		addressSku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := PublicIPAddressSku_Tier(*source.Tier)
		addressSku.Tier = &tier
	} else {
		addressSku.Tier = nil
	}

	// No error
	return nil
}

// AssignProperties_To_PublicIPAddressSku populates the provided destination PublicIPAddressSku from our PublicIPAddressSku
func (addressSku *PublicIPAddressSku) AssignProperties_To_PublicIPAddressSku(destination *v20201101s.PublicIPAddressSku) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// No error
	return nil
}

// Initialize_From_PublicIPAddressSku_STATUS populates our PublicIPAddressSku from the provided source PublicIPAddressSku_STATUS
func (addressSku *PublicIPAddressSku) Initialize_From_PublicIPAddressSku_STATUS(source *PublicIPAddressSku_STATUS) error {

	// Name
	if source.Name != nil {
		name := PublicIPAddressSku_Name(*source.Name)
		addressSku.Name = &name
	} else {
		addressSku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := PublicIPAddressSku_Tier(*source.Tier)
		addressSku.Tier = &tier
	} else {
		addressSku.Tier = nil
	}

	// No error
	return nil
}

// SKU of a public IP address.
type PublicIPAddressSku_STATUS struct {
	// Name: Name of a public IP address SKU.
	Name *PublicIPAddressSku_Name_STATUS `json:"name,omitempty"`

	// Tier: Tier of a public IP address SKU.
	Tier *PublicIPAddressSku_Tier_STATUS `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &PublicIPAddressSku_STATUS{}

// NewEmptyARMValue returns an empty ARM value suitable for deserializing into
func (addressSku *PublicIPAddressSku_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &PublicIPAddressSku_STATUS_ARM{}
}

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

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

	// Set property "Tier":
	if typedInput.Tier != nil {
		tier := *typedInput.Tier
		addressSku.Tier = &tier
	}

	// No error
	return nil
}

// AssignProperties_From_PublicIPAddressSku_STATUS populates our PublicIPAddressSku_STATUS from the provided source PublicIPAddressSku_STATUS
func (addressSku *PublicIPAddressSku_STATUS) AssignProperties_From_PublicIPAddressSku_STATUS(source *v20201101s.PublicIPAddressSku_STATUS) error {

	// Name
	if source.Name != nil {
		name := PublicIPAddressSku_Name_STATUS(*source.Name)
		addressSku.Name = &name
	} else {
		addressSku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := PublicIPAddressSku_Tier_STATUS(*source.Tier)
		addressSku.Tier = &tier
	} else {
		addressSku.Tier = nil
	}

	// No error
	return nil
}

// AssignProperties_To_PublicIPAddressSku_STATUS populates the provided destination PublicIPAddressSku_STATUS from our PublicIPAddressSku_STATUS
func (addressSku *PublicIPAddressSku_STATUS) AssignProperties_To_PublicIPAddressSku_STATUS(destination *v20201101s.PublicIPAddressSku_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// No error
	return nil
}

// Public IP address resource.
type PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded struct {
	// Reference: Resource ID.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded{}

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

	// 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 *PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded_ARM{}
}

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

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded populates our PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded from the provided source PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
func (embedded *PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded) AssignProperties_From_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(source *v20201101s.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded) error {

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

	// No error
	return nil
}

// AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded populates the provided destination PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded from our PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
func (embedded *PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded) AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(destination *v20201101s.PublicIPAddressSpec_PublicIPAddress_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
}

// +kubebuilder:validation:Enum={"Basic","Standard"}
type DdosSettings_ProtectionCoverage string

const (
	DdosSettings_ProtectionCoverage_Basic    = DdosSettings_ProtectionCoverage("Basic")
	DdosSettings_ProtectionCoverage_Standard = DdosSettings_ProtectionCoverage("Standard")
)

type DdosSettings_ProtectionCoverage_STATUS string

const (
	DdosSettings_ProtectionCoverage_STATUS_Basic    = DdosSettings_ProtectionCoverage_STATUS("Basic")
	DdosSettings_ProtectionCoverage_STATUS_Standard = DdosSettings_ProtectionCoverage_STATUS("Standard")
)

func init() {
	SchemeBuilder.Register(&PublicIPAddress{}, &PublicIPAddressList{})
}
