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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/compute/v1api20240302/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/compute/v1api20240302/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,compute}
// +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: /compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/DiskRP.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}
type Disk struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Disk_Spec   `json:"spec,omitempty"`
	Status            Disk_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Disk{}

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

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

var _ conversion.Convertible = &Disk{}

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

	return disk.AssignProperties_From_Disk(source)
}

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

	return disk.AssignProperties_To_Disk(destination)
}

var _ configmaps.Exporter = &Disk{}

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

var _ secrets.Exporter = &Disk{}

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

var _ genruntime.ImportableResource = &Disk{}

// InitializeSpec initializes the spec for this resource from the given status
func (disk *Disk) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Disk_STATUS); ok {
		return disk.Spec.Initialize_From_Disk_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Disk{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Compute/disks"
func (disk *Disk) GetType() string {
	return "Microsoft.Compute/disks"
}

// NewEmptyStatus returns a new empty (blank) status
func (disk *Disk) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Disk_STATUS{}
}

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

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

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

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

	disk.Status = st
	return nil
}

// AssignProperties_From_Disk populates our Disk from the provided source Disk
func (disk *Disk) AssignProperties_From_Disk(source *storage.Disk) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Disk populates the provided destination Disk from our Disk
func (disk *Disk) AssignProperties_To_Disk(destination *storage.Disk) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/DiskRP.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}
type DiskList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Disk `json:"items"`
}

// +kubebuilder:validation:Enum={"2024-03-02"}
type APIVersion string

const APIVersion_Value = APIVersion("2024-03-02")

type Disk_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"`

	// BurstingEnabled: Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is
	// disabled by default. Does not apply to Ultra disks.
	BurstingEnabled *bool `json:"burstingEnabled,omitempty"`

	// CompletionPercent: Percentage complete for the background copy when a resource is created via the CopyStart operation.
	CompletionPercent *float64 `json:"completionPercent,omitempty"`

	// +kubebuilder:validation:Required
	// CreationData: Disk source information. CreationData information cannot be changed after the disk has been created.
	CreationData *CreationData `json:"creationData,omitempty"`

	// DataAccessAuthMode: Additional authentication requirements when exporting or uploading to a disk or snapshot.
	DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"`

	// DiskAccessReference: ARM id of the DiskAccess resource for using private endpoints on disks.
	DiskAccessReference *genruntime.ResourceReference `armReference:"DiskAccessId" json:"diskAccessReference,omitempty"`

	// DiskIOPSReadOnly: The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One
	// operation can transfer between 4k and 256k bytes.
	DiskIOPSReadOnly *int `json:"diskIOPSReadOnly,omitempty"`

	// DiskIOPSReadWrite: The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can
	// transfer between 4k and 256k bytes.
	DiskIOPSReadWrite *int `json:"diskIOPSReadWrite,omitempty"`

	// DiskMBpsReadOnly: The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly.
	// MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.
	DiskMBpsReadOnly *int `json:"diskMBpsReadOnly,omitempty"`

	// DiskMBpsReadWrite: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes
	// per second - MB here uses the ISO notation, of powers of 10.
	DiskMBpsReadWrite *int `json:"diskMBpsReadWrite,omitempty"`

	// DiskSizeGB: If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to
	// create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only
	// allowed if the disk is not attached to a running VM, and can only increase the disk's size.
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// Encryption: Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
	Encryption *Encryption `json:"encryption,omitempty"`

	// EncryptionSettingsCollection: Encryption settings collection used for Azure Disk Encryption, can contain multiple
	// encryption settings per disk or snapshot.
	EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"`

	// ExtendedLocation: The extended location where the disk will be created. Extended location cannot be changed.
	ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`

	// HyperVGeneration: The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
	HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"`

	// +kubebuilder:validation:Required
	// Location: The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// MaxShares: The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a
	// disk that can be mounted on multiple VMs at the same time.
	MaxShares *int `json:"maxShares,omitempty"`

	// NetworkAccessPolicy: Policy for accessing the disk via network.
	NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"`

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

	// OptimizedForFrequentAttach: Setting this property to true improves reliability and performance of data disks that are
	// frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should
	// not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault
	// domain of the virtual machine.
	OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"`

	// OsType: The Operating System type.
	OsType *OperatingSystemTypes `json:"osType,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"`

	// PublicNetworkAccess: Policy for controlling export on the disk.
	PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// PurchasePlan: Purchase plan information for the the image from which the OS disk was created. E.g. - {name:
	// 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}
	PurchasePlan *DiskPurchasePlan `json:"purchasePlan,omitempty"`

	// SecurityProfile: Contains the security related information for the resource.
	SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"`

	// Sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS,
	// or PremiumV2_LRS.
	Sku *DiskSku `json:"sku,omitempty"`

	// SupportedCapabilities: List of supported capabilities for the image from which the OS disk was created.
	SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"`

	// SupportsHibernation: Indicates the OS on a disk supports hibernation.
	SupportsHibernation *bool `json:"supportsHibernation,omitempty"`

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

	// Tier: Performance tier of the disk (e.g, P4, S10) as described here:
	// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.
	Tier *string `json:"tier,omitempty"`

	// Zones: The Logical zone list for Disk.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ARMTransformer = &Disk_Spec{}

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

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

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

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

	// Set property "Properties":
	if disk.BurstingEnabled != nil ||
		disk.CompletionPercent != nil ||
		disk.CreationData != nil ||
		disk.DataAccessAuthMode != nil ||
		disk.DiskAccessReference != nil ||
		disk.DiskIOPSReadOnly != nil ||
		disk.DiskIOPSReadWrite != nil ||
		disk.DiskMBpsReadOnly != nil ||
		disk.DiskMBpsReadWrite != nil ||
		disk.DiskSizeGB != nil ||
		disk.Encryption != nil ||
		disk.EncryptionSettingsCollection != nil ||
		disk.HyperVGeneration != nil ||
		disk.MaxShares != nil ||
		disk.NetworkAccessPolicy != nil ||
		disk.OptimizedForFrequentAttach != nil ||
		disk.OsType != nil ||
		disk.PublicNetworkAccess != nil ||
		disk.PurchasePlan != nil ||
		disk.SecurityProfile != nil ||
		disk.SupportedCapabilities != nil ||
		disk.SupportsHibernation != nil ||
		disk.Tier != nil {
		result.Properties = &arm.DiskProperties{}
	}
	if disk.BurstingEnabled != nil {
		burstingEnabled := *disk.BurstingEnabled
		result.Properties.BurstingEnabled = &burstingEnabled
	}
	if disk.CompletionPercent != nil {
		completionPercent := *disk.CompletionPercent
		result.Properties.CompletionPercent = &completionPercent
	}
	if disk.CreationData != nil {
		creationData_ARM, err := disk.CreationData.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		creationData := *creationData_ARM.(*arm.CreationData)
		result.Properties.CreationData = &creationData
	}
	if disk.DataAccessAuthMode != nil {
		var temp string
		temp = string(*disk.DataAccessAuthMode)
		dataAccessAuthMode := arm.DataAccessAuthMode(temp)
		result.Properties.DataAccessAuthMode = &dataAccessAuthMode
	}
	if disk.DiskAccessReference != nil {
		diskAccessIdARMID, err := resolved.ResolvedReferences.Lookup(*disk.DiskAccessReference)
		if err != nil {
			return nil, err
		}
		diskAccessId := diskAccessIdARMID
		result.Properties.DiskAccessId = &diskAccessId
	}
	if disk.DiskIOPSReadOnly != nil {
		diskIOPSReadOnly := *disk.DiskIOPSReadOnly
		result.Properties.DiskIOPSReadOnly = &diskIOPSReadOnly
	}
	if disk.DiskIOPSReadWrite != nil {
		diskIOPSReadWrite := *disk.DiskIOPSReadWrite
		result.Properties.DiskIOPSReadWrite = &diskIOPSReadWrite
	}
	if disk.DiskMBpsReadOnly != nil {
		diskMBpsReadOnly := *disk.DiskMBpsReadOnly
		result.Properties.DiskMBpsReadOnly = &diskMBpsReadOnly
	}
	if disk.DiskMBpsReadWrite != nil {
		diskMBpsReadWrite := *disk.DiskMBpsReadWrite
		result.Properties.DiskMBpsReadWrite = &diskMBpsReadWrite
	}
	if disk.DiskSizeGB != nil {
		diskSizeGB := *disk.DiskSizeGB
		result.Properties.DiskSizeGB = &diskSizeGB
	}
	if disk.Encryption != nil {
		encryption_ARM, err := disk.Encryption.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		encryption := *encryption_ARM.(*arm.Encryption)
		result.Properties.Encryption = &encryption
	}
	if disk.EncryptionSettingsCollection != nil {
		encryptionSettingsCollection_ARM, err := disk.EncryptionSettingsCollection.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		encryptionSettingsCollection := *encryptionSettingsCollection_ARM.(*arm.EncryptionSettingsCollection)
		result.Properties.EncryptionSettingsCollection = &encryptionSettingsCollection
	}
	if disk.HyperVGeneration != nil {
		var temp string
		temp = string(*disk.HyperVGeneration)
		hyperVGeneration := arm.HyperVGeneration(temp)
		result.Properties.HyperVGeneration = &hyperVGeneration
	}
	if disk.MaxShares != nil {
		maxShares := *disk.MaxShares
		result.Properties.MaxShares = &maxShares
	}
	if disk.NetworkAccessPolicy != nil {
		var temp string
		temp = string(*disk.NetworkAccessPolicy)
		networkAccessPolicy := arm.NetworkAccessPolicy(temp)
		result.Properties.NetworkAccessPolicy = &networkAccessPolicy
	}
	if disk.OptimizedForFrequentAttach != nil {
		optimizedForFrequentAttach := *disk.OptimizedForFrequentAttach
		result.Properties.OptimizedForFrequentAttach = &optimizedForFrequentAttach
	}
	if disk.OsType != nil {
		var temp string
		temp = string(*disk.OsType)
		osType := arm.OperatingSystemTypes(temp)
		result.Properties.OsType = &osType
	}
	if disk.PublicNetworkAccess != nil {
		var temp string
		temp = string(*disk.PublicNetworkAccess)
		publicNetworkAccess := arm.PublicNetworkAccess(temp)
		result.Properties.PublicNetworkAccess = &publicNetworkAccess
	}
	if disk.PurchasePlan != nil {
		purchasePlan_ARM, err := disk.PurchasePlan.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		purchasePlan := *purchasePlan_ARM.(*arm.DiskPurchasePlan)
		result.Properties.PurchasePlan = &purchasePlan
	}
	if disk.SecurityProfile != nil {
		securityProfile_ARM, err := disk.SecurityProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		securityProfile := *securityProfile_ARM.(*arm.DiskSecurityProfile)
		result.Properties.SecurityProfile = &securityProfile
	}
	if disk.SupportedCapabilities != nil {
		supportedCapabilities_ARM, err := disk.SupportedCapabilities.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		supportedCapabilities := *supportedCapabilities_ARM.(*arm.SupportedCapabilities)
		result.Properties.SupportedCapabilities = &supportedCapabilities
	}
	if disk.SupportsHibernation != nil {
		supportsHibernation := *disk.SupportsHibernation
		result.Properties.SupportsHibernation = &supportsHibernation
	}
	if disk.Tier != nil {
		tier := *disk.Tier
		result.Properties.Tier = &tier
	}

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

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

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

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

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

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

	// Set property "BurstingEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BurstingEnabled != nil {
			burstingEnabled := *typedInput.Properties.BurstingEnabled
			disk.BurstingEnabled = &burstingEnabled
		}
	}

	// Set property "CompletionPercent":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CompletionPercent != nil {
			completionPercent := *typedInput.Properties.CompletionPercent
			disk.CompletionPercent = &completionPercent
		}
	}

	// Set property "CreationData":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreationData != nil {
			var creationData1 CreationData
			err := creationData1.PopulateFromARM(owner, *typedInput.Properties.CreationData)
			if err != nil {
				return err
			}
			creationData := creationData1
			disk.CreationData = &creationData
		}
	}

	// Set property "DataAccessAuthMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DataAccessAuthMode != nil {
			var temp string
			temp = string(*typedInput.Properties.DataAccessAuthMode)
			dataAccessAuthMode := DataAccessAuthMode(temp)
			disk.DataAccessAuthMode = &dataAccessAuthMode
		}
	}

	// no assignment for property "DiskAccessReference"

	// Set property "DiskIOPSReadOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskIOPSReadOnly != nil {
			diskIOPSReadOnly := *typedInput.Properties.DiskIOPSReadOnly
			disk.DiskIOPSReadOnly = &diskIOPSReadOnly
		}
	}

	// Set property "DiskIOPSReadWrite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskIOPSReadWrite != nil {
			diskIOPSReadWrite := *typedInput.Properties.DiskIOPSReadWrite
			disk.DiskIOPSReadWrite = &diskIOPSReadWrite
		}
	}

	// Set property "DiskMBpsReadOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskMBpsReadOnly != nil {
			diskMBpsReadOnly := *typedInput.Properties.DiskMBpsReadOnly
			disk.DiskMBpsReadOnly = &diskMBpsReadOnly
		}
	}

	// Set property "DiskMBpsReadWrite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskMBpsReadWrite != nil {
			diskMBpsReadWrite := *typedInput.Properties.DiskMBpsReadWrite
			disk.DiskMBpsReadWrite = &diskMBpsReadWrite
		}
	}

	// Set property "DiskSizeGB":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskSizeGB != nil {
			diskSizeGB := *typedInput.Properties.DiskSizeGB
			disk.DiskSizeGB = &diskSizeGB
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 Encryption
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			disk.Encryption = &encryption
		}
	}

	// Set property "EncryptionSettingsCollection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EncryptionSettingsCollection != nil {
			var encryptionSettingsCollection1 EncryptionSettingsCollection
			err := encryptionSettingsCollection1.PopulateFromARM(owner, *typedInput.Properties.EncryptionSettingsCollection)
			if err != nil {
				return err
			}
			encryptionSettingsCollection := encryptionSettingsCollection1
			disk.EncryptionSettingsCollection = &encryptionSettingsCollection
		}
	}

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

	// Set property "HyperVGeneration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HyperVGeneration != nil {
			var temp string
			temp = string(*typedInput.Properties.HyperVGeneration)
			hyperVGeneration := HyperVGeneration(temp)
			disk.HyperVGeneration = &hyperVGeneration
		}
	}

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

	// Set property "MaxShares":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaxShares != nil {
			maxShares := *typedInput.Properties.MaxShares
			disk.MaxShares = &maxShares
		}
	}

	// Set property "NetworkAccessPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAccessPolicy != nil {
			var temp string
			temp = string(*typedInput.Properties.NetworkAccessPolicy)
			networkAccessPolicy := NetworkAccessPolicy(temp)
			disk.NetworkAccessPolicy = &networkAccessPolicy
		}
	}

	// no assignment for property "OperatorSpec"

	// Set property "OptimizedForFrequentAttach":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.OptimizedForFrequentAttach != nil {
			optimizedForFrequentAttach := *typedInput.Properties.OptimizedForFrequentAttach
			disk.OptimizedForFrequentAttach = &optimizedForFrequentAttach
		}
	}

	// Set property "OsType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.OsType != nil {
			var temp string
			temp = string(*typedInput.Properties.OsType)
			osType := OperatingSystemTypes(temp)
			disk.OsType = &osType
		}
	}

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

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := PublicNetworkAccess(temp)
			disk.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "PurchasePlan":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PurchasePlan != nil {
			var purchasePlan1 DiskPurchasePlan
			err := purchasePlan1.PopulateFromARM(owner, *typedInput.Properties.PurchasePlan)
			if err != nil {
				return err
			}
			purchasePlan := purchasePlan1
			disk.PurchasePlan = &purchasePlan
		}
	}

	// Set property "SecurityProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SecurityProfile != nil {
			var securityProfile1 DiskSecurityProfile
			err := securityProfile1.PopulateFromARM(owner, *typedInput.Properties.SecurityProfile)
			if err != nil {
				return err
			}
			securityProfile := securityProfile1
			disk.SecurityProfile = &securityProfile
		}
	}

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

	// Set property "SupportedCapabilities":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportedCapabilities != nil {
			var supportedCapabilities1 SupportedCapabilities
			err := supportedCapabilities1.PopulateFromARM(owner, *typedInput.Properties.SupportedCapabilities)
			if err != nil {
				return err
			}
			supportedCapabilities := supportedCapabilities1
			disk.SupportedCapabilities = &supportedCapabilities
		}
	}

	// Set property "SupportsHibernation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportsHibernation != nil {
			supportsHibernation := *typedInput.Properties.SupportsHibernation
			disk.SupportsHibernation = &supportsHibernation
		}
	}

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

	// Set property "Tier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Tier != nil {
			tier := *typedInput.Properties.Tier
			disk.Tier = &tier
		}
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Disk_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Disk_Spec{}
	err := disk.AssignProperties_To_Disk_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_Disk_Spec populates our Disk_Spec from the provided source Disk_Spec
func (disk *Disk_Spec) AssignProperties_From_Disk_Spec(source *storage.Disk_Spec) error {

	// AzureName
	disk.AzureName = source.AzureName

	// BurstingEnabled
	if source.BurstingEnabled != nil {
		burstingEnabled := *source.BurstingEnabled
		disk.BurstingEnabled = &burstingEnabled
	} else {
		disk.BurstingEnabled = nil
	}

	// CompletionPercent
	if source.CompletionPercent != nil {
		completionPercent := *source.CompletionPercent
		disk.CompletionPercent = &completionPercent
	} else {
		disk.CompletionPercent = nil
	}

	// CreationData
	if source.CreationData != nil {
		var creationDatum CreationData
		err := creationDatum.AssignProperties_From_CreationData(source.CreationData)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CreationData() to populate field CreationData")
		}
		disk.CreationData = &creationDatum
	} else {
		disk.CreationData = nil
	}

	// DataAccessAuthMode
	if source.DataAccessAuthMode != nil {
		dataAccessAuthMode := *source.DataAccessAuthMode
		dataAccessAuthModeTemp := genruntime.ToEnum(dataAccessAuthMode, dataAccessAuthMode_Values)
		disk.DataAccessAuthMode = &dataAccessAuthModeTemp
	} else {
		disk.DataAccessAuthMode = nil
	}

	// DiskAccessReference
	if source.DiskAccessReference != nil {
		diskAccessReference := source.DiskAccessReference.Copy()
		disk.DiskAccessReference = &diskAccessReference
	} else {
		disk.DiskAccessReference = nil
	}

	// DiskIOPSReadOnly
	disk.DiskIOPSReadOnly = genruntime.ClonePointerToInt(source.DiskIOPSReadOnly)

	// DiskIOPSReadWrite
	disk.DiskIOPSReadWrite = genruntime.ClonePointerToInt(source.DiskIOPSReadWrite)

	// DiskMBpsReadOnly
	disk.DiskMBpsReadOnly = genruntime.ClonePointerToInt(source.DiskMBpsReadOnly)

	// DiskMBpsReadWrite
	disk.DiskMBpsReadWrite = genruntime.ClonePointerToInt(source.DiskMBpsReadWrite)

	// DiskSizeGB
	disk.DiskSizeGB = genruntime.ClonePointerToInt(source.DiskSizeGB)

	// Encryption
	if source.Encryption != nil {
		var encryption Encryption
		err := encryption.AssignProperties_From_Encryption(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Encryption() to populate field Encryption")
		}
		disk.Encryption = &encryption
	} else {
		disk.Encryption = nil
	}

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

	// HyperVGeneration
	if source.HyperVGeneration != nil {
		hyperVGeneration := *source.HyperVGeneration
		hyperVGenerationTemp := genruntime.ToEnum(hyperVGeneration, hyperVGeneration_Values)
		disk.HyperVGeneration = &hyperVGenerationTemp
	} else {
		disk.HyperVGeneration = nil
	}

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

	// MaxShares
	disk.MaxShares = genruntime.ClonePointerToInt(source.MaxShares)

	// NetworkAccessPolicy
	if source.NetworkAccessPolicy != nil {
		networkAccessPolicy := *source.NetworkAccessPolicy
		networkAccessPolicyTemp := genruntime.ToEnum(networkAccessPolicy, networkAccessPolicy_Values)
		disk.NetworkAccessPolicy = &networkAccessPolicyTemp
	} else {
		disk.NetworkAccessPolicy = nil
	}

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

	// OptimizedForFrequentAttach
	if source.OptimizedForFrequentAttach != nil {
		optimizedForFrequentAttach := *source.OptimizedForFrequentAttach
		disk.OptimizedForFrequentAttach = &optimizedForFrequentAttach
	} else {
		disk.OptimizedForFrequentAttach = nil
	}

	// OsType
	if source.OsType != nil {
		osType := *source.OsType
		osTypeTemp := genruntime.ToEnum(osType, operatingSystemTypes_Values)
		disk.OsType = &osTypeTemp
	} else {
		disk.OsType = nil
	}

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, publicNetworkAccess_Values)
		disk.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		disk.PublicNetworkAccess = nil
	}

	// PurchasePlan
	if source.PurchasePlan != nil {
		var purchasePlan DiskPurchasePlan
		err := purchasePlan.AssignProperties_From_DiskPurchasePlan(source.PurchasePlan)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DiskPurchasePlan() to populate field PurchasePlan")
		}
		disk.PurchasePlan = &purchasePlan
	} else {
		disk.PurchasePlan = nil
	}

	// SecurityProfile
	if source.SecurityProfile != nil {
		var securityProfile DiskSecurityProfile
		err := securityProfile.AssignProperties_From_DiskSecurityProfile(source.SecurityProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DiskSecurityProfile() to populate field SecurityProfile")
		}
		disk.SecurityProfile = &securityProfile
	} else {
		disk.SecurityProfile = nil
	}

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

	// SupportedCapabilities
	if source.SupportedCapabilities != nil {
		var supportedCapability SupportedCapabilities
		err := supportedCapability.AssignProperties_From_SupportedCapabilities(source.SupportedCapabilities)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SupportedCapabilities() to populate field SupportedCapabilities")
		}
		disk.SupportedCapabilities = &supportedCapability
	} else {
		disk.SupportedCapabilities = nil
	}

	// SupportsHibernation
	if source.SupportsHibernation != nil {
		supportsHibernation := *source.SupportsHibernation
		disk.SupportsHibernation = &supportsHibernation
	} else {
		disk.SupportsHibernation = nil
	}

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

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = disk.AzureName

	// BurstingEnabled
	if disk.BurstingEnabled != nil {
		burstingEnabled := *disk.BurstingEnabled
		destination.BurstingEnabled = &burstingEnabled
	} else {
		destination.BurstingEnabled = nil
	}

	// CompletionPercent
	if disk.CompletionPercent != nil {
		completionPercent := *disk.CompletionPercent
		destination.CompletionPercent = &completionPercent
	} else {
		destination.CompletionPercent = nil
	}

	// CreationData
	if disk.CreationData != nil {
		var creationDatum storage.CreationData
		err := disk.CreationData.AssignProperties_To_CreationData(&creationDatum)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CreationData() to populate field CreationData")
		}
		destination.CreationData = &creationDatum
	} else {
		destination.CreationData = nil
	}

	// DataAccessAuthMode
	if disk.DataAccessAuthMode != nil {
		dataAccessAuthMode := string(*disk.DataAccessAuthMode)
		destination.DataAccessAuthMode = &dataAccessAuthMode
	} else {
		destination.DataAccessAuthMode = nil
	}

	// DiskAccessReference
	if disk.DiskAccessReference != nil {
		diskAccessReference := disk.DiskAccessReference.Copy()
		destination.DiskAccessReference = &diskAccessReference
	} else {
		destination.DiskAccessReference = nil
	}

	// DiskIOPSReadOnly
	destination.DiskIOPSReadOnly = genruntime.ClonePointerToInt(disk.DiskIOPSReadOnly)

	// DiskIOPSReadWrite
	destination.DiskIOPSReadWrite = genruntime.ClonePointerToInt(disk.DiskIOPSReadWrite)

	// DiskMBpsReadOnly
	destination.DiskMBpsReadOnly = genruntime.ClonePointerToInt(disk.DiskMBpsReadOnly)

	// DiskMBpsReadWrite
	destination.DiskMBpsReadWrite = genruntime.ClonePointerToInt(disk.DiskMBpsReadWrite)

	// DiskSizeGB
	destination.DiskSizeGB = genruntime.ClonePointerToInt(disk.DiskSizeGB)

	// Encryption
	if disk.Encryption != nil {
		var encryption storage.Encryption
		err := disk.Encryption.AssignProperties_To_Encryption(&encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption")
		}
		destination.Encryption = &encryption
	} else {
		destination.Encryption = nil
	}

	// EncryptionSettingsCollection
	if disk.EncryptionSettingsCollection != nil {
		var encryptionSettingsCollection storage.EncryptionSettingsCollection
		err := disk.EncryptionSettingsCollection.AssignProperties_To_EncryptionSettingsCollection(&encryptionSettingsCollection)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EncryptionSettingsCollection() to populate field EncryptionSettingsCollection")
		}
		destination.EncryptionSettingsCollection = &encryptionSettingsCollection
	} else {
		destination.EncryptionSettingsCollection = nil
	}

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

	// HyperVGeneration
	if disk.HyperVGeneration != nil {
		hyperVGeneration := string(*disk.HyperVGeneration)
		destination.HyperVGeneration = &hyperVGeneration
	} else {
		destination.HyperVGeneration = nil
	}

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

	// MaxShares
	destination.MaxShares = genruntime.ClonePointerToInt(disk.MaxShares)

	// NetworkAccessPolicy
	if disk.NetworkAccessPolicy != nil {
		networkAccessPolicy := string(*disk.NetworkAccessPolicy)
		destination.NetworkAccessPolicy = &networkAccessPolicy
	} else {
		destination.NetworkAccessPolicy = nil
	}

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

	// OptimizedForFrequentAttach
	if disk.OptimizedForFrequentAttach != nil {
		optimizedForFrequentAttach := *disk.OptimizedForFrequentAttach
		destination.OptimizedForFrequentAttach = &optimizedForFrequentAttach
	} else {
		destination.OptimizedForFrequentAttach = nil
	}

	// OriginalVersion
	destination.OriginalVersion = disk.OriginalVersion()

	// OsType
	if disk.OsType != nil {
		osType := string(*disk.OsType)
		destination.OsType = &osType
	} else {
		destination.OsType = nil
	}

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

	// PublicNetworkAccess
	if disk.PublicNetworkAccess != nil {
		publicNetworkAccess := string(*disk.PublicNetworkAccess)
		destination.PublicNetworkAccess = &publicNetworkAccess
	} else {
		destination.PublicNetworkAccess = nil
	}

	// PurchasePlan
	if disk.PurchasePlan != nil {
		var purchasePlan storage.DiskPurchasePlan
		err := disk.PurchasePlan.AssignProperties_To_DiskPurchasePlan(&purchasePlan)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DiskPurchasePlan() to populate field PurchasePlan")
		}
		destination.PurchasePlan = &purchasePlan
	} else {
		destination.PurchasePlan = nil
	}

	// SecurityProfile
	if disk.SecurityProfile != nil {
		var securityProfile storage.DiskSecurityProfile
		err := disk.SecurityProfile.AssignProperties_To_DiskSecurityProfile(&securityProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DiskSecurityProfile() to populate field SecurityProfile")
		}
		destination.SecurityProfile = &securityProfile
	} else {
		destination.SecurityProfile = nil
	}

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

	// SupportedCapabilities
	if disk.SupportedCapabilities != nil {
		var supportedCapability storage.SupportedCapabilities
		err := disk.SupportedCapabilities.AssignProperties_To_SupportedCapabilities(&supportedCapability)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SupportedCapabilities() to populate field SupportedCapabilities")
		}
		destination.SupportedCapabilities = &supportedCapability
	} else {
		destination.SupportedCapabilities = nil
	}

	// SupportsHibernation
	if disk.SupportsHibernation != nil {
		supportsHibernation := *disk.SupportsHibernation
		destination.SupportsHibernation = &supportsHibernation
	} else {
		destination.SupportsHibernation = nil
	}

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

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

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

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

	// No error
	return nil
}

// Initialize_From_Disk_STATUS populates our Disk_Spec from the provided source Disk_STATUS
func (disk *Disk_Spec) Initialize_From_Disk_STATUS(source *Disk_STATUS) error {

	// BurstingEnabled
	if source.BurstingEnabled != nil {
		burstingEnabled := *source.BurstingEnabled
		disk.BurstingEnabled = &burstingEnabled
	} else {
		disk.BurstingEnabled = nil
	}

	// CompletionPercent
	if source.CompletionPercent != nil {
		completionPercent := *source.CompletionPercent
		disk.CompletionPercent = &completionPercent
	} else {
		disk.CompletionPercent = nil
	}

	// CreationData
	if source.CreationData != nil {
		var creationDatum CreationData
		err := creationDatum.Initialize_From_CreationData_STATUS(source.CreationData)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_CreationData_STATUS() to populate field CreationData")
		}
		disk.CreationData = &creationDatum
	} else {
		disk.CreationData = nil
	}

	// DataAccessAuthMode
	if source.DataAccessAuthMode != nil {
		dataAccessAuthMode := genruntime.ToEnum(string(*source.DataAccessAuthMode), dataAccessAuthMode_Values)
		disk.DataAccessAuthMode = &dataAccessAuthMode
	} else {
		disk.DataAccessAuthMode = nil
	}

	// DiskAccessReference
	if source.DiskAccessId != nil {
		diskAccessReference := genruntime.CreateResourceReferenceFromARMID(*source.DiskAccessId)
		disk.DiskAccessReference = &diskAccessReference
	} else {
		disk.DiskAccessReference = nil
	}

	// DiskIOPSReadOnly
	disk.DiskIOPSReadOnly = genruntime.ClonePointerToInt(source.DiskIOPSReadOnly)

	// DiskIOPSReadWrite
	disk.DiskIOPSReadWrite = genruntime.ClonePointerToInt(source.DiskIOPSReadWrite)

	// DiskMBpsReadOnly
	disk.DiskMBpsReadOnly = genruntime.ClonePointerToInt(source.DiskMBpsReadOnly)

	// DiskMBpsReadWrite
	disk.DiskMBpsReadWrite = genruntime.ClonePointerToInt(source.DiskMBpsReadWrite)

	// DiskSizeGB
	disk.DiskSizeGB = genruntime.ClonePointerToInt(source.DiskSizeGB)

	// Encryption
	if source.Encryption != nil {
		var encryption Encryption
		err := encryption.Initialize_From_Encryption_STATUS(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_Encryption_STATUS() to populate field Encryption")
		}
		disk.Encryption = &encryption
	} else {
		disk.Encryption = nil
	}

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

	// HyperVGeneration
	if source.HyperVGeneration != nil {
		hyperVGeneration := genruntime.ToEnum(string(*source.HyperVGeneration), hyperVGeneration_Values)
		disk.HyperVGeneration = &hyperVGeneration
	} else {
		disk.HyperVGeneration = nil
	}

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

	// MaxShares
	disk.MaxShares = genruntime.ClonePointerToInt(source.MaxShares)

	// NetworkAccessPolicy
	if source.NetworkAccessPolicy != nil {
		networkAccessPolicy := genruntime.ToEnum(string(*source.NetworkAccessPolicy), networkAccessPolicy_Values)
		disk.NetworkAccessPolicy = &networkAccessPolicy
	} else {
		disk.NetworkAccessPolicy = nil
	}

	// OptimizedForFrequentAttach
	if source.OptimizedForFrequentAttach != nil {
		optimizedForFrequentAttach := *source.OptimizedForFrequentAttach
		disk.OptimizedForFrequentAttach = &optimizedForFrequentAttach
	} else {
		disk.OptimizedForFrequentAttach = nil
	}

	// OsType
	if source.OsType != nil {
		osType := genruntime.ToEnum(string(*source.OsType), operatingSystemTypes_Values)
		disk.OsType = &osType
	} else {
		disk.OsType = nil
	}

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := genruntime.ToEnum(string(*source.PublicNetworkAccess), publicNetworkAccess_Values)
		disk.PublicNetworkAccess = &publicNetworkAccess
	} else {
		disk.PublicNetworkAccess = nil
	}

	// PurchasePlan
	if source.PurchasePlan != nil {
		var purchasePlan DiskPurchasePlan
		err := purchasePlan.Initialize_From_DiskPurchasePlan_STATUS(source.PurchasePlan)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_DiskPurchasePlan_STATUS() to populate field PurchasePlan")
		}
		disk.PurchasePlan = &purchasePlan
	} else {
		disk.PurchasePlan = nil
	}

	// SecurityProfile
	if source.SecurityProfile != nil {
		var securityProfile DiskSecurityProfile
		err := securityProfile.Initialize_From_DiskSecurityProfile_STATUS(source.SecurityProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_DiskSecurityProfile_STATUS() to populate field SecurityProfile")
		}
		disk.SecurityProfile = &securityProfile
	} else {
		disk.SecurityProfile = nil
	}

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

	// SupportedCapabilities
	if source.SupportedCapabilities != nil {
		var supportedCapability SupportedCapabilities
		err := supportedCapability.Initialize_From_SupportedCapabilities_STATUS(source.SupportedCapabilities)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SupportedCapabilities_STATUS() to populate field SupportedCapabilities")
		}
		disk.SupportedCapabilities = &supportedCapability
	} else {
		disk.SupportedCapabilities = nil
	}

	// SupportsHibernation
	if source.SupportsHibernation != nil {
		supportsHibernation := *source.SupportsHibernation
		disk.SupportsHibernation = &supportsHibernation
	} else {
		disk.SupportsHibernation = nil
	}

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

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

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

	// No error
	return nil
}

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

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

// Disk resource.
type Disk_STATUS struct {
	// BurstingEnabled: Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is
	// disabled by default. Does not apply to Ultra disks.
	BurstingEnabled *bool `json:"burstingEnabled,omitempty"`

	// BurstingEnabledTime: Latest time when bursting was last enabled on a disk.
	BurstingEnabledTime *string `json:"burstingEnabledTime,omitempty"`

	// CompletionPercent: Percentage complete for the background copy when a resource is created via the CopyStart operation.
	CompletionPercent *float64 `json:"completionPercent,omitempty"`

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

	// CreationData: Disk source information. CreationData information cannot be changed after the disk has been created.
	CreationData *CreationData_STATUS `json:"creationData,omitempty"`

	// DataAccessAuthMode: Additional authentication requirements when exporting or uploading to a disk or snapshot.
	DataAccessAuthMode *DataAccessAuthMode_STATUS `json:"dataAccessAuthMode,omitempty"`

	// DiskAccessId: ARM id of the DiskAccess resource for using private endpoints on disks.
	DiskAccessId *string `json:"diskAccessId,omitempty"`

	// DiskIOPSReadOnly: The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One
	// operation can transfer between 4k and 256k bytes.
	DiskIOPSReadOnly *int `json:"diskIOPSReadOnly,omitempty"`

	// DiskIOPSReadWrite: The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can
	// transfer between 4k and 256k bytes.
	DiskIOPSReadWrite *int `json:"diskIOPSReadWrite,omitempty"`

	// DiskMBpsReadOnly: The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly.
	// MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10.
	DiskMBpsReadOnly *int `json:"diskMBpsReadOnly,omitempty"`

	// DiskMBpsReadWrite: The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes
	// per second - MB here uses the ISO notation, of powers of 10.
	DiskMBpsReadWrite *int `json:"diskMBpsReadWrite,omitempty"`

	// DiskSizeBytes: The size of the disk in bytes. This field is read only.
	DiskSizeBytes *int `json:"diskSizeBytes,omitempty"`

	// DiskSizeGB: If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to
	// create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only
	// allowed if the disk is not attached to a running VM, and can only increase the disk's size.
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// DiskState: The state of the disk.
	DiskState *DiskState_STATUS `json:"diskState,omitempty"`

	// Encryption: Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
	Encryption *Encryption_STATUS `json:"encryption,omitempty"`

	// EncryptionSettingsCollection: Encryption settings collection used for Azure Disk Encryption, can contain multiple
	// encryption settings per disk or snapshot.
	EncryptionSettingsCollection *EncryptionSettingsCollection_STATUS `json:"encryptionSettingsCollection,omitempty"`

	// ExtendedLocation: The extended location where the disk will be created. Extended location cannot be changed.
	ExtendedLocation *ExtendedLocation_STATUS `json:"extendedLocation,omitempty"`

	// HyperVGeneration: The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
	HyperVGeneration *HyperVGeneration_STATUS `json:"hyperVGeneration,omitempty"`

	// Id: Fully qualified resource ID for the resource. Ex -
	// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	Id *string `json:"id,omitempty"`

	// LastOwnershipUpdateTime: The UTC time when the ownership state of the disk was last changed i.e., the time the disk was
	// last attached or detached from a VM or the time when the VM to which the disk was attached was deallocated or started.
	LastOwnershipUpdateTime *string `json:"LastOwnershipUpdateTime,omitempty"`

	// Location: The geo-location where the resource lives
	Location *string `json:"location,omitempty"`

	// ManagedBy: A relative URI containing the ID of the VM that has the disk attached.
	ManagedBy *string `json:"managedBy,omitempty"`

	// ManagedByExtended: List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be
	// set to a value greater than one for disks to allow attaching them to multiple VMs.
	ManagedByExtended []string `json:"managedByExtended,omitempty"`

	// MaxShares: The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a
	// disk that can be mounted on multiple VMs at the same time.
	MaxShares *int `json:"maxShares,omitempty"`

	// Name: The name of the resource
	Name *string `json:"name,omitempty"`

	// NetworkAccessPolicy: Policy for accessing the disk via network.
	NetworkAccessPolicy *NetworkAccessPolicy_STATUS `json:"networkAccessPolicy,omitempty"`

	// OptimizedForFrequentAttach: Setting this property to true improves reliability and performance of data disks that are
	// frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should
	// not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault
	// domain of the virtual machine.
	OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"`

	// OsType: The Operating System type.
	OsType *OperatingSystemTypes_STATUS `json:"osType,omitempty"`

	// PropertyUpdatesInProgress: Properties of the disk for which update is pending.
	PropertyUpdatesInProgress *PropertyUpdatesInProgress_STATUS `json:"propertyUpdatesInProgress,omitempty"`

	// ProvisioningState: The disk provisioning state.
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Policy for controlling export on the disk.
	PublicNetworkAccess *PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// PurchasePlan: Purchase plan information for the the image from which the OS disk was created. E.g. - {name:
	// 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer}
	PurchasePlan *DiskPurchasePlan_STATUS `json:"purchasePlan,omitempty"`

	// SecurityProfile: Contains the security related information for the resource.
	SecurityProfile *DiskSecurityProfile_STATUS `json:"securityProfile,omitempty"`

	// ShareInfo: Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than
	// one for disks to allow attaching them to multiple VMs.
	ShareInfo []ShareInfoElement_STATUS `json:"shareInfo,omitempty"`

	// Sku: The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS,
	// or PremiumV2_LRS.
	Sku *DiskSku_STATUS `json:"sku,omitempty"`

	// SupportedCapabilities: List of supported capabilities for the image from which the OS disk was created.
	SupportedCapabilities *SupportedCapabilities_STATUS `json:"supportedCapabilities,omitempty"`

	// SupportsHibernation: Indicates the OS on a disk supports hibernation.
	SupportsHibernation *bool `json:"supportsHibernation,omitempty"`

	// SystemData: Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

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

	// Tier: Performance tier of the disk (e.g, P4, S10) as described here:
	// https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.
	Tier *string `json:"tier,omitempty"`

	// TimeCreated: The time when the disk was created.
	TimeCreated *string `json:"timeCreated,omitempty"`

	// Type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string `json:"type,omitempty"`

	// UniqueId: Unique Guid identifying the resource.
	UniqueId *string `json:"uniqueId,omitempty"`

	// Zones: The Logical zone list for Disk.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Disk_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Disk_STATUS{}
	err := disk.AssignProperties_To_Disk_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 = &Disk_STATUS{}

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

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

	// Set property "BurstingEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BurstingEnabled != nil {
			burstingEnabled := *typedInput.Properties.BurstingEnabled
			disk.BurstingEnabled = &burstingEnabled
		}
	}

	// Set property "BurstingEnabledTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BurstingEnabledTime != nil {
			burstingEnabledTime := *typedInput.Properties.BurstingEnabledTime
			disk.BurstingEnabledTime = &burstingEnabledTime
		}
	}

	// Set property "CompletionPercent":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CompletionPercent != nil {
			completionPercent := *typedInput.Properties.CompletionPercent
			disk.CompletionPercent = &completionPercent
		}
	}

	// no assignment for property "Conditions"

	// Set property "CreationData":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreationData != nil {
			var creationData1 CreationData_STATUS
			err := creationData1.PopulateFromARM(owner, *typedInput.Properties.CreationData)
			if err != nil {
				return err
			}
			creationData := creationData1
			disk.CreationData = &creationData
		}
	}

	// Set property "DataAccessAuthMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DataAccessAuthMode != nil {
			var temp string
			temp = string(*typedInput.Properties.DataAccessAuthMode)
			dataAccessAuthMode := DataAccessAuthMode_STATUS(temp)
			disk.DataAccessAuthMode = &dataAccessAuthMode
		}
	}

	// Set property "DiskAccessId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskAccessId != nil {
			diskAccessId := *typedInput.Properties.DiskAccessId
			disk.DiskAccessId = &diskAccessId
		}
	}

	// Set property "DiskIOPSReadOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskIOPSReadOnly != nil {
			diskIOPSReadOnly := *typedInput.Properties.DiskIOPSReadOnly
			disk.DiskIOPSReadOnly = &diskIOPSReadOnly
		}
	}

	// Set property "DiskIOPSReadWrite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskIOPSReadWrite != nil {
			diskIOPSReadWrite := *typedInput.Properties.DiskIOPSReadWrite
			disk.DiskIOPSReadWrite = &diskIOPSReadWrite
		}
	}

	// Set property "DiskMBpsReadOnly":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskMBpsReadOnly != nil {
			diskMBpsReadOnly := *typedInput.Properties.DiskMBpsReadOnly
			disk.DiskMBpsReadOnly = &diskMBpsReadOnly
		}
	}

	// Set property "DiskMBpsReadWrite":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskMBpsReadWrite != nil {
			diskMBpsReadWrite := *typedInput.Properties.DiskMBpsReadWrite
			disk.DiskMBpsReadWrite = &diskMBpsReadWrite
		}
	}

	// Set property "DiskSizeBytes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskSizeBytes != nil {
			diskSizeBytes := *typedInput.Properties.DiskSizeBytes
			disk.DiskSizeBytes = &diskSizeBytes
		}
	}

	// Set property "DiskSizeGB":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskSizeGB != nil {
			diskSizeGB := *typedInput.Properties.DiskSizeGB
			disk.DiskSizeGB = &diskSizeGB
		}
	}

	// Set property "DiskState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DiskState != nil {
			var temp string
			temp = string(*typedInput.Properties.DiskState)
			diskState := DiskState_STATUS(temp)
			disk.DiskState = &diskState
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 Encryption_STATUS
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			disk.Encryption = &encryption
		}
	}

	// Set property "EncryptionSettingsCollection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EncryptionSettingsCollection != nil {
			var encryptionSettingsCollection1 EncryptionSettingsCollection_STATUS
			err := encryptionSettingsCollection1.PopulateFromARM(owner, *typedInput.Properties.EncryptionSettingsCollection)
			if err != nil {
				return err
			}
			encryptionSettingsCollection := encryptionSettingsCollection1
			disk.EncryptionSettingsCollection = &encryptionSettingsCollection
		}
	}

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

	// Set property "HyperVGeneration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HyperVGeneration != nil {
			var temp string
			temp = string(*typedInput.Properties.HyperVGeneration)
			hyperVGeneration := HyperVGeneration_STATUS(temp)
			disk.HyperVGeneration = &hyperVGeneration
		}
	}

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

	// Set property "LastOwnershipUpdateTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastOwnershipUpdateTime != nil {
			lastOwnershipUpdateTime := *typedInput.Properties.LastOwnershipUpdateTime
			disk.LastOwnershipUpdateTime = &lastOwnershipUpdateTime
		}
	}

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

	// Set property "ManagedBy":
	if typedInput.ManagedBy != nil {
		managedBy := *typedInput.ManagedBy
		disk.ManagedBy = &managedBy
	}

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

	// Set property "MaxShares":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaxShares != nil {
			maxShares := *typedInput.Properties.MaxShares
			disk.MaxShares = &maxShares
		}
	}

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

	// Set property "NetworkAccessPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAccessPolicy != nil {
			var temp string
			temp = string(*typedInput.Properties.NetworkAccessPolicy)
			networkAccessPolicy := NetworkAccessPolicy_STATUS(temp)
			disk.NetworkAccessPolicy = &networkAccessPolicy
		}
	}

	// Set property "OptimizedForFrequentAttach":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.OptimizedForFrequentAttach != nil {
			optimizedForFrequentAttach := *typedInput.Properties.OptimizedForFrequentAttach
			disk.OptimizedForFrequentAttach = &optimizedForFrequentAttach
		}
	}

	// Set property "OsType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.OsType != nil {
			var temp string
			temp = string(*typedInput.Properties.OsType)
			osType := OperatingSystemTypes_STATUS(temp)
			disk.OsType = &osType
		}
	}

	// Set property "PropertyUpdatesInProgress":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PropertyUpdatesInProgress != nil {
			var propertyUpdatesInProgress1 PropertyUpdatesInProgress_STATUS
			err := propertyUpdatesInProgress1.PopulateFromARM(owner, *typedInput.Properties.PropertyUpdatesInProgress)
			if err != nil {
				return err
			}
			propertyUpdatesInProgress := propertyUpdatesInProgress1
			disk.PropertyUpdatesInProgress = &propertyUpdatesInProgress
		}
	}

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

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := PublicNetworkAccess_STATUS(temp)
			disk.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "PurchasePlan":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PurchasePlan != nil {
			var purchasePlan1 DiskPurchasePlan_STATUS
			err := purchasePlan1.PopulateFromARM(owner, *typedInput.Properties.PurchasePlan)
			if err != nil {
				return err
			}
			purchasePlan := purchasePlan1
			disk.PurchasePlan = &purchasePlan
		}
	}

	// Set property "SecurityProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SecurityProfile != nil {
			var securityProfile1 DiskSecurityProfile_STATUS
			err := securityProfile1.PopulateFromARM(owner, *typedInput.Properties.SecurityProfile)
			if err != nil {
				return err
			}
			securityProfile := securityProfile1
			disk.SecurityProfile = &securityProfile
		}
	}

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

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

	// Set property "SupportedCapabilities":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportedCapabilities != nil {
			var supportedCapabilities1 SupportedCapabilities_STATUS
			err := supportedCapabilities1.PopulateFromARM(owner, *typedInput.Properties.SupportedCapabilities)
			if err != nil {
				return err
			}
			supportedCapabilities := supportedCapabilities1
			disk.SupportedCapabilities = &supportedCapabilities
		}
	}

	// Set property "SupportsHibernation":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SupportsHibernation != nil {
			supportsHibernation := *typedInput.Properties.SupportsHibernation
			disk.SupportsHibernation = &supportsHibernation
		}
	}

	// Set property "SystemData":
	if typedInput.SystemData != nil {
		var systemData1 SystemData_STATUS
		err := systemData1.PopulateFromARM(owner, *typedInput.SystemData)
		if err != nil {
			return err
		}
		systemData := systemData1
		disk.SystemData = &systemData
	}

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

	// Set property "Tier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Tier != nil {
			tier := *typedInput.Properties.Tier
			disk.Tier = &tier
		}
	}

	// Set property "TimeCreated":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TimeCreated != nil {
			timeCreated := *typedInput.Properties.TimeCreated
			disk.TimeCreated = &timeCreated
		}
	}

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

	// Set property "UniqueId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.UniqueId != nil {
			uniqueId := *typedInput.Properties.UniqueId
			disk.UniqueId = &uniqueId
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_Disk_STATUS populates our Disk_STATUS from the provided source Disk_STATUS
func (disk *Disk_STATUS) AssignProperties_From_Disk_STATUS(source *storage.Disk_STATUS) error {

	// BurstingEnabled
	if source.BurstingEnabled != nil {
		burstingEnabled := *source.BurstingEnabled
		disk.BurstingEnabled = &burstingEnabled
	} else {
		disk.BurstingEnabled = nil
	}

	// BurstingEnabledTime
	disk.BurstingEnabledTime = genruntime.ClonePointerToString(source.BurstingEnabledTime)

	// CompletionPercent
	if source.CompletionPercent != nil {
		completionPercent := *source.CompletionPercent
		disk.CompletionPercent = &completionPercent
	} else {
		disk.CompletionPercent = nil
	}

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

	// CreationData
	if source.CreationData != nil {
		var creationDatum CreationData_STATUS
		err := creationDatum.AssignProperties_From_CreationData_STATUS(source.CreationData)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CreationData_STATUS() to populate field CreationData")
		}
		disk.CreationData = &creationDatum
	} else {
		disk.CreationData = nil
	}

	// DataAccessAuthMode
	if source.DataAccessAuthMode != nil {
		dataAccessAuthMode := *source.DataAccessAuthMode
		dataAccessAuthModeTemp := genruntime.ToEnum(dataAccessAuthMode, dataAccessAuthMode_STATUS_Values)
		disk.DataAccessAuthMode = &dataAccessAuthModeTemp
	} else {
		disk.DataAccessAuthMode = nil
	}

	// DiskAccessId
	disk.DiskAccessId = genruntime.ClonePointerToString(source.DiskAccessId)

	// DiskIOPSReadOnly
	disk.DiskIOPSReadOnly = genruntime.ClonePointerToInt(source.DiskIOPSReadOnly)

	// DiskIOPSReadWrite
	disk.DiskIOPSReadWrite = genruntime.ClonePointerToInt(source.DiskIOPSReadWrite)

	// DiskMBpsReadOnly
	disk.DiskMBpsReadOnly = genruntime.ClonePointerToInt(source.DiskMBpsReadOnly)

	// DiskMBpsReadWrite
	disk.DiskMBpsReadWrite = genruntime.ClonePointerToInt(source.DiskMBpsReadWrite)

	// DiskSizeBytes
	disk.DiskSizeBytes = genruntime.ClonePointerToInt(source.DiskSizeBytes)

	// DiskSizeGB
	disk.DiskSizeGB = genruntime.ClonePointerToInt(source.DiskSizeGB)

	// DiskState
	if source.DiskState != nil {
		diskState := *source.DiskState
		diskStateTemp := genruntime.ToEnum(diskState, diskState_STATUS_Values)
		disk.DiskState = &diskStateTemp
	} else {
		disk.DiskState = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption Encryption_STATUS
		err := encryption.AssignProperties_From_Encryption_STATUS(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Encryption_STATUS() to populate field Encryption")
		}
		disk.Encryption = &encryption
	} else {
		disk.Encryption = nil
	}

	// EncryptionSettingsCollection
	if source.EncryptionSettingsCollection != nil {
		var encryptionSettingsCollection EncryptionSettingsCollection_STATUS
		err := encryptionSettingsCollection.AssignProperties_From_EncryptionSettingsCollection_STATUS(source.EncryptionSettingsCollection)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EncryptionSettingsCollection_STATUS() to populate field EncryptionSettingsCollection")
		}
		disk.EncryptionSettingsCollection = &encryptionSettingsCollection
	} else {
		disk.EncryptionSettingsCollection = nil
	}

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

	// HyperVGeneration
	if source.HyperVGeneration != nil {
		hyperVGeneration := *source.HyperVGeneration
		hyperVGenerationTemp := genruntime.ToEnum(hyperVGeneration, hyperVGeneration_STATUS_Values)
		disk.HyperVGeneration = &hyperVGenerationTemp
	} else {
		disk.HyperVGeneration = nil
	}

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

	// LastOwnershipUpdateTime
	disk.LastOwnershipUpdateTime = genruntime.ClonePointerToString(source.LastOwnershipUpdateTime)

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

	// ManagedBy
	disk.ManagedBy = genruntime.ClonePointerToString(source.ManagedBy)

	// ManagedByExtended
	disk.ManagedByExtended = genruntime.CloneSliceOfString(source.ManagedByExtended)

	// MaxShares
	disk.MaxShares = genruntime.ClonePointerToInt(source.MaxShares)

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

	// NetworkAccessPolicy
	if source.NetworkAccessPolicy != nil {
		networkAccessPolicy := *source.NetworkAccessPolicy
		networkAccessPolicyTemp := genruntime.ToEnum(networkAccessPolicy, networkAccessPolicy_STATUS_Values)
		disk.NetworkAccessPolicy = &networkAccessPolicyTemp
	} else {
		disk.NetworkAccessPolicy = nil
	}

	// OptimizedForFrequentAttach
	if source.OptimizedForFrequentAttach != nil {
		optimizedForFrequentAttach := *source.OptimizedForFrequentAttach
		disk.OptimizedForFrequentAttach = &optimizedForFrequentAttach
	} else {
		disk.OptimizedForFrequentAttach = nil
	}

	// OsType
	if source.OsType != nil {
		osType := *source.OsType
		osTypeTemp := genruntime.ToEnum(osType, operatingSystemTypes_STATUS_Values)
		disk.OsType = &osTypeTemp
	} else {
		disk.OsType = nil
	}

	// PropertyUpdatesInProgress
	if source.PropertyUpdatesInProgress != nil {
		var propertyUpdatesInProgress PropertyUpdatesInProgress_STATUS
		err := propertyUpdatesInProgress.AssignProperties_From_PropertyUpdatesInProgress_STATUS(source.PropertyUpdatesInProgress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PropertyUpdatesInProgress_STATUS() to populate field PropertyUpdatesInProgress")
		}
		disk.PropertyUpdatesInProgress = &propertyUpdatesInProgress
	} else {
		disk.PropertyUpdatesInProgress = nil
	}

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, publicNetworkAccess_STATUS_Values)
		disk.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		disk.PublicNetworkAccess = nil
	}

	// PurchasePlan
	if source.PurchasePlan != nil {
		var purchasePlan DiskPurchasePlan_STATUS
		err := purchasePlan.AssignProperties_From_DiskPurchasePlan_STATUS(source.PurchasePlan)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DiskPurchasePlan_STATUS() to populate field PurchasePlan")
		}
		disk.PurchasePlan = &purchasePlan
	} else {
		disk.PurchasePlan = nil
	}

	// SecurityProfile
	if source.SecurityProfile != nil {
		var securityProfile DiskSecurityProfile_STATUS
		err := securityProfile.AssignProperties_From_DiskSecurityProfile_STATUS(source.SecurityProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DiskSecurityProfile_STATUS() to populate field SecurityProfile")
		}
		disk.SecurityProfile = &securityProfile
	} else {
		disk.SecurityProfile = nil
	}

	// ShareInfo
	if source.ShareInfo != nil {
		shareInfoList := make([]ShareInfoElement_STATUS, len(source.ShareInfo))
		for shareInfoIndex, shareInfoItem := range source.ShareInfo {
			var shareInfo ShareInfoElement_STATUS
			err := shareInfo.AssignProperties_From_ShareInfoElement_STATUS(&shareInfoItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ShareInfoElement_STATUS() to populate field ShareInfo")
			}
			shareInfoList[shareInfoIndex] = shareInfo
		}
		disk.ShareInfo = shareInfoList
	} else {
		disk.ShareInfo = nil
	}

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

	// SupportedCapabilities
	if source.SupportedCapabilities != nil {
		var supportedCapability SupportedCapabilities_STATUS
		err := supportedCapability.AssignProperties_From_SupportedCapabilities_STATUS(source.SupportedCapabilities)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SupportedCapabilities_STATUS() to populate field SupportedCapabilities")
		}
		disk.SupportedCapabilities = &supportedCapability
	} else {
		disk.SupportedCapabilities = nil
	}

	// SupportsHibernation
	if source.SupportsHibernation != nil {
		supportsHibernation := *source.SupportsHibernation
		disk.SupportsHibernation = &supportsHibernation
	} else {
		disk.SupportsHibernation = nil
	}

	// SystemData
	if source.SystemData != nil {
		var systemDatum SystemData_STATUS
		err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData")
		}
		disk.SystemData = &systemDatum
	} else {
		disk.SystemData = nil
	}

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

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

	// TimeCreated
	disk.TimeCreated = genruntime.ClonePointerToString(source.TimeCreated)

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

	// UniqueId
	disk.UniqueId = genruntime.ClonePointerToString(source.UniqueId)

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

	// No error
	return nil
}

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

	// BurstingEnabled
	if disk.BurstingEnabled != nil {
		burstingEnabled := *disk.BurstingEnabled
		destination.BurstingEnabled = &burstingEnabled
	} else {
		destination.BurstingEnabled = nil
	}

	// BurstingEnabledTime
	destination.BurstingEnabledTime = genruntime.ClonePointerToString(disk.BurstingEnabledTime)

	// CompletionPercent
	if disk.CompletionPercent != nil {
		completionPercent := *disk.CompletionPercent
		destination.CompletionPercent = &completionPercent
	} else {
		destination.CompletionPercent = nil
	}

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

	// CreationData
	if disk.CreationData != nil {
		var creationDatum storage.CreationData_STATUS
		err := disk.CreationData.AssignProperties_To_CreationData_STATUS(&creationDatum)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CreationData_STATUS() to populate field CreationData")
		}
		destination.CreationData = &creationDatum
	} else {
		destination.CreationData = nil
	}

	// DataAccessAuthMode
	if disk.DataAccessAuthMode != nil {
		dataAccessAuthMode := string(*disk.DataAccessAuthMode)
		destination.DataAccessAuthMode = &dataAccessAuthMode
	} else {
		destination.DataAccessAuthMode = nil
	}

	// DiskAccessId
	destination.DiskAccessId = genruntime.ClonePointerToString(disk.DiskAccessId)

	// DiskIOPSReadOnly
	destination.DiskIOPSReadOnly = genruntime.ClonePointerToInt(disk.DiskIOPSReadOnly)

	// DiskIOPSReadWrite
	destination.DiskIOPSReadWrite = genruntime.ClonePointerToInt(disk.DiskIOPSReadWrite)

	// DiskMBpsReadOnly
	destination.DiskMBpsReadOnly = genruntime.ClonePointerToInt(disk.DiskMBpsReadOnly)

	// DiskMBpsReadWrite
	destination.DiskMBpsReadWrite = genruntime.ClonePointerToInt(disk.DiskMBpsReadWrite)

	// DiskSizeBytes
	destination.DiskSizeBytes = genruntime.ClonePointerToInt(disk.DiskSizeBytes)

	// DiskSizeGB
	destination.DiskSizeGB = genruntime.ClonePointerToInt(disk.DiskSizeGB)

	// DiskState
	if disk.DiskState != nil {
		diskState := string(*disk.DiskState)
		destination.DiskState = &diskState
	} else {
		destination.DiskState = nil
	}

	// Encryption
	if disk.Encryption != nil {
		var encryption storage.Encryption_STATUS
		err := disk.Encryption.AssignProperties_To_Encryption_STATUS(&encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Encryption_STATUS() to populate field Encryption")
		}
		destination.Encryption = &encryption
	} else {
		destination.Encryption = nil
	}

	// EncryptionSettingsCollection
	if disk.EncryptionSettingsCollection != nil {
		var encryptionSettingsCollection storage.EncryptionSettingsCollection_STATUS
		err := disk.EncryptionSettingsCollection.AssignProperties_To_EncryptionSettingsCollection_STATUS(&encryptionSettingsCollection)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EncryptionSettingsCollection_STATUS() to populate field EncryptionSettingsCollection")
		}
		destination.EncryptionSettingsCollection = &encryptionSettingsCollection
	} else {
		destination.EncryptionSettingsCollection = nil
	}

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

	// HyperVGeneration
	if disk.HyperVGeneration != nil {
		hyperVGeneration := string(*disk.HyperVGeneration)
		destination.HyperVGeneration = &hyperVGeneration
	} else {
		destination.HyperVGeneration = nil
	}

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

	// LastOwnershipUpdateTime
	destination.LastOwnershipUpdateTime = genruntime.ClonePointerToString(disk.LastOwnershipUpdateTime)

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

	// ManagedBy
	destination.ManagedBy = genruntime.ClonePointerToString(disk.ManagedBy)

	// ManagedByExtended
	destination.ManagedByExtended = genruntime.CloneSliceOfString(disk.ManagedByExtended)

	// MaxShares
	destination.MaxShares = genruntime.ClonePointerToInt(disk.MaxShares)

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

	// NetworkAccessPolicy
	if disk.NetworkAccessPolicy != nil {
		networkAccessPolicy := string(*disk.NetworkAccessPolicy)
		destination.NetworkAccessPolicy = &networkAccessPolicy
	} else {
		destination.NetworkAccessPolicy = nil
	}

	// OptimizedForFrequentAttach
	if disk.OptimizedForFrequentAttach != nil {
		optimizedForFrequentAttach := *disk.OptimizedForFrequentAttach
		destination.OptimizedForFrequentAttach = &optimizedForFrequentAttach
	} else {
		destination.OptimizedForFrequentAttach = nil
	}

	// OsType
	if disk.OsType != nil {
		osType := string(*disk.OsType)
		destination.OsType = &osType
	} else {
		destination.OsType = nil
	}

	// PropertyUpdatesInProgress
	if disk.PropertyUpdatesInProgress != nil {
		var propertyUpdatesInProgress storage.PropertyUpdatesInProgress_STATUS
		err := disk.PropertyUpdatesInProgress.AssignProperties_To_PropertyUpdatesInProgress_STATUS(&propertyUpdatesInProgress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PropertyUpdatesInProgress_STATUS() to populate field PropertyUpdatesInProgress")
		}
		destination.PropertyUpdatesInProgress = &propertyUpdatesInProgress
	} else {
		destination.PropertyUpdatesInProgress = nil
	}

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

	// PublicNetworkAccess
	if disk.PublicNetworkAccess != nil {
		publicNetworkAccess := string(*disk.PublicNetworkAccess)
		destination.PublicNetworkAccess = &publicNetworkAccess
	} else {
		destination.PublicNetworkAccess = nil
	}

	// PurchasePlan
	if disk.PurchasePlan != nil {
		var purchasePlan storage.DiskPurchasePlan_STATUS
		err := disk.PurchasePlan.AssignProperties_To_DiskPurchasePlan_STATUS(&purchasePlan)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DiskPurchasePlan_STATUS() to populate field PurchasePlan")
		}
		destination.PurchasePlan = &purchasePlan
	} else {
		destination.PurchasePlan = nil
	}

	// SecurityProfile
	if disk.SecurityProfile != nil {
		var securityProfile storage.DiskSecurityProfile_STATUS
		err := disk.SecurityProfile.AssignProperties_To_DiskSecurityProfile_STATUS(&securityProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DiskSecurityProfile_STATUS() to populate field SecurityProfile")
		}
		destination.SecurityProfile = &securityProfile
	} else {
		destination.SecurityProfile = nil
	}

	// ShareInfo
	if disk.ShareInfo != nil {
		shareInfoList := make([]storage.ShareInfoElement_STATUS, len(disk.ShareInfo))
		for shareInfoIndex, shareInfoItem := range disk.ShareInfo {
			var shareInfo storage.ShareInfoElement_STATUS
			err := shareInfoItem.AssignProperties_To_ShareInfoElement_STATUS(&shareInfo)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ShareInfoElement_STATUS() to populate field ShareInfo")
			}
			shareInfoList[shareInfoIndex] = shareInfo
		}
		destination.ShareInfo = shareInfoList
	} else {
		destination.ShareInfo = nil
	}

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

	// SupportedCapabilities
	if disk.SupportedCapabilities != nil {
		var supportedCapability storage.SupportedCapabilities_STATUS
		err := disk.SupportedCapabilities.AssignProperties_To_SupportedCapabilities_STATUS(&supportedCapability)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SupportedCapabilities_STATUS() to populate field SupportedCapabilities")
		}
		destination.SupportedCapabilities = &supportedCapability
	} else {
		destination.SupportedCapabilities = nil
	}

	// SupportsHibernation
	if disk.SupportsHibernation != nil {
		supportsHibernation := *disk.SupportsHibernation
		destination.SupportsHibernation = &supportsHibernation
	} else {
		destination.SupportsHibernation = nil
	}

	// SystemData
	if disk.SystemData != nil {
		var systemDatum storage.SystemData_STATUS
		err := disk.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData")
		}
		destination.SystemData = &systemDatum
	} else {
		destination.SystemData = nil
	}

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

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

	// TimeCreated
	destination.TimeCreated = genruntime.ClonePointerToString(disk.TimeCreated)

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

	// UniqueId
	destination.UniqueId = genruntime.ClonePointerToString(disk.UniqueId)

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

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

	// No error
	return nil
}

// Data used when creating a disk.
type CreationData struct {
	// +kubebuilder:validation:Required
	// CreateOption: This enumerates the possible sources of a disk's creation.
	CreateOption *DiskCreateOption `json:"createOption,omitempty"`

	// ElasticSanResourceReference: Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic
	// san volume snapshot.
	ElasticSanResourceReference *genruntime.ResourceReference `armReference:"ElasticSanResourceId" json:"elasticSanResourceReference,omitempty"`

	// GalleryImageReference: Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of
	// the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk.
	GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"`

	// ImageReference: Disk source information for PIR or user images.
	ImageReference *ImageDiskReference `json:"imageReference,omitempty"`

	// LogicalSectorSize: Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default.
	LogicalSectorSize *int `json:"logicalSectorSize,omitempty"`

	// PerformancePlus: Set this flag to true to get a boost on the performance target of the disk deployed, see here on the
	// respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled.
	PerformancePlus *bool `json:"performancePlus,omitempty"`

	// ProvisionedBandwidthCopySpeed: If this field is set on a snapshot and createOption is CopyStart, the snapshot will be
	// copied at a quicker speed.
	ProvisionedBandwidthCopySpeed *ProvisionedBandwidthCopyOption `json:"provisionedBandwidthCopySpeed,omitempty"`

	// SecurityDataUri: If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state.
	SecurityDataUri *string `json:"securityDataUri,omitempty"`

	// SourceResourceReference: If createOption is Copy, this is the ARM id of the source snapshot or disk.
	SourceResourceReference *genruntime.ResourceReference `armReference:"SourceResourceId" json:"sourceResourceReference,omitempty"`

	// SourceUri: If createOption is Import, this is the URI of a blob to be imported into a managed disk.
	SourceUri *string `json:"sourceUri,omitempty"`

	// StorageAccountId: Required if createOption is Import. The Azure Resource Manager identifier of the storage account
	// containing the blob to import as a disk.
	StorageAccountId *string `json:"storageAccountId,omitempty"`

	// UploadSizeBytes: If createOption is Upload, this is the size of the contents of the upload including the VHD footer.
	// This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512
	// bytes for the VHD footer).
	UploadSizeBytes *int `json:"uploadSizeBytes,omitempty"`
}

var _ genruntime.ARMTransformer = &CreationData{}

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

	// Set property "CreateOption":
	if data.CreateOption != nil {
		var temp string
		temp = string(*data.CreateOption)
		createOption := arm.DiskCreateOption(temp)
		result.CreateOption = &createOption
	}

	// Set property "ElasticSanResourceId":
	if data.ElasticSanResourceReference != nil {
		elasticSanResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*data.ElasticSanResourceReference)
		if err != nil {
			return nil, err
		}
		elasticSanResourceReference := elasticSanResourceReferenceARMID
		result.ElasticSanResourceId = &elasticSanResourceReference
	}

	// Set property "GalleryImageReference":
	if data.GalleryImageReference != nil {
		galleryImageReference_ARM, err := data.GalleryImageReference.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		galleryImageReference := *galleryImageReference_ARM.(*arm.ImageDiskReference)
		result.GalleryImageReference = &galleryImageReference
	}

	// Set property "ImageReference":
	if data.ImageReference != nil {
		imageReference_ARM, err := data.ImageReference.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		imageReference := *imageReference_ARM.(*arm.ImageDiskReference)
		result.ImageReference = &imageReference
	}

	// Set property "LogicalSectorSize":
	if data.LogicalSectorSize != nil {
		logicalSectorSize := *data.LogicalSectorSize
		result.LogicalSectorSize = &logicalSectorSize
	}

	// Set property "PerformancePlus":
	if data.PerformancePlus != nil {
		performancePlus := *data.PerformancePlus
		result.PerformancePlus = &performancePlus
	}

	// Set property "ProvisionedBandwidthCopySpeed":
	if data.ProvisionedBandwidthCopySpeed != nil {
		var temp string
		temp = string(*data.ProvisionedBandwidthCopySpeed)
		provisionedBandwidthCopySpeed := arm.ProvisionedBandwidthCopyOption(temp)
		result.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeed
	}

	// Set property "SecurityDataUri":
	if data.SecurityDataUri != nil {
		securityDataUri := *data.SecurityDataUri
		result.SecurityDataUri = &securityDataUri
	}

	// Set property "SourceResourceId":
	if data.SourceResourceReference != nil {
		sourceResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*data.SourceResourceReference)
		if err != nil {
			return nil, err
		}
		sourceResourceReference := sourceResourceReferenceARMID
		result.SourceResourceId = &sourceResourceReference
	}

	// Set property "SourceUri":
	if data.SourceUri != nil {
		sourceUri := *data.SourceUri
		result.SourceUri = &sourceUri
	}

	// Set property "StorageAccountId":
	if data.StorageAccountId != nil {
		storageAccountId := *data.StorageAccountId
		result.StorageAccountId = &storageAccountId
	}

	// Set property "UploadSizeBytes":
	if data.UploadSizeBytes != nil {
		uploadSizeBytes := *data.UploadSizeBytes
		result.UploadSizeBytes = &uploadSizeBytes
	}
	return result, nil
}

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

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

	// Set property "CreateOption":
	if typedInput.CreateOption != nil {
		var temp string
		temp = string(*typedInput.CreateOption)
		createOption := DiskCreateOption(temp)
		data.CreateOption = &createOption
	}

	// no assignment for property "ElasticSanResourceReference"

	// Set property "GalleryImageReference":
	if typedInput.GalleryImageReference != nil {
		var galleryImageReference1 ImageDiskReference
		err := galleryImageReference1.PopulateFromARM(owner, *typedInput.GalleryImageReference)
		if err != nil {
			return err
		}
		galleryImageReference := galleryImageReference1
		data.GalleryImageReference = &galleryImageReference
	}

	// Set property "ImageReference":
	if typedInput.ImageReference != nil {
		var imageReference1 ImageDiskReference
		err := imageReference1.PopulateFromARM(owner, *typedInput.ImageReference)
		if err != nil {
			return err
		}
		imageReference := imageReference1
		data.ImageReference = &imageReference
	}

	// Set property "LogicalSectorSize":
	if typedInput.LogicalSectorSize != nil {
		logicalSectorSize := *typedInput.LogicalSectorSize
		data.LogicalSectorSize = &logicalSectorSize
	}

	// Set property "PerformancePlus":
	if typedInput.PerformancePlus != nil {
		performancePlus := *typedInput.PerformancePlus
		data.PerformancePlus = &performancePlus
	}

	// Set property "ProvisionedBandwidthCopySpeed":
	if typedInput.ProvisionedBandwidthCopySpeed != nil {
		var temp string
		temp = string(*typedInput.ProvisionedBandwidthCopySpeed)
		provisionedBandwidthCopySpeed := ProvisionedBandwidthCopyOption(temp)
		data.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeed
	}

	// Set property "SecurityDataUri":
	if typedInput.SecurityDataUri != nil {
		securityDataUri := *typedInput.SecurityDataUri
		data.SecurityDataUri = &securityDataUri
	}

	// no assignment for property "SourceResourceReference"

	// Set property "SourceUri":
	if typedInput.SourceUri != nil {
		sourceUri := *typedInput.SourceUri
		data.SourceUri = &sourceUri
	}

	// Set property "StorageAccountId":
	if typedInput.StorageAccountId != nil {
		storageAccountId := *typedInput.StorageAccountId
		data.StorageAccountId = &storageAccountId
	}

	// Set property "UploadSizeBytes":
	if typedInput.UploadSizeBytes != nil {
		uploadSizeBytes := *typedInput.UploadSizeBytes
		data.UploadSizeBytes = &uploadSizeBytes
	}

	// No error
	return nil
}

// AssignProperties_From_CreationData populates our CreationData from the provided source CreationData
func (data *CreationData) AssignProperties_From_CreationData(source *storage.CreationData) error {

	// CreateOption
	if source.CreateOption != nil {
		createOption := *source.CreateOption
		createOptionTemp := genruntime.ToEnum(createOption, diskCreateOption_Values)
		data.CreateOption = &createOptionTemp
	} else {
		data.CreateOption = nil
	}

	// ElasticSanResourceReference
	if source.ElasticSanResourceReference != nil {
		elasticSanResourceReference := source.ElasticSanResourceReference.Copy()
		data.ElasticSanResourceReference = &elasticSanResourceReference
	} else {
		data.ElasticSanResourceReference = nil
	}

	// GalleryImageReference
	if source.GalleryImageReference != nil {
		var galleryImageReference ImageDiskReference
		err := galleryImageReference.AssignProperties_From_ImageDiskReference(source.GalleryImageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageDiskReference() to populate field GalleryImageReference")
		}
		data.GalleryImageReference = &galleryImageReference
	} else {
		data.GalleryImageReference = nil
	}

	// ImageReference
	if source.ImageReference != nil {
		var imageReference ImageDiskReference
		err := imageReference.AssignProperties_From_ImageDiskReference(source.ImageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageDiskReference() to populate field ImageReference")
		}
		data.ImageReference = &imageReference
	} else {
		data.ImageReference = nil
	}

	// LogicalSectorSize
	data.LogicalSectorSize = genruntime.ClonePointerToInt(source.LogicalSectorSize)

	// PerformancePlus
	if source.PerformancePlus != nil {
		performancePlus := *source.PerformancePlus
		data.PerformancePlus = &performancePlus
	} else {
		data.PerformancePlus = nil
	}

	// ProvisionedBandwidthCopySpeed
	if source.ProvisionedBandwidthCopySpeed != nil {
		provisionedBandwidthCopySpeed := *source.ProvisionedBandwidthCopySpeed
		provisionedBandwidthCopySpeedTemp := genruntime.ToEnum(provisionedBandwidthCopySpeed, provisionedBandwidthCopyOption_Values)
		data.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeedTemp
	} else {
		data.ProvisionedBandwidthCopySpeed = nil
	}

	// SecurityDataUri
	data.SecurityDataUri = genruntime.ClonePointerToString(source.SecurityDataUri)

	// SourceResourceReference
	if source.SourceResourceReference != nil {
		sourceResourceReference := source.SourceResourceReference.Copy()
		data.SourceResourceReference = &sourceResourceReference
	} else {
		data.SourceResourceReference = nil
	}

	// SourceUri
	data.SourceUri = genruntime.ClonePointerToString(source.SourceUri)

	// StorageAccountId
	data.StorageAccountId = genruntime.ClonePointerToString(source.StorageAccountId)

	// UploadSizeBytes
	data.UploadSizeBytes = genruntime.ClonePointerToInt(source.UploadSizeBytes)

	// No error
	return nil
}

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

	// CreateOption
	if data.CreateOption != nil {
		createOption := string(*data.CreateOption)
		destination.CreateOption = &createOption
	} else {
		destination.CreateOption = nil
	}

	// ElasticSanResourceReference
	if data.ElasticSanResourceReference != nil {
		elasticSanResourceReference := data.ElasticSanResourceReference.Copy()
		destination.ElasticSanResourceReference = &elasticSanResourceReference
	} else {
		destination.ElasticSanResourceReference = nil
	}

	// GalleryImageReference
	if data.GalleryImageReference != nil {
		var galleryImageReference storage.ImageDiskReference
		err := data.GalleryImageReference.AssignProperties_To_ImageDiskReference(&galleryImageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageDiskReference() to populate field GalleryImageReference")
		}
		destination.GalleryImageReference = &galleryImageReference
	} else {
		destination.GalleryImageReference = nil
	}

	// ImageReference
	if data.ImageReference != nil {
		var imageReference storage.ImageDiskReference
		err := data.ImageReference.AssignProperties_To_ImageDiskReference(&imageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageDiskReference() to populate field ImageReference")
		}
		destination.ImageReference = &imageReference
	} else {
		destination.ImageReference = nil
	}

	// LogicalSectorSize
	destination.LogicalSectorSize = genruntime.ClonePointerToInt(data.LogicalSectorSize)

	// PerformancePlus
	if data.PerformancePlus != nil {
		performancePlus := *data.PerformancePlus
		destination.PerformancePlus = &performancePlus
	} else {
		destination.PerformancePlus = nil
	}

	// ProvisionedBandwidthCopySpeed
	if data.ProvisionedBandwidthCopySpeed != nil {
		provisionedBandwidthCopySpeed := string(*data.ProvisionedBandwidthCopySpeed)
		destination.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeed
	} else {
		destination.ProvisionedBandwidthCopySpeed = nil
	}

	// SecurityDataUri
	destination.SecurityDataUri = genruntime.ClonePointerToString(data.SecurityDataUri)

	// SourceResourceReference
	if data.SourceResourceReference != nil {
		sourceResourceReference := data.SourceResourceReference.Copy()
		destination.SourceResourceReference = &sourceResourceReference
	} else {
		destination.SourceResourceReference = nil
	}

	// SourceUri
	destination.SourceUri = genruntime.ClonePointerToString(data.SourceUri)

	// StorageAccountId
	destination.StorageAccountId = genruntime.ClonePointerToString(data.StorageAccountId)

	// UploadSizeBytes
	destination.UploadSizeBytes = genruntime.ClonePointerToInt(data.UploadSizeBytes)

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

	// No error
	return nil
}

// Initialize_From_CreationData_STATUS populates our CreationData from the provided source CreationData_STATUS
func (data *CreationData) Initialize_From_CreationData_STATUS(source *CreationData_STATUS) error {

	// CreateOption
	if source.CreateOption != nil {
		createOption := genruntime.ToEnum(string(*source.CreateOption), diskCreateOption_Values)
		data.CreateOption = &createOption
	} else {
		data.CreateOption = nil
	}

	// ElasticSanResourceReference
	if source.ElasticSanResourceId != nil {
		elasticSanResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.ElasticSanResourceId)
		data.ElasticSanResourceReference = &elasticSanResourceReference
	} else {
		data.ElasticSanResourceReference = nil
	}

	// GalleryImageReference
	if source.GalleryImageReference != nil {
		var galleryImageReference ImageDiskReference
		err := galleryImageReference.Initialize_From_ImageDiskReference_STATUS(source.GalleryImageReference)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ImageDiskReference_STATUS() to populate field GalleryImageReference")
		}
		data.GalleryImageReference = &galleryImageReference
	} else {
		data.GalleryImageReference = nil
	}

	// ImageReference
	if source.ImageReference != nil {
		var imageReference ImageDiskReference
		err := imageReference.Initialize_From_ImageDiskReference_STATUS(source.ImageReference)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ImageDiskReference_STATUS() to populate field ImageReference")
		}
		data.ImageReference = &imageReference
	} else {
		data.ImageReference = nil
	}

	// LogicalSectorSize
	data.LogicalSectorSize = genruntime.ClonePointerToInt(source.LogicalSectorSize)

	// PerformancePlus
	if source.PerformancePlus != nil {
		performancePlus := *source.PerformancePlus
		data.PerformancePlus = &performancePlus
	} else {
		data.PerformancePlus = nil
	}

	// ProvisionedBandwidthCopySpeed
	if source.ProvisionedBandwidthCopySpeed != nil {
		provisionedBandwidthCopySpeed := genruntime.ToEnum(string(*source.ProvisionedBandwidthCopySpeed), provisionedBandwidthCopyOption_Values)
		data.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeed
	} else {
		data.ProvisionedBandwidthCopySpeed = nil
	}

	// SecurityDataUri
	data.SecurityDataUri = genruntime.ClonePointerToString(source.SecurityDataUri)

	// SourceResourceReference
	if source.SourceResourceId != nil {
		sourceResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.SourceResourceId)
		data.SourceResourceReference = &sourceResourceReference
	} else {
		data.SourceResourceReference = nil
	}

	// SourceUri
	data.SourceUri = genruntime.ClonePointerToString(source.SourceUri)

	// StorageAccountId
	data.StorageAccountId = genruntime.ClonePointerToString(source.StorageAccountId)

	// UploadSizeBytes
	data.UploadSizeBytes = genruntime.ClonePointerToInt(source.UploadSizeBytes)

	// No error
	return nil
}

// Data used when creating a disk.
type CreationData_STATUS struct {
	// CreateOption: This enumerates the possible sources of a disk's creation.
	CreateOption *DiskCreateOption_STATUS `json:"createOption,omitempty"`

	// ElasticSanResourceId: Required if createOption is CopyFromSanSnapshot. This is the ARM id of the source elastic san
	// volume snapshot.
	ElasticSanResourceId *string `json:"elasticSanResourceId,omitempty"`

	// GalleryImageReference: Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of
	// the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk.
	GalleryImageReference *ImageDiskReference_STATUS `json:"galleryImageReference,omitempty"`

	// ImageReference: Disk source information for PIR or user images.
	ImageReference *ImageDiskReference_STATUS `json:"imageReference,omitempty"`

	// LogicalSectorSize: Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default.
	LogicalSectorSize *int `json:"logicalSectorSize,omitempty"`

	// PerformancePlus: Set this flag to true to get a boost on the performance target of the disk deployed, see here on the
	// respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled.
	PerformancePlus *bool `json:"performancePlus,omitempty"`

	// ProvisionedBandwidthCopySpeed: If this field is set on a snapshot and createOption is CopyStart, the snapshot will be
	// copied at a quicker speed.
	ProvisionedBandwidthCopySpeed *ProvisionedBandwidthCopyOption_STATUS `json:"provisionedBandwidthCopySpeed,omitempty"`

	// SecurityDataUri: If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state.
	SecurityDataUri *string `json:"securityDataUri,omitempty"`

	// SourceResourceId: If createOption is Copy, this is the ARM id of the source snapshot or disk.
	SourceResourceId *string `json:"sourceResourceId,omitempty"`

	// SourceUniqueId: If this field is set, this is the unique id identifying the source of this resource.
	SourceUniqueId *string `json:"sourceUniqueId,omitempty"`

	// SourceUri: If createOption is Import, this is the URI of a blob to be imported into a managed disk.
	SourceUri *string `json:"sourceUri,omitempty"`

	// StorageAccountId: Required if createOption is Import. The Azure Resource Manager identifier of the storage account
	// containing the blob to import as a disk.
	StorageAccountId *string `json:"storageAccountId,omitempty"`

	// UploadSizeBytes: If createOption is Upload, this is the size of the contents of the upload including the VHD footer.
	// This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512
	// bytes for the VHD footer).
	UploadSizeBytes *int `json:"uploadSizeBytes,omitempty"`
}

var _ genruntime.FromARMConverter = &CreationData_STATUS{}

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

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

	// Set property "CreateOption":
	if typedInput.CreateOption != nil {
		var temp string
		temp = string(*typedInput.CreateOption)
		createOption := DiskCreateOption_STATUS(temp)
		data.CreateOption = &createOption
	}

	// Set property "ElasticSanResourceId":
	if typedInput.ElasticSanResourceId != nil {
		elasticSanResourceId := *typedInput.ElasticSanResourceId
		data.ElasticSanResourceId = &elasticSanResourceId
	}

	// Set property "GalleryImageReference":
	if typedInput.GalleryImageReference != nil {
		var galleryImageReference1 ImageDiskReference_STATUS
		err := galleryImageReference1.PopulateFromARM(owner, *typedInput.GalleryImageReference)
		if err != nil {
			return err
		}
		galleryImageReference := galleryImageReference1
		data.GalleryImageReference = &galleryImageReference
	}

	// Set property "ImageReference":
	if typedInput.ImageReference != nil {
		var imageReference1 ImageDiskReference_STATUS
		err := imageReference1.PopulateFromARM(owner, *typedInput.ImageReference)
		if err != nil {
			return err
		}
		imageReference := imageReference1
		data.ImageReference = &imageReference
	}

	// Set property "LogicalSectorSize":
	if typedInput.LogicalSectorSize != nil {
		logicalSectorSize := *typedInput.LogicalSectorSize
		data.LogicalSectorSize = &logicalSectorSize
	}

	// Set property "PerformancePlus":
	if typedInput.PerformancePlus != nil {
		performancePlus := *typedInput.PerformancePlus
		data.PerformancePlus = &performancePlus
	}

	// Set property "ProvisionedBandwidthCopySpeed":
	if typedInput.ProvisionedBandwidthCopySpeed != nil {
		var temp string
		temp = string(*typedInput.ProvisionedBandwidthCopySpeed)
		provisionedBandwidthCopySpeed := ProvisionedBandwidthCopyOption_STATUS(temp)
		data.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeed
	}

	// Set property "SecurityDataUri":
	if typedInput.SecurityDataUri != nil {
		securityDataUri := *typedInput.SecurityDataUri
		data.SecurityDataUri = &securityDataUri
	}

	// Set property "SourceResourceId":
	if typedInput.SourceResourceId != nil {
		sourceResourceId := *typedInput.SourceResourceId
		data.SourceResourceId = &sourceResourceId
	}

	// Set property "SourceUniqueId":
	if typedInput.SourceUniqueId != nil {
		sourceUniqueId := *typedInput.SourceUniqueId
		data.SourceUniqueId = &sourceUniqueId
	}

	// Set property "SourceUri":
	if typedInput.SourceUri != nil {
		sourceUri := *typedInput.SourceUri
		data.SourceUri = &sourceUri
	}

	// Set property "StorageAccountId":
	if typedInput.StorageAccountId != nil {
		storageAccountId := *typedInput.StorageAccountId
		data.StorageAccountId = &storageAccountId
	}

	// Set property "UploadSizeBytes":
	if typedInput.UploadSizeBytes != nil {
		uploadSizeBytes := *typedInput.UploadSizeBytes
		data.UploadSizeBytes = &uploadSizeBytes
	}

	// No error
	return nil
}

// AssignProperties_From_CreationData_STATUS populates our CreationData_STATUS from the provided source CreationData_STATUS
func (data *CreationData_STATUS) AssignProperties_From_CreationData_STATUS(source *storage.CreationData_STATUS) error {

	// CreateOption
	if source.CreateOption != nil {
		createOption := *source.CreateOption
		createOptionTemp := genruntime.ToEnum(createOption, diskCreateOption_STATUS_Values)
		data.CreateOption = &createOptionTemp
	} else {
		data.CreateOption = nil
	}

	// ElasticSanResourceId
	data.ElasticSanResourceId = genruntime.ClonePointerToString(source.ElasticSanResourceId)

	// GalleryImageReference
	if source.GalleryImageReference != nil {
		var galleryImageReference ImageDiskReference_STATUS
		err := galleryImageReference.AssignProperties_From_ImageDiskReference_STATUS(source.GalleryImageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageDiskReference_STATUS() to populate field GalleryImageReference")
		}
		data.GalleryImageReference = &galleryImageReference
	} else {
		data.GalleryImageReference = nil
	}

	// ImageReference
	if source.ImageReference != nil {
		var imageReference ImageDiskReference_STATUS
		err := imageReference.AssignProperties_From_ImageDiskReference_STATUS(source.ImageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageDiskReference_STATUS() to populate field ImageReference")
		}
		data.ImageReference = &imageReference
	} else {
		data.ImageReference = nil
	}

	// LogicalSectorSize
	data.LogicalSectorSize = genruntime.ClonePointerToInt(source.LogicalSectorSize)

	// PerformancePlus
	if source.PerformancePlus != nil {
		performancePlus := *source.PerformancePlus
		data.PerformancePlus = &performancePlus
	} else {
		data.PerformancePlus = nil
	}

	// ProvisionedBandwidthCopySpeed
	if source.ProvisionedBandwidthCopySpeed != nil {
		provisionedBandwidthCopySpeed := *source.ProvisionedBandwidthCopySpeed
		provisionedBandwidthCopySpeedTemp := genruntime.ToEnum(provisionedBandwidthCopySpeed, provisionedBandwidthCopyOption_STATUS_Values)
		data.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeedTemp
	} else {
		data.ProvisionedBandwidthCopySpeed = nil
	}

	// SecurityDataUri
	data.SecurityDataUri = genruntime.ClonePointerToString(source.SecurityDataUri)

	// SourceResourceId
	data.SourceResourceId = genruntime.ClonePointerToString(source.SourceResourceId)

	// SourceUniqueId
	data.SourceUniqueId = genruntime.ClonePointerToString(source.SourceUniqueId)

	// SourceUri
	data.SourceUri = genruntime.ClonePointerToString(source.SourceUri)

	// StorageAccountId
	data.StorageAccountId = genruntime.ClonePointerToString(source.StorageAccountId)

	// UploadSizeBytes
	data.UploadSizeBytes = genruntime.ClonePointerToInt(source.UploadSizeBytes)

	// No error
	return nil
}

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

	// CreateOption
	if data.CreateOption != nil {
		createOption := string(*data.CreateOption)
		destination.CreateOption = &createOption
	} else {
		destination.CreateOption = nil
	}

	// ElasticSanResourceId
	destination.ElasticSanResourceId = genruntime.ClonePointerToString(data.ElasticSanResourceId)

	// GalleryImageReference
	if data.GalleryImageReference != nil {
		var galleryImageReference storage.ImageDiskReference_STATUS
		err := data.GalleryImageReference.AssignProperties_To_ImageDiskReference_STATUS(&galleryImageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageDiskReference_STATUS() to populate field GalleryImageReference")
		}
		destination.GalleryImageReference = &galleryImageReference
	} else {
		destination.GalleryImageReference = nil
	}

	// ImageReference
	if data.ImageReference != nil {
		var imageReference storage.ImageDiskReference_STATUS
		err := data.ImageReference.AssignProperties_To_ImageDiskReference_STATUS(&imageReference)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageDiskReference_STATUS() to populate field ImageReference")
		}
		destination.ImageReference = &imageReference
	} else {
		destination.ImageReference = nil
	}

	// LogicalSectorSize
	destination.LogicalSectorSize = genruntime.ClonePointerToInt(data.LogicalSectorSize)

	// PerformancePlus
	if data.PerformancePlus != nil {
		performancePlus := *data.PerformancePlus
		destination.PerformancePlus = &performancePlus
	} else {
		destination.PerformancePlus = nil
	}

	// ProvisionedBandwidthCopySpeed
	if data.ProvisionedBandwidthCopySpeed != nil {
		provisionedBandwidthCopySpeed := string(*data.ProvisionedBandwidthCopySpeed)
		destination.ProvisionedBandwidthCopySpeed = &provisionedBandwidthCopySpeed
	} else {
		destination.ProvisionedBandwidthCopySpeed = nil
	}

	// SecurityDataUri
	destination.SecurityDataUri = genruntime.ClonePointerToString(data.SecurityDataUri)

	// SourceResourceId
	destination.SourceResourceId = genruntime.ClonePointerToString(data.SourceResourceId)

	// SourceUniqueId
	destination.SourceUniqueId = genruntime.ClonePointerToString(data.SourceUniqueId)

	// SourceUri
	destination.SourceUri = genruntime.ClonePointerToString(data.SourceUri)

	// StorageAccountId
	destination.StorageAccountId = genruntime.ClonePointerToString(data.StorageAccountId)

	// UploadSizeBytes
	destination.UploadSizeBytes = genruntime.ClonePointerToInt(data.UploadSizeBytes)

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

	// No error
	return nil
}

// Additional authentication requirements when exporting or uploading to a disk or snapshot.
// +kubebuilder:validation:Enum={"AzureActiveDirectory","None"}
type DataAccessAuthMode string

const (
	DataAccessAuthMode_AzureActiveDirectory = DataAccessAuthMode("AzureActiveDirectory")
	DataAccessAuthMode_None                 = DataAccessAuthMode("None")
)

// Mapping from string to DataAccessAuthMode
var dataAccessAuthMode_Values = map[string]DataAccessAuthMode{
	"azureactivedirectory": DataAccessAuthMode_AzureActiveDirectory,
	"none":                 DataAccessAuthMode_None,
}

// Additional authentication requirements when exporting or uploading to a disk or snapshot.
type DataAccessAuthMode_STATUS string

const (
	DataAccessAuthMode_STATUS_AzureActiveDirectory = DataAccessAuthMode_STATUS("AzureActiveDirectory")
	DataAccessAuthMode_STATUS_None                 = DataAccessAuthMode_STATUS("None")
)

// Mapping from string to DataAccessAuthMode_STATUS
var dataAccessAuthMode_STATUS_Values = map[string]DataAccessAuthMode_STATUS{
	"azureactivedirectory": DataAccessAuthMode_STATUS_AzureActiveDirectory,
	"none":                 DataAccessAuthMode_STATUS_None,
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type DiskOperatorSpec 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_DiskOperatorSpec populates our DiskOperatorSpec from the provided source DiskOperatorSpec
func (operator *DiskOperatorSpec) AssignProperties_From_DiskOperatorSpec(source *storage.DiskOperatorSpec) 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_DiskOperatorSpec populates the provided destination DiskOperatorSpec from our DiskOperatorSpec
func (operator *DiskOperatorSpec) AssignProperties_To_DiskOperatorSpec(destination *storage.DiskOperatorSpec) 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
}

// Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
type DiskPurchasePlan struct {
	// +kubebuilder:validation:Required
	// Name: The plan ID.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// Product: Specifies the product of the image from the marketplace. This is the same value as Offer under the
	// imageReference element.
	Product *string `json:"product,omitempty"`

	// PromotionCode: The Offer Promotion Code.
	PromotionCode *string `json:"promotionCode,omitempty"`

	// +kubebuilder:validation:Required
	// Publisher: The publisher ID.
	Publisher *string `json:"publisher,omitempty"`
}

var _ genruntime.ARMTransformer = &DiskPurchasePlan{}

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

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

	// Set property "Product":
	if plan.Product != nil {
		product := *plan.Product
		result.Product = &product
	}

	// Set property "PromotionCode":
	if plan.PromotionCode != nil {
		promotionCode := *plan.PromotionCode
		result.PromotionCode = &promotionCode
	}

	// Set property "Publisher":
	if plan.Publisher != nil {
		publisher := *plan.Publisher
		result.Publisher = &publisher
	}
	return result, nil
}

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

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

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

	// Set property "Product":
	if typedInput.Product != nil {
		product := *typedInput.Product
		plan.Product = &product
	}

	// Set property "PromotionCode":
	if typedInput.PromotionCode != nil {
		promotionCode := *typedInput.PromotionCode
		plan.PromotionCode = &promotionCode
	}

	// Set property "Publisher":
	if typedInput.Publisher != nil {
		publisher := *typedInput.Publisher
		plan.Publisher = &publisher
	}

	// No error
	return nil
}

// AssignProperties_From_DiskPurchasePlan populates our DiskPurchasePlan from the provided source DiskPurchasePlan
func (plan *DiskPurchasePlan) AssignProperties_From_DiskPurchasePlan(source *storage.DiskPurchasePlan) error {

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

	// Product
	plan.Product = genruntime.ClonePointerToString(source.Product)

	// PromotionCode
	plan.PromotionCode = genruntime.ClonePointerToString(source.PromotionCode)

	// Publisher
	plan.Publisher = genruntime.ClonePointerToString(source.Publisher)

	// No error
	return nil
}

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

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

	// Product
	destination.Product = genruntime.ClonePointerToString(plan.Product)

	// PromotionCode
	destination.PromotionCode = genruntime.ClonePointerToString(plan.PromotionCode)

	// Publisher
	destination.Publisher = genruntime.ClonePointerToString(plan.Publisher)

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

	// No error
	return nil
}

// Initialize_From_DiskPurchasePlan_STATUS populates our DiskPurchasePlan from the provided source DiskPurchasePlan_STATUS
func (plan *DiskPurchasePlan) Initialize_From_DiskPurchasePlan_STATUS(source *DiskPurchasePlan_STATUS) error {

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

	// Product
	plan.Product = genruntime.ClonePointerToString(source.Product)

	// PromotionCode
	plan.PromotionCode = genruntime.ClonePointerToString(source.PromotionCode)

	// Publisher
	plan.Publisher = genruntime.ClonePointerToString(source.Publisher)

	// No error
	return nil
}

// Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
type DiskPurchasePlan_STATUS struct {
	// Name: The plan ID.
	Name *string `json:"name,omitempty"`

	// Product: Specifies the product of the image from the marketplace. This is the same value as Offer under the
	// imageReference element.
	Product *string `json:"product,omitempty"`

	// PromotionCode: The Offer Promotion Code.
	PromotionCode *string `json:"promotionCode,omitempty"`

	// Publisher: The publisher ID.
	Publisher *string `json:"publisher,omitempty"`
}

var _ genruntime.FromARMConverter = &DiskPurchasePlan_STATUS{}

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

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

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

	// Set property "Product":
	if typedInput.Product != nil {
		product := *typedInput.Product
		plan.Product = &product
	}

	// Set property "PromotionCode":
	if typedInput.PromotionCode != nil {
		promotionCode := *typedInput.PromotionCode
		plan.PromotionCode = &promotionCode
	}

	// Set property "Publisher":
	if typedInput.Publisher != nil {
		publisher := *typedInput.Publisher
		plan.Publisher = &publisher
	}

	// No error
	return nil
}

// AssignProperties_From_DiskPurchasePlan_STATUS populates our DiskPurchasePlan_STATUS from the provided source DiskPurchasePlan_STATUS
func (plan *DiskPurchasePlan_STATUS) AssignProperties_From_DiskPurchasePlan_STATUS(source *storage.DiskPurchasePlan_STATUS) error {

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

	// Product
	plan.Product = genruntime.ClonePointerToString(source.Product)

	// PromotionCode
	plan.PromotionCode = genruntime.ClonePointerToString(source.PromotionCode)

	// Publisher
	plan.Publisher = genruntime.ClonePointerToString(source.Publisher)

	// No error
	return nil
}

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

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

	// Product
	destination.Product = genruntime.ClonePointerToString(plan.Product)

	// PromotionCode
	destination.PromotionCode = genruntime.ClonePointerToString(plan.PromotionCode)

	// Publisher
	destination.Publisher = genruntime.ClonePointerToString(plan.Publisher)

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

	// No error
	return nil
}

// Contains the security related information for the resource.
type DiskSecurityProfile struct {
	// SecureVMDiskEncryptionSetReference: ResourceId of the disk encryption set associated to Confidential VM supported disk
	// encrypted with customer managed key
	SecureVMDiskEncryptionSetReference *genruntime.ResourceReference `armReference:"SecureVMDiskEncryptionSetId" json:"secureVMDiskEncryptionSetReference,omitempty"`

	// SecurityType: Specifies the SecurityType of the VM. Applicable for OS disks only.
	SecurityType *DiskSecurityTypes `json:"securityType,omitempty"`
}

var _ genruntime.ARMTransformer = &DiskSecurityProfile{}

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

	// Set property "SecureVMDiskEncryptionSetId":
	if profile.SecureVMDiskEncryptionSetReference != nil {
		secureVMDiskEncryptionSetReferenceARMID, err := resolved.ResolvedReferences.Lookup(*profile.SecureVMDiskEncryptionSetReference)
		if err != nil {
			return nil, err
		}
		secureVMDiskEncryptionSetReference := secureVMDiskEncryptionSetReferenceARMID
		result.SecureVMDiskEncryptionSetId = &secureVMDiskEncryptionSetReference
	}

	// Set property "SecurityType":
	if profile.SecurityType != nil {
		var temp string
		temp = string(*profile.SecurityType)
		securityType := arm.DiskSecurityTypes(temp)
		result.SecurityType = &securityType
	}
	return result, nil
}

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

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

	// no assignment for property "SecureVMDiskEncryptionSetReference"

	// Set property "SecurityType":
	if typedInput.SecurityType != nil {
		var temp string
		temp = string(*typedInput.SecurityType)
		securityType := DiskSecurityTypes(temp)
		profile.SecurityType = &securityType
	}

	// No error
	return nil
}

// AssignProperties_From_DiskSecurityProfile populates our DiskSecurityProfile from the provided source DiskSecurityProfile
func (profile *DiskSecurityProfile) AssignProperties_From_DiskSecurityProfile(source *storage.DiskSecurityProfile) error {

	// SecureVMDiskEncryptionSetReference
	if source.SecureVMDiskEncryptionSetReference != nil {
		secureVMDiskEncryptionSetReference := source.SecureVMDiskEncryptionSetReference.Copy()
		profile.SecureVMDiskEncryptionSetReference = &secureVMDiskEncryptionSetReference
	} else {
		profile.SecureVMDiskEncryptionSetReference = nil
	}

	// SecurityType
	if source.SecurityType != nil {
		securityType := *source.SecurityType
		securityTypeTemp := genruntime.ToEnum(securityType, diskSecurityTypes_Values)
		profile.SecurityType = &securityTypeTemp
	} else {
		profile.SecurityType = nil
	}

	// No error
	return nil
}

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

	// SecureVMDiskEncryptionSetReference
	if profile.SecureVMDiskEncryptionSetReference != nil {
		secureVMDiskEncryptionSetReference := profile.SecureVMDiskEncryptionSetReference.Copy()
		destination.SecureVMDiskEncryptionSetReference = &secureVMDiskEncryptionSetReference
	} else {
		destination.SecureVMDiskEncryptionSetReference = nil
	}

	// SecurityType
	if profile.SecurityType != nil {
		securityType := string(*profile.SecurityType)
		destination.SecurityType = &securityType
	} else {
		destination.SecurityType = nil
	}

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

	// No error
	return nil
}

// Initialize_From_DiskSecurityProfile_STATUS populates our DiskSecurityProfile from the provided source DiskSecurityProfile_STATUS
func (profile *DiskSecurityProfile) Initialize_From_DiskSecurityProfile_STATUS(source *DiskSecurityProfile_STATUS) error {

	// SecureVMDiskEncryptionSetReference
	if source.SecureVMDiskEncryptionSetId != nil {
		secureVMDiskEncryptionSetReference := genruntime.CreateResourceReferenceFromARMID(*source.SecureVMDiskEncryptionSetId)
		profile.SecureVMDiskEncryptionSetReference = &secureVMDiskEncryptionSetReference
	} else {
		profile.SecureVMDiskEncryptionSetReference = nil
	}

	// SecurityType
	if source.SecurityType != nil {
		securityType := genruntime.ToEnum(string(*source.SecurityType), diskSecurityTypes_Values)
		profile.SecurityType = &securityType
	} else {
		profile.SecurityType = nil
	}

	// No error
	return nil
}

// Contains the security related information for the resource.
type DiskSecurityProfile_STATUS struct {
	// SecureVMDiskEncryptionSetId: ResourceId of the disk encryption set associated to Confidential VM supported disk
	// encrypted with customer managed key
	SecureVMDiskEncryptionSetId *string `json:"secureVMDiskEncryptionSetId,omitempty"`

	// SecurityType: Specifies the SecurityType of the VM. Applicable for OS disks only.
	SecurityType *DiskSecurityTypes_STATUS `json:"securityType,omitempty"`
}

var _ genruntime.FromARMConverter = &DiskSecurityProfile_STATUS{}

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

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

	// Set property "SecureVMDiskEncryptionSetId":
	if typedInput.SecureVMDiskEncryptionSetId != nil {
		secureVMDiskEncryptionSetId := *typedInput.SecureVMDiskEncryptionSetId
		profile.SecureVMDiskEncryptionSetId = &secureVMDiskEncryptionSetId
	}

	// Set property "SecurityType":
	if typedInput.SecurityType != nil {
		var temp string
		temp = string(*typedInput.SecurityType)
		securityType := DiskSecurityTypes_STATUS(temp)
		profile.SecurityType = &securityType
	}

	// No error
	return nil
}

// AssignProperties_From_DiskSecurityProfile_STATUS populates our DiskSecurityProfile_STATUS from the provided source DiskSecurityProfile_STATUS
func (profile *DiskSecurityProfile_STATUS) AssignProperties_From_DiskSecurityProfile_STATUS(source *storage.DiskSecurityProfile_STATUS) error {

	// SecureVMDiskEncryptionSetId
	profile.SecureVMDiskEncryptionSetId = genruntime.ClonePointerToString(source.SecureVMDiskEncryptionSetId)

	// SecurityType
	if source.SecurityType != nil {
		securityType := *source.SecurityType
		securityTypeTemp := genruntime.ToEnum(securityType, diskSecurityTypes_STATUS_Values)
		profile.SecurityType = &securityTypeTemp
	} else {
		profile.SecurityType = nil
	}

	// No error
	return nil
}

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

	// SecureVMDiskEncryptionSetId
	destination.SecureVMDiskEncryptionSetId = genruntime.ClonePointerToString(profile.SecureVMDiskEncryptionSetId)

	// SecurityType
	if profile.SecurityType != nil {
		securityType := string(*profile.SecurityType)
		destination.SecurityType = &securityType
	} else {
		destination.SecurityType = nil
	}

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

	// No error
	return nil
}

// The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or
// PremiumV2_LRS.
type DiskSku struct {
	// Name: The sku name.
	Name *DiskStorageAccountTypes `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &DiskSku{}

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

	// Set property "Name":
	if diskSku.Name != nil {
		var temp string
		temp = string(*diskSku.Name)
		name := arm.DiskStorageAccountTypes(temp)
		result.Name = &name
	}
	return result, nil
}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_DiskSku populates our DiskSku from the provided source DiskSku
func (diskSku *DiskSku) AssignProperties_From_DiskSku(source *storage.DiskSku) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_DiskSku_STATUS populates our DiskSku from the provided source DiskSku_STATUS
func (diskSku *DiskSku) Initialize_From_DiskSku_STATUS(source *DiskSku_STATUS) error {

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

	// No error
	return nil
}

// The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or
// PremiumV2_LRS.
type DiskSku_STATUS struct {
	// Name: The sku name.
	Name *DiskStorageAccountTypes_STATUS `json:"name,omitempty"`

	// Tier: The sku tier.
	Tier *string `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &DiskSku_STATUS{}

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_DiskSku_STATUS populates our DiskSku_STATUS from the provided source DiskSku_STATUS
func (diskSku *DiskSku_STATUS) AssignProperties_From_DiskSku_STATUS(source *storage.DiskSku_STATUS) error {

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// This enumerates the possible state of the disk.
type DiskState_STATUS string

const (
	DiskState_STATUS_ActiveSAS       = DiskState_STATUS("ActiveSAS")
	DiskState_STATUS_ActiveSASFrozen = DiskState_STATUS("ActiveSASFrozen")
	DiskState_STATUS_ActiveUpload    = DiskState_STATUS("ActiveUpload")
	DiskState_STATUS_Attached        = DiskState_STATUS("Attached")
	DiskState_STATUS_Frozen          = DiskState_STATUS("Frozen")
	DiskState_STATUS_ReadyToUpload   = DiskState_STATUS("ReadyToUpload")
	DiskState_STATUS_Reserved        = DiskState_STATUS("Reserved")
	DiskState_STATUS_Unattached      = DiskState_STATUS("Unattached")
)

// Mapping from string to DiskState_STATUS
var diskState_STATUS_Values = map[string]DiskState_STATUS{
	"activesas":       DiskState_STATUS_ActiveSAS,
	"activesasfrozen": DiskState_STATUS_ActiveSASFrozen,
	"activeupload":    DiskState_STATUS_ActiveUpload,
	"attached":        DiskState_STATUS_Attached,
	"frozen":          DiskState_STATUS_Frozen,
	"readytoupload":   DiskState_STATUS_ReadyToUpload,
	"reserved":        DiskState_STATUS_Reserved,
	"unattached":      DiskState_STATUS_Unattached,
}

// Encryption at rest settings for disk or snapshot
type Encryption struct {
	// DiskEncryptionSetReference: ResourceId of the disk encryption set to use for enabling encryption at rest.
	DiskEncryptionSetReference *genruntime.ResourceReference `armReference:"DiskEncryptionSetId" json:"diskEncryptionSetReference,omitempty"`

	// Type: The type of key used to encrypt the data of the disk.
	Type *EncryptionType `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &Encryption{}

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

	// Set property "DiskEncryptionSetId":
	if encryption.DiskEncryptionSetReference != nil {
		diskEncryptionSetReferenceARMID, err := resolved.ResolvedReferences.Lookup(*encryption.DiskEncryptionSetReference)
		if err != nil {
			return nil, err
		}
		diskEncryptionSetReference := diskEncryptionSetReferenceARMID
		result.DiskEncryptionSetId = &diskEncryptionSetReference
	}

	// Set property "Type":
	if encryption.Type != nil {
		var temp string
		temp = string(*encryption.Type)
		typeVar := arm.EncryptionType(temp)
		result.Type = &typeVar
	}
	return result, nil
}

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

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

	// no assignment for property "DiskEncryptionSetReference"

	// Set property "Type":
	if typedInput.Type != nil {
		var temp string
		temp = string(*typedInput.Type)
		typeVar := EncryptionType(temp)
		encryption.Type = &typeVar
	}

	// No error
	return nil
}

// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption
func (encryption *Encryption) AssignProperties_From_Encryption(source *storage.Encryption) error {

	// DiskEncryptionSetReference
	if source.DiskEncryptionSetReference != nil {
		diskEncryptionSetReference := source.DiskEncryptionSetReference.Copy()
		encryption.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		encryption.DiskEncryptionSetReference = nil
	}

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

	// No error
	return nil
}

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

	// DiskEncryptionSetReference
	if encryption.DiskEncryptionSetReference != nil {
		diskEncryptionSetReference := encryption.DiskEncryptionSetReference.Copy()
		destination.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		destination.DiskEncryptionSetReference = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_Encryption_STATUS populates our Encryption from the provided source Encryption_STATUS
func (encryption *Encryption) Initialize_From_Encryption_STATUS(source *Encryption_STATUS) error {

	// DiskEncryptionSetReference
	if source.DiskEncryptionSetId != nil {
		diskEncryptionSetReference := genruntime.CreateResourceReferenceFromARMID(*source.DiskEncryptionSetId)
		encryption.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		encryption.DiskEncryptionSetReference = nil
	}

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

	// No error
	return nil
}

// Encryption at rest settings for disk or snapshot
type Encryption_STATUS struct {
	// DiskEncryptionSetId: ResourceId of the disk encryption set to use for enabling encryption at rest.
	DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"`

	// Type: The type of key used to encrypt the data of the disk.
	Type *EncryptionType_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &Encryption_STATUS{}

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

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

	// Set property "DiskEncryptionSetId":
	if typedInput.DiskEncryptionSetId != nil {
		diskEncryptionSetId := *typedInput.DiskEncryptionSetId
		encryption.DiskEncryptionSetId = &diskEncryptionSetId
	}

	// Set property "Type":
	if typedInput.Type != nil {
		var temp string
		temp = string(*typedInput.Type)
		typeVar := EncryptionType_STATUS(temp)
		encryption.Type = &typeVar
	}

	// No error
	return nil
}

// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS
func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *storage.Encryption_STATUS) error {

	// DiskEncryptionSetId
	encryption.DiskEncryptionSetId = genruntime.ClonePointerToString(source.DiskEncryptionSetId)

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

	// No error
	return nil
}

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

	// DiskEncryptionSetId
	destination.DiskEncryptionSetId = genruntime.ClonePointerToString(encryption.DiskEncryptionSetId)

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

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

	// No error
	return nil
}

// Encryption settings for disk or snapshot
type EncryptionSettingsCollection struct {
	// +kubebuilder:validation:Required
	// Enabled: Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set
	// this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is
	// null in the request object, the existing settings remain unchanged.
	Enabled *bool `json:"enabled,omitempty"`

	// EncryptionSettings: A collection of encryption settings, one for each disk volume.
	EncryptionSettings []EncryptionSettingsElement `json:"encryptionSettings,omitempty"`

	// EncryptionSettingsVersion: Describes what type of encryption is used for the disks. Once this field is set, it cannot be
	// overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption.
	EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"`
}

var _ genruntime.ARMTransformer = &EncryptionSettingsCollection{}

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

	// Set property "Enabled":
	if collection.Enabled != nil {
		enabled := *collection.Enabled
		result.Enabled = &enabled
	}

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

	// Set property "EncryptionSettingsVersion":
	if collection.EncryptionSettingsVersion != nil {
		encryptionSettingsVersion := *collection.EncryptionSettingsVersion
		result.EncryptionSettingsVersion = &encryptionSettingsVersion
	}
	return result, nil
}

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

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

	// Set property "Enabled":
	if typedInput.Enabled != nil {
		enabled := *typedInput.Enabled
		collection.Enabled = &enabled
	}

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

	// Set property "EncryptionSettingsVersion":
	if typedInput.EncryptionSettingsVersion != nil {
		encryptionSettingsVersion := *typedInput.EncryptionSettingsVersion
		collection.EncryptionSettingsVersion = &encryptionSettingsVersion
	}

	// No error
	return nil
}

// AssignProperties_From_EncryptionSettingsCollection populates our EncryptionSettingsCollection from the provided source EncryptionSettingsCollection
func (collection *EncryptionSettingsCollection) AssignProperties_From_EncryptionSettingsCollection(source *storage.EncryptionSettingsCollection) error {

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		collection.Enabled = &enabled
	} else {
		collection.Enabled = nil
	}

	// EncryptionSettings
	if source.EncryptionSettings != nil {
		encryptionSettingList := make([]EncryptionSettingsElement, len(source.EncryptionSettings))
		for encryptionSettingIndex, encryptionSettingItem := range source.EncryptionSettings {
			var encryptionSetting EncryptionSettingsElement
			err := encryptionSetting.AssignProperties_From_EncryptionSettingsElement(&encryptionSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EncryptionSettingsElement() to populate field EncryptionSettings")
			}
			encryptionSettingList[encryptionSettingIndex] = encryptionSetting
		}
		collection.EncryptionSettings = encryptionSettingList
	} else {
		collection.EncryptionSettings = nil
	}

	// EncryptionSettingsVersion
	collection.EncryptionSettingsVersion = genruntime.ClonePointerToString(source.EncryptionSettingsVersion)

	// No error
	return nil
}

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

	// Enabled
	if collection.Enabled != nil {
		enabled := *collection.Enabled
		destination.Enabled = &enabled
	} else {
		destination.Enabled = nil
	}

	// EncryptionSettings
	if collection.EncryptionSettings != nil {
		encryptionSettingList := make([]storage.EncryptionSettingsElement, len(collection.EncryptionSettings))
		for encryptionSettingIndex, encryptionSettingItem := range collection.EncryptionSettings {
			var encryptionSetting storage.EncryptionSettingsElement
			err := encryptionSettingItem.AssignProperties_To_EncryptionSettingsElement(&encryptionSetting)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EncryptionSettingsElement() to populate field EncryptionSettings")
			}
			encryptionSettingList[encryptionSettingIndex] = encryptionSetting
		}
		destination.EncryptionSettings = encryptionSettingList
	} else {
		destination.EncryptionSettings = nil
	}

	// EncryptionSettingsVersion
	destination.EncryptionSettingsVersion = genruntime.ClonePointerToString(collection.EncryptionSettingsVersion)

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

	// No error
	return nil
}

// Initialize_From_EncryptionSettingsCollection_STATUS populates our EncryptionSettingsCollection from the provided source EncryptionSettingsCollection_STATUS
func (collection *EncryptionSettingsCollection) Initialize_From_EncryptionSettingsCollection_STATUS(source *EncryptionSettingsCollection_STATUS) error {

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		collection.Enabled = &enabled
	} else {
		collection.Enabled = nil
	}

	// EncryptionSettings
	if source.EncryptionSettings != nil {
		encryptionSettingList := make([]EncryptionSettingsElement, len(source.EncryptionSettings))
		for encryptionSettingIndex, encryptionSettingItem := range source.EncryptionSettings {
			var encryptionSetting EncryptionSettingsElement
			err := encryptionSetting.Initialize_From_EncryptionSettingsElement_STATUS(&encryptionSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_EncryptionSettingsElement_STATUS() to populate field EncryptionSettings")
			}
			encryptionSettingList[encryptionSettingIndex] = encryptionSetting
		}
		collection.EncryptionSettings = encryptionSettingList
	} else {
		collection.EncryptionSettings = nil
	}

	// EncryptionSettingsVersion
	collection.EncryptionSettingsVersion = genruntime.ClonePointerToString(source.EncryptionSettingsVersion)

	// No error
	return nil
}

// Encryption settings for disk or snapshot
type EncryptionSettingsCollection_STATUS struct {
	// Enabled: Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set
	// this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is
	// null in the request object, the existing settings remain unchanged.
	Enabled *bool `json:"enabled,omitempty"`

	// EncryptionSettings: A collection of encryption settings, one for each disk volume.
	EncryptionSettings []EncryptionSettingsElement_STATUS `json:"encryptionSettings,omitempty"`

	// EncryptionSettingsVersion: Describes what type of encryption is used for the disks. Once this field is set, it cannot be
	// overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption.
	EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"`
}

var _ genruntime.FromARMConverter = &EncryptionSettingsCollection_STATUS{}

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

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

	// Set property "Enabled":
	if typedInput.Enabled != nil {
		enabled := *typedInput.Enabled
		collection.Enabled = &enabled
	}

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

	// Set property "EncryptionSettingsVersion":
	if typedInput.EncryptionSettingsVersion != nil {
		encryptionSettingsVersion := *typedInput.EncryptionSettingsVersion
		collection.EncryptionSettingsVersion = &encryptionSettingsVersion
	}

	// No error
	return nil
}

// AssignProperties_From_EncryptionSettingsCollection_STATUS populates our EncryptionSettingsCollection_STATUS from the provided source EncryptionSettingsCollection_STATUS
func (collection *EncryptionSettingsCollection_STATUS) AssignProperties_From_EncryptionSettingsCollection_STATUS(source *storage.EncryptionSettingsCollection_STATUS) error {

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		collection.Enabled = &enabled
	} else {
		collection.Enabled = nil
	}

	// EncryptionSettings
	if source.EncryptionSettings != nil {
		encryptionSettingList := make([]EncryptionSettingsElement_STATUS, len(source.EncryptionSettings))
		for encryptionSettingIndex, encryptionSettingItem := range source.EncryptionSettings {
			var encryptionSetting EncryptionSettingsElement_STATUS
			err := encryptionSetting.AssignProperties_From_EncryptionSettingsElement_STATUS(&encryptionSettingItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EncryptionSettingsElement_STATUS() to populate field EncryptionSettings")
			}
			encryptionSettingList[encryptionSettingIndex] = encryptionSetting
		}
		collection.EncryptionSettings = encryptionSettingList
	} else {
		collection.EncryptionSettings = nil
	}

	// EncryptionSettingsVersion
	collection.EncryptionSettingsVersion = genruntime.ClonePointerToString(source.EncryptionSettingsVersion)

	// No error
	return nil
}

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

	// Enabled
	if collection.Enabled != nil {
		enabled := *collection.Enabled
		destination.Enabled = &enabled
	} else {
		destination.Enabled = nil
	}

	// EncryptionSettings
	if collection.EncryptionSettings != nil {
		encryptionSettingList := make([]storage.EncryptionSettingsElement_STATUS, len(collection.EncryptionSettings))
		for encryptionSettingIndex, encryptionSettingItem := range collection.EncryptionSettings {
			var encryptionSetting storage.EncryptionSettingsElement_STATUS
			err := encryptionSettingItem.AssignProperties_To_EncryptionSettingsElement_STATUS(&encryptionSetting)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EncryptionSettingsElement_STATUS() to populate field EncryptionSettings")
			}
			encryptionSettingList[encryptionSettingIndex] = encryptionSetting
		}
		destination.EncryptionSettings = encryptionSettingList
	} else {
		destination.EncryptionSettings = nil
	}

	// EncryptionSettingsVersion
	destination.EncryptionSettingsVersion = genruntime.ClonePointerToString(collection.EncryptionSettingsVersion)

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

	// No error
	return nil
}

// The complex type of the extended location.
type ExtendedLocation struct {
	// Name: The name of the extended location.
	Name *string `json:"name,omitempty"`

	// Type: The type of the extended location.
	Type *ExtendedLocationType `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &ExtendedLocation{}

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

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

	// Set property "Type":
	if location.Type != nil {
		var temp string
		temp = string(*location.Type)
		typeVar := arm.ExtendedLocationType(temp)
		result.Type = &typeVar
	}
	return result, nil
}

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

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

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

	// Set property "Type":
	if typedInput.Type != nil {
		var temp string
		temp = string(*typedInput.Type)
		typeVar := ExtendedLocationType(temp)
		location.Type = &typeVar
	}

	// No error
	return nil
}

// AssignProperties_From_ExtendedLocation populates our ExtendedLocation from the provided source ExtendedLocation
func (location *ExtendedLocation) AssignProperties_From_ExtendedLocation(source *storage.ExtendedLocation) error {

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Initialize_From_ExtendedLocation_STATUS populates our ExtendedLocation from the provided source ExtendedLocation_STATUS
func (location *ExtendedLocation) Initialize_From_ExtendedLocation_STATUS(source *ExtendedLocation_STATUS) error {

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

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

	// No error
	return nil
}

// The complex type of the extended location.
type ExtendedLocation_STATUS struct {
	// Name: The name of the extended location.
	Name *string `json:"name,omitempty"`

	// Type: The type of the extended location.
	Type *ExtendedLocationType_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &ExtendedLocation_STATUS{}

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

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

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

	// Set property "Type":
	if typedInput.Type != nil {
		var temp string
		temp = string(*typedInput.Type)
		typeVar := ExtendedLocationType_STATUS(temp)
		location.Type = &typeVar
	}

	// No error
	return nil
}

// AssignProperties_From_ExtendedLocation_STATUS populates our ExtendedLocation_STATUS from the provided source ExtendedLocation_STATUS
func (location *ExtendedLocation_STATUS) AssignProperties_From_ExtendedLocation_STATUS(source *storage.ExtendedLocation_STATUS) error {

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
// +kubebuilder:validation:Enum={"V1","V2"}
type HyperVGeneration string

const (
	HyperVGeneration_V1 = HyperVGeneration("V1")
	HyperVGeneration_V2 = HyperVGeneration("V2")
)

// Mapping from string to HyperVGeneration
var hyperVGeneration_Values = map[string]HyperVGeneration{
	"v1": HyperVGeneration_V1,
	"v2": HyperVGeneration_V2,
}

// The hypervisor generation of the Virtual Machine. Applicable to OS disks only.
type HyperVGeneration_STATUS string

const (
	HyperVGeneration_STATUS_V1 = HyperVGeneration_STATUS("V1")
	HyperVGeneration_STATUS_V2 = HyperVGeneration_STATUS("V2")
)

// Mapping from string to HyperVGeneration_STATUS
var hyperVGeneration_STATUS_Values = map[string]HyperVGeneration_STATUS{
	"v1": HyperVGeneration_STATUS_V1,
	"v2": HyperVGeneration_STATUS_V2,
}

// Policy for accessing the disk via network.
// +kubebuilder:validation:Enum={"AllowAll","AllowPrivate","DenyAll"}
type NetworkAccessPolicy string

const (
	NetworkAccessPolicy_AllowAll     = NetworkAccessPolicy("AllowAll")
	NetworkAccessPolicy_AllowPrivate = NetworkAccessPolicy("AllowPrivate")
	NetworkAccessPolicy_DenyAll      = NetworkAccessPolicy("DenyAll")
)

// Mapping from string to NetworkAccessPolicy
var networkAccessPolicy_Values = map[string]NetworkAccessPolicy{
	"allowall":     NetworkAccessPolicy_AllowAll,
	"allowprivate": NetworkAccessPolicy_AllowPrivate,
	"denyall":      NetworkAccessPolicy_DenyAll,
}

// Policy for accessing the disk via network.
type NetworkAccessPolicy_STATUS string

const (
	NetworkAccessPolicy_STATUS_AllowAll     = NetworkAccessPolicy_STATUS("AllowAll")
	NetworkAccessPolicy_STATUS_AllowPrivate = NetworkAccessPolicy_STATUS("AllowPrivate")
	NetworkAccessPolicy_STATUS_DenyAll      = NetworkAccessPolicy_STATUS("DenyAll")
)

// Mapping from string to NetworkAccessPolicy_STATUS
var networkAccessPolicy_STATUS_Values = map[string]NetworkAccessPolicy_STATUS{
	"allowall":     NetworkAccessPolicy_STATUS_AllowAll,
	"allowprivate": NetworkAccessPolicy_STATUS_AllowPrivate,
	"denyall":      NetworkAccessPolicy_STATUS_DenyAll,
}

// The Operating System type.
// +kubebuilder:validation:Enum={"Linux","Windows"}
type OperatingSystemTypes string

const (
	OperatingSystemTypes_Linux   = OperatingSystemTypes("Linux")
	OperatingSystemTypes_Windows = OperatingSystemTypes("Windows")
)

// Mapping from string to OperatingSystemTypes
var operatingSystemTypes_Values = map[string]OperatingSystemTypes{
	"linux":   OperatingSystemTypes_Linux,
	"windows": OperatingSystemTypes_Windows,
}

// The Operating System type.
type OperatingSystemTypes_STATUS string

const (
	OperatingSystemTypes_STATUS_Linux   = OperatingSystemTypes_STATUS("Linux")
	OperatingSystemTypes_STATUS_Windows = OperatingSystemTypes_STATUS("Windows")
)

// Mapping from string to OperatingSystemTypes_STATUS
var operatingSystemTypes_STATUS_Values = map[string]OperatingSystemTypes_STATUS{
	"linux":   OperatingSystemTypes_STATUS_Linux,
	"windows": OperatingSystemTypes_STATUS_Windows,
}

// Properties of the disk for which update is pending.
type PropertyUpdatesInProgress_STATUS struct {
	// TargetTier: The target performance tier of the disk if a tier change operation is in progress.
	TargetTier *string `json:"targetTier,omitempty"`
}

var _ genruntime.FromARMConverter = &PropertyUpdatesInProgress_STATUS{}

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

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

	// Set property "TargetTier":
	if typedInput.TargetTier != nil {
		targetTier := *typedInput.TargetTier
		progress.TargetTier = &targetTier
	}

	// No error
	return nil
}

// AssignProperties_From_PropertyUpdatesInProgress_STATUS populates our PropertyUpdatesInProgress_STATUS from the provided source PropertyUpdatesInProgress_STATUS
func (progress *PropertyUpdatesInProgress_STATUS) AssignProperties_From_PropertyUpdatesInProgress_STATUS(source *storage.PropertyUpdatesInProgress_STATUS) error {

	// TargetTier
	progress.TargetTier = genruntime.ClonePointerToString(source.TargetTier)

	// No error
	return nil
}

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

	// TargetTier
	destination.TargetTier = genruntime.ClonePointerToString(progress.TargetTier)

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

	// No error
	return nil
}

// Policy for controlling export on the disk.
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type PublicNetworkAccess string

const (
	PublicNetworkAccess_Disabled = PublicNetworkAccess("Disabled")
	PublicNetworkAccess_Enabled  = PublicNetworkAccess("Enabled")
)

// Mapping from string to PublicNetworkAccess
var publicNetworkAccess_Values = map[string]PublicNetworkAccess{
	"disabled": PublicNetworkAccess_Disabled,
	"enabled":  PublicNetworkAccess_Enabled,
}

// Policy for controlling export on the disk.
type PublicNetworkAccess_STATUS string

const (
	PublicNetworkAccess_STATUS_Disabled = PublicNetworkAccess_STATUS("Disabled")
	PublicNetworkAccess_STATUS_Enabled  = PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to PublicNetworkAccess_STATUS
var publicNetworkAccess_STATUS_Values = map[string]PublicNetworkAccess_STATUS{
	"disabled": PublicNetworkAccess_STATUS_Disabled,
	"enabled":  PublicNetworkAccess_STATUS_Enabled,
}

type ShareInfoElement_STATUS struct {
	// VmUri: A relative URI containing the ID of the VM that has the disk attached.
	VmUri *string `json:"vmUri,omitempty"`
}

var _ genruntime.FromARMConverter = &ShareInfoElement_STATUS{}

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

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

	// Set property "VmUri":
	if typedInput.VmUri != nil {
		vmUri := *typedInput.VmUri
		element.VmUri = &vmUri
	}

	// No error
	return nil
}

// AssignProperties_From_ShareInfoElement_STATUS populates our ShareInfoElement_STATUS from the provided source ShareInfoElement_STATUS
func (element *ShareInfoElement_STATUS) AssignProperties_From_ShareInfoElement_STATUS(source *storage.ShareInfoElement_STATUS) error {

	// VmUri
	element.VmUri = genruntime.ClonePointerToString(source.VmUri)

	// No error
	return nil
}

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

	// VmUri
	destination.VmUri = genruntime.ClonePointerToString(element.VmUri)

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

	// No error
	return nil
}

// List of supported capabilities persisted on the disk resource for VM use.
type SupportedCapabilities struct {
	// AcceleratedNetwork: True if the image from which the OS disk is created supports accelerated networking.
	AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"`

	// Architecture: CPU architecture supported by an OS disk.
	Architecture *Architecture `json:"architecture,omitempty"`

	// DiskControllerTypes: The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI.
	DiskControllerTypes *string `json:"diskControllerTypes,omitempty"`
}

var _ genruntime.ARMTransformer = &SupportedCapabilities{}

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

	// Set property "AcceleratedNetwork":
	if capabilities.AcceleratedNetwork != nil {
		acceleratedNetwork := *capabilities.AcceleratedNetwork
		result.AcceleratedNetwork = &acceleratedNetwork
	}

	// Set property "Architecture":
	if capabilities.Architecture != nil {
		var temp string
		temp = string(*capabilities.Architecture)
		architecture := arm.Architecture(temp)
		result.Architecture = &architecture
	}

	// Set property "DiskControllerTypes":
	if capabilities.DiskControllerTypes != nil {
		diskControllerTypes := *capabilities.DiskControllerTypes
		result.DiskControllerTypes = &diskControllerTypes
	}
	return result, nil
}

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

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

	// Set property "AcceleratedNetwork":
	if typedInput.AcceleratedNetwork != nil {
		acceleratedNetwork := *typedInput.AcceleratedNetwork
		capabilities.AcceleratedNetwork = &acceleratedNetwork
	}

	// Set property "Architecture":
	if typedInput.Architecture != nil {
		var temp string
		temp = string(*typedInput.Architecture)
		architecture := Architecture(temp)
		capabilities.Architecture = &architecture
	}

	// Set property "DiskControllerTypes":
	if typedInput.DiskControllerTypes != nil {
		diskControllerTypes := *typedInput.DiskControllerTypes
		capabilities.DiskControllerTypes = &diskControllerTypes
	}

	// No error
	return nil
}

// AssignProperties_From_SupportedCapabilities populates our SupportedCapabilities from the provided source SupportedCapabilities
func (capabilities *SupportedCapabilities) AssignProperties_From_SupportedCapabilities(source *storage.SupportedCapabilities) error {

	// AcceleratedNetwork
	if source.AcceleratedNetwork != nil {
		acceleratedNetwork := *source.AcceleratedNetwork
		capabilities.AcceleratedNetwork = &acceleratedNetwork
	} else {
		capabilities.AcceleratedNetwork = nil
	}

	// Architecture
	if source.Architecture != nil {
		architecture := *source.Architecture
		architectureTemp := genruntime.ToEnum(architecture, architecture_Values)
		capabilities.Architecture = &architectureTemp
	} else {
		capabilities.Architecture = nil
	}

	// DiskControllerTypes
	capabilities.DiskControllerTypes = genruntime.ClonePointerToString(source.DiskControllerTypes)

	// No error
	return nil
}

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

	// AcceleratedNetwork
	if capabilities.AcceleratedNetwork != nil {
		acceleratedNetwork := *capabilities.AcceleratedNetwork
		destination.AcceleratedNetwork = &acceleratedNetwork
	} else {
		destination.AcceleratedNetwork = nil
	}

	// Architecture
	if capabilities.Architecture != nil {
		architecture := string(*capabilities.Architecture)
		destination.Architecture = &architecture
	} else {
		destination.Architecture = nil
	}

	// DiskControllerTypes
	destination.DiskControllerTypes = genruntime.ClonePointerToString(capabilities.DiskControllerTypes)

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

	// No error
	return nil
}

// Initialize_From_SupportedCapabilities_STATUS populates our SupportedCapabilities from the provided source SupportedCapabilities_STATUS
func (capabilities *SupportedCapabilities) Initialize_From_SupportedCapabilities_STATUS(source *SupportedCapabilities_STATUS) error {

	// AcceleratedNetwork
	if source.AcceleratedNetwork != nil {
		acceleratedNetwork := *source.AcceleratedNetwork
		capabilities.AcceleratedNetwork = &acceleratedNetwork
	} else {
		capabilities.AcceleratedNetwork = nil
	}

	// Architecture
	if source.Architecture != nil {
		architecture := genruntime.ToEnum(string(*source.Architecture), architecture_Values)
		capabilities.Architecture = &architecture
	} else {
		capabilities.Architecture = nil
	}

	// DiskControllerTypes
	capabilities.DiskControllerTypes = genruntime.ClonePointerToString(source.DiskControllerTypes)

	// No error
	return nil
}

// List of supported capabilities persisted on the disk resource for VM use.
type SupportedCapabilities_STATUS struct {
	// AcceleratedNetwork: True if the image from which the OS disk is created supports accelerated networking.
	AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"`

	// Architecture: CPU architecture supported by an OS disk.
	Architecture *Architecture_STATUS `json:"architecture,omitempty"`

	// DiskControllerTypes: The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI.
	DiskControllerTypes *string `json:"diskControllerTypes,omitempty"`
}

var _ genruntime.FromARMConverter = &SupportedCapabilities_STATUS{}

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

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

	// Set property "AcceleratedNetwork":
	if typedInput.AcceleratedNetwork != nil {
		acceleratedNetwork := *typedInput.AcceleratedNetwork
		capabilities.AcceleratedNetwork = &acceleratedNetwork
	}

	// Set property "Architecture":
	if typedInput.Architecture != nil {
		var temp string
		temp = string(*typedInput.Architecture)
		architecture := Architecture_STATUS(temp)
		capabilities.Architecture = &architecture
	}

	// Set property "DiskControllerTypes":
	if typedInput.DiskControllerTypes != nil {
		diskControllerTypes := *typedInput.DiskControllerTypes
		capabilities.DiskControllerTypes = &diskControllerTypes
	}

	// No error
	return nil
}

// AssignProperties_From_SupportedCapabilities_STATUS populates our SupportedCapabilities_STATUS from the provided source SupportedCapabilities_STATUS
func (capabilities *SupportedCapabilities_STATUS) AssignProperties_From_SupportedCapabilities_STATUS(source *storage.SupportedCapabilities_STATUS) error {

	// AcceleratedNetwork
	if source.AcceleratedNetwork != nil {
		acceleratedNetwork := *source.AcceleratedNetwork
		capabilities.AcceleratedNetwork = &acceleratedNetwork
	} else {
		capabilities.AcceleratedNetwork = nil
	}

	// Architecture
	if source.Architecture != nil {
		architecture := *source.Architecture
		architectureTemp := genruntime.ToEnum(architecture, architecture_STATUS_Values)
		capabilities.Architecture = &architectureTemp
	} else {
		capabilities.Architecture = nil
	}

	// DiskControllerTypes
	capabilities.DiskControllerTypes = genruntime.ClonePointerToString(source.DiskControllerTypes)

	// No error
	return nil
}

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

	// AcceleratedNetwork
	if capabilities.AcceleratedNetwork != nil {
		acceleratedNetwork := *capabilities.AcceleratedNetwork
		destination.AcceleratedNetwork = &acceleratedNetwork
	} else {
		destination.AcceleratedNetwork = nil
	}

	// Architecture
	if capabilities.Architecture != nil {
		architecture := string(*capabilities.Architecture)
		destination.Architecture = &architecture
	} else {
		destination.Architecture = nil
	}

	// DiskControllerTypes
	destination.DiskControllerTypes = genruntime.ClonePointerToString(capabilities.DiskControllerTypes)

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

	// No error
	return nil
}

// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
	// CreatedAt: The timestamp of resource creation (UTC).
	CreatedAt *string `json:"createdAt,omitempty"`

	// CreatedBy: The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType: The type of identity that created the resource.
	CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"`

	// LastModifiedAt: The timestamp of resource last modification (UTC)
	LastModifiedAt *string `json:"lastModifiedAt,omitempty"`

	// LastModifiedBy: The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// LastModifiedByType: The type of identity that last modified the resource.
	LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"`
}

var _ genruntime.FromARMConverter = &SystemData_STATUS{}

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

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

	// Set property "CreatedAt":
	if typedInput.CreatedAt != nil {
		createdAt := *typedInput.CreatedAt
		data.CreatedAt = &createdAt
	}

	// Set property "CreatedBy":
	if typedInput.CreatedBy != nil {
		createdBy := *typedInput.CreatedBy
		data.CreatedBy = &createdBy
	}

	// Set property "CreatedByType":
	if typedInput.CreatedByType != nil {
		var temp string
		temp = string(*typedInput.CreatedByType)
		createdByType := SystemData_CreatedByType_STATUS(temp)
		data.CreatedByType = &createdByType
	}

	// Set property "LastModifiedAt":
	if typedInput.LastModifiedAt != nil {
		lastModifiedAt := *typedInput.LastModifiedAt
		data.LastModifiedAt = &lastModifiedAt
	}

	// Set property "LastModifiedBy":
	if typedInput.LastModifiedBy != nil {
		lastModifiedBy := *typedInput.LastModifiedBy
		data.LastModifiedBy = &lastModifiedBy
	}

	// Set property "LastModifiedByType":
	if typedInput.LastModifiedByType != nil {
		var temp string
		temp = string(*typedInput.LastModifiedByType)
		lastModifiedByType := SystemData_LastModifiedByType_STATUS(temp)
		data.LastModifiedByType = &lastModifiedByType
	}

	// No error
	return nil
}

// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS
func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *storage.SystemData_STATUS) error {

	// CreatedAt
	data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt)

	// CreatedBy
	data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy)

	// CreatedByType
	if source.CreatedByType != nil {
		createdByType := *source.CreatedByType
		createdByTypeTemp := genruntime.ToEnum(createdByType, systemData_CreatedByType_STATUS_Values)
		data.CreatedByType = &createdByTypeTemp
	} else {
		data.CreatedByType = nil
	}

	// LastModifiedAt
	data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt)

	// LastModifiedBy
	data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy)

	// LastModifiedByType
	if source.LastModifiedByType != nil {
		lastModifiedByType := *source.LastModifiedByType
		lastModifiedByTypeTemp := genruntime.ToEnum(lastModifiedByType, systemData_LastModifiedByType_STATUS_Values)
		data.LastModifiedByType = &lastModifiedByTypeTemp
	} else {
		data.LastModifiedByType = nil
	}

	// No error
	return nil
}

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

	// CreatedAt
	destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt)

	// CreatedBy
	destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy)

	// CreatedByType
	if data.CreatedByType != nil {
		createdByType := string(*data.CreatedByType)
		destination.CreatedByType = &createdByType
	} else {
		destination.CreatedByType = nil
	}

	// LastModifiedAt
	destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt)

	// LastModifiedBy
	destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy)

	// LastModifiedByType
	if data.LastModifiedByType != nil {
		lastModifiedByType := string(*data.LastModifiedByType)
		destination.LastModifiedByType = &lastModifiedByType
	} else {
		destination.LastModifiedByType = nil
	}

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

	// No error
	return nil
}

// CPU architecture supported by an OS disk.
// +kubebuilder:validation:Enum={"Arm64","x64"}
type Architecture string

const (
	Architecture_Arm64 = Architecture("Arm64")
	Architecture_X64   = Architecture("x64")
)

// Mapping from string to Architecture
var architecture_Values = map[string]Architecture{
	"arm64": Architecture_Arm64,
	"x64":   Architecture_X64,
}

// CPU architecture supported by an OS disk.
type Architecture_STATUS string

const (
	Architecture_STATUS_Arm64 = Architecture_STATUS("Arm64")
	Architecture_STATUS_X64   = Architecture_STATUS("x64")
)

// Mapping from string to Architecture_STATUS
var architecture_STATUS_Values = map[string]Architecture_STATUS{
	"arm64": Architecture_STATUS_Arm64,
	"x64":   Architecture_STATUS_X64,
}

// This enumerates the possible sources of a disk's creation.
// +kubebuilder:validation:Enum={"Attach","Copy","CopyFromSanSnapshot","CopyStart","Empty","FromImage","Import","ImportSecure","Restore","Upload","UploadPreparedSecure"}
type DiskCreateOption string

const (
	DiskCreateOption_Attach               = DiskCreateOption("Attach")
	DiskCreateOption_Copy                 = DiskCreateOption("Copy")
	DiskCreateOption_CopyFromSanSnapshot  = DiskCreateOption("CopyFromSanSnapshot")
	DiskCreateOption_CopyStart            = DiskCreateOption("CopyStart")
	DiskCreateOption_Empty                = DiskCreateOption("Empty")
	DiskCreateOption_FromImage            = DiskCreateOption("FromImage")
	DiskCreateOption_Import               = DiskCreateOption("Import")
	DiskCreateOption_ImportSecure         = DiskCreateOption("ImportSecure")
	DiskCreateOption_Restore              = DiskCreateOption("Restore")
	DiskCreateOption_Upload               = DiskCreateOption("Upload")
	DiskCreateOption_UploadPreparedSecure = DiskCreateOption("UploadPreparedSecure")
)

// Mapping from string to DiskCreateOption
var diskCreateOption_Values = map[string]DiskCreateOption{
	"attach":               DiskCreateOption_Attach,
	"copy":                 DiskCreateOption_Copy,
	"copyfromsansnapshot":  DiskCreateOption_CopyFromSanSnapshot,
	"copystart":            DiskCreateOption_CopyStart,
	"empty":                DiskCreateOption_Empty,
	"fromimage":            DiskCreateOption_FromImage,
	"import":               DiskCreateOption_Import,
	"importsecure":         DiskCreateOption_ImportSecure,
	"restore":              DiskCreateOption_Restore,
	"upload":               DiskCreateOption_Upload,
	"uploadpreparedsecure": DiskCreateOption_UploadPreparedSecure,
}

// This enumerates the possible sources of a disk's creation.
type DiskCreateOption_STATUS string

const (
	DiskCreateOption_STATUS_Attach               = DiskCreateOption_STATUS("Attach")
	DiskCreateOption_STATUS_Copy                 = DiskCreateOption_STATUS("Copy")
	DiskCreateOption_STATUS_CopyFromSanSnapshot  = DiskCreateOption_STATUS("CopyFromSanSnapshot")
	DiskCreateOption_STATUS_CopyStart            = DiskCreateOption_STATUS("CopyStart")
	DiskCreateOption_STATUS_Empty                = DiskCreateOption_STATUS("Empty")
	DiskCreateOption_STATUS_FromImage            = DiskCreateOption_STATUS("FromImage")
	DiskCreateOption_STATUS_Import               = DiskCreateOption_STATUS("Import")
	DiskCreateOption_STATUS_ImportSecure         = DiskCreateOption_STATUS("ImportSecure")
	DiskCreateOption_STATUS_Restore              = DiskCreateOption_STATUS("Restore")
	DiskCreateOption_STATUS_Upload               = DiskCreateOption_STATUS("Upload")
	DiskCreateOption_STATUS_UploadPreparedSecure = DiskCreateOption_STATUS("UploadPreparedSecure")
)

// Mapping from string to DiskCreateOption_STATUS
var diskCreateOption_STATUS_Values = map[string]DiskCreateOption_STATUS{
	"attach":               DiskCreateOption_STATUS_Attach,
	"copy":                 DiskCreateOption_STATUS_Copy,
	"copyfromsansnapshot":  DiskCreateOption_STATUS_CopyFromSanSnapshot,
	"copystart":            DiskCreateOption_STATUS_CopyStart,
	"empty":                DiskCreateOption_STATUS_Empty,
	"fromimage":            DiskCreateOption_STATUS_FromImage,
	"import":               DiskCreateOption_STATUS_Import,
	"importsecure":         DiskCreateOption_STATUS_ImportSecure,
	"restore":              DiskCreateOption_STATUS_Restore,
	"upload":               DiskCreateOption_STATUS_Upload,
	"uploadpreparedsecure": DiskCreateOption_STATUS_UploadPreparedSecure,
}

// Specifies the SecurityType of the VM. Applicable for OS disks only.
// +kubebuilder:validation:Enum={"ConfidentialVM_DiskEncryptedWithCustomerKey","ConfidentialVM_DiskEncryptedWithPlatformKey","ConfidentialVM_NonPersistedTPM","ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey","TrustedLaunch"}
type DiskSecurityTypes string

const (
	DiskSecurityTypes_ConfidentialVM_DiskEncryptedWithCustomerKey             = DiskSecurityTypes("ConfidentialVM_DiskEncryptedWithCustomerKey")
	DiskSecurityTypes_ConfidentialVM_DiskEncryptedWithPlatformKey             = DiskSecurityTypes("ConfidentialVM_DiskEncryptedWithPlatformKey")
	DiskSecurityTypes_ConfidentialVM_NonPersistedTPM                          = DiskSecurityTypes("ConfidentialVM_NonPersistedTPM")
	DiskSecurityTypes_ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey = DiskSecurityTypes("ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey")
	DiskSecurityTypes_TrustedLaunch                                           = DiskSecurityTypes("TrustedLaunch")
)

// Mapping from string to DiskSecurityTypes
var diskSecurityTypes_Values = map[string]DiskSecurityTypes{
	"confidentialvm_diskencryptedwithcustomerkey":             DiskSecurityTypes_ConfidentialVM_DiskEncryptedWithCustomerKey,
	"confidentialvm_diskencryptedwithplatformkey":             DiskSecurityTypes_ConfidentialVM_DiskEncryptedWithPlatformKey,
	"confidentialvm_nonpersistedtpm":                          DiskSecurityTypes_ConfidentialVM_NonPersistedTPM,
	"confidentialvm_vmgueststateonlyencryptedwithplatformkey": DiskSecurityTypes_ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey,
	"trustedlaunch": DiskSecurityTypes_TrustedLaunch,
}

// Specifies the SecurityType of the VM. Applicable for OS disks only.
type DiskSecurityTypes_STATUS string

const (
	DiskSecurityTypes_STATUS_ConfidentialVM_DiskEncryptedWithCustomerKey             = DiskSecurityTypes_STATUS("ConfidentialVM_DiskEncryptedWithCustomerKey")
	DiskSecurityTypes_STATUS_ConfidentialVM_DiskEncryptedWithPlatformKey             = DiskSecurityTypes_STATUS("ConfidentialVM_DiskEncryptedWithPlatformKey")
	DiskSecurityTypes_STATUS_ConfidentialVM_NonPersistedTPM                          = DiskSecurityTypes_STATUS("ConfidentialVM_NonPersistedTPM")
	DiskSecurityTypes_STATUS_ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey = DiskSecurityTypes_STATUS("ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey")
	DiskSecurityTypes_STATUS_TrustedLaunch                                           = DiskSecurityTypes_STATUS("TrustedLaunch")
)

// Mapping from string to DiskSecurityTypes_STATUS
var diskSecurityTypes_STATUS_Values = map[string]DiskSecurityTypes_STATUS{
	"confidentialvm_diskencryptedwithcustomerkey":             DiskSecurityTypes_STATUS_ConfidentialVM_DiskEncryptedWithCustomerKey,
	"confidentialvm_diskencryptedwithplatformkey":             DiskSecurityTypes_STATUS_ConfidentialVM_DiskEncryptedWithPlatformKey,
	"confidentialvm_nonpersistedtpm":                          DiskSecurityTypes_STATUS_ConfidentialVM_NonPersistedTPM,
	"confidentialvm_vmgueststateonlyencryptedwithplatformkey": DiskSecurityTypes_STATUS_ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey,
	"trustedlaunch": DiskSecurityTypes_STATUS_TrustedLaunch,
}

// The sku name.
// +kubebuilder:validation:Enum={"PremiumV2_LRS","Premium_LRS","Premium_ZRS","StandardSSD_LRS","StandardSSD_ZRS","Standard_LRS","UltraSSD_LRS"}
type DiskStorageAccountTypes string

const (
	DiskStorageAccountTypes_PremiumV2_LRS   = DiskStorageAccountTypes("PremiumV2_LRS")
	DiskStorageAccountTypes_Premium_LRS     = DiskStorageAccountTypes("Premium_LRS")
	DiskStorageAccountTypes_Premium_ZRS     = DiskStorageAccountTypes("Premium_ZRS")
	DiskStorageAccountTypes_StandardSSD_LRS = DiskStorageAccountTypes("StandardSSD_LRS")
	DiskStorageAccountTypes_StandardSSD_ZRS = DiskStorageAccountTypes("StandardSSD_ZRS")
	DiskStorageAccountTypes_Standard_LRS    = DiskStorageAccountTypes("Standard_LRS")
	DiskStorageAccountTypes_UltraSSD_LRS    = DiskStorageAccountTypes("UltraSSD_LRS")
)

// Mapping from string to DiskStorageAccountTypes
var diskStorageAccountTypes_Values = map[string]DiskStorageAccountTypes{
	"premiumv2_lrs":   DiskStorageAccountTypes_PremiumV2_LRS,
	"premium_lrs":     DiskStorageAccountTypes_Premium_LRS,
	"premium_zrs":     DiskStorageAccountTypes_Premium_ZRS,
	"standardssd_lrs": DiskStorageAccountTypes_StandardSSD_LRS,
	"standardssd_zrs": DiskStorageAccountTypes_StandardSSD_ZRS,
	"standard_lrs":    DiskStorageAccountTypes_Standard_LRS,
	"ultrassd_lrs":    DiskStorageAccountTypes_UltraSSD_LRS,
}

// The sku name.
type DiskStorageAccountTypes_STATUS string

const (
	DiskStorageAccountTypes_STATUS_PremiumV2_LRS   = DiskStorageAccountTypes_STATUS("PremiumV2_LRS")
	DiskStorageAccountTypes_STATUS_Premium_LRS     = DiskStorageAccountTypes_STATUS("Premium_LRS")
	DiskStorageAccountTypes_STATUS_Premium_ZRS     = DiskStorageAccountTypes_STATUS("Premium_ZRS")
	DiskStorageAccountTypes_STATUS_StandardSSD_LRS = DiskStorageAccountTypes_STATUS("StandardSSD_LRS")
	DiskStorageAccountTypes_STATUS_StandardSSD_ZRS = DiskStorageAccountTypes_STATUS("StandardSSD_ZRS")
	DiskStorageAccountTypes_STATUS_Standard_LRS    = DiskStorageAccountTypes_STATUS("Standard_LRS")
	DiskStorageAccountTypes_STATUS_UltraSSD_LRS    = DiskStorageAccountTypes_STATUS("UltraSSD_LRS")
)

// Mapping from string to DiskStorageAccountTypes_STATUS
var diskStorageAccountTypes_STATUS_Values = map[string]DiskStorageAccountTypes_STATUS{
	"premiumv2_lrs":   DiskStorageAccountTypes_STATUS_PremiumV2_LRS,
	"premium_lrs":     DiskStorageAccountTypes_STATUS_Premium_LRS,
	"premium_zrs":     DiskStorageAccountTypes_STATUS_Premium_ZRS,
	"standardssd_lrs": DiskStorageAccountTypes_STATUS_StandardSSD_LRS,
	"standardssd_zrs": DiskStorageAccountTypes_STATUS_StandardSSD_ZRS,
	"standard_lrs":    DiskStorageAccountTypes_STATUS_Standard_LRS,
	"ultrassd_lrs":    DiskStorageAccountTypes_STATUS_UltraSSD_LRS,
}

// Encryption settings for one disk volume.
type EncryptionSettingsElement struct {
	// DiskEncryptionKey: Key Vault Secret Url and vault id of the disk encryption key
	DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"`

	// KeyEncryptionKey: Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when
	// provided is used to unwrap the disk encryption key.
	KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"`
}

var _ genruntime.ARMTransformer = &EncryptionSettingsElement{}

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

	// Set property "DiskEncryptionKey":
	if element.DiskEncryptionKey != nil {
		diskEncryptionKey_ARM, err := element.DiskEncryptionKey.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		diskEncryptionKey := *diskEncryptionKey_ARM.(*arm.KeyVaultAndSecretReference)
		result.DiskEncryptionKey = &diskEncryptionKey
	}

	// Set property "KeyEncryptionKey":
	if element.KeyEncryptionKey != nil {
		keyEncryptionKey_ARM, err := element.KeyEncryptionKey.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		keyEncryptionKey := *keyEncryptionKey_ARM.(*arm.KeyVaultAndKeyReference)
		result.KeyEncryptionKey = &keyEncryptionKey
	}
	return result, nil
}

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

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

	// Set property "DiskEncryptionKey":
	if typedInput.DiskEncryptionKey != nil {
		var diskEncryptionKey1 KeyVaultAndSecretReference
		err := diskEncryptionKey1.PopulateFromARM(owner, *typedInput.DiskEncryptionKey)
		if err != nil {
			return err
		}
		diskEncryptionKey := diskEncryptionKey1
		element.DiskEncryptionKey = &diskEncryptionKey
	}

	// Set property "KeyEncryptionKey":
	if typedInput.KeyEncryptionKey != nil {
		var keyEncryptionKey1 KeyVaultAndKeyReference
		err := keyEncryptionKey1.PopulateFromARM(owner, *typedInput.KeyEncryptionKey)
		if err != nil {
			return err
		}
		keyEncryptionKey := keyEncryptionKey1
		element.KeyEncryptionKey = &keyEncryptionKey
	}

	// No error
	return nil
}

// AssignProperties_From_EncryptionSettingsElement populates our EncryptionSettingsElement from the provided source EncryptionSettingsElement
func (element *EncryptionSettingsElement) AssignProperties_From_EncryptionSettingsElement(source *storage.EncryptionSettingsElement) error {

	// DiskEncryptionKey
	if source.DiskEncryptionKey != nil {
		var diskEncryptionKey KeyVaultAndSecretReference
		err := diskEncryptionKey.AssignProperties_From_KeyVaultAndSecretReference(source.DiskEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KeyVaultAndSecretReference() to populate field DiskEncryptionKey")
		}
		element.DiskEncryptionKey = &diskEncryptionKey
	} else {
		element.DiskEncryptionKey = nil
	}

	// KeyEncryptionKey
	if source.KeyEncryptionKey != nil {
		var keyEncryptionKey KeyVaultAndKeyReference
		err := keyEncryptionKey.AssignProperties_From_KeyVaultAndKeyReference(source.KeyEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KeyVaultAndKeyReference() to populate field KeyEncryptionKey")
		}
		element.KeyEncryptionKey = &keyEncryptionKey
	} else {
		element.KeyEncryptionKey = nil
	}

	// No error
	return nil
}

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

	// DiskEncryptionKey
	if element.DiskEncryptionKey != nil {
		var diskEncryptionKey storage.KeyVaultAndSecretReference
		err := element.DiskEncryptionKey.AssignProperties_To_KeyVaultAndSecretReference(&diskEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KeyVaultAndSecretReference() to populate field DiskEncryptionKey")
		}
		destination.DiskEncryptionKey = &diskEncryptionKey
	} else {
		destination.DiskEncryptionKey = nil
	}

	// KeyEncryptionKey
	if element.KeyEncryptionKey != nil {
		var keyEncryptionKey storage.KeyVaultAndKeyReference
		err := element.KeyEncryptionKey.AssignProperties_To_KeyVaultAndKeyReference(&keyEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KeyVaultAndKeyReference() to populate field KeyEncryptionKey")
		}
		destination.KeyEncryptionKey = &keyEncryptionKey
	} else {
		destination.KeyEncryptionKey = nil
	}

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

	// No error
	return nil
}

// Initialize_From_EncryptionSettingsElement_STATUS populates our EncryptionSettingsElement from the provided source EncryptionSettingsElement_STATUS
func (element *EncryptionSettingsElement) Initialize_From_EncryptionSettingsElement_STATUS(source *EncryptionSettingsElement_STATUS) error {

	// DiskEncryptionKey
	if source.DiskEncryptionKey != nil {
		var diskEncryptionKey KeyVaultAndSecretReference
		err := diskEncryptionKey.Initialize_From_KeyVaultAndSecretReference_STATUS(source.DiskEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_KeyVaultAndSecretReference_STATUS() to populate field DiskEncryptionKey")
		}
		element.DiskEncryptionKey = &diskEncryptionKey
	} else {
		element.DiskEncryptionKey = nil
	}

	// KeyEncryptionKey
	if source.KeyEncryptionKey != nil {
		var keyEncryptionKey KeyVaultAndKeyReference
		err := keyEncryptionKey.Initialize_From_KeyVaultAndKeyReference_STATUS(source.KeyEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_KeyVaultAndKeyReference_STATUS() to populate field KeyEncryptionKey")
		}
		element.KeyEncryptionKey = &keyEncryptionKey
	} else {
		element.KeyEncryptionKey = nil
	}

	// No error
	return nil
}

// Encryption settings for one disk volume.
type EncryptionSettingsElement_STATUS struct {
	// DiskEncryptionKey: Key Vault Secret Url and vault id of the disk encryption key
	DiskEncryptionKey *KeyVaultAndSecretReference_STATUS `json:"diskEncryptionKey,omitempty"`

	// KeyEncryptionKey: Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when
	// provided is used to unwrap the disk encryption key.
	KeyEncryptionKey *KeyVaultAndKeyReference_STATUS `json:"keyEncryptionKey,omitempty"`
}

var _ genruntime.FromARMConverter = &EncryptionSettingsElement_STATUS{}

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

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

	// Set property "DiskEncryptionKey":
	if typedInput.DiskEncryptionKey != nil {
		var diskEncryptionKey1 KeyVaultAndSecretReference_STATUS
		err := diskEncryptionKey1.PopulateFromARM(owner, *typedInput.DiskEncryptionKey)
		if err != nil {
			return err
		}
		diskEncryptionKey := diskEncryptionKey1
		element.DiskEncryptionKey = &diskEncryptionKey
	}

	// Set property "KeyEncryptionKey":
	if typedInput.KeyEncryptionKey != nil {
		var keyEncryptionKey1 KeyVaultAndKeyReference_STATUS
		err := keyEncryptionKey1.PopulateFromARM(owner, *typedInput.KeyEncryptionKey)
		if err != nil {
			return err
		}
		keyEncryptionKey := keyEncryptionKey1
		element.KeyEncryptionKey = &keyEncryptionKey
	}

	// No error
	return nil
}

// AssignProperties_From_EncryptionSettingsElement_STATUS populates our EncryptionSettingsElement_STATUS from the provided source EncryptionSettingsElement_STATUS
func (element *EncryptionSettingsElement_STATUS) AssignProperties_From_EncryptionSettingsElement_STATUS(source *storage.EncryptionSettingsElement_STATUS) error {

	// DiskEncryptionKey
	if source.DiskEncryptionKey != nil {
		var diskEncryptionKey KeyVaultAndSecretReference_STATUS
		err := diskEncryptionKey.AssignProperties_From_KeyVaultAndSecretReference_STATUS(source.DiskEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KeyVaultAndSecretReference_STATUS() to populate field DiskEncryptionKey")
		}
		element.DiskEncryptionKey = &diskEncryptionKey
	} else {
		element.DiskEncryptionKey = nil
	}

	// KeyEncryptionKey
	if source.KeyEncryptionKey != nil {
		var keyEncryptionKey KeyVaultAndKeyReference_STATUS
		err := keyEncryptionKey.AssignProperties_From_KeyVaultAndKeyReference_STATUS(source.KeyEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KeyVaultAndKeyReference_STATUS() to populate field KeyEncryptionKey")
		}
		element.KeyEncryptionKey = &keyEncryptionKey
	} else {
		element.KeyEncryptionKey = nil
	}

	// No error
	return nil
}

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

	// DiskEncryptionKey
	if element.DiskEncryptionKey != nil {
		var diskEncryptionKey storage.KeyVaultAndSecretReference_STATUS
		err := element.DiskEncryptionKey.AssignProperties_To_KeyVaultAndSecretReference_STATUS(&diskEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KeyVaultAndSecretReference_STATUS() to populate field DiskEncryptionKey")
		}
		destination.DiskEncryptionKey = &diskEncryptionKey
	} else {
		destination.DiskEncryptionKey = nil
	}

	// KeyEncryptionKey
	if element.KeyEncryptionKey != nil {
		var keyEncryptionKey storage.KeyVaultAndKeyReference_STATUS
		err := element.KeyEncryptionKey.AssignProperties_To_KeyVaultAndKeyReference_STATUS(&keyEncryptionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KeyVaultAndKeyReference_STATUS() to populate field KeyEncryptionKey")
		}
		destination.KeyEncryptionKey = &keyEncryptionKey
	} else {
		destination.KeyEncryptionKey = nil
	}

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

	// No error
	return nil
}

// The type of key used to encrypt the data of the disk.
// +kubebuilder:validation:Enum={"EncryptionAtRestWithCustomerKey","EncryptionAtRestWithPlatformAndCustomerKeys","EncryptionAtRestWithPlatformKey"}
type EncryptionType string

const (
	EncryptionType_EncryptionAtRestWithCustomerKey             = EncryptionType("EncryptionAtRestWithCustomerKey")
	EncryptionType_EncryptionAtRestWithPlatformAndCustomerKeys = EncryptionType("EncryptionAtRestWithPlatformAndCustomerKeys")
	EncryptionType_EncryptionAtRestWithPlatformKey             = EncryptionType("EncryptionAtRestWithPlatformKey")
)

// Mapping from string to EncryptionType
var encryptionType_Values = map[string]EncryptionType{
	"encryptionatrestwithcustomerkey":             EncryptionType_EncryptionAtRestWithCustomerKey,
	"encryptionatrestwithplatformandcustomerkeys": EncryptionType_EncryptionAtRestWithPlatformAndCustomerKeys,
	"encryptionatrestwithplatformkey":             EncryptionType_EncryptionAtRestWithPlatformKey,
}

// The type of key used to encrypt the data of the disk.
type EncryptionType_STATUS string

const (
	EncryptionType_STATUS_EncryptionAtRestWithCustomerKey             = EncryptionType_STATUS("EncryptionAtRestWithCustomerKey")
	EncryptionType_STATUS_EncryptionAtRestWithPlatformAndCustomerKeys = EncryptionType_STATUS("EncryptionAtRestWithPlatformAndCustomerKeys")
	EncryptionType_STATUS_EncryptionAtRestWithPlatformKey             = EncryptionType_STATUS("EncryptionAtRestWithPlatformKey")
)

// Mapping from string to EncryptionType_STATUS
var encryptionType_STATUS_Values = map[string]EncryptionType_STATUS{
	"encryptionatrestwithcustomerkey":             EncryptionType_STATUS_EncryptionAtRestWithCustomerKey,
	"encryptionatrestwithplatformandcustomerkeys": EncryptionType_STATUS_EncryptionAtRestWithPlatformAndCustomerKeys,
	"encryptionatrestwithplatformkey":             EncryptionType_STATUS_EncryptionAtRestWithPlatformKey,
}

// The type of extendedLocation.
// +kubebuilder:validation:Enum={"EdgeZone"}
type ExtendedLocationType string

const ExtendedLocationType_EdgeZone = ExtendedLocationType("EdgeZone")

// Mapping from string to ExtendedLocationType
var extendedLocationType_Values = map[string]ExtendedLocationType{
	"edgezone": ExtendedLocationType_EdgeZone,
}

// The type of extendedLocation.
type ExtendedLocationType_STATUS string

const ExtendedLocationType_STATUS_EdgeZone = ExtendedLocationType_STATUS("EdgeZone")

// Mapping from string to ExtendedLocationType_STATUS
var extendedLocationType_STATUS_Values = map[string]ExtendedLocationType_STATUS{
	"edgezone": ExtendedLocationType_STATUS_EdgeZone,
}

// The source image used for creating the disk.
type ImageDiskReference struct {
	// CommunityGalleryImageId: A relative uri containing a community Azure Compute Gallery image reference.
	CommunityGalleryImageId *string `json:"communityGalleryImageId,omitempty"`

	// Lun: If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the
	// image to use. For OS disks, this field is null.
	Lun *int `json:"lun,omitempty"`

	// Reference: A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image
	// reference.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`

	// SharedGalleryImageId: A relative uri containing a direct shared Azure Compute Gallery image reference.
	SharedGalleryImageId *string `json:"sharedGalleryImageId,omitempty"`
}

var _ genruntime.ARMTransformer = &ImageDiskReference{}

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

	// Set property "CommunityGalleryImageId":
	if reference.CommunityGalleryImageId != nil {
		communityGalleryImageId := *reference.CommunityGalleryImageId
		result.CommunityGalleryImageId = &communityGalleryImageId
	}

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

	// Set property "Lun":
	if reference.Lun != nil {
		lun := *reference.Lun
		result.Lun = &lun
	}

	// Set property "SharedGalleryImageId":
	if reference.SharedGalleryImageId != nil {
		sharedGalleryImageId := *reference.SharedGalleryImageId
		result.SharedGalleryImageId = &sharedGalleryImageId
	}
	return result, nil
}

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

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

	// Set property "CommunityGalleryImageId":
	if typedInput.CommunityGalleryImageId != nil {
		communityGalleryImageId := *typedInput.CommunityGalleryImageId
		reference.CommunityGalleryImageId = &communityGalleryImageId
	}

	// Set property "Lun":
	if typedInput.Lun != nil {
		lun := *typedInput.Lun
		reference.Lun = &lun
	}

	// no assignment for property "Reference"

	// Set property "SharedGalleryImageId":
	if typedInput.SharedGalleryImageId != nil {
		sharedGalleryImageId := *typedInput.SharedGalleryImageId
		reference.SharedGalleryImageId = &sharedGalleryImageId
	}

	// No error
	return nil
}

// AssignProperties_From_ImageDiskReference populates our ImageDiskReference from the provided source ImageDiskReference
func (reference *ImageDiskReference) AssignProperties_From_ImageDiskReference(source *storage.ImageDiskReference) error {

	// CommunityGalleryImageId
	reference.CommunityGalleryImageId = genruntime.ClonePointerToString(source.CommunityGalleryImageId)

	// Lun
	reference.Lun = genruntime.ClonePointerToInt(source.Lun)

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

	// SharedGalleryImageId
	reference.SharedGalleryImageId = genruntime.ClonePointerToString(source.SharedGalleryImageId)

	// No error
	return nil
}

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

	// CommunityGalleryImageId
	destination.CommunityGalleryImageId = genruntime.ClonePointerToString(reference.CommunityGalleryImageId)

	// Lun
	destination.Lun = genruntime.ClonePointerToInt(reference.Lun)

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

	// SharedGalleryImageId
	destination.SharedGalleryImageId = genruntime.ClonePointerToString(reference.SharedGalleryImageId)

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

	// No error
	return nil
}

// Initialize_From_ImageDiskReference_STATUS populates our ImageDiskReference from the provided source ImageDiskReference_STATUS
func (reference *ImageDiskReference) Initialize_From_ImageDiskReference_STATUS(source *ImageDiskReference_STATUS) error {

	// CommunityGalleryImageId
	reference.CommunityGalleryImageId = genruntime.ClonePointerToString(source.CommunityGalleryImageId)

	// Lun
	reference.Lun = genruntime.ClonePointerToInt(source.Lun)

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

	// SharedGalleryImageId
	reference.SharedGalleryImageId = genruntime.ClonePointerToString(source.SharedGalleryImageId)

	// No error
	return nil
}

// The source image used for creating the disk.
type ImageDiskReference_STATUS struct {
	// CommunityGalleryImageId: A relative uri containing a community Azure Compute Gallery image reference.
	CommunityGalleryImageId *string `json:"communityGalleryImageId,omitempty"`

	// Id: A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference.
	Id *string `json:"id,omitempty"`

	// Lun: If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the
	// image to use. For OS disks, this field is null.
	Lun *int `json:"lun,omitempty"`

	// SharedGalleryImageId: A relative uri containing a direct shared Azure Compute Gallery image reference.
	SharedGalleryImageId *string `json:"sharedGalleryImageId,omitempty"`
}

var _ genruntime.FromARMConverter = &ImageDiskReference_STATUS{}

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

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

	// Set property "CommunityGalleryImageId":
	if typedInput.CommunityGalleryImageId != nil {
		communityGalleryImageId := *typedInput.CommunityGalleryImageId
		reference.CommunityGalleryImageId = &communityGalleryImageId
	}

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

	// Set property "Lun":
	if typedInput.Lun != nil {
		lun := *typedInput.Lun
		reference.Lun = &lun
	}

	// Set property "SharedGalleryImageId":
	if typedInput.SharedGalleryImageId != nil {
		sharedGalleryImageId := *typedInput.SharedGalleryImageId
		reference.SharedGalleryImageId = &sharedGalleryImageId
	}

	// No error
	return nil
}

// AssignProperties_From_ImageDiskReference_STATUS populates our ImageDiskReference_STATUS from the provided source ImageDiskReference_STATUS
func (reference *ImageDiskReference_STATUS) AssignProperties_From_ImageDiskReference_STATUS(source *storage.ImageDiskReference_STATUS) error {

	// CommunityGalleryImageId
	reference.CommunityGalleryImageId = genruntime.ClonePointerToString(source.CommunityGalleryImageId)

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

	// Lun
	reference.Lun = genruntime.ClonePointerToInt(source.Lun)

	// SharedGalleryImageId
	reference.SharedGalleryImageId = genruntime.ClonePointerToString(source.SharedGalleryImageId)

	// No error
	return nil
}

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

	// CommunityGalleryImageId
	destination.CommunityGalleryImageId = genruntime.ClonePointerToString(reference.CommunityGalleryImageId)

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

	// Lun
	destination.Lun = genruntime.ClonePointerToInt(reference.Lun)

	// SharedGalleryImageId
	destination.SharedGalleryImageId = genruntime.ClonePointerToString(reference.SharedGalleryImageId)

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

	// No error
	return nil
}

// If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed.
// +kubebuilder:validation:Enum={"Enhanced","None"}
type ProvisionedBandwidthCopyOption string

const (
	ProvisionedBandwidthCopyOption_Enhanced = ProvisionedBandwidthCopyOption("Enhanced")
	ProvisionedBandwidthCopyOption_None     = ProvisionedBandwidthCopyOption("None")
)

// Mapping from string to ProvisionedBandwidthCopyOption
var provisionedBandwidthCopyOption_Values = map[string]ProvisionedBandwidthCopyOption{
	"enhanced": ProvisionedBandwidthCopyOption_Enhanced,
	"none":     ProvisionedBandwidthCopyOption_None,
}

// If this field is set on a snapshot and createOption is CopyStart, the snapshot will be copied at a quicker speed.
type ProvisionedBandwidthCopyOption_STATUS string

const (
	ProvisionedBandwidthCopyOption_STATUS_Enhanced = ProvisionedBandwidthCopyOption_STATUS("Enhanced")
	ProvisionedBandwidthCopyOption_STATUS_None     = ProvisionedBandwidthCopyOption_STATUS("None")
)

// Mapping from string to ProvisionedBandwidthCopyOption_STATUS
var provisionedBandwidthCopyOption_STATUS_Values = map[string]ProvisionedBandwidthCopyOption_STATUS{
	"enhanced": ProvisionedBandwidthCopyOption_STATUS_Enhanced,
	"none":     ProvisionedBandwidthCopyOption_STATUS_None,
}

type SystemData_CreatedByType_STATUS string

const (
	SystemData_CreatedByType_STATUS_Application     = SystemData_CreatedByType_STATUS("Application")
	SystemData_CreatedByType_STATUS_Key             = SystemData_CreatedByType_STATUS("Key")
	SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity")
	SystemData_CreatedByType_STATUS_User            = SystemData_CreatedByType_STATUS("User")
)

// Mapping from string to SystemData_CreatedByType_STATUS
var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{
	"application":     SystemData_CreatedByType_STATUS_Application,
	"key":             SystemData_CreatedByType_STATUS_Key,
	"managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity,
	"user":            SystemData_CreatedByType_STATUS_User,
}

type SystemData_LastModifiedByType_STATUS string

const (
	SystemData_LastModifiedByType_STATUS_Application     = SystemData_LastModifiedByType_STATUS("Application")
	SystemData_LastModifiedByType_STATUS_Key             = SystemData_LastModifiedByType_STATUS("Key")
	SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity")
	SystemData_LastModifiedByType_STATUS_User            = SystemData_LastModifiedByType_STATUS("User")
)

// Mapping from string to SystemData_LastModifiedByType_STATUS
var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{
	"application":     SystemData_LastModifiedByType_STATUS_Application,
	"key":             SystemData_LastModifiedByType_STATUS_Key,
	"managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity,
	"user":            SystemData_LastModifiedByType_STATUS_User,
}

// Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey
type KeyVaultAndKeyReference struct {
	// +kubebuilder:validation:Required
	// KeyUrl: Url pointing to a key or secret in KeyVault
	KeyUrl *string `json:"keyUrl,omitempty"`

	// +kubebuilder:validation:Required
	// SourceVault: Resource id of the KeyVault containing the key or secret
	SourceVault *SourceVault `json:"sourceVault,omitempty"`
}

var _ genruntime.ARMTransformer = &KeyVaultAndKeyReference{}

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

	// Set property "KeyUrl":
	if reference.KeyUrl != nil {
		keyUrl := *reference.KeyUrl
		result.KeyUrl = &keyUrl
	}

	// Set property "SourceVault":
	if reference.SourceVault != nil {
		sourceVault_ARM, err := reference.SourceVault.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sourceVault := *sourceVault_ARM.(*arm.SourceVault)
		result.SourceVault = &sourceVault
	}
	return result, nil
}

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

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

	// Set property "KeyUrl":
	if typedInput.KeyUrl != nil {
		keyUrl := *typedInput.KeyUrl
		reference.KeyUrl = &keyUrl
	}

	// Set property "SourceVault":
	if typedInput.SourceVault != nil {
		var sourceVault1 SourceVault
		err := sourceVault1.PopulateFromARM(owner, *typedInput.SourceVault)
		if err != nil {
			return err
		}
		sourceVault := sourceVault1
		reference.SourceVault = &sourceVault
	}

	// No error
	return nil
}

// AssignProperties_From_KeyVaultAndKeyReference populates our KeyVaultAndKeyReference from the provided source KeyVaultAndKeyReference
func (reference *KeyVaultAndKeyReference) AssignProperties_From_KeyVaultAndKeyReference(source *storage.KeyVaultAndKeyReference) error {

	// KeyUrl
	reference.KeyUrl = genruntime.ClonePointerToString(source.KeyUrl)

	// SourceVault
	if source.SourceVault != nil {
		var sourceVault SourceVault
		err := sourceVault.AssignProperties_From_SourceVault(source.SourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SourceVault() to populate field SourceVault")
		}
		reference.SourceVault = &sourceVault
	} else {
		reference.SourceVault = nil
	}

	// No error
	return nil
}

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

	// KeyUrl
	destination.KeyUrl = genruntime.ClonePointerToString(reference.KeyUrl)

	// SourceVault
	if reference.SourceVault != nil {
		var sourceVault storage.SourceVault
		err := reference.SourceVault.AssignProperties_To_SourceVault(&sourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SourceVault() to populate field SourceVault")
		}
		destination.SourceVault = &sourceVault
	} else {
		destination.SourceVault = nil
	}

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

	// No error
	return nil
}

// Initialize_From_KeyVaultAndKeyReference_STATUS populates our KeyVaultAndKeyReference from the provided source KeyVaultAndKeyReference_STATUS
func (reference *KeyVaultAndKeyReference) Initialize_From_KeyVaultAndKeyReference_STATUS(source *KeyVaultAndKeyReference_STATUS) error {

	// KeyUrl
	reference.KeyUrl = genruntime.ClonePointerToString(source.KeyUrl)

	// SourceVault
	if source.SourceVault != nil {
		var sourceVault SourceVault
		err := sourceVault.Initialize_From_SourceVault_STATUS(source.SourceVault)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SourceVault_STATUS() to populate field SourceVault")
		}
		reference.SourceVault = &sourceVault
	} else {
		reference.SourceVault = nil
	}

	// No error
	return nil
}

// Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey
type KeyVaultAndKeyReference_STATUS struct {
	// KeyUrl: Url pointing to a key or secret in KeyVault
	KeyUrl *string `json:"keyUrl,omitempty"`

	// SourceVault: Resource id of the KeyVault containing the key or secret
	SourceVault *SourceVault_STATUS `json:"sourceVault,omitempty"`
}

var _ genruntime.FromARMConverter = &KeyVaultAndKeyReference_STATUS{}

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

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

	// Set property "KeyUrl":
	if typedInput.KeyUrl != nil {
		keyUrl := *typedInput.KeyUrl
		reference.KeyUrl = &keyUrl
	}

	// Set property "SourceVault":
	if typedInput.SourceVault != nil {
		var sourceVault1 SourceVault_STATUS
		err := sourceVault1.PopulateFromARM(owner, *typedInput.SourceVault)
		if err != nil {
			return err
		}
		sourceVault := sourceVault1
		reference.SourceVault = &sourceVault
	}

	// No error
	return nil
}

// AssignProperties_From_KeyVaultAndKeyReference_STATUS populates our KeyVaultAndKeyReference_STATUS from the provided source KeyVaultAndKeyReference_STATUS
func (reference *KeyVaultAndKeyReference_STATUS) AssignProperties_From_KeyVaultAndKeyReference_STATUS(source *storage.KeyVaultAndKeyReference_STATUS) error {

	// KeyUrl
	reference.KeyUrl = genruntime.ClonePointerToString(source.KeyUrl)

	// SourceVault
	if source.SourceVault != nil {
		var sourceVault SourceVault_STATUS
		err := sourceVault.AssignProperties_From_SourceVault_STATUS(source.SourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SourceVault_STATUS() to populate field SourceVault")
		}
		reference.SourceVault = &sourceVault
	} else {
		reference.SourceVault = nil
	}

	// No error
	return nil
}

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

	// KeyUrl
	destination.KeyUrl = genruntime.ClonePointerToString(reference.KeyUrl)

	// SourceVault
	if reference.SourceVault != nil {
		var sourceVault storage.SourceVault_STATUS
		err := reference.SourceVault.AssignProperties_To_SourceVault_STATUS(&sourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SourceVault_STATUS() to populate field SourceVault")
		}
		destination.SourceVault = &sourceVault
	} else {
		destination.SourceVault = nil
	}

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

	// No error
	return nil
}

// Key Vault Secret Url and vault id of the encryption key
type KeyVaultAndSecretReference struct {
	// +kubebuilder:validation:Required
	// SecretUrl: Url pointing to a key or secret in KeyVault
	SecretUrl *string `json:"secretUrl,omitempty"`

	// +kubebuilder:validation:Required
	// SourceVault: Resource id of the KeyVault containing the key or secret
	SourceVault *SourceVault `json:"sourceVault,omitempty"`
}

var _ genruntime.ARMTransformer = &KeyVaultAndSecretReference{}

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

	// Set property "SecretUrl":
	if reference.SecretUrl != nil {
		secretUrl := *reference.SecretUrl
		result.SecretUrl = &secretUrl
	}

	// Set property "SourceVault":
	if reference.SourceVault != nil {
		sourceVault_ARM, err := reference.SourceVault.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sourceVault := *sourceVault_ARM.(*arm.SourceVault)
		result.SourceVault = &sourceVault
	}
	return result, nil
}

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

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

	// Set property "SecretUrl":
	if typedInput.SecretUrl != nil {
		secretUrl := *typedInput.SecretUrl
		reference.SecretUrl = &secretUrl
	}

	// Set property "SourceVault":
	if typedInput.SourceVault != nil {
		var sourceVault1 SourceVault
		err := sourceVault1.PopulateFromARM(owner, *typedInput.SourceVault)
		if err != nil {
			return err
		}
		sourceVault := sourceVault1
		reference.SourceVault = &sourceVault
	}

	// No error
	return nil
}

// AssignProperties_From_KeyVaultAndSecretReference populates our KeyVaultAndSecretReference from the provided source KeyVaultAndSecretReference
func (reference *KeyVaultAndSecretReference) AssignProperties_From_KeyVaultAndSecretReference(source *storage.KeyVaultAndSecretReference) error {

	// SecretUrl
	reference.SecretUrl = genruntime.ClonePointerToString(source.SecretUrl)

	// SourceVault
	if source.SourceVault != nil {
		var sourceVault SourceVault
		err := sourceVault.AssignProperties_From_SourceVault(source.SourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SourceVault() to populate field SourceVault")
		}
		reference.SourceVault = &sourceVault
	} else {
		reference.SourceVault = nil
	}

	// No error
	return nil
}

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

	// SecretUrl
	destination.SecretUrl = genruntime.ClonePointerToString(reference.SecretUrl)

	// SourceVault
	if reference.SourceVault != nil {
		var sourceVault storage.SourceVault
		err := reference.SourceVault.AssignProperties_To_SourceVault(&sourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SourceVault() to populate field SourceVault")
		}
		destination.SourceVault = &sourceVault
	} else {
		destination.SourceVault = nil
	}

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

	// No error
	return nil
}

// Initialize_From_KeyVaultAndSecretReference_STATUS populates our KeyVaultAndSecretReference from the provided source KeyVaultAndSecretReference_STATUS
func (reference *KeyVaultAndSecretReference) Initialize_From_KeyVaultAndSecretReference_STATUS(source *KeyVaultAndSecretReference_STATUS) error {

	// SecretUrl
	reference.SecretUrl = genruntime.ClonePointerToString(source.SecretUrl)

	// SourceVault
	if source.SourceVault != nil {
		var sourceVault SourceVault
		err := sourceVault.Initialize_From_SourceVault_STATUS(source.SourceVault)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SourceVault_STATUS() to populate field SourceVault")
		}
		reference.SourceVault = &sourceVault
	} else {
		reference.SourceVault = nil
	}

	// No error
	return nil
}

// Key Vault Secret Url and vault id of the encryption key
type KeyVaultAndSecretReference_STATUS struct {
	// SecretUrl: Url pointing to a key or secret in KeyVault
	SecretUrl *string `json:"secretUrl,omitempty"`

	// SourceVault: Resource id of the KeyVault containing the key or secret
	SourceVault *SourceVault_STATUS `json:"sourceVault,omitempty"`
}

var _ genruntime.FromARMConverter = &KeyVaultAndSecretReference_STATUS{}

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

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

	// Set property "SecretUrl":
	if typedInput.SecretUrl != nil {
		secretUrl := *typedInput.SecretUrl
		reference.SecretUrl = &secretUrl
	}

	// Set property "SourceVault":
	if typedInput.SourceVault != nil {
		var sourceVault1 SourceVault_STATUS
		err := sourceVault1.PopulateFromARM(owner, *typedInput.SourceVault)
		if err != nil {
			return err
		}
		sourceVault := sourceVault1
		reference.SourceVault = &sourceVault
	}

	// No error
	return nil
}

// AssignProperties_From_KeyVaultAndSecretReference_STATUS populates our KeyVaultAndSecretReference_STATUS from the provided source KeyVaultAndSecretReference_STATUS
func (reference *KeyVaultAndSecretReference_STATUS) AssignProperties_From_KeyVaultAndSecretReference_STATUS(source *storage.KeyVaultAndSecretReference_STATUS) error {

	// SecretUrl
	reference.SecretUrl = genruntime.ClonePointerToString(source.SecretUrl)

	// SourceVault
	if source.SourceVault != nil {
		var sourceVault SourceVault_STATUS
		err := sourceVault.AssignProperties_From_SourceVault_STATUS(source.SourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SourceVault_STATUS() to populate field SourceVault")
		}
		reference.SourceVault = &sourceVault
	} else {
		reference.SourceVault = nil
	}

	// No error
	return nil
}

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

	// SecretUrl
	destination.SecretUrl = genruntime.ClonePointerToString(reference.SecretUrl)

	// SourceVault
	if reference.SourceVault != nil {
		var sourceVault storage.SourceVault_STATUS
		err := reference.SourceVault.AssignProperties_To_SourceVault_STATUS(&sourceVault)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SourceVault_STATUS() to populate field SourceVault")
		}
		destination.SourceVault = &sourceVault
	} else {
		destination.SourceVault = nil
	}

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&Disk{}, &DiskList{})
}
