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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/storage/v1api20230101/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/storage/v1api20230101/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/2023-01-01/blob.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default
type StorageAccountsBlobService struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              StorageAccountsBlobService_Spec   `json:"spec,omitempty"`
	Status            StorageAccountsBlobService_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &StorageAccountsBlobService{}

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

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

var _ conversion.Convertible = &StorageAccountsBlobService{}

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

	return service.AssignProperties_From_StorageAccountsBlobService(source)
}

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

	return service.AssignProperties_To_StorageAccountsBlobService(destination)
}

var _ configmaps.Exporter = &StorageAccountsBlobService{}

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

var _ secrets.Exporter = &StorageAccountsBlobService{}

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

var _ genruntime.ImportableResource = &StorageAccountsBlobService{}

// InitializeSpec initializes the spec for this resource from the given status
func (service *StorageAccountsBlobService) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*StorageAccountsBlobService_STATUS); ok {
		return service.Spec.Initialize_From_StorageAccountsBlobService_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &StorageAccountsBlobService{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2023-01-01"
func (service StorageAccountsBlobService) GetAPIVersion() string {
	return "2023-01-01"
}

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

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

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

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

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

// NewEmptyStatus returns a new empty (blank) status
func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &StorageAccountsBlobService_STATUS{}
}

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

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

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

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

	service.Status = st
	return nil
}

// AssignProperties_From_StorageAccountsBlobService populates our StorageAccountsBlobService from the provided source StorageAccountsBlobService
func (service *StorageAccountsBlobService) AssignProperties_From_StorageAccountsBlobService(source *storage.StorageAccountsBlobService) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_StorageAccountsBlobService populates the provided destination StorageAccountsBlobService from our StorageAccountsBlobService
func (service *StorageAccountsBlobService) AssignProperties_To_StorageAccountsBlobService(destination *storage.StorageAccountsBlobService) error {

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

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

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

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

type StorageAccountsBlobService_Spec struct {
	// AutomaticSnapshotPolicyEnabled: Deprecated in favor of isVersioningEnabled property.
	AutomaticSnapshotPolicyEnabled *bool `json:"automaticSnapshotPolicyEnabled,omitempty"`

	// ChangeFeed: The blob service properties for change feed events.
	ChangeFeed *ChangeFeed `json:"changeFeed,omitempty"`

	// ContainerDeleteRetentionPolicy: The blob service properties for container soft delete.
	ContainerDeleteRetentionPolicy *DeleteRetentionPolicy `json:"containerDeleteRetentionPolicy,omitempty"`

	// Cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no
	// CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the
	// Blob service.
	Cors *CorsRules `json:"cors,omitempty"`

	// DefaultServiceVersion: DefaultServiceVersion indicates the default version to use for requests to the Blob service if an
	// incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions.
	DefaultServiceVersion *string `json:"defaultServiceVersion,omitempty"`

	// DeleteRetentionPolicy: The blob service properties for blob soft delete.
	DeleteRetentionPolicy *DeleteRetentionPolicy `json:"deleteRetentionPolicy,omitempty"`

	// IsVersioningEnabled: Versioning is enabled if set to true.
	IsVersioningEnabled *bool `json:"isVersioningEnabled,omitempty"`

	// LastAccessTimeTrackingPolicy: The blob service property to configure last access time based tracking policy.
	LastAccessTimeTrackingPolicy *LastAccessTimeTrackingPolicy `json:"lastAccessTimeTrackingPolicy,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *StorageAccountsBlobServiceOperatorSpec `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"`

	// RestorePolicy: The blob service properties for blob restore policy.
	RestorePolicy *RestorePolicyProperties `json:"restorePolicy,omitempty"`
}

var _ genruntime.ARMTransformer = &StorageAccountsBlobService_Spec{}

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

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

	// Set property "Properties":
	if service.AutomaticSnapshotPolicyEnabled != nil ||
		service.ChangeFeed != nil ||
		service.ContainerDeleteRetentionPolicy != nil ||
		service.Cors != nil ||
		service.DefaultServiceVersion != nil ||
		service.DeleteRetentionPolicy != nil ||
		service.IsVersioningEnabled != nil ||
		service.LastAccessTimeTrackingPolicy != nil ||
		service.RestorePolicy != nil {
		result.Properties = &arm.StorageAccounts_BlobService_Properties_Spec{}
	}
	if service.AutomaticSnapshotPolicyEnabled != nil {
		automaticSnapshotPolicyEnabled := *service.AutomaticSnapshotPolicyEnabled
		result.Properties.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
	}
	if service.ChangeFeed != nil {
		changeFeed_ARM, err := service.ChangeFeed.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		changeFeed := *changeFeed_ARM.(*arm.ChangeFeed)
		result.Properties.ChangeFeed = &changeFeed
	}
	if service.ContainerDeleteRetentionPolicy != nil {
		containerDeleteRetentionPolicy_ARM, err := service.ContainerDeleteRetentionPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		containerDeleteRetentionPolicy := *containerDeleteRetentionPolicy_ARM.(*arm.DeleteRetentionPolicy)
		result.Properties.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
	}
	if service.Cors != nil {
		cors_ARM, err := service.Cors.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		cors := *cors_ARM.(*arm.CorsRules)
		result.Properties.Cors = &cors
	}
	if service.DefaultServiceVersion != nil {
		defaultServiceVersion := *service.DefaultServiceVersion
		result.Properties.DefaultServiceVersion = &defaultServiceVersion
	}
	if service.DeleteRetentionPolicy != nil {
		deleteRetentionPolicy_ARM, err := service.DeleteRetentionPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		deleteRetentionPolicy := *deleteRetentionPolicy_ARM.(*arm.DeleteRetentionPolicy)
		result.Properties.DeleteRetentionPolicy = &deleteRetentionPolicy
	}
	if service.IsVersioningEnabled != nil {
		isVersioningEnabled := *service.IsVersioningEnabled
		result.Properties.IsVersioningEnabled = &isVersioningEnabled
	}
	if service.LastAccessTimeTrackingPolicy != nil {
		lastAccessTimeTrackingPolicy_ARM, err := service.LastAccessTimeTrackingPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		lastAccessTimeTrackingPolicy := *lastAccessTimeTrackingPolicy_ARM.(*arm.LastAccessTimeTrackingPolicy)
		result.Properties.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
	}
	if service.RestorePolicy != nil {
		restorePolicy_ARM, err := service.RestorePolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		restorePolicy := *restorePolicy_ARM.(*arm.RestorePolicyProperties)
		result.Properties.RestorePolicy = &restorePolicy
	}
	return result, nil
}

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

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

	// Set property "AutomaticSnapshotPolicyEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AutomaticSnapshotPolicyEnabled != nil {
			automaticSnapshotPolicyEnabled := *typedInput.Properties.AutomaticSnapshotPolicyEnabled
			service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
		}
	}

	// Set property "ChangeFeed":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ChangeFeed != nil {
			var changeFeed1 ChangeFeed
			err := changeFeed1.PopulateFromARM(owner, *typedInput.Properties.ChangeFeed)
			if err != nil {
				return err
			}
			changeFeed := changeFeed1
			service.ChangeFeed = &changeFeed
		}
	}

	// Set property "ContainerDeleteRetentionPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ContainerDeleteRetentionPolicy != nil {
			var containerDeleteRetentionPolicy1 DeleteRetentionPolicy
			err := containerDeleteRetentionPolicy1.PopulateFromARM(owner, *typedInput.Properties.ContainerDeleteRetentionPolicy)
			if err != nil {
				return err
			}
			containerDeleteRetentionPolicy := containerDeleteRetentionPolicy1
			service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
		}
	}

	// Set property "Cors":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Cors != nil {
			var cors1 CorsRules
			err := cors1.PopulateFromARM(owner, *typedInput.Properties.Cors)
			if err != nil {
				return err
			}
			cors := cors1
			service.Cors = &cors
		}
	}

	// Set property "DefaultServiceVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultServiceVersion != nil {
			defaultServiceVersion := *typedInput.Properties.DefaultServiceVersion
			service.DefaultServiceVersion = &defaultServiceVersion
		}
	}

	// Set property "DeleteRetentionPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeleteRetentionPolicy != nil {
			var deleteRetentionPolicy1 DeleteRetentionPolicy
			err := deleteRetentionPolicy1.PopulateFromARM(owner, *typedInput.Properties.DeleteRetentionPolicy)
			if err != nil {
				return err
			}
			deleteRetentionPolicy := deleteRetentionPolicy1
			service.DeleteRetentionPolicy = &deleteRetentionPolicy
		}
	}

	// Set property "IsVersioningEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsVersioningEnabled != nil {
			isVersioningEnabled := *typedInput.Properties.IsVersioningEnabled
			service.IsVersioningEnabled = &isVersioningEnabled
		}
	}

	// Set property "LastAccessTimeTrackingPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastAccessTimeTrackingPolicy != nil {
			var lastAccessTimeTrackingPolicy1 LastAccessTimeTrackingPolicy
			err := lastAccessTimeTrackingPolicy1.PopulateFromARM(owner, *typedInput.Properties.LastAccessTimeTrackingPolicy)
			if err != nil {
				return err
			}
			lastAccessTimeTrackingPolicy := lastAccessTimeTrackingPolicy1
			service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
		}
	}

	// no assignment for property "OperatorSpec"

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

	// Set property "RestorePolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestorePolicy != nil {
			var restorePolicy1 RestorePolicyProperties
			err := restorePolicy1.PopulateFromARM(owner, *typedInput.Properties.RestorePolicy)
			if err != nil {
				return err
			}
			restorePolicy := restorePolicy1
			service.RestorePolicy = &restorePolicy
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &StorageAccountsBlobService_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsBlobService_Spec{}
	err := service.AssignProperties_To_StorageAccountsBlobService_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_StorageAccountsBlobService_Spec populates our StorageAccountsBlobService_Spec from the provided source StorageAccountsBlobService_Spec
func (service *StorageAccountsBlobService_Spec) AssignProperties_From_StorageAccountsBlobService_Spec(source *storage.StorageAccountsBlobService_Spec) error {

	// AutomaticSnapshotPolicyEnabled
	if source.AutomaticSnapshotPolicyEnabled != nil {
		automaticSnapshotPolicyEnabled := *source.AutomaticSnapshotPolicyEnabled
		service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
	} else {
		service.AutomaticSnapshotPolicyEnabled = nil
	}

	// ChangeFeed
	if source.ChangeFeed != nil {
		var changeFeed ChangeFeed
		err := changeFeed.AssignProperties_From_ChangeFeed(source.ChangeFeed)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ChangeFeed() to populate field ChangeFeed")
		}
		service.ChangeFeed = &changeFeed
	} else {
		service.ChangeFeed = nil
	}

	// ContainerDeleteRetentionPolicy
	if source.ContainerDeleteRetentionPolicy != nil {
		var containerDeleteRetentionPolicy DeleteRetentionPolicy
		err := containerDeleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy(source.ContainerDeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy() to populate field ContainerDeleteRetentionPolicy")
		}
		service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
	} else {
		service.ContainerDeleteRetentionPolicy = nil
	}

	// Cors
	if source.Cors != nil {
		var cor CorsRules
		err := cor.AssignProperties_From_CorsRules(source.Cors)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CorsRules() to populate field Cors")
		}
		service.Cors = &cor
	} else {
		service.Cors = nil
	}

	// DefaultServiceVersion
	service.DefaultServiceVersion = genruntime.ClonePointerToString(source.DefaultServiceVersion)

	// DeleteRetentionPolicy
	if source.DeleteRetentionPolicy != nil {
		var deleteRetentionPolicy DeleteRetentionPolicy
		err := deleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy(source.DeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy() to populate field DeleteRetentionPolicy")
		}
		service.DeleteRetentionPolicy = &deleteRetentionPolicy
	} else {
		service.DeleteRetentionPolicy = nil
	}

	// IsVersioningEnabled
	if source.IsVersioningEnabled != nil {
		isVersioningEnabled := *source.IsVersioningEnabled
		service.IsVersioningEnabled = &isVersioningEnabled
	} else {
		service.IsVersioningEnabled = nil
	}

	// LastAccessTimeTrackingPolicy
	if source.LastAccessTimeTrackingPolicy != nil {
		var lastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy
		err := lastAccessTimeTrackingPolicy.AssignProperties_From_LastAccessTimeTrackingPolicy(source.LastAccessTimeTrackingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LastAccessTimeTrackingPolicy() to populate field LastAccessTimeTrackingPolicy")
		}
		service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
	} else {
		service.LastAccessTimeTrackingPolicy = nil
	}

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

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

	// RestorePolicy
	if source.RestorePolicy != nil {
		var restorePolicy RestorePolicyProperties
		err := restorePolicy.AssignProperties_From_RestorePolicyProperties(source.RestorePolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_RestorePolicyProperties() to populate field RestorePolicy")
		}
		service.RestorePolicy = &restorePolicy
	} else {
		service.RestorePolicy = nil
	}

	// No error
	return nil
}

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

	// AutomaticSnapshotPolicyEnabled
	if service.AutomaticSnapshotPolicyEnabled != nil {
		automaticSnapshotPolicyEnabled := *service.AutomaticSnapshotPolicyEnabled
		destination.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
	} else {
		destination.AutomaticSnapshotPolicyEnabled = nil
	}

	// ChangeFeed
	if service.ChangeFeed != nil {
		var changeFeed storage.ChangeFeed
		err := service.ChangeFeed.AssignProperties_To_ChangeFeed(&changeFeed)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ChangeFeed() to populate field ChangeFeed")
		}
		destination.ChangeFeed = &changeFeed
	} else {
		destination.ChangeFeed = nil
	}

	// ContainerDeleteRetentionPolicy
	if service.ContainerDeleteRetentionPolicy != nil {
		var containerDeleteRetentionPolicy storage.DeleteRetentionPolicy
		err := service.ContainerDeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy(&containerDeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy() to populate field ContainerDeleteRetentionPolicy")
		}
		destination.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
	} else {
		destination.ContainerDeleteRetentionPolicy = nil
	}

	// Cors
	if service.Cors != nil {
		var cor storage.CorsRules
		err := service.Cors.AssignProperties_To_CorsRules(&cor)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CorsRules() to populate field Cors")
		}
		destination.Cors = &cor
	} else {
		destination.Cors = nil
	}

	// DefaultServiceVersion
	destination.DefaultServiceVersion = genruntime.ClonePointerToString(service.DefaultServiceVersion)

	// DeleteRetentionPolicy
	if service.DeleteRetentionPolicy != nil {
		var deleteRetentionPolicy storage.DeleteRetentionPolicy
		err := service.DeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy(&deleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy() to populate field DeleteRetentionPolicy")
		}
		destination.DeleteRetentionPolicy = &deleteRetentionPolicy
	} else {
		destination.DeleteRetentionPolicy = nil
	}

	// IsVersioningEnabled
	if service.IsVersioningEnabled != nil {
		isVersioningEnabled := *service.IsVersioningEnabled
		destination.IsVersioningEnabled = &isVersioningEnabled
	} else {
		destination.IsVersioningEnabled = nil
	}

	// LastAccessTimeTrackingPolicy
	if service.LastAccessTimeTrackingPolicy != nil {
		var lastAccessTimeTrackingPolicy storage.LastAccessTimeTrackingPolicy
		err := service.LastAccessTimeTrackingPolicy.AssignProperties_To_LastAccessTimeTrackingPolicy(&lastAccessTimeTrackingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_LastAccessTimeTrackingPolicy() to populate field LastAccessTimeTrackingPolicy")
		}
		destination.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
	} else {
		destination.LastAccessTimeTrackingPolicy = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = service.OriginalVersion()

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

	// RestorePolicy
	if service.RestorePolicy != nil {
		var restorePolicy storage.RestorePolicyProperties
		err := service.RestorePolicy.AssignProperties_To_RestorePolicyProperties(&restorePolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_RestorePolicyProperties() to populate field RestorePolicy")
		}
		destination.RestorePolicy = &restorePolicy
	} else {
		destination.RestorePolicy = nil
	}

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

	// No error
	return nil
}

// Initialize_From_StorageAccountsBlobService_STATUS populates our StorageAccountsBlobService_Spec from the provided source StorageAccountsBlobService_STATUS
func (service *StorageAccountsBlobService_Spec) Initialize_From_StorageAccountsBlobService_STATUS(source *StorageAccountsBlobService_STATUS) error {

	// AutomaticSnapshotPolicyEnabled
	if source.AutomaticSnapshotPolicyEnabled != nil {
		automaticSnapshotPolicyEnabled := *source.AutomaticSnapshotPolicyEnabled
		service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
	} else {
		service.AutomaticSnapshotPolicyEnabled = nil
	}

	// ChangeFeed
	if source.ChangeFeed != nil {
		var changeFeed ChangeFeed
		err := changeFeed.Initialize_From_ChangeFeed_STATUS(source.ChangeFeed)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ChangeFeed_STATUS() to populate field ChangeFeed")
		}
		service.ChangeFeed = &changeFeed
	} else {
		service.ChangeFeed = nil
	}

	// ContainerDeleteRetentionPolicy
	if source.ContainerDeleteRetentionPolicy != nil {
		var containerDeleteRetentionPolicy DeleteRetentionPolicy
		err := containerDeleteRetentionPolicy.Initialize_From_DeleteRetentionPolicy_STATUS(source.ContainerDeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_DeleteRetentionPolicy_STATUS() to populate field ContainerDeleteRetentionPolicy")
		}
		service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
	} else {
		service.ContainerDeleteRetentionPolicy = nil
	}

	// Cors
	if source.Cors != nil {
		var cor CorsRules
		err := cor.Initialize_From_CorsRules_STATUS(source.Cors)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_CorsRules_STATUS() to populate field Cors")
		}
		service.Cors = &cor
	} else {
		service.Cors = nil
	}

	// DefaultServiceVersion
	service.DefaultServiceVersion = genruntime.ClonePointerToString(source.DefaultServiceVersion)

	// DeleteRetentionPolicy
	if source.DeleteRetentionPolicy != nil {
		var deleteRetentionPolicy DeleteRetentionPolicy
		err := deleteRetentionPolicy.Initialize_From_DeleteRetentionPolicy_STATUS(source.DeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_DeleteRetentionPolicy_STATUS() to populate field DeleteRetentionPolicy")
		}
		service.DeleteRetentionPolicy = &deleteRetentionPolicy
	} else {
		service.DeleteRetentionPolicy = nil
	}

	// IsVersioningEnabled
	if source.IsVersioningEnabled != nil {
		isVersioningEnabled := *source.IsVersioningEnabled
		service.IsVersioningEnabled = &isVersioningEnabled
	} else {
		service.IsVersioningEnabled = nil
	}

	// LastAccessTimeTrackingPolicy
	if source.LastAccessTimeTrackingPolicy != nil {
		var lastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy
		err := lastAccessTimeTrackingPolicy.Initialize_From_LastAccessTimeTrackingPolicy_STATUS(source.LastAccessTimeTrackingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_LastAccessTimeTrackingPolicy_STATUS() to populate field LastAccessTimeTrackingPolicy")
		}
		service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
	} else {
		service.LastAccessTimeTrackingPolicy = nil
	}

	// RestorePolicy
	if source.RestorePolicy != nil {
		var restorePolicy RestorePolicyProperties
		err := restorePolicy.Initialize_From_RestorePolicyProperties_STATUS(source.RestorePolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_RestorePolicyProperties_STATUS() to populate field RestorePolicy")
		}
		service.RestorePolicy = &restorePolicy
	} else {
		service.RestorePolicy = nil
	}

	// No error
	return nil
}

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

type StorageAccountsBlobService_STATUS struct {
	// AutomaticSnapshotPolicyEnabled: Deprecated in favor of isVersioningEnabled property.
	AutomaticSnapshotPolicyEnabled *bool `json:"automaticSnapshotPolicyEnabled,omitempty"`

	// ChangeFeed: The blob service properties for change feed events.
	ChangeFeed *ChangeFeed_STATUS `json:"changeFeed,omitempty"`

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

	// ContainerDeleteRetentionPolicy: The blob service properties for container soft delete.
	ContainerDeleteRetentionPolicy *DeleteRetentionPolicy_STATUS `json:"containerDeleteRetentionPolicy,omitempty"`

	// Cors: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no
	// CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the
	// Blob service.
	Cors *CorsRules_STATUS `json:"cors,omitempty"`

	// DefaultServiceVersion: DefaultServiceVersion indicates the default version to use for requests to the Blob service if an
	// incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions.
	DefaultServiceVersion *string `json:"defaultServiceVersion,omitempty"`

	// DeleteRetentionPolicy: The blob service properties for blob soft delete.
	DeleteRetentionPolicy *DeleteRetentionPolicy_STATUS `json:"deleteRetentionPolicy,omitempty"`

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

	// IsVersioningEnabled: Versioning is enabled if set to true.
	IsVersioningEnabled *bool `json:"isVersioningEnabled,omitempty"`

	// LastAccessTimeTrackingPolicy: The blob service property to configure last access time based tracking policy.
	LastAccessTimeTrackingPolicy *LastAccessTimeTrackingPolicy_STATUS `json:"lastAccessTimeTrackingPolicy,omitempty"`

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

	// RestorePolicy: The blob service properties for blob restore policy.
	RestorePolicy *RestorePolicyProperties_STATUS `json:"restorePolicy,omitempty"`

	// Sku: Sku name and tier.
	Sku *Sku_STATUS `json:"sku,omitempty"`

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

var _ genruntime.ConvertibleStatus = &StorageAccountsBlobService_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsBlobService_STATUS{}
	err := service.AssignProperties_To_StorageAccountsBlobService_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 = &StorageAccountsBlobService_STATUS{}

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

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

	// Set property "AutomaticSnapshotPolicyEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AutomaticSnapshotPolicyEnabled != nil {
			automaticSnapshotPolicyEnabled := *typedInput.Properties.AutomaticSnapshotPolicyEnabled
			service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
		}
	}

	// Set property "ChangeFeed":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ChangeFeed != nil {
			var changeFeed1 ChangeFeed_STATUS
			err := changeFeed1.PopulateFromARM(owner, *typedInput.Properties.ChangeFeed)
			if err != nil {
				return err
			}
			changeFeed := changeFeed1
			service.ChangeFeed = &changeFeed
		}
	}

	// no assignment for property "Conditions"

	// Set property "ContainerDeleteRetentionPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ContainerDeleteRetentionPolicy != nil {
			var containerDeleteRetentionPolicy1 DeleteRetentionPolicy_STATUS
			err := containerDeleteRetentionPolicy1.PopulateFromARM(owner, *typedInput.Properties.ContainerDeleteRetentionPolicy)
			if err != nil {
				return err
			}
			containerDeleteRetentionPolicy := containerDeleteRetentionPolicy1
			service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
		}
	}

	// Set property "Cors":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Cors != nil {
			var cors1 CorsRules_STATUS
			err := cors1.PopulateFromARM(owner, *typedInput.Properties.Cors)
			if err != nil {
				return err
			}
			cors := cors1
			service.Cors = &cors
		}
	}

	// Set property "DefaultServiceVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultServiceVersion != nil {
			defaultServiceVersion := *typedInput.Properties.DefaultServiceVersion
			service.DefaultServiceVersion = &defaultServiceVersion
		}
	}

	// Set property "DeleteRetentionPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeleteRetentionPolicy != nil {
			var deleteRetentionPolicy1 DeleteRetentionPolicy_STATUS
			err := deleteRetentionPolicy1.PopulateFromARM(owner, *typedInput.Properties.DeleteRetentionPolicy)
			if err != nil {
				return err
			}
			deleteRetentionPolicy := deleteRetentionPolicy1
			service.DeleteRetentionPolicy = &deleteRetentionPolicy
		}
	}

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

	// Set property "IsVersioningEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsVersioningEnabled != nil {
			isVersioningEnabled := *typedInput.Properties.IsVersioningEnabled
			service.IsVersioningEnabled = &isVersioningEnabled
		}
	}

	// Set property "LastAccessTimeTrackingPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastAccessTimeTrackingPolicy != nil {
			var lastAccessTimeTrackingPolicy1 LastAccessTimeTrackingPolicy_STATUS
			err := lastAccessTimeTrackingPolicy1.PopulateFromARM(owner, *typedInput.Properties.LastAccessTimeTrackingPolicy)
			if err != nil {
				return err
			}
			lastAccessTimeTrackingPolicy := lastAccessTimeTrackingPolicy1
			service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
		}
	}

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

	// Set property "RestorePolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestorePolicy != nil {
			var restorePolicy1 RestorePolicyProperties_STATUS
			err := restorePolicy1.PopulateFromARM(owner, *typedInput.Properties.RestorePolicy)
			if err != nil {
				return err
			}
			restorePolicy := restorePolicy1
			service.RestorePolicy = &restorePolicy
		}
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_StorageAccountsBlobService_STATUS populates our StorageAccountsBlobService_STATUS from the provided source StorageAccountsBlobService_STATUS
func (service *StorageAccountsBlobService_STATUS) AssignProperties_From_StorageAccountsBlobService_STATUS(source *storage.StorageAccountsBlobService_STATUS) error {

	// AutomaticSnapshotPolicyEnabled
	if source.AutomaticSnapshotPolicyEnabled != nil {
		automaticSnapshotPolicyEnabled := *source.AutomaticSnapshotPolicyEnabled
		service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
	} else {
		service.AutomaticSnapshotPolicyEnabled = nil
	}

	// ChangeFeed
	if source.ChangeFeed != nil {
		var changeFeed ChangeFeed_STATUS
		err := changeFeed.AssignProperties_From_ChangeFeed_STATUS(source.ChangeFeed)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ChangeFeed_STATUS() to populate field ChangeFeed")
		}
		service.ChangeFeed = &changeFeed
	} else {
		service.ChangeFeed = nil
	}

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

	// ContainerDeleteRetentionPolicy
	if source.ContainerDeleteRetentionPolicy != nil {
		var containerDeleteRetentionPolicy DeleteRetentionPolicy_STATUS
		err := containerDeleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy_STATUS(source.ContainerDeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy_STATUS() to populate field ContainerDeleteRetentionPolicy")
		}
		service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
	} else {
		service.ContainerDeleteRetentionPolicy = nil
	}

	// Cors
	if source.Cors != nil {
		var cor CorsRules_STATUS
		err := cor.AssignProperties_From_CorsRules_STATUS(source.Cors)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CorsRules_STATUS() to populate field Cors")
		}
		service.Cors = &cor
	} else {
		service.Cors = nil
	}

	// DefaultServiceVersion
	service.DefaultServiceVersion = genruntime.ClonePointerToString(source.DefaultServiceVersion)

	// DeleteRetentionPolicy
	if source.DeleteRetentionPolicy != nil {
		var deleteRetentionPolicy DeleteRetentionPolicy_STATUS
		err := deleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy_STATUS(source.DeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy_STATUS() to populate field DeleteRetentionPolicy")
		}
		service.DeleteRetentionPolicy = &deleteRetentionPolicy
	} else {
		service.DeleteRetentionPolicy = nil
	}

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

	// IsVersioningEnabled
	if source.IsVersioningEnabled != nil {
		isVersioningEnabled := *source.IsVersioningEnabled
		service.IsVersioningEnabled = &isVersioningEnabled
	} else {
		service.IsVersioningEnabled = nil
	}

	// LastAccessTimeTrackingPolicy
	if source.LastAccessTimeTrackingPolicy != nil {
		var lastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy_STATUS
		err := lastAccessTimeTrackingPolicy.AssignProperties_From_LastAccessTimeTrackingPolicy_STATUS(source.LastAccessTimeTrackingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LastAccessTimeTrackingPolicy_STATUS() to populate field LastAccessTimeTrackingPolicy")
		}
		service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
	} else {
		service.LastAccessTimeTrackingPolicy = nil
	}

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

	// RestorePolicy
	if source.RestorePolicy != nil {
		var restorePolicy RestorePolicyProperties_STATUS
		err := restorePolicy.AssignProperties_From_RestorePolicyProperties_STATUS(source.RestorePolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_RestorePolicyProperties_STATUS() to populate field RestorePolicy")
		}
		service.RestorePolicy = &restorePolicy
	} else {
		service.RestorePolicy = nil
	}

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

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

	// No error
	return nil
}

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

	// AutomaticSnapshotPolicyEnabled
	if service.AutomaticSnapshotPolicyEnabled != nil {
		automaticSnapshotPolicyEnabled := *service.AutomaticSnapshotPolicyEnabled
		destination.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
	} else {
		destination.AutomaticSnapshotPolicyEnabled = nil
	}

	// ChangeFeed
	if service.ChangeFeed != nil {
		var changeFeed storage.ChangeFeed_STATUS
		err := service.ChangeFeed.AssignProperties_To_ChangeFeed_STATUS(&changeFeed)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ChangeFeed_STATUS() to populate field ChangeFeed")
		}
		destination.ChangeFeed = &changeFeed
	} else {
		destination.ChangeFeed = nil
	}

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

	// ContainerDeleteRetentionPolicy
	if service.ContainerDeleteRetentionPolicy != nil {
		var containerDeleteRetentionPolicy storage.DeleteRetentionPolicy_STATUS
		err := service.ContainerDeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy_STATUS(&containerDeleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy_STATUS() to populate field ContainerDeleteRetentionPolicy")
		}
		destination.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
	} else {
		destination.ContainerDeleteRetentionPolicy = nil
	}

	// Cors
	if service.Cors != nil {
		var cor storage.CorsRules_STATUS
		err := service.Cors.AssignProperties_To_CorsRules_STATUS(&cor)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CorsRules_STATUS() to populate field Cors")
		}
		destination.Cors = &cor
	} else {
		destination.Cors = nil
	}

	// DefaultServiceVersion
	destination.DefaultServiceVersion = genruntime.ClonePointerToString(service.DefaultServiceVersion)

	// DeleteRetentionPolicy
	if service.DeleteRetentionPolicy != nil {
		var deleteRetentionPolicy storage.DeleteRetentionPolicy_STATUS
		err := service.DeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy_STATUS(&deleteRetentionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy_STATUS() to populate field DeleteRetentionPolicy")
		}
		destination.DeleteRetentionPolicy = &deleteRetentionPolicy
	} else {
		destination.DeleteRetentionPolicy = nil
	}

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

	// IsVersioningEnabled
	if service.IsVersioningEnabled != nil {
		isVersioningEnabled := *service.IsVersioningEnabled
		destination.IsVersioningEnabled = &isVersioningEnabled
	} else {
		destination.IsVersioningEnabled = nil
	}

	// LastAccessTimeTrackingPolicy
	if service.LastAccessTimeTrackingPolicy != nil {
		var lastAccessTimeTrackingPolicy storage.LastAccessTimeTrackingPolicy_STATUS
		err := service.LastAccessTimeTrackingPolicy.AssignProperties_To_LastAccessTimeTrackingPolicy_STATUS(&lastAccessTimeTrackingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_LastAccessTimeTrackingPolicy_STATUS() to populate field LastAccessTimeTrackingPolicy")
		}
		destination.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
	} else {
		destination.LastAccessTimeTrackingPolicy = nil
	}

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

	// RestorePolicy
	if service.RestorePolicy != nil {
		var restorePolicy storage.RestorePolicyProperties_STATUS
		err := service.RestorePolicy.AssignProperties_To_RestorePolicyProperties_STATUS(&restorePolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_RestorePolicyProperties_STATUS() to populate field RestorePolicy")
		}
		destination.RestorePolicy = &restorePolicy
	} else {
		destination.RestorePolicy = nil
	}

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

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

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

	// No error
	return nil
}

// The blob service properties for change feed events.
type ChangeFeed struct {
	// Enabled: Indicates whether change feed event logging is enabled for the Blob service.
	Enabled *bool `json:"enabled,omitempty"`

	// +kubebuilder:validation:Maximum=146000
	// +kubebuilder:validation:Minimum=1
	// RetentionInDays: Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is
	// 146000 days (400 years). A null value indicates an infinite retention of the change feed.
	RetentionInDays *int `json:"retentionInDays,omitempty"`
}

var _ genruntime.ARMTransformer = &ChangeFeed{}

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

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

	// Set property "RetentionInDays":
	if feed.RetentionInDays != nil {
		retentionInDays := *feed.RetentionInDays
		result.RetentionInDays = &retentionInDays
	}
	return result, nil
}

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

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

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

	// Set property "RetentionInDays":
	if typedInput.RetentionInDays != nil {
		retentionInDays := *typedInput.RetentionInDays
		feed.RetentionInDays = &retentionInDays
	}

	// No error
	return nil
}

// AssignProperties_From_ChangeFeed populates our ChangeFeed from the provided source ChangeFeed
func (feed *ChangeFeed) AssignProperties_From_ChangeFeed(source *storage.ChangeFeed) error {

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

	// RetentionInDays
	feed.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)

	// No error
	return nil
}

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

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

	// RetentionInDays
	destination.RetentionInDays = genruntime.ClonePointerToInt(feed.RetentionInDays)

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

	// No error
	return nil
}

// Initialize_From_ChangeFeed_STATUS populates our ChangeFeed from the provided source ChangeFeed_STATUS
func (feed *ChangeFeed) Initialize_From_ChangeFeed_STATUS(source *ChangeFeed_STATUS) error {

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

	// RetentionInDays
	feed.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)

	// No error
	return nil
}

// The blob service properties for change feed events.
type ChangeFeed_STATUS struct {
	// Enabled: Indicates whether change feed event logging is enabled for the Blob service.
	Enabled *bool `json:"enabled,omitempty"`

	// RetentionInDays: Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is
	// 146000 days (400 years). A null value indicates an infinite retention of the change feed.
	RetentionInDays *int `json:"retentionInDays,omitempty"`
}

var _ genruntime.FromARMConverter = &ChangeFeed_STATUS{}

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

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

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

	// Set property "RetentionInDays":
	if typedInput.RetentionInDays != nil {
		retentionInDays := *typedInput.RetentionInDays
		feed.RetentionInDays = &retentionInDays
	}

	// No error
	return nil
}

// AssignProperties_From_ChangeFeed_STATUS populates our ChangeFeed_STATUS from the provided source ChangeFeed_STATUS
func (feed *ChangeFeed_STATUS) AssignProperties_From_ChangeFeed_STATUS(source *storage.ChangeFeed_STATUS) error {

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

	// RetentionInDays
	feed.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)

	// No error
	return nil
}

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

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

	// RetentionInDays
	destination.RetentionInDays = genruntime.ClonePointerToInt(feed.RetentionInDays)

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

	// No error
	return nil
}

// Sets the CORS rules. You can include up to five CorsRule elements in the request.
type CorsRules struct {
	// CorsRules: The List of CORS rules. You can include up to five CorsRule elements in the request.
	CorsRules []CorsRule `json:"corsRules,omitempty"`
}

var _ genruntime.ARMTransformer = &CorsRules{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_CorsRules populates our CorsRules from the provided source CorsRules
func (rules *CorsRules) AssignProperties_From_CorsRules(source *storage.CorsRules) error {

	// CorsRules
	if source.CorsRules != nil {
		corsRuleList := make([]CorsRule, len(source.CorsRules))
		for corsRuleIndex, corsRuleItem := range source.CorsRules {
			var corsRule CorsRule
			err := corsRule.AssignProperties_From_CorsRule(&corsRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CorsRule() to populate field CorsRules")
			}
			corsRuleList[corsRuleIndex] = corsRule
		}
		rules.CorsRules = corsRuleList
	} else {
		rules.CorsRules = nil
	}

	// No error
	return nil
}

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

	// CorsRules
	if rules.CorsRules != nil {
		corsRuleList := make([]storage.CorsRule, len(rules.CorsRules))
		for corsRuleIndex, corsRuleItem := range rules.CorsRules {
			var corsRule storage.CorsRule
			err := corsRuleItem.AssignProperties_To_CorsRule(&corsRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CorsRule() to populate field CorsRules")
			}
			corsRuleList[corsRuleIndex] = corsRule
		}
		destination.CorsRules = corsRuleList
	} else {
		destination.CorsRules = nil
	}

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

	// No error
	return nil
}

// Initialize_From_CorsRules_STATUS populates our CorsRules from the provided source CorsRules_STATUS
func (rules *CorsRules) Initialize_From_CorsRules_STATUS(source *CorsRules_STATUS) error {

	// CorsRules
	if source.CorsRules != nil {
		corsRuleList := make([]CorsRule, len(source.CorsRules))
		for corsRuleIndex, corsRuleItem := range source.CorsRules {
			var corsRule CorsRule
			err := corsRule.Initialize_From_CorsRule_STATUS(&corsRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_CorsRule_STATUS() to populate field CorsRules")
			}
			corsRuleList[corsRuleIndex] = corsRule
		}
		rules.CorsRules = corsRuleList
	} else {
		rules.CorsRules = nil
	}

	// No error
	return nil
}

// Sets the CORS rules. You can include up to five CorsRule elements in the request.
type CorsRules_STATUS struct {
	// CorsRules: The List of CORS rules. You can include up to five CorsRule elements in the request.
	CorsRules []CorsRule_STATUS `json:"corsRules,omitempty"`
}

var _ genruntime.FromARMConverter = &CorsRules_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_CorsRules_STATUS populates our CorsRules_STATUS from the provided source CorsRules_STATUS
func (rules *CorsRules_STATUS) AssignProperties_From_CorsRules_STATUS(source *storage.CorsRules_STATUS) error {

	// CorsRules
	if source.CorsRules != nil {
		corsRuleList := make([]CorsRule_STATUS, len(source.CorsRules))
		for corsRuleIndex, corsRuleItem := range source.CorsRules {
			var corsRule CorsRule_STATUS
			err := corsRule.AssignProperties_From_CorsRule_STATUS(&corsRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CorsRule_STATUS() to populate field CorsRules")
			}
			corsRuleList[corsRuleIndex] = corsRule
		}
		rules.CorsRules = corsRuleList
	} else {
		rules.CorsRules = nil
	}

	// No error
	return nil
}

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

	// CorsRules
	if rules.CorsRules != nil {
		corsRuleList := make([]storage.CorsRule_STATUS, len(rules.CorsRules))
		for corsRuleIndex, corsRuleItem := range rules.CorsRules {
			var corsRule storage.CorsRule_STATUS
			err := corsRuleItem.AssignProperties_To_CorsRule_STATUS(&corsRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CorsRule_STATUS() to populate field CorsRules")
			}
			corsRuleList[corsRuleIndex] = corsRule
		}
		destination.CorsRules = corsRuleList
	} else {
		destination.CorsRules = nil
	}

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

	// No error
	return nil
}

// The service properties for soft delete.
type DeleteRetentionPolicy struct {
	// AllowPermanentDelete: This property when set to true allows deletion of the soft deleted blob versions and snapshots.
	// This property cannot be used blob restore policy. This property only applies to blob service and does not apply to
	// containers or file share.
	AllowPermanentDelete *bool `json:"allowPermanentDelete,omitempty"`

	// +kubebuilder:validation:Maximum=365
	// +kubebuilder:validation:Minimum=1
	// Days: Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and
	// the maximum value can be 365.
	Days *int `json:"days,omitempty"`

	// Enabled: Indicates whether DeleteRetentionPolicy is enabled.
	Enabled *bool `json:"enabled,omitempty"`
}

var _ genruntime.ARMTransformer = &DeleteRetentionPolicy{}

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

	// Set property "AllowPermanentDelete":
	if policy.AllowPermanentDelete != nil {
		allowPermanentDelete := *policy.AllowPermanentDelete
		result.AllowPermanentDelete = &allowPermanentDelete
	}

	// Set property "Days":
	if policy.Days != nil {
		days := *policy.Days
		result.Days = &days
	}

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

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

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

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

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

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

	// No error
	return nil
}

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

	// AllowPermanentDelete
	if source.AllowPermanentDelete != nil {
		allowPermanentDelete := *source.AllowPermanentDelete
		policy.AllowPermanentDelete = &allowPermanentDelete
	} else {
		policy.AllowPermanentDelete = nil
	}

	// Days
	policy.Days = genruntime.ClonePointerToInt(source.Days)

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

	// No error
	return nil
}

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

	// AllowPermanentDelete
	if policy.AllowPermanentDelete != nil {
		allowPermanentDelete := *policy.AllowPermanentDelete
		destination.AllowPermanentDelete = &allowPermanentDelete
	} else {
		destination.AllowPermanentDelete = nil
	}

	// Days
	destination.Days = genruntime.ClonePointerToInt(policy.Days)

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

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

	// No error
	return nil
}

// Initialize_From_DeleteRetentionPolicy_STATUS populates our DeleteRetentionPolicy from the provided source DeleteRetentionPolicy_STATUS
func (policy *DeleteRetentionPolicy) Initialize_From_DeleteRetentionPolicy_STATUS(source *DeleteRetentionPolicy_STATUS) error {

	// AllowPermanentDelete
	if source.AllowPermanentDelete != nil {
		allowPermanentDelete := *source.AllowPermanentDelete
		policy.AllowPermanentDelete = &allowPermanentDelete
	} else {
		policy.AllowPermanentDelete = nil
	}

	// Days
	policy.Days = genruntime.ClonePointerToInt(source.Days)

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

	// No error
	return nil
}

// The service properties for soft delete.
type DeleteRetentionPolicy_STATUS struct {
	// AllowPermanentDelete: This property when set to true allows deletion of the soft deleted blob versions and snapshots.
	// This property cannot be used blob restore policy. This property only applies to blob service and does not apply to
	// containers or file share.
	AllowPermanentDelete *bool `json:"allowPermanentDelete,omitempty"`

	// Days: Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and
	// the maximum value can be 365.
	Days *int `json:"days,omitempty"`

	// Enabled: Indicates whether DeleteRetentionPolicy is enabled.
	Enabled *bool `json:"enabled,omitempty"`
}

var _ genruntime.FromARMConverter = &DeleteRetentionPolicy_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

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

	// AllowPermanentDelete
	if source.AllowPermanentDelete != nil {
		allowPermanentDelete := *source.AllowPermanentDelete
		policy.AllowPermanentDelete = &allowPermanentDelete
	} else {
		policy.AllowPermanentDelete = nil
	}

	// Days
	policy.Days = genruntime.ClonePointerToInt(source.Days)

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

	// No error
	return nil
}

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

	// AllowPermanentDelete
	if policy.AllowPermanentDelete != nil {
		allowPermanentDelete := *policy.AllowPermanentDelete
		destination.AllowPermanentDelete = &allowPermanentDelete
	} else {
		destination.AllowPermanentDelete = nil
	}

	// Days
	destination.Days = genruntime.ClonePointerToInt(policy.Days)

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

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

	// No error
	return nil
}

// The blob service properties for Last access time based tracking policy.
type LastAccessTimeTrackingPolicy struct {
	// BlobType: An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently
	// read only
	BlobType []string `json:"blobType,omitempty"`

	// +kubebuilder:validation:Required
	// Enable: When set to true last access time based tracking is enabled.
	Enable *bool `json:"enable,omitempty"`

	// Name: Name of the policy. The valid value is AccessTimeTracking. This field is currently read only
	Name *LastAccessTimeTrackingPolicy_Name `json:"name,omitempty"`

	// TrackingGranularityInDays: The field specifies blob object tracking granularity in days, typically how often the blob
	// object should be tracked.This field is currently read only with value as 1
	TrackingGranularityInDays *int `json:"trackingGranularityInDays,omitempty"`
}

var _ genruntime.ARMTransformer = &LastAccessTimeTrackingPolicy{}

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

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

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

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

	// Set property "TrackingGranularityInDays":
	if policy.TrackingGranularityInDays != nil {
		trackingGranularityInDays := *policy.TrackingGranularityInDays
		result.TrackingGranularityInDays = &trackingGranularityInDays
	}
	return result, nil
}

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

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

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

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

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

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

	// No error
	return nil
}

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

	// BlobType
	policy.BlobType = genruntime.CloneSliceOfString(source.BlobType)

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

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

	// TrackingGranularityInDays
	policy.TrackingGranularityInDays = genruntime.ClonePointerToInt(source.TrackingGranularityInDays)

	// No error
	return nil
}

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

	// BlobType
	destination.BlobType = genruntime.CloneSliceOfString(policy.BlobType)

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

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

	// TrackingGranularityInDays
	destination.TrackingGranularityInDays = genruntime.ClonePointerToInt(policy.TrackingGranularityInDays)

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

	// No error
	return nil
}

// Initialize_From_LastAccessTimeTrackingPolicy_STATUS populates our LastAccessTimeTrackingPolicy from the provided source LastAccessTimeTrackingPolicy_STATUS
func (policy *LastAccessTimeTrackingPolicy) Initialize_From_LastAccessTimeTrackingPolicy_STATUS(source *LastAccessTimeTrackingPolicy_STATUS) error {

	// BlobType
	policy.BlobType = genruntime.CloneSliceOfString(source.BlobType)

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

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

	// TrackingGranularityInDays
	policy.TrackingGranularityInDays = genruntime.ClonePointerToInt(source.TrackingGranularityInDays)

	// No error
	return nil
}

// The blob service properties for Last access time based tracking policy.
type LastAccessTimeTrackingPolicy_STATUS struct {
	// BlobType: An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently
	// read only
	BlobType []string `json:"blobType,omitempty"`

	// Enable: When set to true last access time based tracking is enabled.
	Enable *bool `json:"enable,omitempty"`

	// Name: Name of the policy. The valid value is AccessTimeTracking. This field is currently read only
	Name *LastAccessTimeTrackingPolicy_Name_STATUS `json:"name,omitempty"`

	// TrackingGranularityInDays: The field specifies blob object tracking granularity in days, typically how often the blob
	// object should be tracked.This field is currently read only with value as 1
	TrackingGranularityInDays *int `json:"trackingGranularityInDays,omitempty"`
}

var _ genruntime.FromARMConverter = &LastAccessTimeTrackingPolicy_STATUS{}

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

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

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

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

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

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

	// No error
	return nil
}

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

	// BlobType
	policy.BlobType = genruntime.CloneSliceOfString(source.BlobType)

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

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

	// TrackingGranularityInDays
	policy.TrackingGranularityInDays = genruntime.ClonePointerToInt(source.TrackingGranularityInDays)

	// No error
	return nil
}

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

	// BlobType
	destination.BlobType = genruntime.CloneSliceOfString(policy.BlobType)

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

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

	// TrackingGranularityInDays
	destination.TrackingGranularityInDays = genruntime.ClonePointerToInt(policy.TrackingGranularityInDays)

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

	// No error
	return nil
}

// The blob service properties for blob restore policy
type RestorePolicyProperties struct {
	// +kubebuilder:validation:Maximum=365
	// +kubebuilder:validation:Minimum=1
	// Days: how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.
	Days *int `json:"days,omitempty"`

	// +kubebuilder:validation:Required
	// Enabled: Blob restore is enabled if set to true.
	Enabled *bool `json:"enabled,omitempty"`
}

var _ genruntime.ARMTransformer = &RestorePolicyProperties{}

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

	// Set property "Days":
	if properties.Days != nil {
		days := *properties.Days
		result.Days = &days
	}

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

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

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

	// Set property "Days":
	if typedInput.Days != nil {
		days := *typedInput.Days
		properties.Days = &days
	}

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

	// No error
	return nil
}

// AssignProperties_From_RestorePolicyProperties populates our RestorePolicyProperties from the provided source RestorePolicyProperties
func (properties *RestorePolicyProperties) AssignProperties_From_RestorePolicyProperties(source *storage.RestorePolicyProperties) error {

	// Days
	properties.Days = genruntime.ClonePointerToInt(source.Days)

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

	// No error
	return nil
}

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

	// Days
	destination.Days = genruntime.ClonePointerToInt(properties.Days)

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

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

	// No error
	return nil
}

// Initialize_From_RestorePolicyProperties_STATUS populates our RestorePolicyProperties from the provided source RestorePolicyProperties_STATUS
func (properties *RestorePolicyProperties) Initialize_From_RestorePolicyProperties_STATUS(source *RestorePolicyProperties_STATUS) error {

	// Days
	properties.Days = genruntime.ClonePointerToInt(source.Days)

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

	// No error
	return nil
}

// The blob service properties for blob restore policy
type RestorePolicyProperties_STATUS struct {
	// Days: how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.
	Days *int `json:"days,omitempty"`

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

	// LastEnabledTime: Deprecated in favor of minRestoreTime property.
	LastEnabledTime *string `json:"lastEnabledTime,omitempty"`

	// MinRestoreTime: Returns the minimum date and time that the restore can be started.
	MinRestoreTime *string `json:"minRestoreTime,omitempty"`
}

var _ genruntime.FromARMConverter = &RestorePolicyProperties_STATUS{}

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

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

	// Set property "Days":
	if typedInput.Days != nil {
		days := *typedInput.Days
		properties.Days = &days
	}

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

	// Set property "LastEnabledTime":
	if typedInput.LastEnabledTime != nil {
		lastEnabledTime := *typedInput.LastEnabledTime
		properties.LastEnabledTime = &lastEnabledTime
	}

	// Set property "MinRestoreTime":
	if typedInput.MinRestoreTime != nil {
		minRestoreTime := *typedInput.MinRestoreTime
		properties.MinRestoreTime = &minRestoreTime
	}

	// No error
	return nil
}

// AssignProperties_From_RestorePolicyProperties_STATUS populates our RestorePolicyProperties_STATUS from the provided source RestorePolicyProperties_STATUS
func (properties *RestorePolicyProperties_STATUS) AssignProperties_From_RestorePolicyProperties_STATUS(source *storage.RestorePolicyProperties_STATUS) error {

	// Days
	properties.Days = genruntime.ClonePointerToInt(source.Days)

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

	// LastEnabledTime
	properties.LastEnabledTime = genruntime.ClonePointerToString(source.LastEnabledTime)

	// MinRestoreTime
	properties.MinRestoreTime = genruntime.ClonePointerToString(source.MinRestoreTime)

	// No error
	return nil
}

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

	// Days
	destination.Days = genruntime.ClonePointerToInt(properties.Days)

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

	// LastEnabledTime
	destination.LastEnabledTime = genruntime.ClonePointerToString(properties.LastEnabledTime)

	// MinRestoreTime
	destination.MinRestoreTime = genruntime.ClonePointerToString(properties.MinRestoreTime)

	// 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 StorageAccountsBlobServiceOperatorSpec 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_StorageAccountsBlobServiceOperatorSpec populates our StorageAccountsBlobServiceOperatorSpec from the provided source StorageAccountsBlobServiceOperatorSpec
func (operator *StorageAccountsBlobServiceOperatorSpec) AssignProperties_From_StorageAccountsBlobServiceOperatorSpec(source *storage.StorageAccountsBlobServiceOperatorSpec) 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_StorageAccountsBlobServiceOperatorSpec populates the provided destination StorageAccountsBlobServiceOperatorSpec from our StorageAccountsBlobServiceOperatorSpec
func (operator *StorageAccountsBlobServiceOperatorSpec) AssignProperties_To_StorageAccountsBlobServiceOperatorSpec(destination *storage.StorageAccountsBlobServiceOperatorSpec) 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
}

// Specifies a CORS rule for the Blob service.
type CorsRule struct {
	// +kubebuilder:validation:Required
	// AllowedHeaders: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin
	// request.
	AllowedHeaders []string `json:"allowedHeaders,omitempty"`

	// +kubebuilder:validation:Required
	// AllowedMethods: Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the
	// origin.
	AllowedMethods []CorsRule_AllowedMethods `json:"allowedMethods,omitempty"`

	// +kubebuilder:validation:Required
	// AllowedOrigins: Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*"
	// to allow all domains
	AllowedOrigins []string `json:"allowedOrigins,omitempty"`

	// +kubebuilder:validation:Required
	// ExposedHeaders: Required if CorsRule element is present. A list of response headers to expose to CORS clients.
	ExposedHeaders []string `json:"exposedHeaders,omitempty"`

	// +kubebuilder:validation:Required
	// MaxAgeInSeconds: Required if CorsRule element is present. The number of seconds that the client/browser should cache a
	// preflight response.
	MaxAgeInSeconds *int `json:"maxAgeInSeconds,omitempty"`
}

var _ genruntime.ARMTransformer = &CorsRule{}

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

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

	// Set property "AllowedMethods":
	for _, item := range rule.AllowedMethods {
		var temp string
		temp = string(item)
		result.AllowedMethods = append(result.AllowedMethods, arm.CorsRule_AllowedMethods(temp))
	}

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

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

	// Set property "MaxAgeInSeconds":
	if rule.MaxAgeInSeconds != nil {
		maxAgeInSeconds := *rule.MaxAgeInSeconds
		result.MaxAgeInSeconds = &maxAgeInSeconds
	}
	return result, nil
}

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

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

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

	// Set property "AllowedMethods":
	for _, item := range typedInput.AllowedMethods {
		var temp string
		temp = string(item)
		rule.AllowedMethods = append(rule.AllowedMethods, CorsRule_AllowedMethods(temp))
	}

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

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

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

	// No error
	return nil
}

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

	// AllowedHeaders
	rule.AllowedHeaders = genruntime.CloneSliceOfString(source.AllowedHeaders)

	// AllowedMethods
	if source.AllowedMethods != nil {
		allowedMethodList := make([]CorsRule_AllowedMethods, len(source.AllowedMethods))
		for allowedMethodIndex, allowedMethodItem := range source.AllowedMethods {
			allowedMethodList[allowedMethodIndex] = genruntime.ToEnum(allowedMethodItem, corsRule_AllowedMethods_Values)
		}
		rule.AllowedMethods = allowedMethodList
	} else {
		rule.AllowedMethods = nil
	}

	// AllowedOrigins
	rule.AllowedOrigins = genruntime.CloneSliceOfString(source.AllowedOrigins)

	// ExposedHeaders
	rule.ExposedHeaders = genruntime.CloneSliceOfString(source.ExposedHeaders)

	// MaxAgeInSeconds
	rule.MaxAgeInSeconds = genruntime.ClonePointerToInt(source.MaxAgeInSeconds)

	// No error
	return nil
}

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

	// AllowedHeaders
	destination.AllowedHeaders = genruntime.CloneSliceOfString(rule.AllowedHeaders)

	// AllowedMethods
	if rule.AllowedMethods != nil {
		allowedMethodList := make([]string, len(rule.AllowedMethods))
		for allowedMethodIndex, allowedMethodItem := range rule.AllowedMethods {
			allowedMethodList[allowedMethodIndex] = string(allowedMethodItem)
		}
		destination.AllowedMethods = allowedMethodList
	} else {
		destination.AllowedMethods = nil
	}

	// AllowedOrigins
	destination.AllowedOrigins = genruntime.CloneSliceOfString(rule.AllowedOrigins)

	// ExposedHeaders
	destination.ExposedHeaders = genruntime.CloneSliceOfString(rule.ExposedHeaders)

	// MaxAgeInSeconds
	destination.MaxAgeInSeconds = genruntime.ClonePointerToInt(rule.MaxAgeInSeconds)

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

	// No error
	return nil
}

// Initialize_From_CorsRule_STATUS populates our CorsRule from the provided source CorsRule_STATUS
func (rule *CorsRule) Initialize_From_CorsRule_STATUS(source *CorsRule_STATUS) error {

	// AllowedHeaders
	rule.AllowedHeaders = genruntime.CloneSliceOfString(source.AllowedHeaders)

	// AllowedMethods
	if source.AllowedMethods != nil {
		allowedMethodList := make([]CorsRule_AllowedMethods, len(source.AllowedMethods))
		for allowedMethodIndex, allowedMethodItem := range source.AllowedMethods {
			allowedMethod := genruntime.ToEnum(string(allowedMethodItem), corsRule_AllowedMethods_Values)
			allowedMethodList[allowedMethodIndex] = allowedMethod
		}
		rule.AllowedMethods = allowedMethodList
	} else {
		rule.AllowedMethods = nil
	}

	// AllowedOrigins
	rule.AllowedOrigins = genruntime.CloneSliceOfString(source.AllowedOrigins)

	// ExposedHeaders
	rule.ExposedHeaders = genruntime.CloneSliceOfString(source.ExposedHeaders)

	// MaxAgeInSeconds
	rule.MaxAgeInSeconds = genruntime.ClonePointerToInt(source.MaxAgeInSeconds)

	// No error
	return nil
}

// Specifies a CORS rule for the Blob service.
type CorsRule_STATUS struct {
	// AllowedHeaders: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin
	// request.
	AllowedHeaders []string `json:"allowedHeaders,omitempty"`

	// AllowedMethods: Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the
	// origin.
	AllowedMethods []CorsRule_AllowedMethods_STATUS `json:"allowedMethods,omitempty"`

	// AllowedOrigins: Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*"
	// to allow all domains
	AllowedOrigins []string `json:"allowedOrigins,omitempty"`

	// ExposedHeaders: Required if CorsRule element is present. A list of response headers to expose to CORS clients.
	ExposedHeaders []string `json:"exposedHeaders,omitempty"`

	// MaxAgeInSeconds: Required if CorsRule element is present. The number of seconds that the client/browser should cache a
	// preflight response.
	MaxAgeInSeconds *int `json:"maxAgeInSeconds,omitempty"`
}

var _ genruntime.FromARMConverter = &CorsRule_STATUS{}

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

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

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

	// Set property "AllowedMethods":
	for _, item := range typedInput.AllowedMethods {
		var temp string
		temp = string(item)
		rule.AllowedMethods = append(rule.AllowedMethods, CorsRule_AllowedMethods_STATUS(temp))
	}

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

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

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

	// No error
	return nil
}

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

	// AllowedHeaders
	rule.AllowedHeaders = genruntime.CloneSliceOfString(source.AllowedHeaders)

	// AllowedMethods
	if source.AllowedMethods != nil {
		allowedMethodList := make([]CorsRule_AllowedMethods_STATUS, len(source.AllowedMethods))
		for allowedMethodIndex, allowedMethodItem := range source.AllowedMethods {
			allowedMethodList[allowedMethodIndex] = genruntime.ToEnum(allowedMethodItem, corsRule_AllowedMethods_STATUS_Values)
		}
		rule.AllowedMethods = allowedMethodList
	} else {
		rule.AllowedMethods = nil
	}

	// AllowedOrigins
	rule.AllowedOrigins = genruntime.CloneSliceOfString(source.AllowedOrigins)

	// ExposedHeaders
	rule.ExposedHeaders = genruntime.CloneSliceOfString(source.ExposedHeaders)

	// MaxAgeInSeconds
	rule.MaxAgeInSeconds = genruntime.ClonePointerToInt(source.MaxAgeInSeconds)

	// No error
	return nil
}

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

	// AllowedHeaders
	destination.AllowedHeaders = genruntime.CloneSliceOfString(rule.AllowedHeaders)

	// AllowedMethods
	if rule.AllowedMethods != nil {
		allowedMethodList := make([]string, len(rule.AllowedMethods))
		for allowedMethodIndex, allowedMethodItem := range rule.AllowedMethods {
			allowedMethodList[allowedMethodIndex] = string(allowedMethodItem)
		}
		destination.AllowedMethods = allowedMethodList
	} else {
		destination.AllowedMethods = nil
	}

	// AllowedOrigins
	destination.AllowedOrigins = genruntime.CloneSliceOfString(rule.AllowedOrigins)

	// ExposedHeaders
	destination.ExposedHeaders = genruntime.CloneSliceOfString(rule.ExposedHeaders)

	// MaxAgeInSeconds
	destination.MaxAgeInSeconds = genruntime.ClonePointerToInt(rule.MaxAgeInSeconds)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"AccessTimeTracking"}
type LastAccessTimeTrackingPolicy_Name string

const LastAccessTimeTrackingPolicy_Name_AccessTimeTracking = LastAccessTimeTrackingPolicy_Name("AccessTimeTracking")

// Mapping from string to LastAccessTimeTrackingPolicy_Name
var lastAccessTimeTrackingPolicy_Name_Values = map[string]LastAccessTimeTrackingPolicy_Name{
	"accesstimetracking": LastAccessTimeTrackingPolicy_Name_AccessTimeTracking,
}

type LastAccessTimeTrackingPolicy_Name_STATUS string

const LastAccessTimeTrackingPolicy_Name_STATUS_AccessTimeTracking = LastAccessTimeTrackingPolicy_Name_STATUS("AccessTimeTracking")

// Mapping from string to LastAccessTimeTrackingPolicy_Name_STATUS
var lastAccessTimeTrackingPolicy_Name_STATUS_Values = map[string]LastAccessTimeTrackingPolicy_Name_STATUS{
	"accesstimetracking": LastAccessTimeTrackingPolicy_Name_STATUS_AccessTimeTracking,
}

// +kubebuilder:validation:Enum={"CONNECT","DELETE","GET","HEAD","MERGE","OPTIONS","PATCH","POST","PUT","TRACE"}
type CorsRule_AllowedMethods string

const (
	CorsRule_AllowedMethods_CONNECT = CorsRule_AllowedMethods("CONNECT")
	CorsRule_AllowedMethods_DELETE  = CorsRule_AllowedMethods("DELETE")
	CorsRule_AllowedMethods_GET     = CorsRule_AllowedMethods("GET")
	CorsRule_AllowedMethods_HEAD    = CorsRule_AllowedMethods("HEAD")
	CorsRule_AllowedMethods_MERGE   = CorsRule_AllowedMethods("MERGE")
	CorsRule_AllowedMethods_OPTIONS = CorsRule_AllowedMethods("OPTIONS")
	CorsRule_AllowedMethods_PATCH   = CorsRule_AllowedMethods("PATCH")
	CorsRule_AllowedMethods_POST    = CorsRule_AllowedMethods("POST")
	CorsRule_AllowedMethods_PUT     = CorsRule_AllowedMethods("PUT")
	CorsRule_AllowedMethods_TRACE   = CorsRule_AllowedMethods("TRACE")
)

// Mapping from string to CorsRule_AllowedMethods
var corsRule_AllowedMethods_Values = map[string]CorsRule_AllowedMethods{
	"connect": CorsRule_AllowedMethods_CONNECT,
	"delete":  CorsRule_AllowedMethods_DELETE,
	"get":     CorsRule_AllowedMethods_GET,
	"head":    CorsRule_AllowedMethods_HEAD,
	"merge":   CorsRule_AllowedMethods_MERGE,
	"options": CorsRule_AllowedMethods_OPTIONS,
	"patch":   CorsRule_AllowedMethods_PATCH,
	"post":    CorsRule_AllowedMethods_POST,
	"put":     CorsRule_AllowedMethods_PUT,
	"trace":   CorsRule_AllowedMethods_TRACE,
}

type CorsRule_AllowedMethods_STATUS string

const (
	CorsRule_AllowedMethods_STATUS_CONNECT = CorsRule_AllowedMethods_STATUS("CONNECT")
	CorsRule_AllowedMethods_STATUS_DELETE  = CorsRule_AllowedMethods_STATUS("DELETE")
	CorsRule_AllowedMethods_STATUS_GET     = CorsRule_AllowedMethods_STATUS("GET")
	CorsRule_AllowedMethods_STATUS_HEAD    = CorsRule_AllowedMethods_STATUS("HEAD")
	CorsRule_AllowedMethods_STATUS_MERGE   = CorsRule_AllowedMethods_STATUS("MERGE")
	CorsRule_AllowedMethods_STATUS_OPTIONS = CorsRule_AllowedMethods_STATUS("OPTIONS")
	CorsRule_AllowedMethods_STATUS_PATCH   = CorsRule_AllowedMethods_STATUS("PATCH")
	CorsRule_AllowedMethods_STATUS_POST    = CorsRule_AllowedMethods_STATUS("POST")
	CorsRule_AllowedMethods_STATUS_PUT     = CorsRule_AllowedMethods_STATUS("PUT")
	CorsRule_AllowedMethods_STATUS_TRACE   = CorsRule_AllowedMethods_STATUS("TRACE")
)

// Mapping from string to CorsRule_AllowedMethods_STATUS
var corsRule_AllowedMethods_STATUS_Values = map[string]CorsRule_AllowedMethods_STATUS{
	"connect": CorsRule_AllowedMethods_STATUS_CONNECT,
	"delete":  CorsRule_AllowedMethods_STATUS_DELETE,
	"get":     CorsRule_AllowedMethods_STATUS_GET,
	"head":    CorsRule_AllowedMethods_STATUS_HEAD,
	"merge":   CorsRule_AllowedMethods_STATUS_MERGE,
	"options": CorsRule_AllowedMethods_STATUS_OPTIONS,
	"patch":   CorsRule_AllowedMethods_STATUS_PATCH,
	"post":    CorsRule_AllowedMethods_STATUS_POST,
	"put":     CorsRule_AllowedMethods_STATUS_PUT,
	"trace":   CorsRule_AllowedMethods_STATUS_TRACE,
}

func init() {
	SchemeBuilder.Register(&StorageAccountsBlobService{}, &StorageAccountsBlobServiceList{})
}
