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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/storage/v1api20210401/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/storage/v1api20210401/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,storage}
// +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: /storage/resource-manager/Microsoft.Storage/stable/2021-04-01/storage.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/default
type StorageAccountsManagementPolicy struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              StorageAccountsManagementPolicy_Spec   `json:"spec,omitempty"`
	Status            StorageAccountsManagementPolicy_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &StorageAccountsManagementPolicy{}

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

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

var _ conversion.Convertible = &StorageAccountsManagementPolicy{}

// ConvertFrom populates our StorageAccountsManagementPolicy from the provided hub StorageAccountsManagementPolicy
func (policy *StorageAccountsManagementPolicy) ConvertFrom(hub conversion.Hub) error {
	// intermediate variable for conversion
	var source storage.StorageAccountsManagementPolicy

	err := source.ConvertFrom(hub)
	if err != nil {
		return eris.Wrap(err, "converting from hub to source")
	}

	err = policy.AssignProperties_From_StorageAccountsManagementPolicy(&source)
	if err != nil {
		return eris.Wrap(err, "converting from source to policy")
	}

	return nil
}

// ConvertTo populates the provided hub StorageAccountsManagementPolicy from our StorageAccountsManagementPolicy
func (policy *StorageAccountsManagementPolicy) ConvertTo(hub conversion.Hub) error {
	// intermediate variable for conversion
	var destination storage.StorageAccountsManagementPolicy
	err := policy.AssignProperties_To_StorageAccountsManagementPolicy(&destination)
	if err != nil {
		return eris.Wrap(err, "converting to destination from policy")
	}
	err = destination.ConvertTo(hub)
	if err != nil {
		return eris.Wrap(err, "converting from destination to hub")
	}

	return nil
}

var _ configmaps.Exporter = &StorageAccountsManagementPolicy{}

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

var _ secrets.Exporter = &StorageAccountsManagementPolicy{}

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

var _ genruntime.KubernetesResource = &StorageAccountsManagementPolicy{}

// AzureName returns the Azure name of the resource (always "default")
func (policy *StorageAccountsManagementPolicy) AzureName() string {
	return "default"
}

// GetAPIVersion returns the ARM API version of the resource. This is always "2021-04-01"
func (policy StorageAccountsManagementPolicy) GetAPIVersion() string {
	return "2021-04-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Storage/storageAccounts/managementPolicies"
func (policy *StorageAccountsManagementPolicy) GetType() string {
	return "Microsoft.Storage/storageAccounts/managementPolicies"
}

// NewEmptyStatus returns a new empty (blank) status
func (policy *StorageAccountsManagementPolicy) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &StorageAccountsManagementPolicy_STATUS{}
}

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

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

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

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

	policy.Status = st
	return nil
}

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_StorageAccountsManagementPolicy populates the provided destination StorageAccountsManagementPolicy from our StorageAccountsManagementPolicy
func (policy *StorageAccountsManagementPolicy) AssignProperties_To_StorageAccountsManagementPolicy(destination *storage.StorageAccountsManagementPolicy) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /storage/resource-manager/Microsoft.Storage/stable/2021-04-01/storage.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/default
type StorageAccountsManagementPolicyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []StorageAccountsManagementPolicy `json:"items"`
}

type StorageAccountsManagementPolicy_Spec struct {
	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *StorageAccountsManagementPolicyOperatorSpec `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 storage.azure.com/StorageAccount resource
	Owner *genruntime.KnownResourceReference `group:"storage.azure.com" json:"owner,omitempty" kind:"StorageAccount"`

	// +kubebuilder:validation:Required
	// Policy: The Storage Account ManagementPolicy, in JSON format. See more details in:
	// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
	Policy *ManagementPolicySchema `json:"policy,omitempty"`
}

var _ genruntime.ARMTransformer = &StorageAccountsManagementPolicy_Spec{}

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

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

	// Set property "Properties":
	if policy.Policy != nil {
		result.Properties = &arm.ManagementPolicyProperties{}
	}
	if policy.Policy != nil {
		policy_ARM, err := policy.Policy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		policy1 := *policy_ARM.(*arm.ManagementPolicySchema)
		result.Properties.Policy = &policy1
	}
	return result, nil
}

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

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

	// no assignment for property "OperatorSpec"

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

	// Set property "Policy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Policy != nil {
			var policy2 ManagementPolicySchema
			err := policy2.PopulateFromARM(owner, *typedInput.Properties.Policy)
			if err != nil {
				return err
			}
			policy1 := policy2
			policy.Policy = &policy1
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &StorageAccountsManagementPolicy_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsManagementPolicy_Spec{}
	err := policy.AssignProperties_To_StorageAccountsManagementPolicy_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_StorageAccountsManagementPolicy_Spec populates our StorageAccountsManagementPolicy_Spec from the provided source StorageAccountsManagementPolicy_Spec
func (policy *StorageAccountsManagementPolicy_Spec) AssignProperties_From_StorageAccountsManagementPolicy_Spec(source *storage.StorageAccountsManagementPolicy_Spec) error {

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

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

	// Policy
	if source.Policy != nil {
		var policyLocal ManagementPolicySchema
		err := policyLocal.AssignProperties_From_ManagementPolicySchema(source.Policy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicySchema() to populate field Policy")
		}
		policy.Policy = &policyLocal
	} else {
		policy.Policy = nil
	}

	// No error
	return nil
}

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

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

	// OriginalVersion
	destination.OriginalVersion = policy.OriginalVersion()

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

	// Policy
	if policy.Policy != nil {
		var policyLocal storage.ManagementPolicySchema
		err := policy.Policy.AssignProperties_To_ManagementPolicySchema(&policyLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicySchema() to populate field Policy")
		}
		destination.Policy = &policyLocal
	} else {
		destination.Policy = nil
	}

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

	// No error
	return nil
}

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

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

	// LastModifiedTime: Returns the date and time the ManagementPolicies was last modified.
	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`

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

	// Policy: The Storage Account ManagementPolicy, in JSON format. See more details in:
	// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
	Policy *ManagementPolicySchema_STATUS `json:"policy,omitempty"`

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

var _ genruntime.ConvertibleStatus = &StorageAccountsManagementPolicy_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsManagementPolicy_STATUS{}
	err := policy.AssignProperties_To_StorageAccountsManagementPolicy_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 = &StorageAccountsManagementPolicy_STATUS{}

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

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

	// no assignment for property "Conditions"

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

	// Set property "LastModifiedTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastModifiedTime != nil {
			lastModifiedTime := *typedInput.Properties.LastModifiedTime
			policy.LastModifiedTime = &lastModifiedTime
		}
	}

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

	// Set property "Policy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Policy != nil {
			var policy2 ManagementPolicySchema_STATUS
			err := policy2.PopulateFromARM(owner, *typedInput.Properties.Policy)
			if err != nil {
				return err
			}
			policy1 := policy2
			policy.Policy = &policy1
		}
	}

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

	// No error
	return nil
}

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

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

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

	// LastModifiedTime
	policy.LastModifiedTime = genruntime.ClonePointerToString(source.LastModifiedTime)

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

	// Policy
	if source.Policy != nil {
		var policyLocal ManagementPolicySchema_STATUS
		err := policyLocal.AssignProperties_From_ManagementPolicySchema_STATUS(source.Policy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicySchema_STATUS() to populate field Policy")
		}
		policy.Policy = &policyLocal
	} else {
		policy.Policy = nil
	}

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

	// No error
	return nil
}

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

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

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

	// LastModifiedTime
	destination.LastModifiedTime = genruntime.ClonePointerToString(policy.LastModifiedTime)

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

	// Policy
	if policy.Policy != nil {
		var policyLocal storage.ManagementPolicySchema_STATUS
		err := policy.Policy.AssignProperties_To_ManagementPolicySchema_STATUS(&policyLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicySchema_STATUS() to populate field Policy")
		}
		destination.Policy = &policyLocal
	} else {
		destination.Policy = nil
	}

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

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

	// No error
	return nil
}

// The Storage Account ManagementPolicies Rules. See more details in:
// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
type ManagementPolicySchema struct {
	// +kubebuilder:validation:Required
	// Rules: The Storage Account ManagementPolicies Rules. See more details in:
	// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
	Rules []ManagementPolicyRule `json:"rules,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicySchema{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicySchema populates our ManagementPolicySchema from the provided source ManagementPolicySchema
func (schema *ManagementPolicySchema) AssignProperties_From_ManagementPolicySchema(source *storage.ManagementPolicySchema) error {

	// Rules
	if source.Rules != nil {
		ruleList := make([]ManagementPolicyRule, len(source.Rules))
		for ruleIndex, ruleItem := range source.Rules {
			var rule ManagementPolicyRule
			err := rule.AssignProperties_From_ManagementPolicyRule(&ruleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyRule() to populate field Rules")
			}
			ruleList[ruleIndex] = rule
		}
		schema.Rules = ruleList
	} else {
		schema.Rules = nil
	}

	// No error
	return nil
}

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

	// Rules
	if schema.Rules != nil {
		ruleList := make([]storage.ManagementPolicyRule, len(schema.Rules))
		for ruleIndex, ruleItem := range schema.Rules {
			var rule storage.ManagementPolicyRule
			err := ruleItem.AssignProperties_To_ManagementPolicyRule(&rule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyRule() to populate field Rules")
			}
			ruleList[ruleIndex] = rule
		}
		destination.Rules = ruleList
	} else {
		destination.Rules = nil
	}

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

	// No error
	return nil
}

// The Storage Account ManagementPolicies Rules. See more details in:
// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
type ManagementPolicySchema_STATUS struct {
	// Rules: The Storage Account ManagementPolicies Rules. See more details in:
	// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
	Rules []ManagementPolicyRule_STATUS `json:"rules,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicySchema_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicySchema_STATUS populates our ManagementPolicySchema_STATUS from the provided source ManagementPolicySchema_STATUS
func (schema *ManagementPolicySchema_STATUS) AssignProperties_From_ManagementPolicySchema_STATUS(source *storage.ManagementPolicySchema_STATUS) error {

	// Rules
	if source.Rules != nil {
		ruleList := make([]ManagementPolicyRule_STATUS, len(source.Rules))
		for ruleIndex, ruleItem := range source.Rules {
			var rule ManagementPolicyRule_STATUS
			err := rule.AssignProperties_From_ManagementPolicyRule_STATUS(&ruleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyRule_STATUS() to populate field Rules")
			}
			ruleList[ruleIndex] = rule
		}
		schema.Rules = ruleList
	} else {
		schema.Rules = nil
	}

	// No error
	return nil
}

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

	// Rules
	if schema.Rules != nil {
		ruleList := make([]storage.ManagementPolicyRule_STATUS, len(schema.Rules))
		for ruleIndex, ruleItem := range schema.Rules {
			var rule storage.ManagementPolicyRule_STATUS
			err := ruleItem.AssignProperties_To_ManagementPolicyRule_STATUS(&rule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyRule_STATUS() to populate field Rules")
			}
			ruleList[ruleIndex] = rule
		}
		destination.Rules = ruleList
	} else {
		destination.Rules = 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 StorageAccountsManagementPolicyOperatorSpec 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_StorageAccountsManagementPolicyOperatorSpec populates our StorageAccountsManagementPolicyOperatorSpec from the provided source StorageAccountsManagementPolicyOperatorSpec
func (operator *StorageAccountsManagementPolicyOperatorSpec) AssignProperties_From_StorageAccountsManagementPolicyOperatorSpec(source *storage.StorageAccountsManagementPolicyOperatorSpec) 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_StorageAccountsManagementPolicyOperatorSpec populates the provided destination StorageAccountsManagementPolicyOperatorSpec from our StorageAccountsManagementPolicyOperatorSpec
func (operator *StorageAccountsManagementPolicyOperatorSpec) AssignProperties_To_StorageAccountsManagementPolicyOperatorSpec(destination *storage.StorageAccountsManagementPolicyOperatorSpec) 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
}

// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name.
type ManagementPolicyRule struct {
	// +kubebuilder:validation:Required
	// Definition: An object that defines the Lifecycle rule.
	Definition *ManagementPolicyDefinition `json:"definition,omitempty"`

	// Enabled: Rule is enabled if set to true.
	Enabled *bool `json:"enabled,omitempty"`

	// +kubebuilder:validation:Required
	// Name: A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be
	// unique within a policy.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// Type: The valid value is Lifecycle
	Type *ManagementPolicyRule_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicyRule{}

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

	// Set property "Definition":
	if rule.Definition != nil {
		definition_ARM, err := rule.Definition.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		definition := *definition_ARM.(*arm.ManagementPolicyDefinition)
		result.Definition = &definition
	}

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

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

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

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

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

	// Set property "Definition":
	if typedInput.Definition != nil {
		var definition1 ManagementPolicyDefinition
		err := definition1.PopulateFromARM(owner, *typedInput.Definition)
		if err != nil {
			return err
		}
		definition := definition1
		rule.Definition = &definition
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyRule populates our ManagementPolicyRule from the provided source ManagementPolicyRule
func (rule *ManagementPolicyRule) AssignProperties_From_ManagementPolicyRule(source *storage.ManagementPolicyRule) error {

	// Definition
	if source.Definition != nil {
		var definition ManagementPolicyDefinition
		err := definition.AssignProperties_From_ManagementPolicyDefinition(source.Definition)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyDefinition() to populate field Definition")
		}
		rule.Definition = &definition
	} else {
		rule.Definition = nil
	}

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

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

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

	// No error
	return nil
}

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

	// Definition
	if rule.Definition != nil {
		var definition storage.ManagementPolicyDefinition
		err := rule.Definition.AssignProperties_To_ManagementPolicyDefinition(&definition)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyDefinition() to populate field Definition")
		}
		destination.Definition = &definition
	} else {
		destination.Definition = nil
	}

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

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

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

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

	// No error
	return nil
}

// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name.
type ManagementPolicyRule_STATUS struct {
	// Definition: An object that defines the Lifecycle rule.
	Definition *ManagementPolicyDefinition_STATUS `json:"definition,omitempty"`

	// Enabled: Rule is enabled if set to true.
	Enabled *bool `json:"enabled,omitempty"`

	// Name: A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be
	// unique within a policy.
	Name *string `json:"name,omitempty"`

	// Type: The valid value is Lifecycle
	Type *ManagementPolicyRule_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicyRule_STATUS{}

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

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

	// Set property "Definition":
	if typedInput.Definition != nil {
		var definition1 ManagementPolicyDefinition_STATUS
		err := definition1.PopulateFromARM(owner, *typedInput.Definition)
		if err != nil {
			return err
		}
		definition := definition1
		rule.Definition = &definition
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyRule_STATUS populates our ManagementPolicyRule_STATUS from the provided source ManagementPolicyRule_STATUS
func (rule *ManagementPolicyRule_STATUS) AssignProperties_From_ManagementPolicyRule_STATUS(source *storage.ManagementPolicyRule_STATUS) error {

	// Definition
	if source.Definition != nil {
		var definition ManagementPolicyDefinition_STATUS
		err := definition.AssignProperties_From_ManagementPolicyDefinition_STATUS(source.Definition)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyDefinition_STATUS() to populate field Definition")
		}
		rule.Definition = &definition
	} else {
		rule.Definition = nil
	}

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

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

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

	// No error
	return nil
}

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

	// Definition
	if rule.Definition != nil {
		var definition storage.ManagementPolicyDefinition_STATUS
		err := rule.Definition.AssignProperties_To_ManagementPolicyDefinition_STATUS(&definition)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyDefinition_STATUS() to populate field Definition")
		}
		destination.Definition = &definition
	} else {
		destination.Definition = nil
	}

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

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

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

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

	// No error
	return nil
}

// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set.
type ManagementPolicyDefinition struct {
	// +kubebuilder:validation:Required
	// Actions: An object that defines the action set.
	Actions *ManagementPolicyAction `json:"actions,omitempty"`

	// Filters: An object that defines the filter set.
	Filters *ManagementPolicyFilter `json:"filters,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicyDefinition{}

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

	// Set property "Actions":
	if definition.Actions != nil {
		actions_ARM, err := definition.Actions.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		actions := *actions_ARM.(*arm.ManagementPolicyAction)
		result.Actions = &actions
	}

	// Set property "Filters":
	if definition.Filters != nil {
		filters_ARM, err := definition.Filters.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		filters := *filters_ARM.(*arm.ManagementPolicyFilter)
		result.Filters = &filters
	}
	return result, nil
}

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

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

	// Set property "Actions":
	if typedInput.Actions != nil {
		var actions1 ManagementPolicyAction
		err := actions1.PopulateFromARM(owner, *typedInput.Actions)
		if err != nil {
			return err
		}
		actions := actions1
		definition.Actions = &actions
	}

	// Set property "Filters":
	if typedInput.Filters != nil {
		var filters1 ManagementPolicyFilter
		err := filters1.PopulateFromARM(owner, *typedInput.Filters)
		if err != nil {
			return err
		}
		filters := filters1
		definition.Filters = &filters
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyDefinition populates our ManagementPolicyDefinition from the provided source ManagementPolicyDefinition
func (definition *ManagementPolicyDefinition) AssignProperties_From_ManagementPolicyDefinition(source *storage.ManagementPolicyDefinition) error {

	// Actions
	if source.Actions != nil {
		var action ManagementPolicyAction
		err := action.AssignProperties_From_ManagementPolicyAction(source.Actions)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyAction() to populate field Actions")
		}
		definition.Actions = &action
	} else {
		definition.Actions = nil
	}

	// Filters
	if source.Filters != nil {
		var filter ManagementPolicyFilter
		err := filter.AssignProperties_From_ManagementPolicyFilter(source.Filters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyFilter() to populate field Filters")
		}
		definition.Filters = &filter
	} else {
		definition.Filters = nil
	}

	// No error
	return nil
}

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

	// Actions
	if definition.Actions != nil {
		var action storage.ManagementPolicyAction
		err := definition.Actions.AssignProperties_To_ManagementPolicyAction(&action)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyAction() to populate field Actions")
		}
		destination.Actions = &action
	} else {
		destination.Actions = nil
	}

	// Filters
	if definition.Filters != nil {
		var filter storage.ManagementPolicyFilter
		err := definition.Filters.AssignProperties_To_ManagementPolicyFilter(&filter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyFilter() to populate field Filters")
		}
		destination.Filters = &filter
	} else {
		destination.Filters = nil
	}

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

	// No error
	return nil
}

// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set.
type ManagementPolicyDefinition_STATUS struct {
	// Actions: An object that defines the action set.
	Actions *ManagementPolicyAction_STATUS `json:"actions,omitempty"`

	// Filters: An object that defines the filter set.
	Filters *ManagementPolicyFilter_STATUS `json:"filters,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicyDefinition_STATUS{}

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

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

	// Set property "Actions":
	if typedInput.Actions != nil {
		var actions1 ManagementPolicyAction_STATUS
		err := actions1.PopulateFromARM(owner, *typedInput.Actions)
		if err != nil {
			return err
		}
		actions := actions1
		definition.Actions = &actions
	}

	// Set property "Filters":
	if typedInput.Filters != nil {
		var filters1 ManagementPolicyFilter_STATUS
		err := filters1.PopulateFromARM(owner, *typedInput.Filters)
		if err != nil {
			return err
		}
		filters := filters1
		definition.Filters = &filters
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyDefinition_STATUS populates our ManagementPolicyDefinition_STATUS from the provided source ManagementPolicyDefinition_STATUS
func (definition *ManagementPolicyDefinition_STATUS) AssignProperties_From_ManagementPolicyDefinition_STATUS(source *storage.ManagementPolicyDefinition_STATUS) error {

	// Actions
	if source.Actions != nil {
		var action ManagementPolicyAction_STATUS
		err := action.AssignProperties_From_ManagementPolicyAction_STATUS(source.Actions)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyAction_STATUS() to populate field Actions")
		}
		definition.Actions = &action
	} else {
		definition.Actions = nil
	}

	// Filters
	if source.Filters != nil {
		var filter ManagementPolicyFilter_STATUS
		err := filter.AssignProperties_From_ManagementPolicyFilter_STATUS(source.Filters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyFilter_STATUS() to populate field Filters")
		}
		definition.Filters = &filter
	} else {
		definition.Filters = nil
	}

	// No error
	return nil
}

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

	// Actions
	if definition.Actions != nil {
		var action storage.ManagementPolicyAction_STATUS
		err := definition.Actions.AssignProperties_To_ManagementPolicyAction_STATUS(&action)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyAction_STATUS() to populate field Actions")
		}
		destination.Actions = &action
	} else {
		destination.Actions = nil
	}

	// Filters
	if definition.Filters != nil {
		var filter storage.ManagementPolicyFilter_STATUS
		err := definition.Filters.AssignProperties_To_ManagementPolicyFilter_STATUS(&filter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyFilter_STATUS() to populate field Filters")
		}
		destination.Filters = &filter
	} else {
		destination.Filters = nil
	}

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Lifecycle"}
type ManagementPolicyRule_Type string

const ManagementPolicyRule_Type_Lifecycle = ManagementPolicyRule_Type("Lifecycle")

// Mapping from string to ManagementPolicyRule_Type
var managementPolicyRule_Type_Values = map[string]ManagementPolicyRule_Type{
	"lifecycle": ManagementPolicyRule_Type_Lifecycle,
}

type ManagementPolicyRule_Type_STATUS string

const ManagementPolicyRule_Type_STATUS_Lifecycle = ManagementPolicyRule_Type_STATUS("Lifecycle")

// Mapping from string to ManagementPolicyRule_Type_STATUS
var managementPolicyRule_Type_STATUS_Values = map[string]ManagementPolicyRule_Type_STATUS{
	"lifecycle": ManagementPolicyRule_Type_STATUS_Lifecycle,
}

// Actions are applied to the filtered blobs when the execution condition is met.
type ManagementPolicyAction struct {
	// BaseBlob: The management policy action for base blob
	BaseBlob *ManagementPolicyBaseBlob `json:"baseBlob,omitempty"`

	// Snapshot: The management policy action for snapshot
	Snapshot *ManagementPolicySnapShot `json:"snapshot,omitempty"`

	// Version: The management policy action for version
	Version *ManagementPolicyVersion `json:"version,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicyAction{}

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

	// Set property "BaseBlob":
	if action.BaseBlob != nil {
		baseBlob_ARM, err := action.BaseBlob.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		baseBlob := *baseBlob_ARM.(*arm.ManagementPolicyBaseBlob)
		result.BaseBlob = &baseBlob
	}

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

	// Set property "Version":
	if action.Version != nil {
		version_ARM, err := action.Version.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		version := *version_ARM.(*arm.ManagementPolicyVersion)
		result.Version = &version
	}
	return result, nil
}

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

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

	// Set property "BaseBlob":
	if typedInput.BaseBlob != nil {
		var baseBlob1 ManagementPolicyBaseBlob
		err := baseBlob1.PopulateFromARM(owner, *typedInput.BaseBlob)
		if err != nil {
			return err
		}
		baseBlob := baseBlob1
		action.BaseBlob = &baseBlob
	}

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

	// Set property "Version":
	if typedInput.Version != nil {
		var version1 ManagementPolicyVersion
		err := version1.PopulateFromARM(owner, *typedInput.Version)
		if err != nil {
			return err
		}
		version := version1
		action.Version = &version
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyAction populates our ManagementPolicyAction from the provided source ManagementPolicyAction
func (action *ManagementPolicyAction) AssignProperties_From_ManagementPolicyAction(source *storage.ManagementPolicyAction) error {

	// BaseBlob
	if source.BaseBlob != nil {
		var baseBlob ManagementPolicyBaseBlob
		err := baseBlob.AssignProperties_From_ManagementPolicyBaseBlob(source.BaseBlob)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyBaseBlob() to populate field BaseBlob")
		}
		action.BaseBlob = &baseBlob
	} else {
		action.BaseBlob = nil
	}

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

	// Version
	if source.Version != nil {
		var version ManagementPolicyVersion
		err := version.AssignProperties_From_ManagementPolicyVersion(source.Version)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyVersion() to populate field Version")
		}
		action.Version = &version
	} else {
		action.Version = nil
	}

	// No error
	return nil
}

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

	// BaseBlob
	if action.BaseBlob != nil {
		var baseBlob storage.ManagementPolicyBaseBlob
		err := action.BaseBlob.AssignProperties_To_ManagementPolicyBaseBlob(&baseBlob)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyBaseBlob() to populate field BaseBlob")
		}
		destination.BaseBlob = &baseBlob
	} else {
		destination.BaseBlob = nil
	}

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

	// Version
	if action.Version != nil {
		var version storage.ManagementPolicyVersion
		err := action.Version.AssignProperties_To_ManagementPolicyVersion(&version)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyVersion() to populate field Version")
		}
		destination.Version = &version
	} else {
		destination.Version = nil
	}

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

	// No error
	return nil
}

// Actions are applied to the filtered blobs when the execution condition is met.
type ManagementPolicyAction_STATUS struct {
	// BaseBlob: The management policy action for base blob
	BaseBlob *ManagementPolicyBaseBlob_STATUS `json:"baseBlob,omitempty"`

	// Snapshot: The management policy action for snapshot
	Snapshot *ManagementPolicySnapShot_STATUS `json:"snapshot,omitempty"`

	// Version: The management policy action for version
	Version *ManagementPolicyVersion_STATUS `json:"version,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicyAction_STATUS{}

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

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

	// Set property "BaseBlob":
	if typedInput.BaseBlob != nil {
		var baseBlob1 ManagementPolicyBaseBlob_STATUS
		err := baseBlob1.PopulateFromARM(owner, *typedInput.BaseBlob)
		if err != nil {
			return err
		}
		baseBlob := baseBlob1
		action.BaseBlob = &baseBlob
	}

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

	// Set property "Version":
	if typedInput.Version != nil {
		var version1 ManagementPolicyVersion_STATUS
		err := version1.PopulateFromARM(owner, *typedInput.Version)
		if err != nil {
			return err
		}
		version := version1
		action.Version = &version
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyAction_STATUS populates our ManagementPolicyAction_STATUS from the provided source ManagementPolicyAction_STATUS
func (action *ManagementPolicyAction_STATUS) AssignProperties_From_ManagementPolicyAction_STATUS(source *storage.ManagementPolicyAction_STATUS) error {

	// BaseBlob
	if source.BaseBlob != nil {
		var baseBlob ManagementPolicyBaseBlob_STATUS
		err := baseBlob.AssignProperties_From_ManagementPolicyBaseBlob_STATUS(source.BaseBlob)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyBaseBlob_STATUS() to populate field BaseBlob")
		}
		action.BaseBlob = &baseBlob
	} else {
		action.BaseBlob = nil
	}

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

	// Version
	if source.Version != nil {
		var version ManagementPolicyVersion_STATUS
		err := version.AssignProperties_From_ManagementPolicyVersion_STATUS(source.Version)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagementPolicyVersion_STATUS() to populate field Version")
		}
		action.Version = &version
	} else {
		action.Version = nil
	}

	// No error
	return nil
}

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

	// BaseBlob
	if action.BaseBlob != nil {
		var baseBlob storage.ManagementPolicyBaseBlob_STATUS
		err := action.BaseBlob.AssignProperties_To_ManagementPolicyBaseBlob_STATUS(&baseBlob)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyBaseBlob_STATUS() to populate field BaseBlob")
		}
		destination.BaseBlob = &baseBlob
	} else {
		destination.BaseBlob = nil
	}

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

	// Version
	if action.Version != nil {
		var version storage.ManagementPolicyVersion_STATUS
		err := action.Version.AssignProperties_To_ManagementPolicyVersion_STATUS(&version)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagementPolicyVersion_STATUS() to populate field Version")
		}
		destination.Version = &version
	} else {
		destination.Version = nil
	}

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

	// No error
	return nil
}

// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical
// AND is performed on all filters.
type ManagementPolicyFilter struct {
	// BlobIndexMatch: An array of blob index tag based filters, there can be at most 10 tag filters
	BlobIndexMatch []TagFilter `json:"blobIndexMatch,omitempty"`

	// +kubebuilder:validation:Required
	// BlobTypes: An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete
	// actions are supported for appendBlob.
	BlobTypes []string `json:"blobTypes,omitempty"`

	// PrefixMatch: An array of strings for prefixes to be match.
	PrefixMatch []string `json:"prefixMatch,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicyFilter{}

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

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

	// Set property "BlobTypes":
	for _, item := range filter.BlobTypes {
		result.BlobTypes = append(result.BlobTypes, item)
	}

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

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyFilter populates our ManagementPolicyFilter from the provided source ManagementPolicyFilter
func (filter *ManagementPolicyFilter) AssignProperties_From_ManagementPolicyFilter(source *storage.ManagementPolicyFilter) error {

	// BlobIndexMatch
	if source.BlobIndexMatch != nil {
		blobIndexMatchList := make([]TagFilter, len(source.BlobIndexMatch))
		for blobIndexMatchIndex, blobIndexMatchItem := range source.BlobIndexMatch {
			var blobIndexMatch TagFilter
			err := blobIndexMatch.AssignProperties_From_TagFilter(&blobIndexMatchItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_TagFilter() to populate field BlobIndexMatch")
			}
			blobIndexMatchList[blobIndexMatchIndex] = blobIndexMatch
		}
		filter.BlobIndexMatch = blobIndexMatchList
	} else {
		filter.BlobIndexMatch = nil
	}

	// BlobTypes
	filter.BlobTypes = genruntime.CloneSliceOfString(source.BlobTypes)

	// PrefixMatch
	filter.PrefixMatch = genruntime.CloneSliceOfString(source.PrefixMatch)

	// No error
	return nil
}

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

	// BlobIndexMatch
	if filter.BlobIndexMatch != nil {
		blobIndexMatchList := make([]storage.TagFilter, len(filter.BlobIndexMatch))
		for blobIndexMatchIndex, blobIndexMatchItem := range filter.BlobIndexMatch {
			var blobIndexMatch storage.TagFilter
			err := blobIndexMatchItem.AssignProperties_To_TagFilter(&blobIndexMatch)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_TagFilter() to populate field BlobIndexMatch")
			}
			blobIndexMatchList[blobIndexMatchIndex] = blobIndexMatch
		}
		destination.BlobIndexMatch = blobIndexMatchList
	} else {
		destination.BlobIndexMatch = nil
	}

	// BlobTypes
	destination.BlobTypes = genruntime.CloneSliceOfString(filter.BlobTypes)

	// PrefixMatch
	destination.PrefixMatch = genruntime.CloneSliceOfString(filter.PrefixMatch)

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

	// No error
	return nil
}

// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical
// AND is performed on all filters.
type ManagementPolicyFilter_STATUS struct {
	// BlobIndexMatch: An array of blob index tag based filters, there can be at most 10 tag filters
	BlobIndexMatch []TagFilter_STATUS `json:"blobIndexMatch,omitempty"`

	// BlobTypes: An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete
	// actions are supported for appendBlob.
	BlobTypes []string `json:"blobTypes,omitempty"`

	// PrefixMatch: An array of strings for prefixes to be match.
	PrefixMatch []string `json:"prefixMatch,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicyFilter_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyFilter_STATUS populates our ManagementPolicyFilter_STATUS from the provided source ManagementPolicyFilter_STATUS
func (filter *ManagementPolicyFilter_STATUS) AssignProperties_From_ManagementPolicyFilter_STATUS(source *storage.ManagementPolicyFilter_STATUS) error {

	// BlobIndexMatch
	if source.BlobIndexMatch != nil {
		blobIndexMatchList := make([]TagFilter_STATUS, len(source.BlobIndexMatch))
		for blobIndexMatchIndex, blobIndexMatchItem := range source.BlobIndexMatch {
			var blobIndexMatch TagFilter_STATUS
			err := blobIndexMatch.AssignProperties_From_TagFilter_STATUS(&blobIndexMatchItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_TagFilter_STATUS() to populate field BlobIndexMatch")
			}
			blobIndexMatchList[blobIndexMatchIndex] = blobIndexMatch
		}
		filter.BlobIndexMatch = blobIndexMatchList
	} else {
		filter.BlobIndexMatch = nil
	}

	// BlobTypes
	filter.BlobTypes = genruntime.CloneSliceOfString(source.BlobTypes)

	// PrefixMatch
	filter.PrefixMatch = genruntime.CloneSliceOfString(source.PrefixMatch)

	// No error
	return nil
}

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

	// BlobIndexMatch
	if filter.BlobIndexMatch != nil {
		blobIndexMatchList := make([]storage.TagFilter_STATUS, len(filter.BlobIndexMatch))
		for blobIndexMatchIndex, blobIndexMatchItem := range filter.BlobIndexMatch {
			var blobIndexMatch storage.TagFilter_STATUS
			err := blobIndexMatchItem.AssignProperties_To_TagFilter_STATUS(&blobIndexMatch)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_TagFilter_STATUS() to populate field BlobIndexMatch")
			}
			blobIndexMatchList[blobIndexMatchIndex] = blobIndexMatch
		}
		destination.BlobIndexMatch = blobIndexMatchList
	} else {
		destination.BlobIndexMatch = nil
	}

	// BlobTypes
	destination.BlobTypes = genruntime.CloneSliceOfString(filter.BlobTypes)

	// PrefixMatch
	destination.PrefixMatch = genruntime.CloneSliceOfString(filter.PrefixMatch)

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

	// No error
	return nil
}

// Management policy action for base blob.
type ManagementPolicyBaseBlob struct {
	// Delete: The function to delete the blob
	Delete *DateAfterModification `json:"delete,omitempty"`

	// EnableAutoTierToHotFromCool: This property enables auto tiering of a blob from cool to hot on a blob access. This
	// property requires tierToCool.daysAfterLastAccessTimeGreaterThan.
	EnableAutoTierToHotFromCool *bool `json:"enableAutoTierToHotFromCool,omitempty"`

	// TierToArchive: The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier
	TierToArchive *DateAfterModification `json:"tierToArchive,omitempty"`

	// TierToCool: The function to tier blobs to cool storage. Support blobs currently at Hot tier
	TierToCool *DateAfterModification `json:"tierToCool,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicyBaseBlob{}

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

	// Set property "Delete":
	if blob.Delete != nil {
		delete_ARM, err := blob.Delete.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		delete := *delete_ARM.(*arm.DateAfterModification)
		result.Delete = &delete
	}

	// Set property "EnableAutoTierToHotFromCool":
	if blob.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *blob.EnableAutoTierToHotFromCool
		result.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	}

	// Set property "TierToArchive":
	if blob.TierToArchive != nil {
		tierToArchive_ARM, err := blob.TierToArchive.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		tierToArchive := *tierToArchive_ARM.(*arm.DateAfterModification)
		result.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if blob.TierToCool != nil {
		tierToCool_ARM, err := blob.TierToCool.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		tierToCool := *tierToCool_ARM.(*arm.DateAfterModification)
		result.TierToCool = &tierToCool
	}
	return result, nil
}

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

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

	// Set property "Delete":
	if typedInput.Delete != nil {
		var delete1 DateAfterModification
		err := delete1.PopulateFromARM(owner, *typedInput.Delete)
		if err != nil {
			return err
		}
		delete := delete1
		blob.Delete = &delete
	}

	// Set property "EnableAutoTierToHotFromCool":
	if typedInput.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *typedInput.EnableAutoTierToHotFromCool
		blob.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	}

	// Set property "TierToArchive":
	if typedInput.TierToArchive != nil {
		var tierToArchive1 DateAfterModification
		err := tierToArchive1.PopulateFromARM(owner, *typedInput.TierToArchive)
		if err != nil {
			return err
		}
		tierToArchive := tierToArchive1
		blob.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if typedInput.TierToCool != nil {
		var tierToCool1 DateAfterModification
		err := tierToCool1.PopulateFromARM(owner, *typedInput.TierToCool)
		if err != nil {
			return err
		}
		tierToCool := tierToCool1
		blob.TierToCool = &tierToCool
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyBaseBlob populates our ManagementPolicyBaseBlob from the provided source ManagementPolicyBaseBlob
func (blob *ManagementPolicyBaseBlob) AssignProperties_From_ManagementPolicyBaseBlob(source *storage.ManagementPolicyBaseBlob) error {

	// Delete
	if source.Delete != nil {
		var delete DateAfterModification
		err := delete.AssignProperties_From_DateAfterModification(source.Delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterModification() to populate field Delete")
		}
		blob.Delete = &delete
	} else {
		blob.Delete = nil
	}

	// EnableAutoTierToHotFromCool
	if source.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *source.EnableAutoTierToHotFromCool
		blob.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	} else {
		blob.EnableAutoTierToHotFromCool = nil
	}

	// TierToArchive
	if source.TierToArchive != nil {
		var tierToArchive DateAfterModification
		err := tierToArchive.AssignProperties_From_DateAfterModification(source.TierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterModification() to populate field TierToArchive")
		}
		blob.TierToArchive = &tierToArchive
	} else {
		blob.TierToArchive = nil
	}

	// TierToCool
	if source.TierToCool != nil {
		var tierToCool DateAfterModification
		err := tierToCool.AssignProperties_From_DateAfterModification(source.TierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterModification() to populate field TierToCool")
		}
		blob.TierToCool = &tierToCool
	} else {
		blob.TierToCool = nil
	}

	// No error
	return nil
}

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

	// Delete
	if blob.Delete != nil {
		var delete storage.DateAfterModification
		err := blob.Delete.AssignProperties_To_DateAfterModification(&delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterModification() to populate field Delete")
		}
		destination.Delete = &delete
	} else {
		destination.Delete = nil
	}

	// EnableAutoTierToHotFromCool
	if blob.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *blob.EnableAutoTierToHotFromCool
		destination.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	} else {
		destination.EnableAutoTierToHotFromCool = nil
	}

	// TierToArchive
	if blob.TierToArchive != nil {
		var tierToArchive storage.DateAfterModification
		err := blob.TierToArchive.AssignProperties_To_DateAfterModification(&tierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterModification() to populate field TierToArchive")
		}
		destination.TierToArchive = &tierToArchive
	} else {
		destination.TierToArchive = nil
	}

	// TierToCool
	if blob.TierToCool != nil {
		var tierToCool storage.DateAfterModification
		err := blob.TierToCool.AssignProperties_To_DateAfterModification(&tierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterModification() to populate field TierToCool")
		}
		destination.TierToCool = &tierToCool
	} else {
		destination.TierToCool = nil
	}

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

	// No error
	return nil
}

// Management policy action for base blob.
type ManagementPolicyBaseBlob_STATUS struct {
	// Delete: The function to delete the blob
	Delete *DateAfterModification_STATUS `json:"delete,omitempty"`

	// EnableAutoTierToHotFromCool: This property enables auto tiering of a blob from cool to hot on a blob access. This
	// property requires tierToCool.daysAfterLastAccessTimeGreaterThan.
	EnableAutoTierToHotFromCool *bool `json:"enableAutoTierToHotFromCool,omitempty"`

	// TierToArchive: The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier
	TierToArchive *DateAfterModification_STATUS `json:"tierToArchive,omitempty"`

	// TierToCool: The function to tier blobs to cool storage. Support blobs currently at Hot tier
	TierToCool *DateAfterModification_STATUS `json:"tierToCool,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicyBaseBlob_STATUS{}

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

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

	// Set property "Delete":
	if typedInput.Delete != nil {
		var delete1 DateAfterModification_STATUS
		err := delete1.PopulateFromARM(owner, *typedInput.Delete)
		if err != nil {
			return err
		}
		delete := delete1
		blob.Delete = &delete
	}

	// Set property "EnableAutoTierToHotFromCool":
	if typedInput.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *typedInput.EnableAutoTierToHotFromCool
		blob.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	}

	// Set property "TierToArchive":
	if typedInput.TierToArchive != nil {
		var tierToArchive1 DateAfterModification_STATUS
		err := tierToArchive1.PopulateFromARM(owner, *typedInput.TierToArchive)
		if err != nil {
			return err
		}
		tierToArchive := tierToArchive1
		blob.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if typedInput.TierToCool != nil {
		var tierToCool1 DateAfterModification_STATUS
		err := tierToCool1.PopulateFromARM(owner, *typedInput.TierToCool)
		if err != nil {
			return err
		}
		tierToCool := tierToCool1
		blob.TierToCool = &tierToCool
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyBaseBlob_STATUS populates our ManagementPolicyBaseBlob_STATUS from the provided source ManagementPolicyBaseBlob_STATUS
func (blob *ManagementPolicyBaseBlob_STATUS) AssignProperties_From_ManagementPolicyBaseBlob_STATUS(source *storage.ManagementPolicyBaseBlob_STATUS) error {

	// Delete
	if source.Delete != nil {
		var delete DateAfterModification_STATUS
		err := delete.AssignProperties_From_DateAfterModification_STATUS(source.Delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterModification_STATUS() to populate field Delete")
		}
		blob.Delete = &delete
	} else {
		blob.Delete = nil
	}

	// EnableAutoTierToHotFromCool
	if source.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *source.EnableAutoTierToHotFromCool
		blob.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	} else {
		blob.EnableAutoTierToHotFromCool = nil
	}

	// TierToArchive
	if source.TierToArchive != nil {
		var tierToArchive DateAfterModification_STATUS
		err := tierToArchive.AssignProperties_From_DateAfterModification_STATUS(source.TierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterModification_STATUS() to populate field TierToArchive")
		}
		blob.TierToArchive = &tierToArchive
	} else {
		blob.TierToArchive = nil
	}

	// TierToCool
	if source.TierToCool != nil {
		var tierToCool DateAfterModification_STATUS
		err := tierToCool.AssignProperties_From_DateAfterModification_STATUS(source.TierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterModification_STATUS() to populate field TierToCool")
		}
		blob.TierToCool = &tierToCool
	} else {
		blob.TierToCool = nil
	}

	// No error
	return nil
}

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

	// Delete
	if blob.Delete != nil {
		var delete storage.DateAfterModification_STATUS
		err := blob.Delete.AssignProperties_To_DateAfterModification_STATUS(&delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterModification_STATUS() to populate field Delete")
		}
		destination.Delete = &delete
	} else {
		destination.Delete = nil
	}

	// EnableAutoTierToHotFromCool
	if blob.EnableAutoTierToHotFromCool != nil {
		enableAutoTierToHotFromCool := *blob.EnableAutoTierToHotFromCool
		destination.EnableAutoTierToHotFromCool = &enableAutoTierToHotFromCool
	} else {
		destination.EnableAutoTierToHotFromCool = nil
	}

	// TierToArchive
	if blob.TierToArchive != nil {
		var tierToArchive storage.DateAfterModification_STATUS
		err := blob.TierToArchive.AssignProperties_To_DateAfterModification_STATUS(&tierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterModification_STATUS() to populate field TierToArchive")
		}
		destination.TierToArchive = &tierToArchive
	} else {
		destination.TierToArchive = nil
	}

	// TierToCool
	if blob.TierToCool != nil {
		var tierToCool storage.DateAfterModification_STATUS
		err := blob.TierToCool.AssignProperties_To_DateAfterModification_STATUS(&tierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterModification_STATUS() to populate field TierToCool")
		}
		destination.TierToCool = &tierToCool
	} else {
		destination.TierToCool = nil
	}

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

	// No error
	return nil
}

// Management policy action for snapshot.
type ManagementPolicySnapShot struct {
	// Delete: The function to delete the blob snapshot
	Delete *DateAfterCreation `json:"delete,omitempty"`

	// TierToArchive: The function to tier blob snapshot to archive storage. Support blob snapshot currently at Hot or Cool tier
	TierToArchive *DateAfterCreation `json:"tierToArchive,omitempty"`

	// TierToCool: The function to tier blob snapshot to cool storage. Support blob snapshot currently at Hot tier
	TierToCool *DateAfterCreation `json:"tierToCool,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicySnapShot{}

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

	// Set property "Delete":
	if shot.Delete != nil {
		delete_ARM, err := shot.Delete.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		delete := *delete_ARM.(*arm.DateAfterCreation)
		result.Delete = &delete
	}

	// Set property "TierToArchive":
	if shot.TierToArchive != nil {
		tierToArchive_ARM, err := shot.TierToArchive.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		tierToArchive := *tierToArchive_ARM.(*arm.DateAfterCreation)
		result.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if shot.TierToCool != nil {
		tierToCool_ARM, err := shot.TierToCool.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		tierToCool := *tierToCool_ARM.(*arm.DateAfterCreation)
		result.TierToCool = &tierToCool
	}
	return result, nil
}

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

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

	// Set property "Delete":
	if typedInput.Delete != nil {
		var delete1 DateAfterCreation
		err := delete1.PopulateFromARM(owner, *typedInput.Delete)
		if err != nil {
			return err
		}
		delete := delete1
		shot.Delete = &delete
	}

	// Set property "TierToArchive":
	if typedInput.TierToArchive != nil {
		var tierToArchive1 DateAfterCreation
		err := tierToArchive1.PopulateFromARM(owner, *typedInput.TierToArchive)
		if err != nil {
			return err
		}
		tierToArchive := tierToArchive1
		shot.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if typedInput.TierToCool != nil {
		var tierToCool1 DateAfterCreation
		err := tierToCool1.PopulateFromARM(owner, *typedInput.TierToCool)
		if err != nil {
			return err
		}
		tierToCool := tierToCool1
		shot.TierToCool = &tierToCool
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicySnapShot populates our ManagementPolicySnapShot from the provided source ManagementPolicySnapShot
func (shot *ManagementPolicySnapShot) AssignProperties_From_ManagementPolicySnapShot(source *storage.ManagementPolicySnapShot) error {

	// Delete
	if source.Delete != nil {
		var delete DateAfterCreation
		err := delete.AssignProperties_From_DateAfterCreation(source.Delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation() to populate field Delete")
		}
		shot.Delete = &delete
	} else {
		shot.Delete = nil
	}

	// TierToArchive
	if source.TierToArchive != nil {
		var tierToArchive DateAfterCreation
		err := tierToArchive.AssignProperties_From_DateAfterCreation(source.TierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation() to populate field TierToArchive")
		}
		shot.TierToArchive = &tierToArchive
	} else {
		shot.TierToArchive = nil
	}

	// TierToCool
	if source.TierToCool != nil {
		var tierToCool DateAfterCreation
		err := tierToCool.AssignProperties_From_DateAfterCreation(source.TierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation() to populate field TierToCool")
		}
		shot.TierToCool = &tierToCool
	} else {
		shot.TierToCool = nil
	}

	// No error
	return nil
}

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

	// Delete
	if shot.Delete != nil {
		var delete storage.DateAfterCreation
		err := shot.Delete.AssignProperties_To_DateAfterCreation(&delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation() to populate field Delete")
		}
		destination.Delete = &delete
	} else {
		destination.Delete = nil
	}

	// TierToArchive
	if shot.TierToArchive != nil {
		var tierToArchive storage.DateAfterCreation
		err := shot.TierToArchive.AssignProperties_To_DateAfterCreation(&tierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation() to populate field TierToArchive")
		}
		destination.TierToArchive = &tierToArchive
	} else {
		destination.TierToArchive = nil
	}

	// TierToCool
	if shot.TierToCool != nil {
		var tierToCool storage.DateAfterCreation
		err := shot.TierToCool.AssignProperties_To_DateAfterCreation(&tierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation() to populate field TierToCool")
		}
		destination.TierToCool = &tierToCool
	} else {
		destination.TierToCool = nil
	}

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

	// No error
	return nil
}

// Management policy action for snapshot.
type ManagementPolicySnapShot_STATUS struct {
	// Delete: The function to delete the blob snapshot
	Delete *DateAfterCreation_STATUS `json:"delete,omitempty"`

	// TierToArchive: The function to tier blob snapshot to archive storage. Support blob snapshot currently at Hot or Cool tier
	TierToArchive *DateAfterCreation_STATUS `json:"tierToArchive,omitempty"`

	// TierToCool: The function to tier blob snapshot to cool storage. Support blob snapshot currently at Hot tier
	TierToCool *DateAfterCreation_STATUS `json:"tierToCool,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicySnapShot_STATUS{}

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

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

	// Set property "Delete":
	if typedInput.Delete != nil {
		var delete1 DateAfterCreation_STATUS
		err := delete1.PopulateFromARM(owner, *typedInput.Delete)
		if err != nil {
			return err
		}
		delete := delete1
		shot.Delete = &delete
	}

	// Set property "TierToArchive":
	if typedInput.TierToArchive != nil {
		var tierToArchive1 DateAfterCreation_STATUS
		err := tierToArchive1.PopulateFromARM(owner, *typedInput.TierToArchive)
		if err != nil {
			return err
		}
		tierToArchive := tierToArchive1
		shot.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if typedInput.TierToCool != nil {
		var tierToCool1 DateAfterCreation_STATUS
		err := tierToCool1.PopulateFromARM(owner, *typedInput.TierToCool)
		if err != nil {
			return err
		}
		tierToCool := tierToCool1
		shot.TierToCool = &tierToCool
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicySnapShot_STATUS populates our ManagementPolicySnapShot_STATUS from the provided source ManagementPolicySnapShot_STATUS
func (shot *ManagementPolicySnapShot_STATUS) AssignProperties_From_ManagementPolicySnapShot_STATUS(source *storage.ManagementPolicySnapShot_STATUS) error {

	// Delete
	if source.Delete != nil {
		var delete DateAfterCreation_STATUS
		err := delete.AssignProperties_From_DateAfterCreation_STATUS(source.Delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation_STATUS() to populate field Delete")
		}
		shot.Delete = &delete
	} else {
		shot.Delete = nil
	}

	// TierToArchive
	if source.TierToArchive != nil {
		var tierToArchive DateAfterCreation_STATUS
		err := tierToArchive.AssignProperties_From_DateAfterCreation_STATUS(source.TierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation_STATUS() to populate field TierToArchive")
		}
		shot.TierToArchive = &tierToArchive
	} else {
		shot.TierToArchive = nil
	}

	// TierToCool
	if source.TierToCool != nil {
		var tierToCool DateAfterCreation_STATUS
		err := tierToCool.AssignProperties_From_DateAfterCreation_STATUS(source.TierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation_STATUS() to populate field TierToCool")
		}
		shot.TierToCool = &tierToCool
	} else {
		shot.TierToCool = nil
	}

	// No error
	return nil
}

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

	// Delete
	if shot.Delete != nil {
		var delete storage.DateAfterCreation_STATUS
		err := shot.Delete.AssignProperties_To_DateAfterCreation_STATUS(&delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation_STATUS() to populate field Delete")
		}
		destination.Delete = &delete
	} else {
		destination.Delete = nil
	}

	// TierToArchive
	if shot.TierToArchive != nil {
		var tierToArchive storage.DateAfterCreation_STATUS
		err := shot.TierToArchive.AssignProperties_To_DateAfterCreation_STATUS(&tierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation_STATUS() to populate field TierToArchive")
		}
		destination.TierToArchive = &tierToArchive
	} else {
		destination.TierToArchive = nil
	}

	// TierToCool
	if shot.TierToCool != nil {
		var tierToCool storage.DateAfterCreation_STATUS
		err := shot.TierToCool.AssignProperties_To_DateAfterCreation_STATUS(&tierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation_STATUS() to populate field TierToCool")
		}
		destination.TierToCool = &tierToCool
	} else {
		destination.TierToCool = nil
	}

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

	// No error
	return nil
}

// Management policy action for blob version.
type ManagementPolicyVersion struct {
	// Delete: The function to delete the blob version
	Delete *DateAfterCreation `json:"delete,omitempty"`

	// TierToArchive: The function to tier blob version to archive storage. Support blob version currently at Hot or Cool tier
	TierToArchive *DateAfterCreation `json:"tierToArchive,omitempty"`

	// TierToCool: The function to tier blob version to cool storage. Support blob version currently at Hot tier
	TierToCool *DateAfterCreation `json:"tierToCool,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagementPolicyVersion{}

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

	// Set property "Delete":
	if version.Delete != nil {
		delete_ARM, err := version.Delete.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		delete := *delete_ARM.(*arm.DateAfterCreation)
		result.Delete = &delete
	}

	// Set property "TierToArchive":
	if version.TierToArchive != nil {
		tierToArchive_ARM, err := version.TierToArchive.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		tierToArchive := *tierToArchive_ARM.(*arm.DateAfterCreation)
		result.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if version.TierToCool != nil {
		tierToCool_ARM, err := version.TierToCool.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		tierToCool := *tierToCool_ARM.(*arm.DateAfterCreation)
		result.TierToCool = &tierToCool
	}
	return result, nil
}

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

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

	// Set property "Delete":
	if typedInput.Delete != nil {
		var delete1 DateAfterCreation
		err := delete1.PopulateFromARM(owner, *typedInput.Delete)
		if err != nil {
			return err
		}
		delete := delete1
		version.Delete = &delete
	}

	// Set property "TierToArchive":
	if typedInput.TierToArchive != nil {
		var tierToArchive1 DateAfterCreation
		err := tierToArchive1.PopulateFromARM(owner, *typedInput.TierToArchive)
		if err != nil {
			return err
		}
		tierToArchive := tierToArchive1
		version.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if typedInput.TierToCool != nil {
		var tierToCool1 DateAfterCreation
		err := tierToCool1.PopulateFromARM(owner, *typedInput.TierToCool)
		if err != nil {
			return err
		}
		tierToCool := tierToCool1
		version.TierToCool = &tierToCool
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyVersion populates our ManagementPolicyVersion from the provided source ManagementPolicyVersion
func (version *ManagementPolicyVersion) AssignProperties_From_ManagementPolicyVersion(source *storage.ManagementPolicyVersion) error {

	// Delete
	if source.Delete != nil {
		var delete DateAfterCreation
		err := delete.AssignProperties_From_DateAfterCreation(source.Delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation() to populate field Delete")
		}
		version.Delete = &delete
	} else {
		version.Delete = nil
	}

	// TierToArchive
	if source.TierToArchive != nil {
		var tierToArchive DateAfterCreation
		err := tierToArchive.AssignProperties_From_DateAfterCreation(source.TierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation() to populate field TierToArchive")
		}
		version.TierToArchive = &tierToArchive
	} else {
		version.TierToArchive = nil
	}

	// TierToCool
	if source.TierToCool != nil {
		var tierToCool DateAfterCreation
		err := tierToCool.AssignProperties_From_DateAfterCreation(source.TierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation() to populate field TierToCool")
		}
		version.TierToCool = &tierToCool
	} else {
		version.TierToCool = nil
	}

	// No error
	return nil
}

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

	// Delete
	if version.Delete != nil {
		var delete storage.DateAfterCreation
		err := version.Delete.AssignProperties_To_DateAfterCreation(&delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation() to populate field Delete")
		}
		destination.Delete = &delete
	} else {
		destination.Delete = nil
	}

	// TierToArchive
	if version.TierToArchive != nil {
		var tierToArchive storage.DateAfterCreation
		err := version.TierToArchive.AssignProperties_To_DateAfterCreation(&tierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation() to populate field TierToArchive")
		}
		destination.TierToArchive = &tierToArchive
	} else {
		destination.TierToArchive = nil
	}

	// TierToCool
	if version.TierToCool != nil {
		var tierToCool storage.DateAfterCreation
		err := version.TierToCool.AssignProperties_To_DateAfterCreation(&tierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation() to populate field TierToCool")
		}
		destination.TierToCool = &tierToCool
	} else {
		destination.TierToCool = nil
	}

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

	// No error
	return nil
}

// Management policy action for blob version.
type ManagementPolicyVersion_STATUS struct {
	// Delete: The function to delete the blob version
	Delete *DateAfterCreation_STATUS `json:"delete,omitempty"`

	// TierToArchive: The function to tier blob version to archive storage. Support blob version currently at Hot or Cool tier
	TierToArchive *DateAfterCreation_STATUS `json:"tierToArchive,omitempty"`

	// TierToCool: The function to tier blob version to cool storage. Support blob version currently at Hot tier
	TierToCool *DateAfterCreation_STATUS `json:"tierToCool,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagementPolicyVersion_STATUS{}

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

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

	// Set property "Delete":
	if typedInput.Delete != nil {
		var delete1 DateAfterCreation_STATUS
		err := delete1.PopulateFromARM(owner, *typedInput.Delete)
		if err != nil {
			return err
		}
		delete := delete1
		version.Delete = &delete
	}

	// Set property "TierToArchive":
	if typedInput.TierToArchive != nil {
		var tierToArchive1 DateAfterCreation_STATUS
		err := tierToArchive1.PopulateFromARM(owner, *typedInput.TierToArchive)
		if err != nil {
			return err
		}
		tierToArchive := tierToArchive1
		version.TierToArchive = &tierToArchive
	}

	// Set property "TierToCool":
	if typedInput.TierToCool != nil {
		var tierToCool1 DateAfterCreation_STATUS
		err := tierToCool1.PopulateFromARM(owner, *typedInput.TierToCool)
		if err != nil {
			return err
		}
		tierToCool := tierToCool1
		version.TierToCool = &tierToCool
	}

	// No error
	return nil
}

// AssignProperties_From_ManagementPolicyVersion_STATUS populates our ManagementPolicyVersion_STATUS from the provided source ManagementPolicyVersion_STATUS
func (version *ManagementPolicyVersion_STATUS) AssignProperties_From_ManagementPolicyVersion_STATUS(source *storage.ManagementPolicyVersion_STATUS) error {

	// Delete
	if source.Delete != nil {
		var delete DateAfterCreation_STATUS
		err := delete.AssignProperties_From_DateAfterCreation_STATUS(source.Delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation_STATUS() to populate field Delete")
		}
		version.Delete = &delete
	} else {
		version.Delete = nil
	}

	// TierToArchive
	if source.TierToArchive != nil {
		var tierToArchive DateAfterCreation_STATUS
		err := tierToArchive.AssignProperties_From_DateAfterCreation_STATUS(source.TierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation_STATUS() to populate field TierToArchive")
		}
		version.TierToArchive = &tierToArchive
	} else {
		version.TierToArchive = nil
	}

	// TierToCool
	if source.TierToCool != nil {
		var tierToCool DateAfterCreation_STATUS
		err := tierToCool.AssignProperties_From_DateAfterCreation_STATUS(source.TierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DateAfterCreation_STATUS() to populate field TierToCool")
		}
		version.TierToCool = &tierToCool
	} else {
		version.TierToCool = nil
	}

	// No error
	return nil
}

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

	// Delete
	if version.Delete != nil {
		var delete storage.DateAfterCreation_STATUS
		err := version.Delete.AssignProperties_To_DateAfterCreation_STATUS(&delete)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation_STATUS() to populate field Delete")
		}
		destination.Delete = &delete
	} else {
		destination.Delete = nil
	}

	// TierToArchive
	if version.TierToArchive != nil {
		var tierToArchive storage.DateAfterCreation_STATUS
		err := version.TierToArchive.AssignProperties_To_DateAfterCreation_STATUS(&tierToArchive)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation_STATUS() to populate field TierToArchive")
		}
		destination.TierToArchive = &tierToArchive
	} else {
		destination.TierToArchive = nil
	}

	// TierToCool
	if version.TierToCool != nil {
		var tierToCool storage.DateAfterCreation_STATUS
		err := version.TierToCool.AssignProperties_To_DateAfterCreation_STATUS(&tierToCool)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DateAfterCreation_STATUS() to populate field TierToCool")
		}
		destination.TierToCool = &tierToCool
	} else {
		destination.TierToCool = nil
	}

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

	// No error
	return nil
}

// Blob index tag based filtering for blob objects
type TagFilter struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=128
	// +kubebuilder:validation:MinLength=1
	// Name: This is the filter tag name, it can have 1 - 128 characters
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// Op: This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is
	// currently supported
	Op *string `json:"op,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=256
	// +kubebuilder:validation:MinLength=0
	// Value: This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters
	Value *string `json:"value,omitempty"`
}

var _ genruntime.ARMTransformer = &TagFilter{}

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

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

	// Set property "Op":
	if filter.Op != nil {
		op := *filter.Op
		result.Op = &op
	}

	// Set property "Value":
	if filter.Value != nil {
		value := *filter.Value
		result.Value = &value
	}
	return result, nil
}

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

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

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

	// Set property "Op":
	if typedInput.Op != nil {
		op := *typedInput.Op
		filter.Op = &op
	}

	// Set property "Value":
	if typedInput.Value != nil {
		value := *typedInput.Value
		filter.Value = &value
	}

	// No error
	return nil
}

// AssignProperties_From_TagFilter populates our TagFilter from the provided source TagFilter
func (filter *TagFilter) AssignProperties_From_TagFilter(source *storage.TagFilter) error {

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

	// Op
	filter.Op = genruntime.ClonePointerToString(source.Op)

	// Value
	filter.Value = genruntime.ClonePointerToString(source.Value)

	// No error
	return nil
}

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

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

	// Op
	destination.Op = genruntime.ClonePointerToString(filter.Op)

	// Value
	destination.Value = genruntime.ClonePointerToString(filter.Value)

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

	// No error
	return nil
}

// Blob index tag based filtering for blob objects
type TagFilter_STATUS struct {
	// Name: This is the filter tag name, it can have 1 - 128 characters
	Name *string `json:"name,omitempty"`

	// Op: This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is
	// currently supported
	Op *string `json:"op,omitempty"`

	// Value: This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters
	Value *string `json:"value,omitempty"`
}

var _ genruntime.FromARMConverter = &TagFilter_STATUS{}

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

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

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

	// Set property "Op":
	if typedInput.Op != nil {
		op := *typedInput.Op
		filter.Op = &op
	}

	// Set property "Value":
	if typedInput.Value != nil {
		value := *typedInput.Value
		filter.Value = &value
	}

	// No error
	return nil
}

// AssignProperties_From_TagFilter_STATUS populates our TagFilter_STATUS from the provided source TagFilter_STATUS
func (filter *TagFilter_STATUS) AssignProperties_From_TagFilter_STATUS(source *storage.TagFilter_STATUS) error {

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

	// Op
	filter.Op = genruntime.ClonePointerToString(source.Op)

	// Value
	filter.Value = genruntime.ClonePointerToString(source.Value)

	// No error
	return nil
}

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

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

	// Op
	destination.Op = genruntime.ClonePointerToString(filter.Op)

	// Value
	destination.Value = genruntime.ClonePointerToString(filter.Value)

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

	// No error
	return nil
}

// Object to define the number of days after creation.
type DateAfterCreation struct {
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:MultipleOf=1
	// DaysAfterCreationGreaterThan: Value indicating the age in days after creation
	DaysAfterCreationGreaterThan *int `json:"daysAfterCreationGreaterThan,omitempty"`
}

var _ genruntime.ARMTransformer = &DateAfterCreation{}

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

	// Set property "DaysAfterCreationGreaterThan":
	if creation.DaysAfterCreationGreaterThan != nil {
		daysAfterCreationGreaterThan := *creation.DaysAfterCreationGreaterThan
		result.DaysAfterCreationGreaterThan = &daysAfterCreationGreaterThan
	}
	return result, nil
}

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

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

	// Set property "DaysAfterCreationGreaterThan":
	if typedInput.DaysAfterCreationGreaterThan != nil {
		daysAfterCreationGreaterThan := *typedInput.DaysAfterCreationGreaterThan
		creation.DaysAfterCreationGreaterThan = &daysAfterCreationGreaterThan
	}

	// No error
	return nil
}

// AssignProperties_From_DateAfterCreation populates our DateAfterCreation from the provided source DateAfterCreation
func (creation *DateAfterCreation) AssignProperties_From_DateAfterCreation(source *storage.DateAfterCreation) error {

	// DaysAfterCreationGreaterThan
	creation.DaysAfterCreationGreaterThan = genruntime.ClonePointerToInt(source.DaysAfterCreationGreaterThan)

	// No error
	return nil
}

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

	// DaysAfterCreationGreaterThan
	destination.DaysAfterCreationGreaterThan = genruntime.ClonePointerToInt(creation.DaysAfterCreationGreaterThan)

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

	// No error
	return nil
}

// Object to define the number of days after creation.
type DateAfterCreation_STATUS struct {
	// DaysAfterCreationGreaterThan: Value indicating the age in days after creation
	DaysAfterCreationGreaterThan *float64 `json:"daysAfterCreationGreaterThan,omitempty"`
}

var _ genruntime.FromARMConverter = &DateAfterCreation_STATUS{}

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

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

	// Set property "DaysAfterCreationGreaterThan":
	if typedInput.DaysAfterCreationGreaterThan != nil {
		daysAfterCreationGreaterThan := *typedInput.DaysAfterCreationGreaterThan
		creation.DaysAfterCreationGreaterThan = &daysAfterCreationGreaterThan
	}

	// No error
	return nil
}

// AssignProperties_From_DateAfterCreation_STATUS populates our DateAfterCreation_STATUS from the provided source DateAfterCreation_STATUS
func (creation *DateAfterCreation_STATUS) AssignProperties_From_DateAfterCreation_STATUS(source *storage.DateAfterCreation_STATUS) error {

	// DaysAfterCreationGreaterThan
	if source.DaysAfterCreationGreaterThan != nil {
		daysAfterCreationGreaterThan := *source.DaysAfterCreationGreaterThan
		creation.DaysAfterCreationGreaterThan = &daysAfterCreationGreaterThan
	} else {
		creation.DaysAfterCreationGreaterThan = nil
	}

	// No error
	return nil
}

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

	// DaysAfterCreationGreaterThan
	if creation.DaysAfterCreationGreaterThan != nil {
		daysAfterCreationGreaterThan := *creation.DaysAfterCreationGreaterThan
		destination.DaysAfterCreationGreaterThan = &daysAfterCreationGreaterThan
	} else {
		destination.DaysAfterCreationGreaterThan = nil
	}

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

	// No error
	return nil
}

// Object to define the number of days after object last modification Or last access. Properties
// daysAfterModificationGreaterThan and daysAfterLastAccessTimeGreaterThan are mutually exclusive.
type DateAfterModification struct {
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:MultipleOf=1
	// DaysAfterLastAccessTimeGreaterThan: Value indicating the age in days after last blob access. This property can only be
	// used in conjunction with last access time tracking policy
	DaysAfterLastAccessTimeGreaterThan *int `json:"daysAfterLastAccessTimeGreaterThan,omitempty"`

	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:MultipleOf=1
	// DaysAfterModificationGreaterThan: Value indicating the age in days after last modification
	DaysAfterModificationGreaterThan *int `json:"daysAfterModificationGreaterThan,omitempty"`
}

var _ genruntime.ARMTransformer = &DateAfterModification{}

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

	// Set property "DaysAfterLastAccessTimeGreaterThan":
	if modification.DaysAfterLastAccessTimeGreaterThan != nil {
		daysAfterLastAccessTimeGreaterThan := *modification.DaysAfterLastAccessTimeGreaterThan
		result.DaysAfterLastAccessTimeGreaterThan = &daysAfterLastAccessTimeGreaterThan
	}

	// Set property "DaysAfterModificationGreaterThan":
	if modification.DaysAfterModificationGreaterThan != nil {
		daysAfterModificationGreaterThan := *modification.DaysAfterModificationGreaterThan
		result.DaysAfterModificationGreaterThan = &daysAfterModificationGreaterThan
	}
	return result, nil
}

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

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

	// Set property "DaysAfterLastAccessTimeGreaterThan":
	if typedInput.DaysAfterLastAccessTimeGreaterThan != nil {
		daysAfterLastAccessTimeGreaterThan := *typedInput.DaysAfterLastAccessTimeGreaterThan
		modification.DaysAfterLastAccessTimeGreaterThan = &daysAfterLastAccessTimeGreaterThan
	}

	// Set property "DaysAfterModificationGreaterThan":
	if typedInput.DaysAfterModificationGreaterThan != nil {
		daysAfterModificationGreaterThan := *typedInput.DaysAfterModificationGreaterThan
		modification.DaysAfterModificationGreaterThan = &daysAfterModificationGreaterThan
	}

	// No error
	return nil
}

// AssignProperties_From_DateAfterModification populates our DateAfterModification from the provided source DateAfterModification
func (modification *DateAfterModification) AssignProperties_From_DateAfterModification(source *storage.DateAfterModification) error {

	// DaysAfterLastAccessTimeGreaterThan
	modification.DaysAfterLastAccessTimeGreaterThan = genruntime.ClonePointerToInt(source.DaysAfterLastAccessTimeGreaterThan)

	// DaysAfterModificationGreaterThan
	modification.DaysAfterModificationGreaterThan = genruntime.ClonePointerToInt(source.DaysAfterModificationGreaterThan)

	// No error
	return nil
}

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

	// DaysAfterLastAccessTimeGreaterThan
	destination.DaysAfterLastAccessTimeGreaterThan = genruntime.ClonePointerToInt(modification.DaysAfterLastAccessTimeGreaterThan)

	// DaysAfterModificationGreaterThan
	destination.DaysAfterModificationGreaterThan = genruntime.ClonePointerToInt(modification.DaysAfterModificationGreaterThan)

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

	// No error
	return nil
}

// Object to define the number of days after object last modification Or last access. Properties
// daysAfterModificationGreaterThan and daysAfterLastAccessTimeGreaterThan are mutually exclusive.
type DateAfterModification_STATUS struct {
	// DaysAfterLastAccessTimeGreaterThan: Value indicating the age in days after last blob access. This property can only be
	// used in conjunction with last access time tracking policy
	DaysAfterLastAccessTimeGreaterThan *float64 `json:"daysAfterLastAccessTimeGreaterThan,omitempty"`

	// DaysAfterModificationGreaterThan: Value indicating the age in days after last modification
	DaysAfterModificationGreaterThan *float64 `json:"daysAfterModificationGreaterThan,omitempty"`
}

var _ genruntime.FromARMConverter = &DateAfterModification_STATUS{}

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

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

	// Set property "DaysAfterLastAccessTimeGreaterThan":
	if typedInput.DaysAfterLastAccessTimeGreaterThan != nil {
		daysAfterLastAccessTimeGreaterThan := *typedInput.DaysAfterLastAccessTimeGreaterThan
		modification.DaysAfterLastAccessTimeGreaterThan = &daysAfterLastAccessTimeGreaterThan
	}

	// Set property "DaysAfterModificationGreaterThan":
	if typedInput.DaysAfterModificationGreaterThan != nil {
		daysAfterModificationGreaterThan := *typedInput.DaysAfterModificationGreaterThan
		modification.DaysAfterModificationGreaterThan = &daysAfterModificationGreaterThan
	}

	// No error
	return nil
}

// AssignProperties_From_DateAfterModification_STATUS populates our DateAfterModification_STATUS from the provided source DateAfterModification_STATUS
func (modification *DateAfterModification_STATUS) AssignProperties_From_DateAfterModification_STATUS(source *storage.DateAfterModification_STATUS) error {

	// DaysAfterLastAccessTimeGreaterThan
	if source.DaysAfterLastAccessTimeGreaterThan != nil {
		daysAfterLastAccessTimeGreaterThan := *source.DaysAfterLastAccessTimeGreaterThan
		modification.DaysAfterLastAccessTimeGreaterThan = &daysAfterLastAccessTimeGreaterThan
	} else {
		modification.DaysAfterLastAccessTimeGreaterThan = nil
	}

	// DaysAfterModificationGreaterThan
	if source.DaysAfterModificationGreaterThan != nil {
		daysAfterModificationGreaterThan := *source.DaysAfterModificationGreaterThan
		modification.DaysAfterModificationGreaterThan = &daysAfterModificationGreaterThan
	} else {
		modification.DaysAfterModificationGreaterThan = nil
	}

	// No error
	return nil
}

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

	// DaysAfterLastAccessTimeGreaterThan
	if modification.DaysAfterLastAccessTimeGreaterThan != nil {
		daysAfterLastAccessTimeGreaterThan := *modification.DaysAfterLastAccessTimeGreaterThan
		destination.DaysAfterLastAccessTimeGreaterThan = &daysAfterLastAccessTimeGreaterThan
	} else {
		destination.DaysAfterLastAccessTimeGreaterThan = nil
	}

	// DaysAfterModificationGreaterThan
	if modification.DaysAfterModificationGreaterThan != nil {
		daysAfterModificationGreaterThan := *modification.DaysAfterModificationGreaterThan
		destination.DaysAfterModificationGreaterThan = &daysAfterModificationGreaterThan
	} else {
		destination.DaysAfterModificationGreaterThan = nil
	}

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&StorageAccountsManagementPolicy{}, &StorageAccountsManagementPolicyList{})
}
