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

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

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,network}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2024-03-01/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 `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.(*storage.PublicIPAddress)
	if !ok {
		return fmt.Errorf("expected network/v1api20240301/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.(*storage.PublicIPAddress)
	if !ok {
		return fmt.Errorf("expected network/v1api20240301/storage/PublicIPAddress but received %T instead", hub)
	}

	return address.AssignProperties_To_PublicIPAddress(destination)
}

var _ configmaps.Exporter = &PublicIPAddress{}

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

var _ secrets.Exporter = &PublicIPAddress{}

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

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); ok {
		return address.Spec.Initialize_From_PublicIPAddress_STATUS(s)
	}

	return fmt.Errorf("expected Status of type PublicIPAddress_STATUS 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 "2024-03-01"
func (address PublicIPAddress) GetAPIVersion() string {
	return "2024-03-01"
}

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

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

	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); ok {
		address.Status = *st
		return nil
	}

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

	address.Status = st
	return nil
}

// AssignProperties_From_PublicIPAddress populates our PublicIPAddress from the provided source PublicIPAddress
func (address *PublicIPAddress) AssignProperties_From_PublicIPAddress(source *storage.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 eris.Wrap(err, "calling AssignProperties_From_PublicIPAddress_Spec() to populate field Spec")
	}
	address.Spec = spec

	// Status
	var status PublicIPAddress_STATUS
	err = status.AssignProperties_From_PublicIPAddress_STATUS(&source.Status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_From_PublicIPAddress_STATUS() 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 *storage.PublicIPAddress) error {

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

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

	// Status
	var status storage.PublicIPAddress_STATUS
	err = address.Status.AssignProperties_To_PublicIPAddress_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_PublicIPAddress_STATUS() to populate field Status")
	}
	destination.Status = status

	// No error
	return nil
}

// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (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/2024-03-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"`

	// DeleteOption: Specify what happens to the public IP address when the VM using it is deleted
	DeleteOption *PublicIPAddressPropertiesFormat_DeleteOption `json:"deleteOption,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"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *PublicIPAddressOperatorSpec `json:"operatorSpec,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`

	// 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 := &arm.PublicIPAddress_Spec{}

	// Set property "ExtendedLocation":
	if address.ExtendedLocation != nil {
		extendedLocation_ARM, err := address.ExtendedLocation.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		extendedLocation := *extendedLocation_ARM.(*arm.ExtendedLocation)
		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.DeleteOption != 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 = &arm.PublicIPAddressPropertiesFormat{}
	}
	if address.DdosSettings != nil {
		ddosSettings_ARM, err := address.DdosSettings.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		ddosSettings := *ddosSettings_ARM.(*arm.DdosSettings)
		result.Properties.DdosSettings = &ddosSettings
	}
	if address.DeleteOption != nil {
		var temp string
		temp = string(*address.DeleteOption)
		deleteOption := arm.PublicIPAddressPropertiesFormat_DeleteOption(temp)
		result.Properties.DeleteOption = &deleteOption
	}
	if address.DnsSettings != nil {
		dnsSettings_ARM, err := address.DnsSettings.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		dnsSettings := *dnsSettings_ARM.(*arm.PublicIPAddressDnsSettings)
		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.(*arm.IpTag))
	}
	if address.LinkedPublicIPAddress != nil {
		linkedPublicIPAddress_ARM, err := address.LinkedPublicIPAddress.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		linkedPublicIPAddress := *linkedPublicIPAddress_ARM.(*arm.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded)
		result.Properties.LinkedPublicIPAddress = &linkedPublicIPAddress
	}
	if address.NatGateway != nil {
		natGateway_ARM, err := address.NatGateway.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		natGateway := *natGateway_ARM.(*arm.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded)
		result.Properties.NatGateway = &natGateway
	}
	if address.PublicIPAddressVersion != nil {
		var temp string
		temp = string(*address.PublicIPAddressVersion)
		publicIPAddressVersion := arm.IPVersion(temp)
		result.Properties.PublicIPAddressVersion = &publicIPAddressVersion
	}
	if address.PublicIPAllocationMethod != nil {
		var temp string
		temp = string(*address.PublicIPAllocationMethod)
		publicIPAllocationMethod := arm.IPAllocationMethod(temp)
		result.Properties.PublicIPAllocationMethod = &publicIPAllocationMethod
	}
	if address.PublicIPPrefix != nil {
		publicIPPrefix_ARM, err := address.PublicIPPrefix.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		publicIPPrefix := *publicIPPrefix_ARM.(*arm.SubResource)
		result.Properties.PublicIPPrefix = &publicIPPrefix
	}
	if address.ServicePublicIPAddress != nil {
		servicePublicIPAddress_ARM, err := address.ServicePublicIPAddress.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		servicePublicIPAddress := *servicePublicIPAddress_ARM.(*arm.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded)
		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.(*arm.PublicIPAddressSku)
		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 &arm.PublicIPAddress_Spec{}
}

// 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.(arm.PublicIPAddress_Spec)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PublicIPAddress_Spec, 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 "DeleteOption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeleteOption != nil {
			var temp string
			temp = string(*typedInput.Properties.DeleteOption)
			deleteOption := PublicIPAddressPropertiesFormat_DeleteOption(temp)
			address.DeleteOption = &deleteOption
		}
	}

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

	// no assignment for property "OperatorSpec"

	// 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 {
			var temp string
			temp = string(*typedInput.Properties.PublicIPAddressVersion)
			publicIPAddressVersion := IPVersion(temp)
			address.PublicIPAddressVersion = &publicIPAddressVersion
		}
	}

	// Set property "PublicIPAllocationMethod":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAllocationMethod != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicIPAllocationMethod)
			publicIPAllocationMethod := IPAllocationMethod(temp)
			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.(*storage.PublicIPAddress_Spec)
	if ok {
		// Populate our instance from source
		return address.AssignProperties_From_PublicIPAddress_Spec(src)
	}

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

	// Update our instance from src
	err = address.AssignProperties_From_PublicIPAddress_Spec(src)
	if err != nil {
		return eris.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.(*storage.PublicIPAddress_Spec)
	if ok {
		// Populate destination from our instance
		return address.AssignProperties_To_PublicIPAddress_Spec(dst)
	}

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

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

	return nil
}

// AssignProperties_From_PublicIPAddress_Spec populates our PublicIPAddress_Spec from the provided source PublicIPAddress_Spec
func (address *PublicIPAddress_Spec) AssignProperties_From_PublicIPAddress_Spec(source *storage.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 eris.Wrap(err, "calling AssignProperties_From_DdosSettings() to populate field DdosSettings")
		}
		address.DdosSettings = &ddosSetting
	} else {
		address.DdosSettings = nil
	}

	// DeleteOption
	if source.DeleteOption != nil {
		deleteOption := *source.DeleteOption
		deleteOptionTemp := genruntime.ToEnum(deleteOption, publicIPAddressPropertiesFormat_DeleteOption_Values)
		address.DeleteOption = &deleteOptionTemp
	} else {
		address.DeleteOption = nil
	}

	// DnsSettings
	if source.DnsSettings != nil {
		var dnsSetting PublicIPAddressDnsSettings
		err := dnsSetting.AssignProperties_From_PublicIPAddressDnsSettings(source.DnsSettings)
		if err != nil {
			return eris.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 eris.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 {
			var ipTag IpTag
			err := ipTag.AssignProperties_From_IpTag(&ipTagItem)
			if err != nil {
				return eris.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 eris.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 eris.Wrap(err, "calling AssignProperties_From_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		address.NatGateway = &natGateway
	} else {
		address.NatGateway = nil
	}

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

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

	// PublicIPAddressVersion
	if source.PublicIPAddressVersion != nil {
		publicIPAddressVersion := *source.PublicIPAddressVersion
		publicIPAddressVersionTemp := genruntime.ToEnum(publicIPAddressVersion, iPVersion_Values)
		address.PublicIPAddressVersion = &publicIPAddressVersionTemp
	} else {
		address.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if source.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := *source.PublicIPAllocationMethod
		publicIPAllocationMethodTemp := genruntime.ToEnum(publicIPAllocationMethod, iPAllocationMethod_Values)
		address.PublicIPAllocationMethod = &publicIPAllocationMethodTemp
	} else {
		address.PublicIPAllocationMethod = nil
	}

	// PublicIPPrefix
	if source.PublicIPPrefix != nil {
		var publicIPPrefix SubResource
		err := publicIPPrefix.AssignProperties_From_SubResource(source.PublicIPPrefix)
		if err != nil {
			return eris.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 eris.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 eris.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 *storage.PublicIPAddress_Spec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AzureName
	destination.AzureName = address.AzureName

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

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

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

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

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

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

	// IpTags
	if address.IpTags != nil {
		ipTagList := make([]storage.IpTag, len(address.IpTags))
		for ipTagIndex, ipTagItem := range address.IpTags {
			var ipTag storage.IpTag
			err := ipTagItem.AssignProperties_To_IpTag(&ipTag)
			if err != nil {
				return eris.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 storage.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
		err := address.LinkedPublicIPAddress.AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(&linkedPublicIPAddress)
		if err != nil {
			return eris.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 storage.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded
		err := address.NatGateway.AssignProperties_To_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded(&natGateway)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_NatGatewaySpec_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		destination.NatGateway = &natGateway
	} else {
		destination.NatGateway = nil
	}

	// OperatorSpec
	if address.OperatorSpec != nil {
		var operatorSpec storage.PublicIPAddressOperatorSpec
		err := address.OperatorSpec.AssignProperties_To_PublicIPAddressOperatorSpec(&operatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PublicIPAddressOperatorSpec() to populate field OperatorSpec")
		}
		destination.OperatorSpec = &operatorSpec
	} else {
		destination.OperatorSpec = 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 storage.SubResource
		err := address.PublicIPPrefix.AssignProperties_To_SubResource(&publicIPPrefix)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field PublicIPPrefix")
		}
		destination.PublicIPPrefix = &publicIPPrefix
	} else {
		destination.PublicIPPrefix = nil
	}

	// ServicePublicIPAddress
	if address.ServicePublicIPAddress != nil {
		var servicePublicIPAddress storage.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded
		err := address.ServicePublicIPAddress.AssignProperties_To_PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded(&servicePublicIPAddress)
		if err != nil {
			return eris.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 storage.PublicIPAddressSku
		err := address.Sku.AssignProperties_To_PublicIPAddressSku(&sku)
		if err != nil {
			return eris.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 populates our PublicIPAddress_Spec from the provided source PublicIPAddress_STATUS
func (address *PublicIPAddress_Spec) Initialize_From_PublicIPAddress_STATUS(source *PublicIPAddress_STATUS) error {

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

	// DeleteOption
	if source.DeleteOption != nil {
		deleteOption := genruntime.ToEnum(string(*source.DeleteOption), publicIPAddressPropertiesFormat_DeleteOption_Values)
		address.DeleteOption = &deleteOption
	} else {
		address.DeleteOption = nil
	}

	// DnsSettings
	if source.DnsSettings != nil {
		var dnsSetting PublicIPAddressDnsSettings
		err := dnsSetting.Initialize_From_PublicIPAddressDnsSettings_STATUS(source.DnsSettings)
		if err != nil {
			return eris.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 eris.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 {
			var ipTag IpTag
			err := ipTag.Initialize_From_IpTag_STATUS(&ipTagItem)
			if err != nil {
				return eris.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 eris.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 := genruntime.ToEnum(string(*source.PublicIPAddressVersion), iPVersion_Values)
		address.PublicIPAddressVersion = &publicIPAddressVersion
	} else {
		address.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if source.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := genruntime.ToEnum(string(*source.PublicIPAllocationMethod), iPAllocationMethod_Values)
		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 eris.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 eris.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 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"`

	// DeleteOption: Specify what happens to the public IP address when the VM using it is deleted
	DeleteOption *PublicIPAddressPropertiesFormat_DeleteOption_STATUS `json:"deleteOption,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{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.PublicIPAddress_STATUS{}
	err := address.AssignProperties_To_PublicIPAddress_STATUS(dst)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()")
	}

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

	return nil
}

var _ genruntime.FromARMConverter = &PublicIPAddress_STATUS{}

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

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (address *PublicIPAddress_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.PublicIPAddress_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PublicIPAddress_STATUS, 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
			address.DdosSettings = &ddosSettings
		}
	}

	// Set property "DeleteOption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeleteOption != nil {
			var temp string
			temp = string(*typedInput.Properties.DeleteOption)
			deleteOption := PublicIPAddressPropertiesFormat_DeleteOption_STATUS(temp)
			address.DeleteOption = &deleteOption
		}
	}

	// 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
			address.DnsSettings = &dnsSettings
		}
	}

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

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

	// 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 "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
			address.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
			}
			address.IpTags = append(address.IpTags, item1)
		}
	}

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

	// Set property "MigrationPhase":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MigrationPhase != nil {
			var temp string
			temp = string(*typedInput.Properties.MigrationPhase)
			migrationPhase := PublicIPAddressPropertiesFormat_MigrationPhase_STATUS(temp)
			address.MigrationPhase = &migrationPhase
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		address.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
			address.NatGateway = &natGateway
		}
	}

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

	// Set property "PublicIPAddressVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAddressVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicIPAddressVersion)
			publicIPAddressVersion := IPVersion_STATUS(temp)
			address.PublicIPAddressVersion = &publicIPAddressVersion
		}
	}

	// Set property "PublicIPAllocationMethod":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIPAllocationMethod != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicIPAllocationMethod)
			publicIPAllocationMethod := IPAllocationMethod_STATUS(temp)
			address.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
			address.PublicIPPrefix = &publicIPPrefix
		}
	}

	// Set property "ResourceGuid":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResourceGuid != nil {
			resourceGuid := *typedInput.Properties.ResourceGuid
			address.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
		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 "Type":
	if typedInput.Type != nil {
		typeVar := *typedInput.Type
		address.Type = &typeVar
	}

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

	// No error
	return nil
}

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

	// Conditions
	address.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 eris.Wrap(err, "calling AssignProperties_From_DdosSettings_STATUS() to populate field DdosSettings")
		}
		address.DdosSettings = &ddosSetting
	} else {
		address.DdosSettings = nil
	}

	// DeleteOption
	if source.DeleteOption != nil {
		deleteOption := *source.DeleteOption
		deleteOptionTemp := genruntime.ToEnum(deleteOption, publicIPAddressPropertiesFormat_DeleteOption_STATUS_Values)
		address.DeleteOption = &deleteOptionTemp
	} else {
		address.DeleteOption = nil
	}

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

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

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

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

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

	// IpAddress
	address.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 eris.Wrap(err, "calling AssignProperties_From_IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field IpConfiguration")
		}
		address.IpConfiguration = &ipConfiguration
	} else {
		address.IpConfiguration = nil
	}

	// IpTags
	if source.IpTags != nil {
		ipTagList := make([]IpTag_STATUS, len(source.IpTags))
		for ipTagIndex, ipTagItem := range source.IpTags {
			var ipTag IpTag_STATUS
			err := ipTag.AssignProperties_From_IpTag_STATUS(&ipTagItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IpTag_STATUS() to populate field IpTags")
			}
			ipTagList[ipTagIndex] = ipTag
		}
		address.IpTags = ipTagList
	} else {
		address.IpTags = nil
	}

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

	// MigrationPhase
	if source.MigrationPhase != nil {
		migrationPhase := *source.MigrationPhase
		migrationPhaseTemp := genruntime.ToEnum(migrationPhase, publicIPAddressPropertiesFormat_MigrationPhase_STATUS_Values)
		address.MigrationPhase = &migrationPhaseTemp
	} else {
		address.MigrationPhase = nil
	}

	// Name
	address.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 eris.Wrap(err, "calling AssignProperties_From_NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded() to populate field NatGateway")
		}
		address.NatGateway = &natGateway
	} else {
		address.NatGateway = nil
	}

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

	// PublicIPAddressVersion
	if source.PublicIPAddressVersion != nil {
		publicIPAddressVersion := *source.PublicIPAddressVersion
		publicIPAddressVersionTemp := genruntime.ToEnum(publicIPAddressVersion, iPVersion_STATUS_Values)
		address.PublicIPAddressVersion = &publicIPAddressVersionTemp
	} else {
		address.PublicIPAddressVersion = nil
	}

	// PublicIPAllocationMethod
	if source.PublicIPAllocationMethod != nil {
		publicIPAllocationMethod := *source.PublicIPAllocationMethod
		publicIPAllocationMethodTemp := genruntime.ToEnum(publicIPAllocationMethod, iPAllocationMethod_STATUS_Values)
		address.PublicIPAllocationMethod = &publicIPAllocationMethodTemp
	} else {
		address.PublicIPAllocationMethod = nil
	}

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

	// ResourceGuid
	address.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 eris.Wrap(err, "calling AssignProperties_From_PublicIPAddressSku_STATUS() to populate field Sku")
		}
		address.Sku = &sku
	} else {
		address.Sku = nil
	}

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

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

	// IpTags
	if address.IpTags != nil {
		ipTagList := make([]storage.IpTag_STATUS, len(address.IpTags))
		for ipTagIndex, ipTagItem := range address.IpTags {
			var ipTag storage.IpTag_STATUS
			err := ipTagItem.AssignProperties_To_IpTag_STATUS(&ipTag)
			if err != nil {
				return eris.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(address.Location)

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

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

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

	// ProvisioningState
	if address.ProvisioningState != nil {
		provisioningState := string(*address.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = 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 storage.SubResource_STATUS
		err := address.PublicIPPrefix.AssignProperties_To_SubResource_STATUS(&publicIPPrefix)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field PublicIPPrefix")
		}
		destination.PublicIPPrefix = &publicIPPrefix
	} else {
		destination.PublicIPPrefix = nil
	}

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

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

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

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

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

// Contains the DDoS protection settings of the public IP.
type DdosSettings struct {
	// DdosProtectionPlan: The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled
	DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"`

	// ProtectionMode: The DDoS protection mode of the public IP
	ProtectionMode *DdosSettings_ProtectionMode `json:"protectionMode,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 := &arm.DdosSettings{}

	// Set property "DdosProtectionPlan":
	if settings.DdosProtectionPlan != nil {
		ddosProtectionPlan_ARM, err := settings.DdosProtectionPlan.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		ddosProtectionPlan := *ddosProtectionPlan_ARM.(*arm.SubResource)
		result.DdosProtectionPlan = &ddosProtectionPlan
	}

	// Set property "ProtectionMode":
	if settings.ProtectionMode != nil {
		var temp string
		temp = string(*settings.ProtectionMode)
		protectionMode := arm.DdosSettings_ProtectionMode(temp)
		result.ProtectionMode = &protectionMode
	}
	return result, nil
}

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

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

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

	// Set property "ProtectionMode":
	if typedInput.ProtectionMode != nil {
		var temp string
		temp = string(*typedInput.ProtectionMode)
		protectionMode := DdosSettings_ProtectionMode(temp)
		settings.ProtectionMode = &protectionMode
	}

	// No error
	return nil
}

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

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

	// ProtectionMode
	if source.ProtectionMode != nil {
		protectionMode := *source.ProtectionMode
		protectionModeTemp := genruntime.ToEnum(protectionMode, ddosSettings_ProtectionMode_Values)
		settings.ProtectionMode = &protectionModeTemp
	} else {
		settings.ProtectionMode = nil
	}

	// No error
	return nil
}

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

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

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

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

	// ProtectionMode
	if source.ProtectionMode != nil {
		protectionMode := genruntime.ToEnum(string(*source.ProtectionMode), ddosSettings_ProtectionMode_Values)
		settings.ProtectionMode = &protectionMode
	} else {
		settings.ProtectionMode = nil
	}

	// No error
	return nil
}

// Contains the DDoS protection settings of the public IP.
type DdosSettings_STATUS struct {
	// DdosProtectionPlan: The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled
	DdosProtectionPlan *SubResource_STATUS `json:"ddosProtectionPlan,omitempty"`

	// ProtectionMode: The DDoS protection mode of the public IP
	ProtectionMode *DdosSettings_ProtectionMode_STATUS `json:"protectionMode,omitempty"`
}

var _ genruntime.FromARMConverter = &DdosSettings_STATUS{}

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

// 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.(arm.DdosSettings_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.DdosSettings_STATUS, got %T", armInput)
	}

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

	// Set property "ProtectionMode":
	if typedInput.ProtectionMode != nil {
		var temp string
		temp = string(*typedInput.ProtectionMode)
		protectionMode := DdosSettings_ProtectionMode_STATUS(temp)
		settings.ProtectionMode = &protectionMode
	}

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

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

	// ProtectionMode
	if source.ProtectionMode != nil {
		protectionMode := *source.ProtectionMode
		protectionModeTemp := genruntime.ToEnum(protectionMode, ddosSettings_ProtectionMode_STATUS_Values)
		settings.ProtectionMode = &protectionModeTemp
	} else {
		settings.ProtectionMode = 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 *storage.DdosSettings_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// ProtectionMode
	if settings.ProtectionMode != nil {
		protectionMode := string(*settings.ProtectionMode)
		destination.ProtectionMode = &protectionMode
	} else {
		destination.ProtectionMode = 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")
)

// Mapping from string to IPAllocationMethod
var iPAllocationMethod_Values = map[string]IPAllocationMethod{
	"dynamic": IPAllocationMethod_Dynamic,
	"static":  IPAllocationMethod_Static,
}

// IP address allocation method.
type IPAllocationMethod_STATUS string

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

// Mapping from string to IPAllocationMethod_STATUS
var iPAllocationMethod_STATUS_Values = map[string]IPAllocationMethod_STATUS{
	"dynamic": IPAllocationMethod_STATUS_Dynamic,
	"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 &arm.IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded{}
}

// 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.(arm.IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IPConfiguration_STATUS_PublicIPAddress_SubResourceEmbedded, 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 *storage.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 *storage.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 := &arm.IpTag{}

	// 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 &arm.IpTag{}
}

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (ipTag *IpTag) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.IpTag)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IpTag, 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 *storage.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 *storage.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 &arm.IpTag_STATUS{}
}

// 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.(arm.IpTag_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.IpTag_STATUS, 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 *storage.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 *storage.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")
)

// Mapping from string to IPVersion
var iPVersion_Values = map[string]IPVersion{
	"ipv4": IPVersion_IPv4,
	"ipv6": IPVersion_IPv6,
}

// IP address version.
type IPVersion_STATUS string

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

// Mapping from string to IPVersion_STATUS
var iPVersion_STATUS_Values = map[string]IPVersion_STATUS{
	"ipv4": IPVersion_STATUS_IPv4,
	"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 &arm.NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded{}
}

// 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.(arm.NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NatGateway_STATUS_PublicIPAddress_SubResourceEmbedded, 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 *storage.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 *storage.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 := &arm.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded{}

	// Set property "Id":
	if embedded.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*embedded.Reference)
		if err != nil {
			return nil, err
		}
		reference := referenceARMID
		result.Id = &reference
	}
	return result, nil
}

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

// 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.(arm.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NatGatewaySpec_PublicIPAddress_SubResourceEmbedded, 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 *storage.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 *storage.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"`

	// DomainNameLabelScope: The domain name label scope. If a domain name label and a domain name label scope are specified,
	// an A DNS record is created for the public IP in the Microsoft Azure DNS system with a hashed value includes in FQDN.
	DomainNameLabelScope *PublicIPAddressDnsSettings_DomainNameLabelScope `json:"domainNameLabelScope,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 := &arm.PublicIPAddressDnsSettings{}

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

	// Set property "DomainNameLabelScope":
	if settings.DomainNameLabelScope != nil {
		var temp string
		temp = string(*settings.DomainNameLabelScope)
		domainNameLabelScope := arm.PublicIPAddressDnsSettings_DomainNameLabelScope(temp)
		result.DomainNameLabelScope = &domainNameLabelScope
	}

	// 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 &arm.PublicIPAddressDnsSettings{}
}

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

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

	// Set property "DomainNameLabelScope":
	if typedInput.DomainNameLabelScope != nil {
		var temp string
		temp = string(*typedInput.DomainNameLabelScope)
		domainNameLabelScope := PublicIPAddressDnsSettings_DomainNameLabelScope(temp)
		settings.DomainNameLabelScope = &domainNameLabelScope
	}

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

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

	// DomainNameLabelScope
	if source.DomainNameLabelScope != nil {
		domainNameLabelScope := *source.DomainNameLabelScope
		domainNameLabelScopeTemp := genruntime.ToEnum(domainNameLabelScope, publicIPAddressDnsSettings_DomainNameLabelScope_Values)
		settings.DomainNameLabelScope = &domainNameLabelScopeTemp
	} else {
		settings.DomainNameLabelScope = nil
	}

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

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

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

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

	// DomainNameLabelScope
	if source.DomainNameLabelScope != nil {
		domainNameLabelScope := genruntime.ToEnum(string(*source.DomainNameLabelScope), publicIPAddressDnsSettings_DomainNameLabelScope_Values)
		settings.DomainNameLabelScope = &domainNameLabelScope
	} else {
		settings.DomainNameLabelScope = nil
	}

	// 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"`

	// DomainNameLabelScope: The domain name label scope. If a domain name label and a domain name label scope are specified,
	// an A DNS record is created for the public IP in the Microsoft Azure DNS system with a hashed value includes in FQDN.
	DomainNameLabelScope *PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS `json:"domainNameLabelScope,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 &arm.PublicIPAddressDnsSettings_STATUS{}
}

// 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.(arm.PublicIPAddressDnsSettings_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PublicIPAddressDnsSettings_STATUS, got %T", armInput)
	}

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

	// Set property "DomainNameLabelScope":
	if typedInput.DomainNameLabelScope != nil {
		var temp string
		temp = string(*typedInput.DomainNameLabelScope)
		domainNameLabelScope := PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS(temp)
		settings.DomainNameLabelScope = &domainNameLabelScope
	}

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

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

	// DomainNameLabelScope
	if source.DomainNameLabelScope != nil {
		domainNameLabelScope := *source.DomainNameLabelScope
		domainNameLabelScopeTemp := genruntime.ToEnum(domainNameLabelScope, publicIPAddressDnsSettings_DomainNameLabelScope_STATUS_Values)
		settings.DomainNameLabelScope = &domainNameLabelScopeTemp
	} else {
		settings.DomainNameLabelScope = nil
	}

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

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

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

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

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type PublicIPAddressOperatorSpec struct {
	// ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Delete","Detach"}
type PublicIPAddressPropertiesFormat_DeleteOption string

const (
	PublicIPAddressPropertiesFormat_DeleteOption_Delete = PublicIPAddressPropertiesFormat_DeleteOption("Delete")
	PublicIPAddressPropertiesFormat_DeleteOption_Detach = PublicIPAddressPropertiesFormat_DeleteOption("Detach")
)

// Mapping from string to PublicIPAddressPropertiesFormat_DeleteOption
var publicIPAddressPropertiesFormat_DeleteOption_Values = map[string]PublicIPAddressPropertiesFormat_DeleteOption{
	"delete": PublicIPAddressPropertiesFormat_DeleteOption_Delete,
	"detach": PublicIPAddressPropertiesFormat_DeleteOption_Detach,
}

type PublicIPAddressPropertiesFormat_DeleteOption_STATUS string

const (
	PublicIPAddressPropertiesFormat_DeleteOption_STATUS_Delete = PublicIPAddressPropertiesFormat_DeleteOption_STATUS("Delete")
	PublicIPAddressPropertiesFormat_DeleteOption_STATUS_Detach = PublicIPAddressPropertiesFormat_DeleteOption_STATUS("Detach")
)

// Mapping from string to PublicIPAddressPropertiesFormat_DeleteOption_STATUS
var publicIPAddressPropertiesFormat_DeleteOption_STATUS_Values = map[string]PublicIPAddressPropertiesFormat_DeleteOption_STATUS{
	"delete": PublicIPAddressPropertiesFormat_DeleteOption_STATUS_Delete,
	"detach": PublicIPAddressPropertiesFormat_DeleteOption_STATUS_Detach,
}

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

// Mapping from string to PublicIPAddressPropertiesFormat_MigrationPhase_STATUS
var publicIPAddressPropertiesFormat_MigrationPhase_STATUS_Values = map[string]PublicIPAddressPropertiesFormat_MigrationPhase_STATUS{
	"abort":     PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Abort,
	"commit":    PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Commit,
	"committed": PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_Committed,
	"none":      PublicIPAddressPropertiesFormat_MigrationPhase_STATUS_None,
	"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 := &arm.PublicIPAddressSku{}

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

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

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

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

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

	// Set property "Tier":
	if typedInput.Tier != nil {
		var temp string
		temp = string(*typedInput.Tier)
		tier := PublicIPAddressSku_Tier(temp)
		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 *storage.PublicIPAddressSku) error {

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

	// Tier
	if source.Tier != nil {
		tier := *source.Tier
		tierTemp := genruntime.ToEnum(tier, publicIPAddressSku_Tier_Values)
		addressSku.Tier = &tierTemp
	} 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 *storage.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 := genruntime.ToEnum(string(*source.Name), publicIPAddressSku_Name_Values)
		addressSku.Name = &name
	} else {
		addressSku.Name = nil
	}

	// Tier
	if source.Tier != nil {
		tier := genruntime.ToEnum(string(*source.Tier), publicIPAddressSku_Tier_Values)
		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 &arm.PublicIPAddressSku_STATUS{}
}

// 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.(arm.PublicIPAddressSku_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PublicIPAddressSku_STATUS, got %T", armInput)
	}

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

	// Set property "Tier":
	if typedInput.Tier != nil {
		var temp string
		temp = string(*typedInput.Tier)
		tier := PublicIPAddressSku_Tier_STATUS(temp)
		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 *storage.PublicIPAddressSku_STATUS) error {

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

	// Tier
	if source.Tier != nil {
		tier := *source.Tier
		tierTemp := genruntime.ToEnum(tier, publicIPAddressSku_Tier_STATUS_Values)
		addressSku.Tier = &tierTemp
	} 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 *storage.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 := &arm.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded{}

	// Set property "Id":
	if embedded.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*embedded.Reference)
		if err != nil {
			return nil, err
		}
		reference := referenceARMID
		result.Id = &reference
	}
	return result, nil
}

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

// 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.(arm.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PublicIPAddressSpec_PublicIPAddress_SubResourceEmbedded, 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 *storage.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 *storage.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={"Disabled","Enabled","VirtualNetworkInherited"}
type DdosSettings_ProtectionMode string

const (
	DdosSettings_ProtectionMode_Disabled                = DdosSettings_ProtectionMode("Disabled")
	DdosSettings_ProtectionMode_Enabled                 = DdosSettings_ProtectionMode("Enabled")
	DdosSettings_ProtectionMode_VirtualNetworkInherited = DdosSettings_ProtectionMode("VirtualNetworkInherited")
)

// Mapping from string to DdosSettings_ProtectionMode
var ddosSettings_ProtectionMode_Values = map[string]DdosSettings_ProtectionMode{
	"disabled":                DdosSettings_ProtectionMode_Disabled,
	"enabled":                 DdosSettings_ProtectionMode_Enabled,
	"virtualnetworkinherited": DdosSettings_ProtectionMode_VirtualNetworkInherited,
}

type DdosSettings_ProtectionMode_STATUS string

const (
	DdosSettings_ProtectionMode_STATUS_Disabled                = DdosSettings_ProtectionMode_STATUS("Disabled")
	DdosSettings_ProtectionMode_STATUS_Enabled                 = DdosSettings_ProtectionMode_STATUS("Enabled")
	DdosSettings_ProtectionMode_STATUS_VirtualNetworkInherited = DdosSettings_ProtectionMode_STATUS("VirtualNetworkInherited")
)

// Mapping from string to DdosSettings_ProtectionMode_STATUS
var ddosSettings_ProtectionMode_STATUS_Values = map[string]DdosSettings_ProtectionMode_STATUS{
	"disabled":                DdosSettings_ProtectionMode_STATUS_Disabled,
	"enabled":                 DdosSettings_ProtectionMode_STATUS_Enabled,
	"virtualnetworkinherited": DdosSettings_ProtectionMode_STATUS_VirtualNetworkInherited,
}

// +kubebuilder:validation:Enum={"NoReuse","ResourceGroupReuse","SubscriptionReuse","TenantReuse"}
type PublicIPAddressDnsSettings_DomainNameLabelScope string

const (
	PublicIPAddressDnsSettings_DomainNameLabelScope_NoReuse            = PublicIPAddressDnsSettings_DomainNameLabelScope("NoReuse")
	PublicIPAddressDnsSettings_DomainNameLabelScope_ResourceGroupReuse = PublicIPAddressDnsSettings_DomainNameLabelScope("ResourceGroupReuse")
	PublicIPAddressDnsSettings_DomainNameLabelScope_SubscriptionReuse  = PublicIPAddressDnsSettings_DomainNameLabelScope("SubscriptionReuse")
	PublicIPAddressDnsSettings_DomainNameLabelScope_TenantReuse        = PublicIPAddressDnsSettings_DomainNameLabelScope("TenantReuse")
)

// Mapping from string to PublicIPAddressDnsSettings_DomainNameLabelScope
var publicIPAddressDnsSettings_DomainNameLabelScope_Values = map[string]PublicIPAddressDnsSettings_DomainNameLabelScope{
	"noreuse":            PublicIPAddressDnsSettings_DomainNameLabelScope_NoReuse,
	"resourcegroupreuse": PublicIPAddressDnsSettings_DomainNameLabelScope_ResourceGroupReuse,
	"subscriptionreuse":  PublicIPAddressDnsSettings_DomainNameLabelScope_SubscriptionReuse,
	"tenantreuse":        PublicIPAddressDnsSettings_DomainNameLabelScope_TenantReuse,
}

type PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS string

const (
	PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_NoReuse            = PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS("NoReuse")
	PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_ResourceGroupReuse = PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS("ResourceGroupReuse")
	PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_SubscriptionReuse  = PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS("SubscriptionReuse")
	PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_TenantReuse        = PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS("TenantReuse")
)

// Mapping from string to PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS
var publicIPAddressDnsSettings_DomainNameLabelScope_STATUS_Values = map[string]PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS{
	"noreuse":            PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_NoReuse,
	"resourcegroupreuse": PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_ResourceGroupReuse,
	"subscriptionreuse":  PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_SubscriptionReuse,
	"tenantreuse":        PublicIPAddressDnsSettings_DomainNameLabelScope_STATUS_TenantReuse,
}

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

const (
	PublicIPAddressSku_Name_Basic    = PublicIPAddressSku_Name("Basic")
	PublicIPAddressSku_Name_Standard = PublicIPAddressSku_Name("Standard")
)

// Mapping from string to PublicIPAddressSku_Name
var publicIPAddressSku_Name_Values = map[string]PublicIPAddressSku_Name{
	"basic":    PublicIPAddressSku_Name_Basic,
	"standard": PublicIPAddressSku_Name_Standard,
}

type PublicIPAddressSku_Name_STATUS string

const (
	PublicIPAddressSku_Name_STATUS_Basic    = PublicIPAddressSku_Name_STATUS("Basic")
	PublicIPAddressSku_Name_STATUS_Standard = PublicIPAddressSku_Name_STATUS("Standard")
)

// Mapping from string to PublicIPAddressSku_Name_STATUS
var publicIPAddressSku_Name_STATUS_Values = map[string]PublicIPAddressSku_Name_STATUS{
	"basic":    PublicIPAddressSku_Name_STATUS_Basic,
	"standard": PublicIPAddressSku_Name_STATUS_Standard,
}

// +kubebuilder:validation:Enum={"Global","Regional"}
type PublicIPAddressSku_Tier string

const (
	PublicIPAddressSku_Tier_Global   = PublicIPAddressSku_Tier("Global")
	PublicIPAddressSku_Tier_Regional = PublicIPAddressSku_Tier("Regional")
)

// Mapping from string to PublicIPAddressSku_Tier
var publicIPAddressSku_Tier_Values = map[string]PublicIPAddressSku_Tier{
	"global":   PublicIPAddressSku_Tier_Global,
	"regional": PublicIPAddressSku_Tier_Regional,
}

type PublicIPAddressSku_Tier_STATUS string

const (
	PublicIPAddressSku_Tier_STATUS_Global   = PublicIPAddressSku_Tier_STATUS("Global")
	PublicIPAddressSku_Tier_STATUS_Regional = PublicIPAddressSku_Tier_STATUS("Regional")
)

// Mapping from string to PublicIPAddressSku_Tier_STATUS
var publicIPAddressSku_Tier_STATUS_Values = map[string]PublicIPAddressSku_Tier_STATUS{
	"global":   PublicIPAddressSku_Tier_STATUS_Global,
	"regional": PublicIPAddressSku_Tier_STATUS_Regional,
}

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