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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/compute/v1api20220301/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/compute/v1api20220301/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/ComputeRP/stable/2022-03-01/image.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}
type Image struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Image_Spec   `json:"spec,omitempty"`
	Status            Image_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Image{}

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

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

var _ conversion.Convertible = &Image{}

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

	return image.AssignProperties_From_Image(source)
}

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

	return image.AssignProperties_To_Image(destination)
}

var _ configmaps.Exporter = &Image{}

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

var _ secrets.Exporter = &Image{}

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

var _ genruntime.ImportableResource = &Image{}

// InitializeSpec initializes the spec for this resource from the given status
func (image *Image) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Image_STATUS); ok {
		return image.Spec.Initialize_From_Image_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Image{}

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

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

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

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

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

// GetSupportedOperations returns the operations supported by the resource
func (image *Image) 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/images"
func (image *Image) GetType() string {
	return "Microsoft.Compute/images"
}

// NewEmptyStatus returns a new empty (blank) status
func (image *Image) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Image_STATUS{}
}

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

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

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

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

	image.Status = st
	return nil
}

// AssignProperties_From_Image populates our Image from the provided source Image
func (image *Image) AssignProperties_From_Image(source *storage.Image) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Image populates the provided destination Image from our Image
func (image *Image) AssignProperties_To_Image(destination *storage.Image) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2022-03-01/image.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}
type ImageList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Image `json:"items"`
}

// +kubebuilder:validation:Enum={"2022-03-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2022-03-01")

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

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

	// HyperVGeneration: Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version
	// 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource
	// like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed
	// resource.
	HyperVGeneration *HyperVGenerationType `json:"hyperVGeneration,omitempty"`

	// +kubebuilder:validation:Required
	// Location: Resource location
	Location *string `json:"location,omitempty"`

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

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

	// SourceVirtualMachine: The source virtual machine from which Image is created.
	SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"`

	// StorageProfile: Specifies the storage settings for the virtual machine disks.
	StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"`

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

var _ genruntime.ARMTransformer = &Image_Spec{}

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

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

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

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

	// Set property "Properties":
	if image.HyperVGeneration != nil ||
		image.SourceVirtualMachine != nil ||
		image.StorageProfile != nil {
		result.Properties = &arm.ImageProperties{}
	}
	if image.HyperVGeneration != nil {
		var temp string
		temp = string(*image.HyperVGeneration)
		hyperVGeneration := arm.HyperVGenerationType(temp)
		result.Properties.HyperVGeneration = &hyperVGeneration
	}
	if image.SourceVirtualMachine != nil {
		sourceVirtualMachine_ARM, err := image.SourceVirtualMachine.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sourceVirtualMachine := *sourceVirtualMachine_ARM.(*arm.SubResource)
		result.Properties.SourceVirtualMachine = &sourceVirtualMachine
	}
	if image.StorageProfile != nil {
		storageProfile_ARM, err := image.StorageProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		storageProfile := *storageProfile_ARM.(*arm.ImageStorageProfile)
		result.Properties.StorageProfile = &storageProfile
	}

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

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

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

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

	// Set property "ExtendedLocation":
	if typedInput.ExtendedLocation != nil {
		var extendedLocation1 ExtendedLocation
		err := extendedLocation1.PopulateFromARM(owner, *typedInput.ExtendedLocation)
		if err != nil {
			return err
		}
		extendedLocation := extendedLocation1
		image.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 := HyperVGenerationType(temp)
			image.HyperVGeneration = &hyperVGeneration
		}
	}

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

	// no assignment for property "OperatorSpec"

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

	// Set property "SourceVirtualMachine":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceVirtualMachine != nil {
			var sourceVirtualMachine1 SubResource
			err := sourceVirtualMachine1.PopulateFromARM(owner, *typedInput.Properties.SourceVirtualMachine)
			if err != nil {
				return err
			}
			sourceVirtualMachine := sourceVirtualMachine1
			image.SourceVirtualMachine = &sourceVirtualMachine
		}
	}

	// Set property "StorageProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.StorageProfile != nil {
			var storageProfile1 ImageStorageProfile
			err := storageProfile1.PopulateFromARM(owner, *typedInput.Properties.StorageProfile)
			if err != nil {
				return err
			}
			storageProfile := storageProfile1
			image.StorageProfile = &storageProfile
		}
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Image_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Image_Spec{}
	err := image.AssignProperties_To_Image_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_Image_Spec populates our Image_Spec from the provided source Image_Spec
func (image *Image_Spec) AssignProperties_From_Image_Spec(source *storage.Image_Spec) error {

	// AzureName
	image.AzureName = source.AzureName

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

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

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

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

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

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

	// StorageProfile
	if source.StorageProfile != nil {
		var storageProfile ImageStorageProfile
		err := storageProfile.AssignProperties_From_ImageStorageProfile(source.StorageProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageStorageProfile() to populate field StorageProfile")
		}
		image.StorageProfile = &storageProfile
	} else {
		image.StorageProfile = nil
	}

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = image.AzureName

	// ExtendedLocation
	if image.ExtendedLocation != nil {
		var extendedLocation storage.ExtendedLocation
		err := image.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 image.HyperVGeneration != nil {
		hyperVGeneration := string(*image.HyperVGeneration)
		destination.HyperVGeneration = &hyperVGeneration
	} else {
		destination.HyperVGeneration = nil
	}

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

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

	// OriginalVersion
	destination.OriginalVersion = image.OriginalVersion()

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

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

	// StorageProfile
	if image.StorageProfile != nil {
		var storageProfile storage.ImageStorageProfile
		err := image.StorageProfile.AssignProperties_To_ImageStorageProfile(&storageProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageStorageProfile() to populate field StorageProfile")
		}
		destination.StorageProfile = &storageProfile
	} else {
		destination.StorageProfile = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_Image_STATUS populates our Image_Spec from the provided source Image_STATUS
func (image *Image_Spec) Initialize_From_Image_STATUS(source *Image_STATUS) error {

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

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

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

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

	// StorageProfile
	if source.StorageProfile != nil {
		var storageProfile ImageStorageProfile
		err := storageProfile.Initialize_From_ImageStorageProfile_STATUS(source.StorageProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ImageStorageProfile_STATUS() to populate field StorageProfile")
		}
		image.StorageProfile = &storageProfile
	} else {
		image.StorageProfile = nil
	}

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

	// No error
	return nil
}

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

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

// The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual
// machine. If SourceImage is provided, the destination virtual hard drive must not exist.
type Image_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

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

	// HyperVGeneration: Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version
	// 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource
	// like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed
	// resource.
	HyperVGeneration *HyperVGenerationType_STATUS `json:"hyperVGeneration,omitempty"`

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

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

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

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

	// SourceVirtualMachine: The source virtual machine from which Image is created.
	SourceVirtualMachine *SubResource_STATUS `json:"sourceVirtualMachine,omitempty"`

	// StorageProfile: Specifies the storage settings for the virtual machine disks.
	StorageProfile *ImageStorageProfile_STATUS `json:"storageProfile,omitempty"`

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

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

var _ genruntime.ConvertibleStatus = &Image_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Image_STATUS{}
	err := image.AssignProperties_To_Image_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 = &Image_STATUS{}

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

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

	// no assignment for property "Conditions"

	// Set property "ExtendedLocation":
	if typedInput.ExtendedLocation != nil {
		var extendedLocation1 ExtendedLocation_STATUS
		err := extendedLocation1.PopulateFromARM(owner, *typedInput.ExtendedLocation)
		if err != nil {
			return err
		}
		extendedLocation := extendedLocation1
		image.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 := HyperVGenerationType_STATUS(temp)
			image.HyperVGeneration = &hyperVGeneration
		}
	}

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

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

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

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

	// Set property "SourceVirtualMachine":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceVirtualMachine != nil {
			var sourceVirtualMachine1 SubResource_STATUS
			err := sourceVirtualMachine1.PopulateFromARM(owner, *typedInput.Properties.SourceVirtualMachine)
			if err != nil {
				return err
			}
			sourceVirtualMachine := sourceVirtualMachine1
			image.SourceVirtualMachine = &sourceVirtualMachine
		}
	}

	// Set property "StorageProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.StorageProfile != nil {
			var storageProfile1 ImageStorageProfile_STATUS
			err := storageProfile1.PopulateFromARM(owner, *typedInput.Properties.StorageProfile)
			if err != nil {
				return err
			}
			storageProfile := storageProfile1
			image.StorageProfile = &storageProfile
		}
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_Image_STATUS populates our Image_STATUS from the provided source Image_STATUS
func (image *Image_STATUS) AssignProperties_From_Image_STATUS(source *storage.Image_STATUS) error {

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

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

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

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

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

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

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

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

	// StorageProfile
	if source.StorageProfile != nil {
		var storageProfile ImageStorageProfile_STATUS
		err := storageProfile.AssignProperties_From_ImageStorageProfile_STATUS(source.StorageProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageStorageProfile_STATUS() to populate field StorageProfile")
		}
		image.StorageProfile = &storageProfile
	} else {
		image.StorageProfile = nil
	}

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

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

	// No error
	return nil
}

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

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

	// ExtendedLocation
	if image.ExtendedLocation != nil {
		var extendedLocation storage.ExtendedLocation_STATUS
		err := image.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 image.HyperVGeneration != nil {
		hyperVGeneration := string(*image.HyperVGeneration)
		destination.HyperVGeneration = &hyperVGeneration
	} else {
		destination.HyperVGeneration = nil
	}

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

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

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

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

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

	// StorageProfile
	if image.StorageProfile != nil {
		var storageProfile storage.ImageStorageProfile_STATUS
		err := image.StorageProfile.AssignProperties_To_ImageStorageProfile_STATUS(&storageProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageStorageProfile_STATUS() to populate field StorageProfile")
		}
		destination.StorageProfile = &storageProfile
	} else {
		destination.StorageProfile = nil
	}

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

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

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

// Specifies the HyperVGeneration Type
// +kubebuilder:validation:Enum={"V1","V2"}
type HyperVGenerationType string

const (
	HyperVGenerationType_V1 = HyperVGenerationType("V1")
	HyperVGenerationType_V2 = HyperVGenerationType("V2")
)

// Mapping from string to HyperVGenerationType
var hyperVGenerationType_Values = map[string]HyperVGenerationType{
	"v1": HyperVGenerationType_V1,
	"v2": HyperVGenerationType_V2,
}

// Specifies the HyperVGeneration Type
type HyperVGenerationType_STATUS string

const (
	HyperVGenerationType_STATUS_V1 = HyperVGenerationType_STATUS("V1")
	HyperVGenerationType_STATUS_V2 = HyperVGenerationType_STATUS("V2")
)

// Mapping from string to HyperVGenerationType_STATUS
var hyperVGenerationType_STATUS_Values = map[string]HyperVGenerationType_STATUS{
	"v1": HyperVGenerationType_STATUS_V1,
	"v2": HyperVGenerationType_STATUS_V2,
}

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

// Describes a storage profile.
type ImageStorageProfile struct {
	// DataDisks: Specifies the parameters that are used to add a data disk to a virtual machine.
	// For more information about disks, see [About disks and VHDs for Azure virtual
	// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
	DataDisks []ImageDataDisk `json:"dataDisks,omitempty"`

	// OsDisk: Specifies information about the operating system disk used by the virtual machine.
	// For more information about disks, see [About disks and VHDs for Azure virtual
	// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
	OsDisk *ImageOSDisk `json:"osDisk,omitempty"`

	// ZoneResilient: Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be
	// created only in regions that provide Zone Redundant Storage (ZRS).
	ZoneResilient *bool `json:"zoneResilient,omitempty"`
}

var _ genruntime.ARMTransformer = &ImageStorageProfile{}

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

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

	// Set property "OsDisk":
	if profile.OsDisk != nil {
		osDisk_ARM, err := profile.OsDisk.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		osDisk := *osDisk_ARM.(*arm.ImageOSDisk)
		result.OsDisk = &osDisk
	}

	// Set property "ZoneResilient":
	if profile.ZoneResilient != nil {
		zoneResilient := *profile.ZoneResilient
		result.ZoneResilient = &zoneResilient
	}
	return result, nil
}

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

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

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

	// Set property "OsDisk":
	if typedInput.OsDisk != nil {
		var osDisk1 ImageOSDisk
		err := osDisk1.PopulateFromARM(owner, *typedInput.OsDisk)
		if err != nil {
			return err
		}
		osDisk := osDisk1
		profile.OsDisk = &osDisk
	}

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

	// No error
	return nil
}

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

	// DataDisks
	if source.DataDisks != nil {
		dataDiskList := make([]ImageDataDisk, len(source.DataDisks))
		for dataDiskIndex, dataDiskItem := range source.DataDisks {
			var dataDisk ImageDataDisk
			err := dataDisk.AssignProperties_From_ImageDataDisk(&dataDiskItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ImageDataDisk() to populate field DataDisks")
			}
			dataDiskList[dataDiskIndex] = dataDisk
		}
		profile.DataDisks = dataDiskList
	} else {
		profile.DataDisks = nil
	}

	// OsDisk
	if source.OsDisk != nil {
		var osDisk ImageOSDisk
		err := osDisk.AssignProperties_From_ImageOSDisk(source.OsDisk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageOSDisk() to populate field OsDisk")
		}
		profile.OsDisk = &osDisk
	} else {
		profile.OsDisk = nil
	}

	// ZoneResilient
	if source.ZoneResilient != nil {
		zoneResilient := *source.ZoneResilient
		profile.ZoneResilient = &zoneResilient
	} else {
		profile.ZoneResilient = nil
	}

	// No error
	return nil
}

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

	// DataDisks
	if profile.DataDisks != nil {
		dataDiskList := make([]storage.ImageDataDisk, len(profile.DataDisks))
		for dataDiskIndex, dataDiskItem := range profile.DataDisks {
			var dataDisk storage.ImageDataDisk
			err := dataDiskItem.AssignProperties_To_ImageDataDisk(&dataDisk)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ImageDataDisk() to populate field DataDisks")
			}
			dataDiskList[dataDiskIndex] = dataDisk
		}
		destination.DataDisks = dataDiskList
	} else {
		destination.DataDisks = nil
	}

	// OsDisk
	if profile.OsDisk != nil {
		var osDisk storage.ImageOSDisk
		err := profile.OsDisk.AssignProperties_To_ImageOSDisk(&osDisk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageOSDisk() to populate field OsDisk")
		}
		destination.OsDisk = &osDisk
	} else {
		destination.OsDisk = nil
	}

	// ZoneResilient
	if profile.ZoneResilient != nil {
		zoneResilient := *profile.ZoneResilient
		destination.ZoneResilient = &zoneResilient
	} else {
		destination.ZoneResilient = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ImageStorageProfile_STATUS populates our ImageStorageProfile from the provided source ImageStorageProfile_STATUS
func (profile *ImageStorageProfile) Initialize_From_ImageStorageProfile_STATUS(source *ImageStorageProfile_STATUS) error {

	// DataDisks
	if source.DataDisks != nil {
		dataDiskList := make([]ImageDataDisk, len(source.DataDisks))
		for dataDiskIndex, dataDiskItem := range source.DataDisks {
			var dataDisk ImageDataDisk
			err := dataDisk.Initialize_From_ImageDataDisk_STATUS(&dataDiskItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ImageDataDisk_STATUS() to populate field DataDisks")
			}
			dataDiskList[dataDiskIndex] = dataDisk
		}
		profile.DataDisks = dataDiskList
	} else {
		profile.DataDisks = nil
	}

	// OsDisk
	if source.OsDisk != nil {
		var osDisk ImageOSDisk
		err := osDisk.Initialize_From_ImageOSDisk_STATUS(source.OsDisk)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ImageOSDisk_STATUS() to populate field OsDisk")
		}
		profile.OsDisk = &osDisk
	} else {
		profile.OsDisk = nil
	}

	// ZoneResilient
	if source.ZoneResilient != nil {
		zoneResilient := *source.ZoneResilient
		profile.ZoneResilient = &zoneResilient
	} else {
		profile.ZoneResilient = nil
	}

	// No error
	return nil
}

// Describes a storage profile.
type ImageStorageProfile_STATUS struct {
	// DataDisks: Specifies the parameters that are used to add a data disk to a virtual machine.
	// For more information about disks, see [About disks and VHDs for Azure virtual
	// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
	DataDisks []ImageDataDisk_STATUS `json:"dataDisks,omitempty"`

	// OsDisk: Specifies information about the operating system disk used by the virtual machine.
	// For more information about disks, see [About disks and VHDs for Azure virtual
	// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
	OsDisk *ImageOSDisk_STATUS `json:"osDisk,omitempty"`

	// ZoneResilient: Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be
	// created only in regions that provide Zone Redundant Storage (ZRS).
	ZoneResilient *bool `json:"zoneResilient,omitempty"`
}

var _ genruntime.FromARMConverter = &ImageStorageProfile_STATUS{}

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

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

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

	// Set property "OsDisk":
	if typedInput.OsDisk != nil {
		var osDisk1 ImageOSDisk_STATUS
		err := osDisk1.PopulateFromARM(owner, *typedInput.OsDisk)
		if err != nil {
			return err
		}
		osDisk := osDisk1
		profile.OsDisk = &osDisk
	}

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

	// No error
	return nil
}

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

	// DataDisks
	if source.DataDisks != nil {
		dataDiskList := make([]ImageDataDisk_STATUS, len(source.DataDisks))
		for dataDiskIndex, dataDiskItem := range source.DataDisks {
			var dataDisk ImageDataDisk_STATUS
			err := dataDisk.AssignProperties_From_ImageDataDisk_STATUS(&dataDiskItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ImageDataDisk_STATUS() to populate field DataDisks")
			}
			dataDiskList[dataDiskIndex] = dataDisk
		}
		profile.DataDisks = dataDiskList
	} else {
		profile.DataDisks = nil
	}

	// OsDisk
	if source.OsDisk != nil {
		var osDisk ImageOSDisk_STATUS
		err := osDisk.AssignProperties_From_ImageOSDisk_STATUS(source.OsDisk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImageOSDisk_STATUS() to populate field OsDisk")
		}
		profile.OsDisk = &osDisk
	} else {
		profile.OsDisk = nil
	}

	// ZoneResilient
	if source.ZoneResilient != nil {
		zoneResilient := *source.ZoneResilient
		profile.ZoneResilient = &zoneResilient
	} else {
		profile.ZoneResilient = nil
	}

	// No error
	return nil
}

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

	// DataDisks
	if profile.DataDisks != nil {
		dataDiskList := make([]storage.ImageDataDisk_STATUS, len(profile.DataDisks))
		for dataDiskIndex, dataDiskItem := range profile.DataDisks {
			var dataDisk storage.ImageDataDisk_STATUS
			err := dataDiskItem.AssignProperties_To_ImageDataDisk_STATUS(&dataDisk)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ImageDataDisk_STATUS() to populate field DataDisks")
			}
			dataDiskList[dataDiskIndex] = dataDisk
		}
		destination.DataDisks = dataDiskList
	} else {
		destination.DataDisks = nil
	}

	// OsDisk
	if profile.OsDisk != nil {
		var osDisk storage.ImageOSDisk_STATUS
		err := profile.OsDisk.AssignProperties_To_ImageOSDisk_STATUS(&osDisk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImageOSDisk_STATUS() to populate field OsDisk")
		}
		destination.OsDisk = &osDisk
	} else {
		destination.OsDisk = nil
	}

	// ZoneResilient
	if profile.ZoneResilient != nil {
		zoneResilient := *profile.ZoneResilient
		destination.ZoneResilient = &zoneResilient
	} else {
		destination.ZoneResilient = nil
	}

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

	// No error
	return nil
}

type SubResource struct {
	// Reference: Resource Id
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &SubResource{}

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

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

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

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

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_SubResource populates our SubResource from the provided source SubResource
func (resource *SubResource) AssignProperties_From_SubResource(source *storage.SubResource) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_SubResource_STATUS populates our SubResource from the provided source SubResource_STATUS
func (resource *SubResource) Initialize_From_SubResource_STATUS(source *SubResource_STATUS) error {

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

	// No error
	return nil
}

type SubResource_STATUS struct {
	// Id: Resource Id
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &SubResource_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_SubResource_STATUS populates our SubResource_STATUS from the provided source SubResource_STATUS
func (resource *SubResource_STATUS) AssignProperties_From_SubResource_STATUS(source *storage.SubResource_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

// Describes a data disk.
type ImageDataDisk struct {
	// BlobUri: The Virtual Hard Disk.
	BlobUri *string `json:"blobUri,omitempty"`

	// Caching: Specifies the caching requirements.
	// Possible values are:
	// None
	// ReadOnly
	// ReadWrite
	// Default: None for Standard storage. ReadOnly for Premium storage
	Caching *ImageDataDisk_Caching `json:"caching,omitempty"`

	// DiskEncryptionSet: Specifies the customer managed disk encryption set resource id for the managed image disk.
	DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"`

	// DiskSizeGB: Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the
	// disk in a virtual machine image.
	// This value cannot be larger than 1023 GB
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// +kubebuilder:validation:Required
	// Lun: Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and
	// therefore must be unique for each data disk attached to a VM.
	Lun *int `json:"lun,omitempty"`

	// ManagedDisk: The managedDisk.
	ManagedDisk *SubResource `json:"managedDisk,omitempty"`

	// Snapshot: The snapshot.
	Snapshot *SubResource `json:"snapshot,omitempty"`

	// StorageAccountType: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with
	// data disks, it cannot be used with OS Disk.
	StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"`
}

var _ genruntime.ARMTransformer = &ImageDataDisk{}

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

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

	// Set property "Caching":
	if disk.Caching != nil {
		var temp string
		temp = string(*disk.Caching)
		caching := arm.ImageDataDisk_Caching(temp)
		result.Caching = &caching
	}

	// Set property "DiskEncryptionSet":
	if disk.DiskEncryptionSet != nil {
		diskEncryptionSet_ARM, err := disk.DiskEncryptionSet.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		diskEncryptionSet := *diskEncryptionSet_ARM.(*arm.SubResource)
		result.DiskEncryptionSet = &diskEncryptionSet
	}

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

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

	// Set property "ManagedDisk":
	if disk.ManagedDisk != nil {
		managedDisk_ARM, err := disk.ManagedDisk.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		managedDisk := *managedDisk_ARM.(*arm.SubResource)
		result.ManagedDisk = &managedDisk
	}

	// Set property "Snapshot":
	if disk.Snapshot != nil {
		snapshot_ARM, err := disk.Snapshot.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		snapshot := *snapshot_ARM.(*arm.SubResource)
		result.Snapshot = &snapshot
	}

	// Set property "StorageAccountType":
	if disk.StorageAccountType != nil {
		var temp string
		temp = string(*disk.StorageAccountType)
		storageAccountType := arm.StorageAccountType(temp)
		result.StorageAccountType = &storageAccountType
	}
	return result, nil
}

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

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

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

	// Set property "Caching":
	if typedInput.Caching != nil {
		var temp string
		temp = string(*typedInput.Caching)
		caching := ImageDataDisk_Caching(temp)
		disk.Caching = &caching
	}

	// Set property "DiskEncryptionSet":
	if typedInput.DiskEncryptionSet != nil {
		var diskEncryptionSet1 SubResource
		err := diskEncryptionSet1.PopulateFromARM(owner, *typedInput.DiskEncryptionSet)
		if err != nil {
			return err
		}
		diskEncryptionSet := diskEncryptionSet1
		disk.DiskEncryptionSet = &diskEncryptionSet
	}

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

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

	// Set property "ManagedDisk":
	if typedInput.ManagedDisk != nil {
		var managedDisk1 SubResource
		err := managedDisk1.PopulateFromARM(owner, *typedInput.ManagedDisk)
		if err != nil {
			return err
		}
		managedDisk := managedDisk1
		disk.ManagedDisk = &managedDisk
	}

	// Set property "Snapshot":
	if typedInput.Snapshot != nil {
		var snapshot1 SubResource
		err := snapshot1.PopulateFromARM(owner, *typedInput.Snapshot)
		if err != nil {
			return err
		}
		snapshot := snapshot1
		disk.Snapshot = &snapshot
	}

	// Set property "StorageAccountType":
	if typedInput.StorageAccountType != nil {
		var temp string
		temp = string(*typedInput.StorageAccountType)
		storageAccountType := StorageAccountType(temp)
		disk.StorageAccountType = &storageAccountType
	}

	// No error
	return nil
}

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

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

	// Caching
	if source.Caching != nil {
		caching := *source.Caching
		cachingTemp := genruntime.ToEnum(caching, imageDataDisk_Caching_Values)
		disk.Caching = &cachingTemp
	} else {
		disk.Caching = nil
	}

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

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

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

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

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

	// StorageAccountType
	if source.StorageAccountType != nil {
		storageAccountType := *source.StorageAccountType
		storageAccountTypeTemp := genruntime.ToEnum(storageAccountType, storageAccountType_Values)
		disk.StorageAccountType = &storageAccountTypeTemp
	} else {
		disk.StorageAccountType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Initialize_From_ImageDataDisk_STATUS populates our ImageDataDisk from the provided source ImageDataDisk_STATUS
func (disk *ImageDataDisk) Initialize_From_ImageDataDisk_STATUS(source *ImageDataDisk_STATUS) error {

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

	// Caching
	if source.Caching != nil {
		caching := genruntime.ToEnum(string(*source.Caching), imageDataDisk_Caching_Values)
		disk.Caching = &caching
	} else {
		disk.Caching = nil
	}

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

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

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

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

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

	// StorageAccountType
	if source.StorageAccountType != nil {
		storageAccountType := genruntime.ToEnum(string(*source.StorageAccountType), storageAccountType_Values)
		disk.StorageAccountType = &storageAccountType
	} else {
		disk.StorageAccountType = nil
	}

	// No error
	return nil
}

// Describes a data disk.
type ImageDataDisk_STATUS struct {
	// BlobUri: The Virtual Hard Disk.
	BlobUri *string `json:"blobUri,omitempty"`

	// Caching: Specifies the caching requirements.
	// Possible values are:
	// None
	// ReadOnly
	// ReadWrite
	// Default: None for Standard storage. ReadOnly for Premium storage
	Caching *ImageDataDisk_Caching_STATUS `json:"caching,omitempty"`

	// DiskEncryptionSet: Specifies the customer managed disk encryption set resource id for the managed image disk.
	DiskEncryptionSet *SubResource_STATUS `json:"diskEncryptionSet,omitempty"`

	// DiskSizeGB: Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the
	// disk in a virtual machine image.
	// This value cannot be larger than 1023 GB
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// Lun: Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and
	// therefore must be unique for each data disk attached to a VM.
	Lun *int `json:"lun,omitempty"`

	// ManagedDisk: The managedDisk.
	ManagedDisk *SubResource_STATUS `json:"managedDisk,omitempty"`

	// Snapshot: The snapshot.
	Snapshot *SubResource_STATUS `json:"snapshot,omitempty"`

	// StorageAccountType: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with
	// data disks, it cannot be used with OS Disk.
	StorageAccountType *StorageAccountType_STATUS `json:"storageAccountType,omitempty"`
}

var _ genruntime.FromARMConverter = &ImageDataDisk_STATUS{}

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

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

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

	// Set property "Caching":
	if typedInput.Caching != nil {
		var temp string
		temp = string(*typedInput.Caching)
		caching := ImageDataDisk_Caching_STATUS(temp)
		disk.Caching = &caching
	}

	// Set property "DiskEncryptionSet":
	if typedInput.DiskEncryptionSet != nil {
		var diskEncryptionSet1 SubResource_STATUS
		err := diskEncryptionSet1.PopulateFromARM(owner, *typedInput.DiskEncryptionSet)
		if err != nil {
			return err
		}
		diskEncryptionSet := diskEncryptionSet1
		disk.DiskEncryptionSet = &diskEncryptionSet
	}

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

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

	// Set property "ManagedDisk":
	if typedInput.ManagedDisk != nil {
		var managedDisk1 SubResource_STATUS
		err := managedDisk1.PopulateFromARM(owner, *typedInput.ManagedDisk)
		if err != nil {
			return err
		}
		managedDisk := managedDisk1
		disk.ManagedDisk = &managedDisk
	}

	// Set property "Snapshot":
	if typedInput.Snapshot != nil {
		var snapshot1 SubResource_STATUS
		err := snapshot1.PopulateFromARM(owner, *typedInput.Snapshot)
		if err != nil {
			return err
		}
		snapshot := snapshot1
		disk.Snapshot = &snapshot
	}

	// Set property "StorageAccountType":
	if typedInput.StorageAccountType != nil {
		var temp string
		temp = string(*typedInput.StorageAccountType)
		storageAccountType := StorageAccountType_STATUS(temp)
		disk.StorageAccountType = &storageAccountType
	}

	// No error
	return nil
}

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

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

	// Caching
	if source.Caching != nil {
		caching := *source.Caching
		cachingTemp := genruntime.ToEnum(caching, imageDataDisk_Caching_STATUS_Values)
		disk.Caching = &cachingTemp
	} else {
		disk.Caching = nil
	}

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

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

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

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

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

	// StorageAccountType
	if source.StorageAccountType != nil {
		storageAccountType := *source.StorageAccountType
		storageAccountTypeTemp := genruntime.ToEnum(storageAccountType, storageAccountType_STATUS_Values)
		disk.StorageAccountType = &storageAccountTypeTemp
	} else {
		disk.StorageAccountType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Describes an Operating System disk.
type ImageOSDisk struct {
	// BlobUri: The Virtual Hard Disk.
	BlobUri *string `json:"blobUri,omitempty"`

	// Caching: Specifies the caching requirements.
	// Possible values are:
	// None
	// ReadOnly
	// ReadWrite
	// Default: None for Standard storage. ReadOnly for Premium storage
	Caching *ImageOSDisk_Caching `json:"caching,omitempty"`

	// DiskEncryptionSet: Specifies the customer managed disk encryption set resource id for the managed image disk.
	DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"`

	// DiskSizeGB: Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the
	// disk in a virtual machine image.
	// This value cannot be larger than 1023 GB
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// ManagedDisk: The managedDisk.
	ManagedDisk *SubResource `json:"managedDisk,omitempty"`

	// +kubebuilder:validation:Required
	// OsState: The OS State. For managed images, use Generalized.
	OsState *ImageOSDisk_OsState `json:"osState,omitempty"`

	// +kubebuilder:validation:Required
	// OsType: This property allows you to specify the type of the OS that is included in the disk if creating a VM from a
	// custom image.
	// Possible values are:
	// Windows
	// Linux
	OsType *ImageOSDisk_OsType `json:"osType,omitempty"`

	// Snapshot: The snapshot.
	Snapshot *SubResource `json:"snapshot,omitempty"`

	// StorageAccountType: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with
	// data disks, it cannot be used with OS Disk.
	StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"`
}

var _ genruntime.ARMTransformer = &ImageOSDisk{}

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

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

	// Set property "Caching":
	if disk.Caching != nil {
		var temp string
		temp = string(*disk.Caching)
		caching := arm.ImageOSDisk_Caching(temp)
		result.Caching = &caching
	}

	// Set property "DiskEncryptionSet":
	if disk.DiskEncryptionSet != nil {
		diskEncryptionSet_ARM, err := disk.DiskEncryptionSet.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		diskEncryptionSet := *diskEncryptionSet_ARM.(*arm.SubResource)
		result.DiskEncryptionSet = &diskEncryptionSet
	}

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

	// Set property "ManagedDisk":
	if disk.ManagedDisk != nil {
		managedDisk_ARM, err := disk.ManagedDisk.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		managedDisk := *managedDisk_ARM.(*arm.SubResource)
		result.ManagedDisk = &managedDisk
	}

	// Set property "OsState":
	if disk.OsState != nil {
		var temp string
		temp = string(*disk.OsState)
		osState := arm.ImageOSDisk_OsState(temp)
		result.OsState = &osState
	}

	// Set property "OsType":
	if disk.OsType != nil {
		var temp string
		temp = string(*disk.OsType)
		osType := arm.ImageOSDisk_OsType(temp)
		result.OsType = &osType
	}

	// Set property "Snapshot":
	if disk.Snapshot != nil {
		snapshot_ARM, err := disk.Snapshot.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		snapshot := *snapshot_ARM.(*arm.SubResource)
		result.Snapshot = &snapshot
	}

	// Set property "StorageAccountType":
	if disk.StorageAccountType != nil {
		var temp string
		temp = string(*disk.StorageAccountType)
		storageAccountType := arm.StorageAccountType(temp)
		result.StorageAccountType = &storageAccountType
	}
	return result, nil
}

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

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

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

	// Set property "Caching":
	if typedInput.Caching != nil {
		var temp string
		temp = string(*typedInput.Caching)
		caching := ImageOSDisk_Caching(temp)
		disk.Caching = &caching
	}

	// Set property "DiskEncryptionSet":
	if typedInput.DiskEncryptionSet != nil {
		var diskEncryptionSet1 SubResource
		err := diskEncryptionSet1.PopulateFromARM(owner, *typedInput.DiskEncryptionSet)
		if err != nil {
			return err
		}
		diskEncryptionSet := diskEncryptionSet1
		disk.DiskEncryptionSet = &diskEncryptionSet
	}

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

	// Set property "ManagedDisk":
	if typedInput.ManagedDisk != nil {
		var managedDisk1 SubResource
		err := managedDisk1.PopulateFromARM(owner, *typedInput.ManagedDisk)
		if err != nil {
			return err
		}
		managedDisk := managedDisk1
		disk.ManagedDisk = &managedDisk
	}

	// Set property "OsState":
	if typedInput.OsState != nil {
		var temp string
		temp = string(*typedInput.OsState)
		osState := ImageOSDisk_OsState(temp)
		disk.OsState = &osState
	}

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

	// Set property "Snapshot":
	if typedInput.Snapshot != nil {
		var snapshot1 SubResource
		err := snapshot1.PopulateFromARM(owner, *typedInput.Snapshot)
		if err != nil {
			return err
		}
		snapshot := snapshot1
		disk.Snapshot = &snapshot
	}

	// Set property "StorageAccountType":
	if typedInput.StorageAccountType != nil {
		var temp string
		temp = string(*typedInput.StorageAccountType)
		storageAccountType := StorageAccountType(temp)
		disk.StorageAccountType = &storageAccountType
	}

	// No error
	return nil
}

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

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

	// Caching
	if source.Caching != nil {
		caching := *source.Caching
		cachingTemp := genruntime.ToEnum(caching, imageOSDisk_Caching_Values)
		disk.Caching = &cachingTemp
	} else {
		disk.Caching = nil
	}

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

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

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

	// OsState
	if source.OsState != nil {
		osState := *source.OsState
		osStateTemp := genruntime.ToEnum(osState, imageOSDisk_OsState_Values)
		disk.OsState = &osStateTemp
	} else {
		disk.OsState = nil
	}

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

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

	// StorageAccountType
	if source.StorageAccountType != nil {
		storageAccountType := *source.StorageAccountType
		storageAccountTypeTemp := genruntime.ToEnum(storageAccountType, storageAccountType_Values)
		disk.StorageAccountType = &storageAccountTypeTemp
	} else {
		disk.StorageAccountType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Initialize_From_ImageOSDisk_STATUS populates our ImageOSDisk from the provided source ImageOSDisk_STATUS
func (disk *ImageOSDisk) Initialize_From_ImageOSDisk_STATUS(source *ImageOSDisk_STATUS) error {

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

	// Caching
	if source.Caching != nil {
		caching := genruntime.ToEnum(string(*source.Caching), imageOSDisk_Caching_Values)
		disk.Caching = &caching
	} else {
		disk.Caching = nil
	}

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

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

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

	// OsState
	if source.OsState != nil {
		osState := genruntime.ToEnum(string(*source.OsState), imageOSDisk_OsState_Values)
		disk.OsState = &osState
	} else {
		disk.OsState = nil
	}

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

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

	// StorageAccountType
	if source.StorageAccountType != nil {
		storageAccountType := genruntime.ToEnum(string(*source.StorageAccountType), storageAccountType_Values)
		disk.StorageAccountType = &storageAccountType
	} else {
		disk.StorageAccountType = nil
	}

	// No error
	return nil
}

// Describes an Operating System disk.
type ImageOSDisk_STATUS struct {
	// BlobUri: The Virtual Hard Disk.
	BlobUri *string `json:"blobUri,omitempty"`

	// Caching: Specifies the caching requirements.
	// Possible values are:
	// None
	// ReadOnly
	// ReadWrite
	// Default: None for Standard storage. ReadOnly for Premium storage
	Caching *ImageOSDisk_Caching_STATUS `json:"caching,omitempty"`

	// DiskEncryptionSet: Specifies the customer managed disk encryption set resource id for the managed image disk.
	DiskEncryptionSet *SubResource_STATUS `json:"diskEncryptionSet,omitempty"`

	// DiskSizeGB: Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the
	// disk in a virtual machine image.
	// This value cannot be larger than 1023 GB
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// ManagedDisk: The managedDisk.
	ManagedDisk *SubResource_STATUS `json:"managedDisk,omitempty"`

	// OsState: The OS State. For managed images, use Generalized.
	OsState *ImageOSDisk_OsState_STATUS `json:"osState,omitempty"`

	// OsType: This property allows you to specify the type of the OS that is included in the disk if creating a VM from a
	// custom image.
	// Possible values are:
	// Windows
	// Linux
	OsType *ImageOSDisk_OsType_STATUS `json:"osType,omitempty"`

	// Snapshot: The snapshot.
	Snapshot *SubResource_STATUS `json:"snapshot,omitempty"`

	// StorageAccountType: Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with
	// data disks, it cannot be used with OS Disk.
	StorageAccountType *StorageAccountType_STATUS `json:"storageAccountType,omitempty"`
}

var _ genruntime.FromARMConverter = &ImageOSDisk_STATUS{}

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

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

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

	// Set property "Caching":
	if typedInput.Caching != nil {
		var temp string
		temp = string(*typedInput.Caching)
		caching := ImageOSDisk_Caching_STATUS(temp)
		disk.Caching = &caching
	}

	// Set property "DiskEncryptionSet":
	if typedInput.DiskEncryptionSet != nil {
		var diskEncryptionSet1 SubResource_STATUS
		err := diskEncryptionSet1.PopulateFromARM(owner, *typedInput.DiskEncryptionSet)
		if err != nil {
			return err
		}
		diskEncryptionSet := diskEncryptionSet1
		disk.DiskEncryptionSet = &diskEncryptionSet
	}

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

	// Set property "ManagedDisk":
	if typedInput.ManagedDisk != nil {
		var managedDisk1 SubResource_STATUS
		err := managedDisk1.PopulateFromARM(owner, *typedInput.ManagedDisk)
		if err != nil {
			return err
		}
		managedDisk := managedDisk1
		disk.ManagedDisk = &managedDisk
	}

	// Set property "OsState":
	if typedInput.OsState != nil {
		var temp string
		temp = string(*typedInput.OsState)
		osState := ImageOSDisk_OsState_STATUS(temp)
		disk.OsState = &osState
	}

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

	// Set property "Snapshot":
	if typedInput.Snapshot != nil {
		var snapshot1 SubResource_STATUS
		err := snapshot1.PopulateFromARM(owner, *typedInput.Snapshot)
		if err != nil {
			return err
		}
		snapshot := snapshot1
		disk.Snapshot = &snapshot
	}

	// Set property "StorageAccountType":
	if typedInput.StorageAccountType != nil {
		var temp string
		temp = string(*typedInput.StorageAccountType)
		storageAccountType := StorageAccountType_STATUS(temp)
		disk.StorageAccountType = &storageAccountType
	}

	// No error
	return nil
}

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

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

	// Caching
	if source.Caching != nil {
		caching := *source.Caching
		cachingTemp := genruntime.ToEnum(caching, imageOSDisk_Caching_STATUS_Values)
		disk.Caching = &cachingTemp
	} else {
		disk.Caching = nil
	}

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

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

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

	// OsState
	if source.OsState != nil {
		osState := *source.OsState
		osStateTemp := genruntime.ToEnum(osState, imageOSDisk_OsState_STATUS_Values)
		disk.OsState = &osStateTemp
	} else {
		disk.OsState = nil
	}

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

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

	// StorageAccountType
	if source.StorageAccountType != nil {
		storageAccountType := *source.StorageAccountType
		storageAccountTypeTemp := genruntime.ToEnum(storageAccountType, storageAccountType_STATUS_Values)
		disk.StorageAccountType = &storageAccountTypeTemp
	} else {
		disk.StorageAccountType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"None","ReadOnly","ReadWrite"}
type ImageDataDisk_Caching string

const (
	ImageDataDisk_Caching_None      = ImageDataDisk_Caching("None")
	ImageDataDisk_Caching_ReadOnly  = ImageDataDisk_Caching("ReadOnly")
	ImageDataDisk_Caching_ReadWrite = ImageDataDisk_Caching("ReadWrite")
)

// Mapping from string to ImageDataDisk_Caching
var imageDataDisk_Caching_Values = map[string]ImageDataDisk_Caching{
	"none":      ImageDataDisk_Caching_None,
	"readonly":  ImageDataDisk_Caching_ReadOnly,
	"readwrite": ImageDataDisk_Caching_ReadWrite,
}

type ImageDataDisk_Caching_STATUS string

const (
	ImageDataDisk_Caching_STATUS_None      = ImageDataDisk_Caching_STATUS("None")
	ImageDataDisk_Caching_STATUS_ReadOnly  = ImageDataDisk_Caching_STATUS("ReadOnly")
	ImageDataDisk_Caching_STATUS_ReadWrite = ImageDataDisk_Caching_STATUS("ReadWrite")
)

// Mapping from string to ImageDataDisk_Caching_STATUS
var imageDataDisk_Caching_STATUS_Values = map[string]ImageDataDisk_Caching_STATUS{
	"none":      ImageDataDisk_Caching_STATUS_None,
	"readonly":  ImageDataDisk_Caching_STATUS_ReadOnly,
	"readwrite": ImageDataDisk_Caching_STATUS_ReadWrite,
}

// +kubebuilder:validation:Enum={"None","ReadOnly","ReadWrite"}
type ImageOSDisk_Caching string

const (
	ImageOSDisk_Caching_None      = ImageOSDisk_Caching("None")
	ImageOSDisk_Caching_ReadOnly  = ImageOSDisk_Caching("ReadOnly")
	ImageOSDisk_Caching_ReadWrite = ImageOSDisk_Caching("ReadWrite")
)

// Mapping from string to ImageOSDisk_Caching
var imageOSDisk_Caching_Values = map[string]ImageOSDisk_Caching{
	"none":      ImageOSDisk_Caching_None,
	"readonly":  ImageOSDisk_Caching_ReadOnly,
	"readwrite": ImageOSDisk_Caching_ReadWrite,
}

type ImageOSDisk_Caching_STATUS string

const (
	ImageOSDisk_Caching_STATUS_None      = ImageOSDisk_Caching_STATUS("None")
	ImageOSDisk_Caching_STATUS_ReadOnly  = ImageOSDisk_Caching_STATUS("ReadOnly")
	ImageOSDisk_Caching_STATUS_ReadWrite = ImageOSDisk_Caching_STATUS("ReadWrite")
)

// Mapping from string to ImageOSDisk_Caching_STATUS
var imageOSDisk_Caching_STATUS_Values = map[string]ImageOSDisk_Caching_STATUS{
	"none":      ImageOSDisk_Caching_STATUS_None,
	"readonly":  ImageOSDisk_Caching_STATUS_ReadOnly,
	"readwrite": ImageOSDisk_Caching_STATUS_ReadWrite,
}

// +kubebuilder:validation:Enum={"Generalized","Specialized"}
type ImageOSDisk_OsState string

const (
	ImageOSDisk_OsState_Generalized = ImageOSDisk_OsState("Generalized")
	ImageOSDisk_OsState_Specialized = ImageOSDisk_OsState("Specialized")
)

// Mapping from string to ImageOSDisk_OsState
var imageOSDisk_OsState_Values = map[string]ImageOSDisk_OsState{
	"generalized": ImageOSDisk_OsState_Generalized,
	"specialized": ImageOSDisk_OsState_Specialized,
}

type ImageOSDisk_OsState_STATUS string

const (
	ImageOSDisk_OsState_STATUS_Generalized = ImageOSDisk_OsState_STATUS("Generalized")
	ImageOSDisk_OsState_STATUS_Specialized = ImageOSDisk_OsState_STATUS("Specialized")
)

// Mapping from string to ImageOSDisk_OsState_STATUS
var imageOSDisk_OsState_STATUS_Values = map[string]ImageOSDisk_OsState_STATUS{
	"generalized": ImageOSDisk_OsState_STATUS_Generalized,
	"specialized": ImageOSDisk_OsState_STATUS_Specialized,
}

// +kubebuilder:validation:Enum={"Linux","Windows"}
type ImageOSDisk_OsType string

const (
	ImageOSDisk_OsType_Linux   = ImageOSDisk_OsType("Linux")
	ImageOSDisk_OsType_Windows = ImageOSDisk_OsType("Windows")
)

// Mapping from string to ImageOSDisk_OsType
var imageOSDisk_OsType_Values = map[string]ImageOSDisk_OsType{
	"linux":   ImageOSDisk_OsType_Linux,
	"windows": ImageOSDisk_OsType_Windows,
}

type ImageOSDisk_OsType_STATUS string

const (
	ImageOSDisk_OsType_STATUS_Linux   = ImageOSDisk_OsType_STATUS("Linux")
	ImageOSDisk_OsType_STATUS_Windows = ImageOSDisk_OsType_STATUS("Windows")
)

// Mapping from string to ImageOSDisk_OsType_STATUS
var imageOSDisk_OsType_STATUS_Values = map[string]ImageOSDisk_OsType_STATUS{
	"linux":   ImageOSDisk_OsType_STATUS_Linux,
	"windows": ImageOSDisk_OsType_STATUS_Windows,
}

// Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you
// create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS
// uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk.
// Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more
// information regarding disks supported for Windows Virtual Machines, refer to
// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to
// https://docs.microsoft.com/azure/virtual-machines/linux/disks-types
// +kubebuilder:validation:Enum={"PremiumV2_LRS","Premium_LRS","Premium_ZRS","StandardSSD_LRS","StandardSSD_ZRS","Standard_LRS","UltraSSD_LRS"}
type StorageAccountType string

const (
	StorageAccountType_PremiumV2_LRS   = StorageAccountType("PremiumV2_LRS")
	StorageAccountType_Premium_LRS     = StorageAccountType("Premium_LRS")
	StorageAccountType_Premium_ZRS     = StorageAccountType("Premium_ZRS")
	StorageAccountType_StandardSSD_LRS = StorageAccountType("StandardSSD_LRS")
	StorageAccountType_StandardSSD_ZRS = StorageAccountType("StandardSSD_ZRS")
	StorageAccountType_Standard_LRS    = StorageAccountType("Standard_LRS")
	StorageAccountType_UltraSSD_LRS    = StorageAccountType("UltraSSD_LRS")
)

// Mapping from string to StorageAccountType
var storageAccountType_Values = map[string]StorageAccountType{
	"premiumv2_lrs":   StorageAccountType_PremiumV2_LRS,
	"premium_lrs":     StorageAccountType_Premium_LRS,
	"premium_zrs":     StorageAccountType_Premium_ZRS,
	"standardssd_lrs": StorageAccountType_StandardSSD_LRS,
	"standardssd_zrs": StorageAccountType_StandardSSD_ZRS,
	"standard_lrs":    StorageAccountType_Standard_LRS,
	"ultrassd_lrs":    StorageAccountType_UltraSSD_LRS,
}

// Specifies the storage account type for the managed disk. Managed OS disk storage account type can only be set when you
// create the scale set. NOTE: UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. Standard_LRS
// uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS uses Premium SSD. UltraSSD_LRS uses Ultra disk.
// Premium_ZRS uses Premium SSD zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant storage. For more
// information regarding disks supported for Windows Virtual Machines, refer to
// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to
// https://docs.microsoft.com/azure/virtual-machines/linux/disks-types
type StorageAccountType_STATUS string

const (
	StorageAccountType_STATUS_PremiumV2_LRS   = StorageAccountType_STATUS("PremiumV2_LRS")
	StorageAccountType_STATUS_Premium_LRS     = StorageAccountType_STATUS("Premium_LRS")
	StorageAccountType_STATUS_Premium_ZRS     = StorageAccountType_STATUS("Premium_ZRS")
	StorageAccountType_STATUS_StandardSSD_LRS = StorageAccountType_STATUS("StandardSSD_LRS")
	StorageAccountType_STATUS_StandardSSD_ZRS = StorageAccountType_STATUS("StandardSSD_ZRS")
	StorageAccountType_STATUS_Standard_LRS    = StorageAccountType_STATUS("Standard_LRS")
	StorageAccountType_STATUS_UltraSSD_LRS    = StorageAccountType_STATUS("UltraSSD_LRS")
)

// Mapping from string to StorageAccountType_STATUS
var storageAccountType_STATUS_Values = map[string]StorageAccountType_STATUS{
	"premiumv2_lrs":   StorageAccountType_STATUS_PremiumV2_LRS,
	"premium_lrs":     StorageAccountType_STATUS_Premium_LRS,
	"premium_zrs":     StorageAccountType_STATUS_Premium_ZRS,
	"standardssd_lrs": StorageAccountType_STATUS_StandardSSD_LRS,
	"standardssd_zrs": StorageAccountType_STATUS_StandardSSD_ZRS,
	"standard_lrs":    StorageAccountType_STATUS_Standard_LRS,
	"ultrassd_lrs":    StorageAccountType_STATUS_UltraSSD_LRS,
}

func init() {
	SchemeBuilder.Register(&Image{}, &ImageList{})
}
