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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/compute/v1api20241101/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/compute/v1api20241101/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/2024-11-01/ComputeRP.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}
type AvailabilitySet struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AvailabilitySet_Spec   `json:"spec,omitempty"`
	Status            AvailabilitySet_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &AvailabilitySet{}

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

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

var _ conversion.Convertible = &AvailabilitySet{}

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

	return availabilitySet.AssignProperties_From_AvailabilitySet(source)
}

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

	return availabilitySet.AssignProperties_To_AvailabilitySet(destination)
}

var _ configmaps.Exporter = &AvailabilitySet{}

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

var _ secrets.Exporter = &AvailabilitySet{}

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

var _ genruntime.ImportableResource = &AvailabilitySet{}

// InitializeSpec initializes the spec for this resource from the given status
func (availabilitySet *AvailabilitySet) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*AvailabilitySet_STATUS); ok {
		return availabilitySet.Spec.Initialize_From_AvailabilitySet_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &AvailabilitySet{}

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

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

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

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

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

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

// NewEmptyStatus returns a new empty (blank) status
func (availabilitySet *AvailabilitySet) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &AvailabilitySet_STATUS{}
}

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

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

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

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

	availabilitySet.Status = st
	return nil
}

// AssignProperties_From_AvailabilitySet populates our AvailabilitySet from the provided source AvailabilitySet
func (availabilitySet *AvailabilitySet) AssignProperties_From_AvailabilitySet(source *storage.AvailabilitySet) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_AvailabilitySet populates the provided destination AvailabilitySet from our AvailabilitySet
func (availabilitySet *AvailabilitySet) AssignProperties_To_AvailabilitySet(destination *storage.AvailabilitySet) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-11-01/ComputeRP.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}
type AvailabilitySetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []AvailabilitySet `json:"items"`
}

// +kubebuilder:validation:Enum={"2024-11-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2024-11-01")

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

	// +kubebuilder:validation:Required
	// Location: The geo-location where the resource lives
	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 *AvailabilitySetOperatorSpec `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"`

	// PlatformFaultDomainCount: Fault Domain count.
	PlatformFaultDomainCount *int `json:"platformFaultDomainCount,omitempty"`

	// PlatformUpdateDomainCount: Update Domain count.
	PlatformUpdateDomainCount *int `json:"platformUpdateDomainCount,omitempty"`

	// ProximityPlacementGroup: Specifies information about the proximity placement group that the availability set should be
	// assigned to. Minimum api-version: 2018-04-01.
	ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"`

	// ScheduledEventsPolicy: Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related
	// configurations for the availability set.
	ScheduledEventsPolicy *ScheduledEventsPolicy `json:"scheduledEventsPolicy,omitempty"`

	// Sku: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of
	// values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks.
	// Default value is 'Classic'.
	Sku *Sku `json:"sku,omitempty"`

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

var _ genruntime.ARMTransformer = &AvailabilitySet_Spec{}

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

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

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

	// Set property "Properties":
	if availabilitySet.PlatformFaultDomainCount != nil ||
		availabilitySet.PlatformUpdateDomainCount != nil ||
		availabilitySet.ProximityPlacementGroup != nil ||
		availabilitySet.ScheduledEventsPolicy != nil {
		result.Properties = &arm.AvailabilitySetProperties{}
	}
	if availabilitySet.PlatformFaultDomainCount != nil {
		platformFaultDomainCount := *availabilitySet.PlatformFaultDomainCount
		result.Properties.PlatformFaultDomainCount = &platformFaultDomainCount
	}
	if availabilitySet.PlatformUpdateDomainCount != nil {
		platformUpdateDomainCount := *availabilitySet.PlatformUpdateDomainCount
		result.Properties.PlatformUpdateDomainCount = &platformUpdateDomainCount
	}
	if availabilitySet.ProximityPlacementGroup != nil {
		proximityPlacementGroup_ARM, err := availabilitySet.ProximityPlacementGroup.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		proximityPlacementGroup := *proximityPlacementGroup_ARM.(*arm.SubResource)
		result.Properties.ProximityPlacementGroup = &proximityPlacementGroup
	}
	if availabilitySet.ScheduledEventsPolicy != nil {
		scheduledEventsPolicy_ARM, err := availabilitySet.ScheduledEventsPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		scheduledEventsPolicy := *scheduledEventsPolicy_ARM.(*arm.ScheduledEventsPolicy)
		result.Properties.ScheduledEventsPolicy = &scheduledEventsPolicy
	}

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

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

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

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

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

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

	// no assignment for property "OperatorSpec"

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

	// Set property "PlatformFaultDomainCount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PlatformFaultDomainCount != nil {
			platformFaultDomainCount := *typedInput.Properties.PlatformFaultDomainCount
			availabilitySet.PlatformFaultDomainCount = &platformFaultDomainCount
		}
	}

	// Set property "PlatformUpdateDomainCount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PlatformUpdateDomainCount != nil {
			platformUpdateDomainCount := *typedInput.Properties.PlatformUpdateDomainCount
			availabilitySet.PlatformUpdateDomainCount = &platformUpdateDomainCount
		}
	}

	// Set property "ProximityPlacementGroup":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProximityPlacementGroup != nil {
			var proximityPlacementGroup1 SubResource
			err := proximityPlacementGroup1.PopulateFromARM(owner, *typedInput.Properties.ProximityPlacementGroup)
			if err != nil {
				return err
			}
			proximityPlacementGroup := proximityPlacementGroup1
			availabilitySet.ProximityPlacementGroup = &proximityPlacementGroup
		}
	}

	// Set property "ScheduledEventsPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ScheduledEventsPolicy != nil {
			var scheduledEventsPolicy1 ScheduledEventsPolicy
			err := scheduledEventsPolicy1.PopulateFromARM(owner, *typedInput.Properties.ScheduledEventsPolicy)
			if err != nil {
				return err
			}
			scheduledEventsPolicy := scheduledEventsPolicy1
			availabilitySet.ScheduledEventsPolicy = &scheduledEventsPolicy
		}
	}

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &AvailabilitySet_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.AvailabilitySet_Spec{}
	err := availabilitySet.AssignProperties_To_AvailabilitySet_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_AvailabilitySet_Spec populates our AvailabilitySet_Spec from the provided source AvailabilitySet_Spec
func (availabilitySet *AvailabilitySet_Spec) AssignProperties_From_AvailabilitySet_Spec(source *storage.AvailabilitySet_Spec) error {

	// AzureName
	availabilitySet.AzureName = source.AzureName

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

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

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

	// PlatformFaultDomainCount
	availabilitySet.PlatformFaultDomainCount = genruntime.ClonePointerToInt(source.PlatformFaultDomainCount)

	// PlatformUpdateDomainCount
	availabilitySet.PlatformUpdateDomainCount = genruntime.ClonePointerToInt(source.PlatformUpdateDomainCount)

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

	// ScheduledEventsPolicy
	if source.ScheduledEventsPolicy != nil {
		var scheduledEventsPolicy ScheduledEventsPolicy
		err := scheduledEventsPolicy.AssignProperties_From_ScheduledEventsPolicy(source.ScheduledEventsPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ScheduledEventsPolicy() to populate field ScheduledEventsPolicy")
		}
		availabilitySet.ScheduledEventsPolicy = &scheduledEventsPolicy
	} else {
		availabilitySet.ScheduledEventsPolicy = nil
	}

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = availabilitySet.AzureName

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

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

	// OriginalVersion
	destination.OriginalVersion = availabilitySet.OriginalVersion()

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

	// PlatformFaultDomainCount
	destination.PlatformFaultDomainCount = genruntime.ClonePointerToInt(availabilitySet.PlatformFaultDomainCount)

	// PlatformUpdateDomainCount
	destination.PlatformUpdateDomainCount = genruntime.ClonePointerToInt(availabilitySet.PlatformUpdateDomainCount)

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

	// ScheduledEventsPolicy
	if availabilitySet.ScheduledEventsPolicy != nil {
		var scheduledEventsPolicy storage.ScheduledEventsPolicy
		err := availabilitySet.ScheduledEventsPolicy.AssignProperties_To_ScheduledEventsPolicy(&scheduledEventsPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledEventsPolicy() to populate field ScheduledEventsPolicy")
		}
		destination.ScheduledEventsPolicy = &scheduledEventsPolicy
	} else {
		destination.ScheduledEventsPolicy = nil
	}

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

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

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

	// No error
	return nil
}

// Initialize_From_AvailabilitySet_STATUS populates our AvailabilitySet_Spec from the provided source AvailabilitySet_STATUS
func (availabilitySet *AvailabilitySet_Spec) Initialize_From_AvailabilitySet_STATUS(source *AvailabilitySet_STATUS) error {

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

	// PlatformFaultDomainCount
	availabilitySet.PlatformFaultDomainCount = genruntime.ClonePointerToInt(source.PlatformFaultDomainCount)

	// PlatformUpdateDomainCount
	availabilitySet.PlatformUpdateDomainCount = genruntime.ClonePointerToInt(source.PlatformUpdateDomainCount)

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

	// ScheduledEventsPolicy
	if source.ScheduledEventsPolicy != nil {
		var scheduledEventsPolicy ScheduledEventsPolicy
		err := scheduledEventsPolicy.Initialize_From_ScheduledEventsPolicy_STATUS(source.ScheduledEventsPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ScheduledEventsPolicy_STATUS() to populate field ScheduledEventsPolicy")
		}
		availabilitySet.ScheduledEventsPolicy = &scheduledEventsPolicy
	} else {
		availabilitySet.ScheduledEventsPolicy = nil
	}

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

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

	// No error
	return nil
}

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

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

// Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines
// specified in the same availability set are allocated to different nodes to maximize availability. For more information
// about availability sets, see [Availability sets
// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure
// planned maintenance, see [Maintenance and updates for Virtual Machines in
// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to
// an availability set at creation time. An existing VM cannot be added to an availability set.
type AvailabilitySet_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

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

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

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

	// PlatformFaultDomainCount: Fault Domain count.
	PlatformFaultDomainCount *int `json:"platformFaultDomainCount,omitempty"`

	// PlatformUpdateDomainCount: Update Domain count.
	PlatformUpdateDomainCount *int `json:"platformUpdateDomainCount,omitempty"`

	// ProximityPlacementGroup: Specifies information about the proximity placement group that the availability set should be
	// assigned to. Minimum api-version: 2018-04-01.
	ProximityPlacementGroup *SubResource_STATUS `json:"proximityPlacementGroup,omitempty"`

	// ScheduledEventsPolicy: Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related
	// configurations for the availability set.
	ScheduledEventsPolicy *ScheduledEventsPolicy_STATUS `json:"scheduledEventsPolicy,omitempty"`

	// Sku: Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of
	// values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks.
	// Default value is 'Classic'.
	Sku *Sku_STATUS `json:"sku,omitempty"`

	// Statuses: The resource status information.
	Statuses []InstanceViewStatus_STATUS `json:"statuses,omitempty"`

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

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

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

	// VirtualMachineScaleSetMigrationInfo: Describes the migration properties on the Availability Set.
	VirtualMachineScaleSetMigrationInfo *VirtualMachineScaleSetMigrationInfo_STATUS `json:"virtualMachineScaleSetMigrationInfo,omitempty"`

	// VirtualMachines: A list of references to all virtual machines in the availability set.
	VirtualMachines []SubResource_STATUS `json:"virtualMachines,omitempty"`
}

var _ genruntime.ConvertibleStatus = &AvailabilitySet_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.AvailabilitySet_STATUS{}
	err := availabilitySet.AssignProperties_To_AvailabilitySet_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 = &AvailabilitySet_STATUS{}

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

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

	// no assignment for property "Conditions"

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

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

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

	// Set property "PlatformFaultDomainCount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PlatformFaultDomainCount != nil {
			platformFaultDomainCount := *typedInput.Properties.PlatformFaultDomainCount
			availabilitySet.PlatformFaultDomainCount = &platformFaultDomainCount
		}
	}

	// Set property "PlatformUpdateDomainCount":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PlatformUpdateDomainCount != nil {
			platformUpdateDomainCount := *typedInput.Properties.PlatformUpdateDomainCount
			availabilitySet.PlatformUpdateDomainCount = &platformUpdateDomainCount
		}
	}

	// Set property "ProximityPlacementGroup":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProximityPlacementGroup != nil {
			var proximityPlacementGroup1 SubResource_STATUS
			err := proximityPlacementGroup1.PopulateFromARM(owner, *typedInput.Properties.ProximityPlacementGroup)
			if err != nil {
				return err
			}
			proximityPlacementGroup := proximityPlacementGroup1
			availabilitySet.ProximityPlacementGroup = &proximityPlacementGroup
		}
	}

	// Set property "ScheduledEventsPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ScheduledEventsPolicy != nil {
			var scheduledEventsPolicy1 ScheduledEventsPolicy_STATUS
			err := scheduledEventsPolicy1.PopulateFromARM(owner, *typedInput.Properties.ScheduledEventsPolicy)
			if err != nil {
				return err
			}
			scheduledEventsPolicy := scheduledEventsPolicy1
			availabilitySet.ScheduledEventsPolicy = &scheduledEventsPolicy
		}
	}

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

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

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

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

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

	// Set property "VirtualMachineScaleSetMigrationInfo":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualMachineScaleSetMigrationInfo != nil {
			var virtualMachineScaleSetMigrationInfo1 VirtualMachineScaleSetMigrationInfo_STATUS
			err := virtualMachineScaleSetMigrationInfo1.PopulateFromARM(owner, *typedInput.Properties.VirtualMachineScaleSetMigrationInfo)
			if err != nil {
				return err
			}
			virtualMachineScaleSetMigrationInfo := virtualMachineScaleSetMigrationInfo1
			availabilitySet.VirtualMachineScaleSetMigrationInfo = &virtualMachineScaleSetMigrationInfo
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_AvailabilitySet_STATUS populates our AvailabilitySet_STATUS from the provided source AvailabilitySet_STATUS
func (availabilitySet *AvailabilitySet_STATUS) AssignProperties_From_AvailabilitySet_STATUS(source *storage.AvailabilitySet_STATUS) error {

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

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

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

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

	// PlatformFaultDomainCount
	availabilitySet.PlatformFaultDomainCount = genruntime.ClonePointerToInt(source.PlatformFaultDomainCount)

	// PlatformUpdateDomainCount
	availabilitySet.PlatformUpdateDomainCount = genruntime.ClonePointerToInt(source.PlatformUpdateDomainCount)

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

	// ScheduledEventsPolicy
	if source.ScheduledEventsPolicy != nil {
		var scheduledEventsPolicy ScheduledEventsPolicy_STATUS
		err := scheduledEventsPolicy.AssignProperties_From_ScheduledEventsPolicy_STATUS(source.ScheduledEventsPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ScheduledEventsPolicy_STATUS() to populate field ScheduledEventsPolicy")
		}
		availabilitySet.ScheduledEventsPolicy = &scheduledEventsPolicy
	} else {
		availabilitySet.ScheduledEventsPolicy = nil
	}

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

	// Statuses
	if source.Statuses != nil {
		statusList := make([]InstanceViewStatus_STATUS, len(source.Statuses))
		for statusIndex, statusItem := range source.Statuses {
			var status InstanceViewStatus_STATUS
			err := status.AssignProperties_From_InstanceViewStatus_STATUS(&statusItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_InstanceViewStatus_STATUS() to populate field Statuses")
			}
			statusList[statusIndex] = status
		}
		availabilitySet.Statuses = statusList
	} else {
		availabilitySet.Statuses = nil
	}

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

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

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

	// VirtualMachineScaleSetMigrationInfo
	if source.VirtualMachineScaleSetMigrationInfo != nil {
		var virtualMachineScaleSetMigrationInfo VirtualMachineScaleSetMigrationInfo_STATUS
		err := virtualMachineScaleSetMigrationInfo.AssignProperties_From_VirtualMachineScaleSetMigrationInfo_STATUS(source.VirtualMachineScaleSetMigrationInfo)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualMachineScaleSetMigrationInfo_STATUS() to populate field VirtualMachineScaleSetMigrationInfo")
		}
		availabilitySet.VirtualMachineScaleSetMigrationInfo = &virtualMachineScaleSetMigrationInfo
	} else {
		availabilitySet.VirtualMachineScaleSetMigrationInfo = nil
	}

	// VirtualMachines
	if source.VirtualMachines != nil {
		virtualMachineList := make([]SubResource_STATUS, len(source.VirtualMachines))
		for virtualMachineIndex, virtualMachineItem := range source.VirtualMachines {
			var virtualMachine SubResource_STATUS
			err := virtualMachine.AssignProperties_From_SubResource_STATUS(&virtualMachineItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field VirtualMachines")
			}
			virtualMachineList[virtualMachineIndex] = virtualMachine
		}
		availabilitySet.VirtualMachines = virtualMachineList
	} else {
		availabilitySet.VirtualMachines = nil
	}

	// No error
	return nil
}

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

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

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

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

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

	// PlatformFaultDomainCount
	destination.PlatformFaultDomainCount = genruntime.ClonePointerToInt(availabilitySet.PlatformFaultDomainCount)

	// PlatformUpdateDomainCount
	destination.PlatformUpdateDomainCount = genruntime.ClonePointerToInt(availabilitySet.PlatformUpdateDomainCount)

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

	// ScheduledEventsPolicy
	if availabilitySet.ScheduledEventsPolicy != nil {
		var scheduledEventsPolicy storage.ScheduledEventsPolicy_STATUS
		err := availabilitySet.ScheduledEventsPolicy.AssignProperties_To_ScheduledEventsPolicy_STATUS(&scheduledEventsPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledEventsPolicy_STATUS() to populate field ScheduledEventsPolicy")
		}
		destination.ScheduledEventsPolicy = &scheduledEventsPolicy
	} else {
		destination.ScheduledEventsPolicy = nil
	}

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

	// Statuses
	if availabilitySet.Statuses != nil {
		statusList := make([]storage.InstanceViewStatus_STATUS, len(availabilitySet.Statuses))
		for statusIndex, statusItem := range availabilitySet.Statuses {
			var status storage.InstanceViewStatus_STATUS
			err := statusItem.AssignProperties_To_InstanceViewStatus_STATUS(&status)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_InstanceViewStatus_STATUS() to populate field Statuses")
			}
			statusList[statusIndex] = status
		}
		destination.Statuses = statusList
	} else {
		destination.Statuses = nil
	}

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

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

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

	// VirtualMachineScaleSetMigrationInfo
	if availabilitySet.VirtualMachineScaleSetMigrationInfo != nil {
		var virtualMachineScaleSetMigrationInfo storage.VirtualMachineScaleSetMigrationInfo_STATUS
		err := availabilitySet.VirtualMachineScaleSetMigrationInfo.AssignProperties_To_VirtualMachineScaleSetMigrationInfo_STATUS(&virtualMachineScaleSetMigrationInfo)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualMachineScaleSetMigrationInfo_STATUS() to populate field VirtualMachineScaleSetMigrationInfo")
		}
		destination.VirtualMachineScaleSetMigrationInfo = &virtualMachineScaleSetMigrationInfo
	} else {
		destination.VirtualMachineScaleSetMigrationInfo = nil
	}

	// VirtualMachines
	if availabilitySet.VirtualMachines != nil {
		virtualMachineList := make([]storage.SubResource_STATUS, len(availabilitySet.VirtualMachines))
		for virtualMachineIndex, virtualMachineItem := range availabilitySet.VirtualMachines {
			var virtualMachine storage.SubResource_STATUS
			err := virtualMachineItem.AssignProperties_To_SubResource_STATUS(&virtualMachine)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field VirtualMachines")
			}
			virtualMachineList[virtualMachineIndex] = virtualMachine
		}
		destination.VirtualMachines = virtualMachineList
	} else {
		destination.VirtualMachines = nil
	}

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

	// No error
	return nil
}

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

// Instance view status.
type InstanceViewStatus_STATUS struct {
	// Code: The status code.
	Code *string `json:"code,omitempty"`

	// DisplayStatus: The short localizable label for the status.
	DisplayStatus *string `json:"displayStatus,omitempty"`

	// Level: The level code.
	Level *StatusLevelTypes_STATUS `json:"level,omitempty"`

	// Message: The detailed status message, including for alerts and error messages.
	Message *string `json:"message,omitempty"`

	// Time: The time of the status.
	Time *string `json:"time,omitempty"`
}

var _ genruntime.FromARMConverter = &InstanceViewStatus_STATUS{}

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

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

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

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

	// Set property "Level":
	if typedInput.Level != nil {
		var temp string
		temp = string(*typedInput.Level)
		level := StatusLevelTypes_STATUS(temp)
		status.Level = &level
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_InstanceViewStatus_STATUS populates our InstanceViewStatus_STATUS from the provided source InstanceViewStatus_STATUS
func (status *InstanceViewStatus_STATUS) AssignProperties_From_InstanceViewStatus_STATUS(source *storage.InstanceViewStatus_STATUS) error {

	// Code
	status.Code = genruntime.ClonePointerToString(source.Code)

	// DisplayStatus
	status.DisplayStatus = genruntime.ClonePointerToString(source.DisplayStatus)

	// Level
	if source.Level != nil {
		level := *source.Level
		levelTemp := genruntime.ToEnum(level, statusLevelTypes_STATUS_Values)
		status.Level = &levelTemp
	} else {
		status.Level = nil
	}

	// Message
	status.Message = genruntime.ClonePointerToString(source.Message)

	// Time
	status.Time = genruntime.ClonePointerToString(source.Time)

	// No error
	return nil
}

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

	// Code
	destination.Code = genruntime.ClonePointerToString(status.Code)

	// DisplayStatus
	destination.DisplayStatus = genruntime.ClonePointerToString(status.DisplayStatus)

	// Level
	if status.Level != nil {
		level := string(*status.Level)
		destination.Level = &level
	} else {
		destination.Level = nil
	}

	// Message
	destination.Message = genruntime.ClonePointerToString(status.Message)

	// Time
	destination.Time = genruntime.ClonePointerToString(status.Time)

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

	// No error
	return nil
}

// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations.
type ScheduledEventsPolicy struct {
	// ScheduledEventsAdditionalPublishingTargets: The configuration parameters used while publishing
	// scheduledEventsAdditionalPublishingTargets.
	ScheduledEventsAdditionalPublishingTargets *ScheduledEventsAdditionalPublishingTargets `json:"scheduledEventsAdditionalPublishingTargets,omitempty"`

	// UserInitiatedReboot: The configuration parameters used while creating userInitiatedReboot scheduled event setting
	// creation.
	UserInitiatedReboot *UserInitiatedReboot `json:"userInitiatedReboot,omitempty"`

	// UserInitiatedRedeploy: The configuration parameters used while creating userInitiatedRedeploy scheduled event setting
	// creation.
	UserInitiatedRedeploy *UserInitiatedRedeploy `json:"userInitiatedRedeploy,omitempty"`
}

var _ genruntime.ARMTransformer = &ScheduledEventsPolicy{}

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

	// Set property "ScheduledEventsAdditionalPublishingTargets":
	if policy.ScheduledEventsAdditionalPublishingTargets != nil {
		scheduledEventsAdditionalPublishingTargets_ARM, err := policy.ScheduledEventsAdditionalPublishingTargets.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		scheduledEventsAdditionalPublishingTargets := *scheduledEventsAdditionalPublishingTargets_ARM.(*arm.ScheduledEventsAdditionalPublishingTargets)
		result.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTargets
	}

	// Set property "UserInitiatedReboot":
	if policy.UserInitiatedReboot != nil {
		userInitiatedReboot_ARM, err := policy.UserInitiatedReboot.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		userInitiatedReboot := *userInitiatedReboot_ARM.(*arm.UserInitiatedReboot)
		result.UserInitiatedReboot = &userInitiatedReboot
	}

	// Set property "UserInitiatedRedeploy":
	if policy.UserInitiatedRedeploy != nil {
		userInitiatedRedeploy_ARM, err := policy.UserInitiatedRedeploy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		userInitiatedRedeploy := *userInitiatedRedeploy_ARM.(*arm.UserInitiatedRedeploy)
		result.UserInitiatedRedeploy = &userInitiatedRedeploy
	}
	return result, nil
}

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

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

	// Set property "ScheduledEventsAdditionalPublishingTargets":
	if typedInput.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTargets1 ScheduledEventsAdditionalPublishingTargets
		err := scheduledEventsAdditionalPublishingTargets1.PopulateFromARM(owner, *typedInput.ScheduledEventsAdditionalPublishingTargets)
		if err != nil {
			return err
		}
		scheduledEventsAdditionalPublishingTargets := scheduledEventsAdditionalPublishingTargets1
		policy.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTargets
	}

	// Set property "UserInitiatedReboot":
	if typedInput.UserInitiatedReboot != nil {
		var userInitiatedReboot1 UserInitiatedReboot
		err := userInitiatedReboot1.PopulateFromARM(owner, *typedInput.UserInitiatedReboot)
		if err != nil {
			return err
		}
		userInitiatedReboot := userInitiatedReboot1
		policy.UserInitiatedReboot = &userInitiatedReboot
	}

	// Set property "UserInitiatedRedeploy":
	if typedInput.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy1 UserInitiatedRedeploy
		err := userInitiatedRedeploy1.PopulateFromARM(owner, *typedInput.UserInitiatedRedeploy)
		if err != nil {
			return err
		}
		userInitiatedRedeploy := userInitiatedRedeploy1
		policy.UserInitiatedRedeploy = &userInitiatedRedeploy
	}

	// No error
	return nil
}

// AssignProperties_From_ScheduledEventsPolicy populates our ScheduledEventsPolicy from the provided source ScheduledEventsPolicy
func (policy *ScheduledEventsPolicy) AssignProperties_From_ScheduledEventsPolicy(source *storage.ScheduledEventsPolicy) error {

	// ScheduledEventsAdditionalPublishingTargets
	if source.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTarget ScheduledEventsAdditionalPublishingTargets
		err := scheduledEventsAdditionalPublishingTarget.AssignProperties_From_ScheduledEventsAdditionalPublishingTargets(source.ScheduledEventsAdditionalPublishingTargets)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ScheduledEventsAdditionalPublishingTargets() to populate field ScheduledEventsAdditionalPublishingTargets")
		}
		policy.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTarget
	} else {
		policy.ScheduledEventsAdditionalPublishingTargets = nil
	}

	// UserInitiatedReboot
	if source.UserInitiatedReboot != nil {
		var userInitiatedReboot UserInitiatedReboot
		err := userInitiatedReboot.AssignProperties_From_UserInitiatedReboot(source.UserInitiatedReboot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UserInitiatedReboot() to populate field UserInitiatedReboot")
		}
		policy.UserInitiatedReboot = &userInitiatedReboot
	} else {
		policy.UserInitiatedReboot = nil
	}

	// UserInitiatedRedeploy
	if source.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy UserInitiatedRedeploy
		err := userInitiatedRedeploy.AssignProperties_From_UserInitiatedRedeploy(source.UserInitiatedRedeploy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UserInitiatedRedeploy() to populate field UserInitiatedRedeploy")
		}
		policy.UserInitiatedRedeploy = &userInitiatedRedeploy
	} else {
		policy.UserInitiatedRedeploy = nil
	}

	// No error
	return nil
}

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

	// ScheduledEventsAdditionalPublishingTargets
	if policy.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTarget storage.ScheduledEventsAdditionalPublishingTargets
		err := policy.ScheduledEventsAdditionalPublishingTargets.AssignProperties_To_ScheduledEventsAdditionalPublishingTargets(&scheduledEventsAdditionalPublishingTarget)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledEventsAdditionalPublishingTargets() to populate field ScheduledEventsAdditionalPublishingTargets")
		}
		destination.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTarget
	} else {
		destination.ScheduledEventsAdditionalPublishingTargets = nil
	}

	// UserInitiatedReboot
	if policy.UserInitiatedReboot != nil {
		var userInitiatedReboot storage.UserInitiatedReboot
		err := policy.UserInitiatedReboot.AssignProperties_To_UserInitiatedReboot(&userInitiatedReboot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UserInitiatedReboot() to populate field UserInitiatedReboot")
		}
		destination.UserInitiatedReboot = &userInitiatedReboot
	} else {
		destination.UserInitiatedReboot = nil
	}

	// UserInitiatedRedeploy
	if policy.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy storage.UserInitiatedRedeploy
		err := policy.UserInitiatedRedeploy.AssignProperties_To_UserInitiatedRedeploy(&userInitiatedRedeploy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UserInitiatedRedeploy() to populate field UserInitiatedRedeploy")
		}
		destination.UserInitiatedRedeploy = &userInitiatedRedeploy
	} else {
		destination.UserInitiatedRedeploy = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ScheduledEventsPolicy_STATUS populates our ScheduledEventsPolicy from the provided source ScheduledEventsPolicy_STATUS
func (policy *ScheduledEventsPolicy) Initialize_From_ScheduledEventsPolicy_STATUS(source *ScheduledEventsPolicy_STATUS) error {

	// ScheduledEventsAdditionalPublishingTargets
	if source.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTarget ScheduledEventsAdditionalPublishingTargets
		err := scheduledEventsAdditionalPublishingTarget.Initialize_From_ScheduledEventsAdditionalPublishingTargets_STATUS(source.ScheduledEventsAdditionalPublishingTargets)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ScheduledEventsAdditionalPublishingTargets_STATUS() to populate field ScheduledEventsAdditionalPublishingTargets")
		}
		policy.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTarget
	} else {
		policy.ScheduledEventsAdditionalPublishingTargets = nil
	}

	// UserInitiatedReboot
	if source.UserInitiatedReboot != nil {
		var userInitiatedReboot UserInitiatedReboot
		err := userInitiatedReboot.Initialize_From_UserInitiatedReboot_STATUS(source.UserInitiatedReboot)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_UserInitiatedReboot_STATUS() to populate field UserInitiatedReboot")
		}
		policy.UserInitiatedReboot = &userInitiatedReboot
	} else {
		policy.UserInitiatedReboot = nil
	}

	// UserInitiatedRedeploy
	if source.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy UserInitiatedRedeploy
		err := userInitiatedRedeploy.Initialize_From_UserInitiatedRedeploy_STATUS(source.UserInitiatedRedeploy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_UserInitiatedRedeploy_STATUS() to populate field UserInitiatedRedeploy")
		}
		policy.UserInitiatedRedeploy = &userInitiatedRedeploy
	} else {
		policy.UserInitiatedRedeploy = nil
	}

	// No error
	return nil
}

// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations.
type ScheduledEventsPolicy_STATUS struct {
	// ScheduledEventsAdditionalPublishingTargets: The configuration parameters used while publishing
	// scheduledEventsAdditionalPublishingTargets.
	ScheduledEventsAdditionalPublishingTargets *ScheduledEventsAdditionalPublishingTargets_STATUS `json:"scheduledEventsAdditionalPublishingTargets,omitempty"`

	// UserInitiatedReboot: The configuration parameters used while creating userInitiatedReboot scheduled event setting
	// creation.
	UserInitiatedReboot *UserInitiatedReboot_STATUS `json:"userInitiatedReboot,omitempty"`

	// UserInitiatedRedeploy: The configuration parameters used while creating userInitiatedRedeploy scheduled event setting
	// creation.
	UserInitiatedRedeploy *UserInitiatedRedeploy_STATUS `json:"userInitiatedRedeploy,omitempty"`
}

var _ genruntime.FromARMConverter = &ScheduledEventsPolicy_STATUS{}

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

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

	// Set property "ScheduledEventsAdditionalPublishingTargets":
	if typedInput.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTargets1 ScheduledEventsAdditionalPublishingTargets_STATUS
		err := scheduledEventsAdditionalPublishingTargets1.PopulateFromARM(owner, *typedInput.ScheduledEventsAdditionalPublishingTargets)
		if err != nil {
			return err
		}
		scheduledEventsAdditionalPublishingTargets := scheduledEventsAdditionalPublishingTargets1
		policy.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTargets
	}

	// Set property "UserInitiatedReboot":
	if typedInput.UserInitiatedReboot != nil {
		var userInitiatedReboot1 UserInitiatedReboot_STATUS
		err := userInitiatedReboot1.PopulateFromARM(owner, *typedInput.UserInitiatedReboot)
		if err != nil {
			return err
		}
		userInitiatedReboot := userInitiatedReboot1
		policy.UserInitiatedReboot = &userInitiatedReboot
	}

	// Set property "UserInitiatedRedeploy":
	if typedInput.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy1 UserInitiatedRedeploy_STATUS
		err := userInitiatedRedeploy1.PopulateFromARM(owner, *typedInput.UserInitiatedRedeploy)
		if err != nil {
			return err
		}
		userInitiatedRedeploy := userInitiatedRedeploy1
		policy.UserInitiatedRedeploy = &userInitiatedRedeploy
	}

	// No error
	return nil
}

// AssignProperties_From_ScheduledEventsPolicy_STATUS populates our ScheduledEventsPolicy_STATUS from the provided source ScheduledEventsPolicy_STATUS
func (policy *ScheduledEventsPolicy_STATUS) AssignProperties_From_ScheduledEventsPolicy_STATUS(source *storage.ScheduledEventsPolicy_STATUS) error {

	// ScheduledEventsAdditionalPublishingTargets
	if source.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTarget ScheduledEventsAdditionalPublishingTargets_STATUS
		err := scheduledEventsAdditionalPublishingTarget.AssignProperties_From_ScheduledEventsAdditionalPublishingTargets_STATUS(source.ScheduledEventsAdditionalPublishingTargets)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ScheduledEventsAdditionalPublishingTargets_STATUS() to populate field ScheduledEventsAdditionalPublishingTargets")
		}
		policy.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTarget
	} else {
		policy.ScheduledEventsAdditionalPublishingTargets = nil
	}

	// UserInitiatedReboot
	if source.UserInitiatedReboot != nil {
		var userInitiatedReboot UserInitiatedReboot_STATUS
		err := userInitiatedReboot.AssignProperties_From_UserInitiatedReboot_STATUS(source.UserInitiatedReboot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UserInitiatedReboot_STATUS() to populate field UserInitiatedReboot")
		}
		policy.UserInitiatedReboot = &userInitiatedReboot
	} else {
		policy.UserInitiatedReboot = nil
	}

	// UserInitiatedRedeploy
	if source.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy UserInitiatedRedeploy_STATUS
		err := userInitiatedRedeploy.AssignProperties_From_UserInitiatedRedeploy_STATUS(source.UserInitiatedRedeploy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UserInitiatedRedeploy_STATUS() to populate field UserInitiatedRedeploy")
		}
		policy.UserInitiatedRedeploy = &userInitiatedRedeploy
	} else {
		policy.UserInitiatedRedeploy = nil
	}

	// No error
	return nil
}

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

	// ScheduledEventsAdditionalPublishingTargets
	if policy.ScheduledEventsAdditionalPublishingTargets != nil {
		var scheduledEventsAdditionalPublishingTarget storage.ScheduledEventsAdditionalPublishingTargets_STATUS
		err := policy.ScheduledEventsAdditionalPublishingTargets.AssignProperties_To_ScheduledEventsAdditionalPublishingTargets_STATUS(&scheduledEventsAdditionalPublishingTarget)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledEventsAdditionalPublishingTargets_STATUS() to populate field ScheduledEventsAdditionalPublishingTargets")
		}
		destination.ScheduledEventsAdditionalPublishingTargets = &scheduledEventsAdditionalPublishingTarget
	} else {
		destination.ScheduledEventsAdditionalPublishingTargets = nil
	}

	// UserInitiatedReboot
	if policy.UserInitiatedReboot != nil {
		var userInitiatedReboot storage.UserInitiatedReboot_STATUS
		err := policy.UserInitiatedReboot.AssignProperties_To_UserInitiatedReboot_STATUS(&userInitiatedReboot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UserInitiatedReboot_STATUS() to populate field UserInitiatedReboot")
		}
		destination.UserInitiatedReboot = &userInitiatedReboot
	} else {
		destination.UserInitiatedReboot = nil
	}

	// UserInitiatedRedeploy
	if policy.UserInitiatedRedeploy != nil {
		var userInitiatedRedeploy storage.UserInitiatedRedeploy_STATUS
		err := policy.UserInitiatedRedeploy.AssignProperties_To_UserInitiatedRedeploy_STATUS(&userInitiatedRedeploy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UserInitiatedRedeploy_STATUS() to populate field UserInitiatedRedeploy")
		}
		destination.UserInitiatedRedeploy = &userInitiatedRedeploy
	} else {
		destination.UserInitiatedRedeploy = nil
	}

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

	// No error
	return nil
}

// Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is
// currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
type Sku struct {
	// Capacity: Specifies the number of virtual machines in the scale set.
	Capacity *int `json:"capacity,omitempty"`

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

	// Tier: Specifies the tier of virtual machines in a scale set.
	// Possible Values:
	// Standard
	// Basic
	Tier *string `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &Sku{}

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

	// Set property "Capacity":
	if sku.Capacity != nil {
		capacity := *sku.Capacity
		result.Capacity = &capacity
	}

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

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

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

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

	// Set property "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		sku.Capacity = &capacity
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_Sku populates our Sku from the provided source Sku
func (sku *Sku) AssignProperties_From_Sku(source *storage.Sku) error {

	// Capacity
	sku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

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

	// No error
	return nil
}

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

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity)

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

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

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

	// No error
	return nil
}

// Initialize_From_Sku_STATUS populates our Sku from the provided source Sku_STATUS
func (sku *Sku) Initialize_From_Sku_STATUS(source *Sku_STATUS) error {

	// Capacity
	sku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

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

	// No error
	return nil
}

// Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is
// currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
type Sku_STATUS struct {
	// Capacity: Specifies the number of virtual machines in the scale set.
	Capacity *int `json:"capacity,omitempty"`

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

	// Tier: Specifies the tier of virtual machines in a scale set.
	// Possible Values:
	// Standard
	// Basic
	Tier *string `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &Sku_STATUS{}

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

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

	// Set property "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		sku.Capacity = &capacity
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_Sku_STATUS populates our Sku_STATUS from the provided source Sku_STATUS
func (sku *Sku_STATUS) AssignProperties_From_Sku_STATUS(source *storage.Sku_STATUS) error {

	// Capacity
	sku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

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

	// No error
	return nil
}

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

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity)

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

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

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

// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
	// CreatedAt: The timestamp of resource creation (UTC).
	CreatedAt *string `json:"createdAt,omitempty"`

	// CreatedBy: The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType: The type of identity that created the resource.
	CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"`

	// LastModifiedAt: The timestamp of resource last modification (UTC)
	LastModifiedAt *string `json:"lastModifiedAt,omitempty"`

	// LastModifiedBy: The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// LastModifiedByType: The type of identity that last modified the resource.
	LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"`
}

var _ genruntime.FromARMConverter = &SystemData_STATUS{}

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

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

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

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

	// Set property "CreatedByType":
	if typedInput.CreatedByType != nil {
		var temp string
		temp = string(*typedInput.CreatedByType)
		createdByType := SystemData_CreatedByType_STATUS(temp)
		data.CreatedByType = &createdByType
	}

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

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

	// Set property "LastModifiedByType":
	if typedInput.LastModifiedByType != nil {
		var temp string
		temp = string(*typedInput.LastModifiedByType)
		lastModifiedByType := SystemData_LastModifiedByType_STATUS(temp)
		data.LastModifiedByType = &lastModifiedByType
	}

	// No error
	return nil
}

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

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

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

	// CreatedByType
	if source.CreatedByType != nil {
		createdByType := *source.CreatedByType
		createdByTypeTemp := genruntime.ToEnum(createdByType, systemData_CreatedByType_STATUS_Values)
		data.CreatedByType = &createdByTypeTemp
	} else {
		data.CreatedByType = nil
	}

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

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

	// LastModifiedByType
	if source.LastModifiedByType != nil {
		lastModifiedByType := *source.LastModifiedByType
		lastModifiedByTypeTemp := genruntime.ToEnum(lastModifiedByType, systemData_LastModifiedByType_STATUS_Values)
		data.LastModifiedByType = &lastModifiedByTypeTemp
	} else {
		data.LastModifiedByType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Describes the Availability Set properties related to migration to Flexible Virtual Machine Scale Set.
type VirtualMachineScaleSetMigrationInfo_STATUS struct {
	// DefaultVirtualMachineScaleSetInfo: Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless
	// migration without downtime of the VMs via the ConvertToVirtualMachineScaleSet API.
	DefaultVirtualMachineScaleSetInfo *DefaultVirtualMachineScaleSetInfo_STATUS `json:"defaultVirtualMachineScaleSetInfo,omitempty"`

	// MigrateToVirtualMachineScaleSet: Specifies the Virtual Machine Scale Set that the Availability Set is migrated to.
	MigrateToVirtualMachineScaleSet *SubResource_STATUS `json:"migrateToVirtualMachineScaleSet,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualMachineScaleSetMigrationInfo_STATUS{}

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

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

	// Set property "DefaultVirtualMachineScaleSetInfo":
	if typedInput.DefaultVirtualMachineScaleSetInfo != nil {
		var defaultVirtualMachineScaleSetInfo1 DefaultVirtualMachineScaleSetInfo_STATUS
		err := defaultVirtualMachineScaleSetInfo1.PopulateFromARM(owner, *typedInput.DefaultVirtualMachineScaleSetInfo)
		if err != nil {
			return err
		}
		defaultVirtualMachineScaleSetInfo := defaultVirtualMachineScaleSetInfo1
		info.DefaultVirtualMachineScaleSetInfo = &defaultVirtualMachineScaleSetInfo
	}

	// Set property "MigrateToVirtualMachineScaleSet":
	if typedInput.MigrateToVirtualMachineScaleSet != nil {
		var migrateToVirtualMachineScaleSet1 SubResource_STATUS
		err := migrateToVirtualMachineScaleSet1.PopulateFromARM(owner, *typedInput.MigrateToVirtualMachineScaleSet)
		if err != nil {
			return err
		}
		migrateToVirtualMachineScaleSet := migrateToVirtualMachineScaleSet1
		info.MigrateToVirtualMachineScaleSet = &migrateToVirtualMachineScaleSet
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualMachineScaleSetMigrationInfo_STATUS populates our VirtualMachineScaleSetMigrationInfo_STATUS from the provided source VirtualMachineScaleSetMigrationInfo_STATUS
func (info *VirtualMachineScaleSetMigrationInfo_STATUS) AssignProperties_From_VirtualMachineScaleSetMigrationInfo_STATUS(source *storage.VirtualMachineScaleSetMigrationInfo_STATUS) error {

	// DefaultVirtualMachineScaleSetInfo
	if source.DefaultVirtualMachineScaleSetInfo != nil {
		var defaultVirtualMachineScaleSetInfo DefaultVirtualMachineScaleSetInfo_STATUS
		err := defaultVirtualMachineScaleSetInfo.AssignProperties_From_DefaultVirtualMachineScaleSetInfo_STATUS(source.DefaultVirtualMachineScaleSetInfo)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DefaultVirtualMachineScaleSetInfo_STATUS() to populate field DefaultVirtualMachineScaleSetInfo")
		}
		info.DefaultVirtualMachineScaleSetInfo = &defaultVirtualMachineScaleSetInfo
	} else {
		info.DefaultVirtualMachineScaleSetInfo = nil
	}

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

	// No error
	return nil
}

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

	// DefaultVirtualMachineScaleSetInfo
	if info.DefaultVirtualMachineScaleSetInfo != nil {
		var defaultVirtualMachineScaleSetInfo storage.DefaultVirtualMachineScaleSetInfo_STATUS
		err := info.DefaultVirtualMachineScaleSetInfo.AssignProperties_To_DefaultVirtualMachineScaleSetInfo_STATUS(&defaultVirtualMachineScaleSetInfo)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DefaultVirtualMachineScaleSetInfo_STATUS() to populate field DefaultVirtualMachineScaleSetInfo")
		}
		destination.DefaultVirtualMachineScaleSetInfo = &defaultVirtualMachineScaleSetInfo
	} else {
		destination.DefaultVirtualMachineScaleSetInfo = nil
	}

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

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

	// No error
	return nil
}

// Indicates the target Virtual Machine ScaleSet properties upon triggering a seamless migration without downtime of the
// VMs via the ConvertToVirtualMachineScaleSet API.
type DefaultVirtualMachineScaleSetInfo_STATUS struct {
	// ConstrainedMaximumCapacity: Indicates if the the maximum capacity of the default migrated Virtual Machine Scale Set
	// after its migration will be constrained to a limited number of VMs.
	ConstrainedMaximumCapacity *bool `json:"constrainedMaximumCapacity,omitempty"`

	// DefaultVirtualMachineScaleSet: The default Virtual Machine ScaleSet Uri that the Availability Set will be moved to upon
	// triggering a seamless migration via the ConvertToVirtualMachineScaleSet API.
	DefaultVirtualMachineScaleSet *SubResource_STATUS `json:"defaultVirtualMachineScaleSet,omitempty"`
}

var _ genruntime.FromARMConverter = &DefaultVirtualMachineScaleSetInfo_STATUS{}

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

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

	// Set property "ConstrainedMaximumCapacity":
	if typedInput.ConstrainedMaximumCapacity != nil {
		constrainedMaximumCapacity := *typedInput.ConstrainedMaximumCapacity
		info.ConstrainedMaximumCapacity = &constrainedMaximumCapacity
	}

	// Set property "DefaultVirtualMachineScaleSet":
	if typedInput.DefaultVirtualMachineScaleSet != nil {
		var defaultVirtualMachineScaleSet1 SubResource_STATUS
		err := defaultVirtualMachineScaleSet1.PopulateFromARM(owner, *typedInput.DefaultVirtualMachineScaleSet)
		if err != nil {
			return err
		}
		defaultVirtualMachineScaleSet := defaultVirtualMachineScaleSet1
		info.DefaultVirtualMachineScaleSet = &defaultVirtualMachineScaleSet
	}

	// No error
	return nil
}

// AssignProperties_From_DefaultVirtualMachineScaleSetInfo_STATUS populates our DefaultVirtualMachineScaleSetInfo_STATUS from the provided source DefaultVirtualMachineScaleSetInfo_STATUS
func (info *DefaultVirtualMachineScaleSetInfo_STATUS) AssignProperties_From_DefaultVirtualMachineScaleSetInfo_STATUS(source *storage.DefaultVirtualMachineScaleSetInfo_STATUS) error {

	// ConstrainedMaximumCapacity
	if source.ConstrainedMaximumCapacity != nil {
		constrainedMaximumCapacity := *source.ConstrainedMaximumCapacity
		info.ConstrainedMaximumCapacity = &constrainedMaximumCapacity
	} else {
		info.ConstrainedMaximumCapacity = nil
	}

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

	// No error
	return nil
}

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

	// ConstrainedMaximumCapacity
	if info.ConstrainedMaximumCapacity != nil {
		constrainedMaximumCapacity := *info.ConstrainedMaximumCapacity
		destination.ConstrainedMaximumCapacity = &constrainedMaximumCapacity
	} else {
		destination.ConstrainedMaximumCapacity = nil
	}

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

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

	// No error
	return nil
}

type ScheduledEventsAdditionalPublishingTargets struct {
	// EventGridAndResourceGraph: The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event
	// setting.
	EventGridAndResourceGraph *EventGridAndResourceGraph `json:"eventGridAndResourceGraph,omitempty"`
}

var _ genruntime.ARMTransformer = &ScheduledEventsAdditionalPublishingTargets{}

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

	// Set property "EventGridAndResourceGraph":
	if targets.EventGridAndResourceGraph != nil {
		eventGridAndResourceGraph_ARM, err := targets.EventGridAndResourceGraph.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		eventGridAndResourceGraph := *eventGridAndResourceGraph_ARM.(*arm.EventGridAndResourceGraph)
		result.EventGridAndResourceGraph = &eventGridAndResourceGraph
	}
	return result, nil
}

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

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

	// Set property "EventGridAndResourceGraph":
	if typedInput.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph1 EventGridAndResourceGraph
		err := eventGridAndResourceGraph1.PopulateFromARM(owner, *typedInput.EventGridAndResourceGraph)
		if err != nil {
			return err
		}
		eventGridAndResourceGraph := eventGridAndResourceGraph1
		targets.EventGridAndResourceGraph = &eventGridAndResourceGraph
	}

	// No error
	return nil
}

// AssignProperties_From_ScheduledEventsAdditionalPublishingTargets populates our ScheduledEventsAdditionalPublishingTargets from the provided source ScheduledEventsAdditionalPublishingTargets
func (targets *ScheduledEventsAdditionalPublishingTargets) AssignProperties_From_ScheduledEventsAdditionalPublishingTargets(source *storage.ScheduledEventsAdditionalPublishingTargets) error {

	// EventGridAndResourceGraph
	if source.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph EventGridAndResourceGraph
		err := eventGridAndResourceGraph.AssignProperties_From_EventGridAndResourceGraph(source.EventGridAndResourceGraph)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EventGridAndResourceGraph() to populate field EventGridAndResourceGraph")
		}
		targets.EventGridAndResourceGraph = &eventGridAndResourceGraph
	} else {
		targets.EventGridAndResourceGraph = nil
	}

	// No error
	return nil
}

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

	// EventGridAndResourceGraph
	if targets.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph storage.EventGridAndResourceGraph
		err := targets.EventGridAndResourceGraph.AssignProperties_To_EventGridAndResourceGraph(&eventGridAndResourceGraph)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EventGridAndResourceGraph() to populate field EventGridAndResourceGraph")
		}
		destination.EventGridAndResourceGraph = &eventGridAndResourceGraph
	} else {
		destination.EventGridAndResourceGraph = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ScheduledEventsAdditionalPublishingTargets_STATUS populates our ScheduledEventsAdditionalPublishingTargets from the provided source ScheduledEventsAdditionalPublishingTargets_STATUS
func (targets *ScheduledEventsAdditionalPublishingTargets) Initialize_From_ScheduledEventsAdditionalPublishingTargets_STATUS(source *ScheduledEventsAdditionalPublishingTargets_STATUS) error {

	// EventGridAndResourceGraph
	if source.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph EventGridAndResourceGraph
		err := eventGridAndResourceGraph.Initialize_From_EventGridAndResourceGraph_STATUS(source.EventGridAndResourceGraph)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_EventGridAndResourceGraph_STATUS() to populate field EventGridAndResourceGraph")
		}
		targets.EventGridAndResourceGraph = &eventGridAndResourceGraph
	} else {
		targets.EventGridAndResourceGraph = nil
	}

	// No error
	return nil
}

type ScheduledEventsAdditionalPublishingTargets_STATUS struct {
	// EventGridAndResourceGraph: The configuration parameters used while creating eventGridAndResourceGraph Scheduled Event
	// setting.
	EventGridAndResourceGraph *EventGridAndResourceGraph_STATUS `json:"eventGridAndResourceGraph,omitempty"`
}

var _ genruntime.FromARMConverter = &ScheduledEventsAdditionalPublishingTargets_STATUS{}

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

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

	// Set property "EventGridAndResourceGraph":
	if typedInput.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph1 EventGridAndResourceGraph_STATUS
		err := eventGridAndResourceGraph1.PopulateFromARM(owner, *typedInput.EventGridAndResourceGraph)
		if err != nil {
			return err
		}
		eventGridAndResourceGraph := eventGridAndResourceGraph1
		targets.EventGridAndResourceGraph = &eventGridAndResourceGraph
	}

	// No error
	return nil
}

// AssignProperties_From_ScheduledEventsAdditionalPublishingTargets_STATUS populates our ScheduledEventsAdditionalPublishingTargets_STATUS from the provided source ScheduledEventsAdditionalPublishingTargets_STATUS
func (targets *ScheduledEventsAdditionalPublishingTargets_STATUS) AssignProperties_From_ScheduledEventsAdditionalPublishingTargets_STATUS(source *storage.ScheduledEventsAdditionalPublishingTargets_STATUS) error {

	// EventGridAndResourceGraph
	if source.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph EventGridAndResourceGraph_STATUS
		err := eventGridAndResourceGraph.AssignProperties_From_EventGridAndResourceGraph_STATUS(source.EventGridAndResourceGraph)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EventGridAndResourceGraph_STATUS() to populate field EventGridAndResourceGraph")
		}
		targets.EventGridAndResourceGraph = &eventGridAndResourceGraph
	} else {
		targets.EventGridAndResourceGraph = nil
	}

	// No error
	return nil
}

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

	// EventGridAndResourceGraph
	if targets.EventGridAndResourceGraph != nil {
		var eventGridAndResourceGraph storage.EventGridAndResourceGraph_STATUS
		err := targets.EventGridAndResourceGraph.AssignProperties_To_EventGridAndResourceGraph_STATUS(&eventGridAndResourceGraph)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EventGridAndResourceGraph_STATUS() to populate field EventGridAndResourceGraph")
		}
		destination.EventGridAndResourceGraph = &eventGridAndResourceGraph
	} else {
		destination.EventGridAndResourceGraph = nil
	}

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

	// No error
	return nil
}

// The level code.
type StatusLevelTypes_STATUS string

const (
	StatusLevelTypes_STATUS_Error   = StatusLevelTypes_STATUS("Error")
	StatusLevelTypes_STATUS_Info    = StatusLevelTypes_STATUS("Info")
	StatusLevelTypes_STATUS_Warning = StatusLevelTypes_STATUS("Warning")
)

// Mapping from string to StatusLevelTypes_STATUS
var statusLevelTypes_STATUS_Values = map[string]StatusLevelTypes_STATUS{
	"error":   StatusLevelTypes_STATUS_Error,
	"info":    StatusLevelTypes_STATUS_Info,
	"warning": StatusLevelTypes_STATUS_Warning,
}

type SystemData_CreatedByType_STATUS string

const (
	SystemData_CreatedByType_STATUS_Application     = SystemData_CreatedByType_STATUS("Application")
	SystemData_CreatedByType_STATUS_Key             = SystemData_CreatedByType_STATUS("Key")
	SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity")
	SystemData_CreatedByType_STATUS_User            = SystemData_CreatedByType_STATUS("User")
)

// Mapping from string to SystemData_CreatedByType_STATUS
var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{
	"application":     SystemData_CreatedByType_STATUS_Application,
	"key":             SystemData_CreatedByType_STATUS_Key,
	"managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity,
	"user":            SystemData_CreatedByType_STATUS_User,
}

type SystemData_LastModifiedByType_STATUS string

const (
	SystemData_LastModifiedByType_STATUS_Application     = SystemData_LastModifiedByType_STATUS("Application")
	SystemData_LastModifiedByType_STATUS_Key             = SystemData_LastModifiedByType_STATUS("Key")
	SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity")
	SystemData_LastModifiedByType_STATUS_User            = SystemData_LastModifiedByType_STATUS("User")
)

// Mapping from string to SystemData_LastModifiedByType_STATUS
var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{
	"application":     SystemData_LastModifiedByType_STATUS_Application,
	"key":             SystemData_LastModifiedByType_STATUS_Key,
	"managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity,
	"user":            SystemData_LastModifiedByType_STATUS_User,
}

// Specifies Reboot related Scheduled Event related configurations.
type UserInitiatedReboot struct {
	// AutomaticallyApprove: Specifies Reboot Scheduled Event related configurations.
	AutomaticallyApprove *bool `json:"automaticallyApprove,omitempty"`
}

var _ genruntime.ARMTransformer = &UserInitiatedReboot{}

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

	// Set property "AutomaticallyApprove":
	if reboot.AutomaticallyApprove != nil {
		automaticallyApprove := *reboot.AutomaticallyApprove
		result.AutomaticallyApprove = &automaticallyApprove
	}
	return result, nil
}

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

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

	// Set property "AutomaticallyApprove":
	if typedInput.AutomaticallyApprove != nil {
		automaticallyApprove := *typedInput.AutomaticallyApprove
		reboot.AutomaticallyApprove = &automaticallyApprove
	}

	// No error
	return nil
}

// AssignProperties_From_UserInitiatedReboot populates our UserInitiatedReboot from the provided source UserInitiatedReboot
func (reboot *UserInitiatedReboot) AssignProperties_From_UserInitiatedReboot(source *storage.UserInitiatedReboot) error {

	// AutomaticallyApprove
	if source.AutomaticallyApprove != nil {
		automaticallyApprove := *source.AutomaticallyApprove
		reboot.AutomaticallyApprove = &automaticallyApprove
	} else {
		reboot.AutomaticallyApprove = nil
	}

	// No error
	return nil
}

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

	// AutomaticallyApprove
	if reboot.AutomaticallyApprove != nil {
		automaticallyApprove := *reboot.AutomaticallyApprove
		destination.AutomaticallyApprove = &automaticallyApprove
	} else {
		destination.AutomaticallyApprove = nil
	}

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

	// No error
	return nil
}

// Initialize_From_UserInitiatedReboot_STATUS populates our UserInitiatedReboot from the provided source UserInitiatedReboot_STATUS
func (reboot *UserInitiatedReboot) Initialize_From_UserInitiatedReboot_STATUS(source *UserInitiatedReboot_STATUS) error {

	// AutomaticallyApprove
	if source.AutomaticallyApprove != nil {
		automaticallyApprove := *source.AutomaticallyApprove
		reboot.AutomaticallyApprove = &automaticallyApprove
	} else {
		reboot.AutomaticallyApprove = nil
	}

	// No error
	return nil
}

// Specifies Reboot related Scheduled Event related configurations.
type UserInitiatedReboot_STATUS struct {
	// AutomaticallyApprove: Specifies Reboot Scheduled Event related configurations.
	AutomaticallyApprove *bool `json:"automaticallyApprove,omitempty"`
}

var _ genruntime.FromARMConverter = &UserInitiatedReboot_STATUS{}

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

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

	// Set property "AutomaticallyApprove":
	if typedInput.AutomaticallyApprove != nil {
		automaticallyApprove := *typedInput.AutomaticallyApprove
		reboot.AutomaticallyApprove = &automaticallyApprove
	}

	// No error
	return nil
}

// AssignProperties_From_UserInitiatedReboot_STATUS populates our UserInitiatedReboot_STATUS from the provided source UserInitiatedReboot_STATUS
func (reboot *UserInitiatedReboot_STATUS) AssignProperties_From_UserInitiatedReboot_STATUS(source *storage.UserInitiatedReboot_STATUS) error {

	// AutomaticallyApprove
	if source.AutomaticallyApprove != nil {
		automaticallyApprove := *source.AutomaticallyApprove
		reboot.AutomaticallyApprove = &automaticallyApprove
	} else {
		reboot.AutomaticallyApprove = nil
	}

	// No error
	return nil
}

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

	// AutomaticallyApprove
	if reboot.AutomaticallyApprove != nil {
		automaticallyApprove := *reboot.AutomaticallyApprove
		destination.AutomaticallyApprove = &automaticallyApprove
	} else {
		destination.AutomaticallyApprove = nil
	}

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

	// No error
	return nil
}

// Specifies Redeploy related Scheduled Event related configurations.
type UserInitiatedRedeploy struct {
	// AutomaticallyApprove: Specifies Redeploy Scheduled Event related configurations.
	AutomaticallyApprove *bool `json:"automaticallyApprove,omitempty"`
}

var _ genruntime.ARMTransformer = &UserInitiatedRedeploy{}

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

	// Set property "AutomaticallyApprove":
	if redeploy.AutomaticallyApprove != nil {
		automaticallyApprove := *redeploy.AutomaticallyApprove
		result.AutomaticallyApprove = &automaticallyApprove
	}
	return result, nil
}

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

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

	// Set property "AutomaticallyApprove":
	if typedInput.AutomaticallyApprove != nil {
		automaticallyApprove := *typedInput.AutomaticallyApprove
		redeploy.AutomaticallyApprove = &automaticallyApprove
	}

	// No error
	return nil
}

// AssignProperties_From_UserInitiatedRedeploy populates our UserInitiatedRedeploy from the provided source UserInitiatedRedeploy
func (redeploy *UserInitiatedRedeploy) AssignProperties_From_UserInitiatedRedeploy(source *storage.UserInitiatedRedeploy) error {

	// AutomaticallyApprove
	if source.AutomaticallyApprove != nil {
		automaticallyApprove := *source.AutomaticallyApprove
		redeploy.AutomaticallyApprove = &automaticallyApprove
	} else {
		redeploy.AutomaticallyApprove = nil
	}

	// No error
	return nil
}

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

	// AutomaticallyApprove
	if redeploy.AutomaticallyApprove != nil {
		automaticallyApprove := *redeploy.AutomaticallyApprove
		destination.AutomaticallyApprove = &automaticallyApprove
	} else {
		destination.AutomaticallyApprove = nil
	}

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

	// No error
	return nil
}

// Initialize_From_UserInitiatedRedeploy_STATUS populates our UserInitiatedRedeploy from the provided source UserInitiatedRedeploy_STATUS
func (redeploy *UserInitiatedRedeploy) Initialize_From_UserInitiatedRedeploy_STATUS(source *UserInitiatedRedeploy_STATUS) error {

	// AutomaticallyApprove
	if source.AutomaticallyApprove != nil {
		automaticallyApprove := *source.AutomaticallyApprove
		redeploy.AutomaticallyApprove = &automaticallyApprove
	} else {
		redeploy.AutomaticallyApprove = nil
	}

	// No error
	return nil
}

// Specifies Redeploy related Scheduled Event related configurations.
type UserInitiatedRedeploy_STATUS struct {
	// AutomaticallyApprove: Specifies Redeploy Scheduled Event related configurations.
	AutomaticallyApprove *bool `json:"automaticallyApprove,omitempty"`
}

var _ genruntime.FromARMConverter = &UserInitiatedRedeploy_STATUS{}

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

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

	// Set property "AutomaticallyApprove":
	if typedInput.AutomaticallyApprove != nil {
		automaticallyApprove := *typedInput.AutomaticallyApprove
		redeploy.AutomaticallyApprove = &automaticallyApprove
	}

	// No error
	return nil
}

// AssignProperties_From_UserInitiatedRedeploy_STATUS populates our UserInitiatedRedeploy_STATUS from the provided source UserInitiatedRedeploy_STATUS
func (redeploy *UserInitiatedRedeploy_STATUS) AssignProperties_From_UserInitiatedRedeploy_STATUS(source *storage.UserInitiatedRedeploy_STATUS) error {

	// AutomaticallyApprove
	if source.AutomaticallyApprove != nil {
		automaticallyApprove := *source.AutomaticallyApprove
		redeploy.AutomaticallyApprove = &automaticallyApprove
	} else {
		redeploy.AutomaticallyApprove = nil
	}

	// No error
	return nil
}

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

	// AutomaticallyApprove
	if redeploy.AutomaticallyApprove != nil {
		automaticallyApprove := *redeploy.AutomaticallyApprove
		destination.AutomaticallyApprove = &automaticallyApprove
	} else {
		destination.AutomaticallyApprove = nil
	}

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

	// No error
	return nil
}

// Specifies eventGridAndResourceGraph related Scheduled Event related configurations.
type EventGridAndResourceGraph struct {
	// Enable: Specifies if event grid and resource graph is enabled for Scheduled event related configurations.
	Enable *bool `json:"enable,omitempty"`
}

var _ genruntime.ARMTransformer = &EventGridAndResourceGraph{}

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

	// Set property "Enable":
	if graph.Enable != nil {
		enable := *graph.Enable
		result.Enable = &enable
	}
	return result, nil
}

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

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

	// Set property "Enable":
	if typedInput.Enable != nil {
		enable := *typedInput.Enable
		graph.Enable = &enable
	}

	// No error
	return nil
}

// AssignProperties_From_EventGridAndResourceGraph populates our EventGridAndResourceGraph from the provided source EventGridAndResourceGraph
func (graph *EventGridAndResourceGraph) AssignProperties_From_EventGridAndResourceGraph(source *storage.EventGridAndResourceGraph) error {

	// Enable
	if source.Enable != nil {
		enable := *source.Enable
		graph.Enable = &enable
	} else {
		graph.Enable = nil
	}

	// No error
	return nil
}

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

	// Enable
	if graph.Enable != nil {
		enable := *graph.Enable
		destination.Enable = &enable
	} else {
		destination.Enable = nil
	}

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

	// No error
	return nil
}

// Initialize_From_EventGridAndResourceGraph_STATUS populates our EventGridAndResourceGraph from the provided source EventGridAndResourceGraph_STATUS
func (graph *EventGridAndResourceGraph) Initialize_From_EventGridAndResourceGraph_STATUS(source *EventGridAndResourceGraph_STATUS) error {

	// Enable
	if source.Enable != nil {
		enable := *source.Enable
		graph.Enable = &enable
	} else {
		graph.Enable = nil
	}

	// No error
	return nil
}

// Specifies eventGridAndResourceGraph related Scheduled Event related configurations.
type EventGridAndResourceGraph_STATUS struct {
	// Enable: Specifies if event grid and resource graph is enabled for Scheduled event related configurations.
	Enable *bool `json:"enable,omitempty"`
}

var _ genruntime.FromARMConverter = &EventGridAndResourceGraph_STATUS{}

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

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

	// Set property "Enable":
	if typedInput.Enable != nil {
		enable := *typedInput.Enable
		graph.Enable = &enable
	}

	// No error
	return nil
}

// AssignProperties_From_EventGridAndResourceGraph_STATUS populates our EventGridAndResourceGraph_STATUS from the provided source EventGridAndResourceGraph_STATUS
func (graph *EventGridAndResourceGraph_STATUS) AssignProperties_From_EventGridAndResourceGraph_STATUS(source *storage.EventGridAndResourceGraph_STATUS) error {

	// Enable
	if source.Enable != nil {
		enable := *source.Enable
		graph.Enable = &enable
	} else {
		graph.Enable = nil
	}

	// No error
	return nil
}

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

	// Enable
	if graph.Enable != nil {
		enable := *graph.Enable
		destination.Enable = &enable
	} else {
		destination.Enable = nil
	}

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&AvailabilitySet{}, &AvailabilitySetList{})
}
