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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/storage/v1api20220901/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/storage/v1api20220901/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/2022-09-01/file.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}
type StorageAccountsFileServicesShare struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              StorageAccountsFileServicesShare_Spec   `json:"spec,omitempty"`
	Status            StorageAccountsFileServicesShare_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &StorageAccountsFileServicesShare{}

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

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

var _ conversion.Convertible = &StorageAccountsFileServicesShare{}

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

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

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

	return nil
}

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

	return nil
}

var _ configmaps.Exporter = &StorageAccountsFileServicesShare{}

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

var _ secrets.Exporter = &StorageAccountsFileServicesShare{}

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

var _ genruntime.KubernetesResource = &StorageAccountsFileServicesShare{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Storage/storageAccounts/fileServices/shares"
func (share *StorageAccountsFileServicesShare) GetType() string {
	return "Microsoft.Storage/storageAccounts/fileServices/shares"
}

// NewEmptyStatus returns a new empty (blank) status
func (share *StorageAccountsFileServicesShare) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &StorageAccountsFileServicesShare_STATUS{}
}

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

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

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

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

	share.Status = st
	return nil
}

// AssignProperties_From_StorageAccountsFileServicesShare populates our StorageAccountsFileServicesShare from the provided source StorageAccountsFileServicesShare
func (share *StorageAccountsFileServicesShare) AssignProperties_From_StorageAccountsFileServicesShare(source *storage.StorageAccountsFileServicesShare) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_StorageAccountsFileServicesShare populates the provided destination StorageAccountsFileServicesShare from our StorageAccountsFileServicesShare
func (share *StorageAccountsFileServicesShare) AssignProperties_To_StorageAccountsFileServicesShare(destination *storage.StorageAccountsFileServicesShare) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /storage/resource-manager/Microsoft.Storage/stable/2022-09-01/file.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}
type StorageAccountsFileServicesShareList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []StorageAccountsFileServicesShare `json:"items"`
}

type StorageAccountsFileServicesShare_Spec struct {
	// AccessTier: Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and
	// Cool. FileStorage account can choose Premium.
	AccessTier *FileShareProperties_AccessTier `json:"accessTier,omitempty"`

	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:MinLength=3
	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName string `json:"azureName,omitempty"`

	// EnabledProtocols: The authentication protocol that is used for the file share. Can only be specified when creating a
	// share.
	EnabledProtocols *FileShareProperties_EnabledProtocols `json:"enabledProtocols,omitempty"`

	// Metadata: A name-value pair to associate with the share as metadata.
	Metadata map[string]string `json:"metadata,omitempty"`

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

	// RootSquash: The property is for NFS share only. The default is NoRootSquash.
	RootSquash *FileShareProperties_RootSquash `json:"rootSquash,omitempty"`

	// +kubebuilder:validation:Maximum=102400
	// +kubebuilder:validation:Minimum=1
	// ShareQuota: The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120).
	// For Large File Shares, the maximum size is 102400.
	ShareQuota *int `json:"shareQuota,omitempty"`

	// SignedIdentifiers: List of stored access policies specified on the share.
	SignedIdentifiers []SignedIdentifier `json:"signedIdentifiers,omitempty"`
}

var _ genruntime.ARMTransformer = &StorageAccountsFileServicesShare_Spec{}

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

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

	// Set property "Properties":
	if share.AccessTier != nil ||
		share.EnabledProtocols != nil ||
		share.Metadata != nil ||
		share.RootSquash != nil ||
		share.ShareQuota != nil ||
		share.SignedIdentifiers != nil {
		result.Properties = &arm.FileShareProperties{}
	}
	if share.AccessTier != nil {
		var temp string
		temp = string(*share.AccessTier)
		accessTier := arm.FileShareProperties_AccessTier(temp)
		result.Properties.AccessTier = &accessTier
	}
	if share.EnabledProtocols != nil {
		var temp string
		temp = string(*share.EnabledProtocols)
		enabledProtocols := arm.FileShareProperties_EnabledProtocols(temp)
		result.Properties.EnabledProtocols = &enabledProtocols
	}
	if share.Metadata != nil {
		result.Properties.Metadata = make(map[string]string, len(share.Metadata))
		for key, value := range share.Metadata {
			result.Properties.Metadata[key] = value
		}
	}
	if share.RootSquash != nil {
		var temp string
		temp = string(*share.RootSquash)
		rootSquash := arm.FileShareProperties_RootSquash(temp)
		result.Properties.RootSquash = &rootSquash
	}
	if share.ShareQuota != nil {
		shareQuota := *share.ShareQuota
		result.Properties.ShareQuota = &shareQuota
	}
	for _, item := range share.SignedIdentifiers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.SignedIdentifiers = append(result.Properties.SignedIdentifiers, *item_ARM.(*arm.SignedIdentifier))
	}
	return result, nil
}

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

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

	// Set property "AccessTier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AccessTier != nil {
			var temp string
			temp = string(*typedInput.Properties.AccessTier)
			accessTier := FileShareProperties_AccessTier(temp)
			share.AccessTier = &accessTier
		}
	}

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

	// Set property "EnabledProtocols":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnabledProtocols != nil {
			var temp string
			temp = string(*typedInput.Properties.EnabledProtocols)
			enabledProtocols := FileShareProperties_EnabledProtocols(temp)
			share.EnabledProtocols = &enabledProtocols
		}
	}

	// Set property "Metadata":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Metadata != nil {
			share.Metadata = make(map[string]string, len(typedInput.Properties.Metadata))
			for key, value := range typedInput.Properties.Metadata {
				share.Metadata[key] = value
			}
		}
	}

	// no assignment for property "OperatorSpec"

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

	// Set property "RootSquash":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RootSquash != nil {
			var temp string
			temp = string(*typedInput.Properties.RootSquash)
			rootSquash := FileShareProperties_RootSquash(temp)
			share.RootSquash = &rootSquash
		}
	}

	// Set property "ShareQuota":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ShareQuota != nil {
			shareQuota := *typedInput.Properties.ShareQuota
			share.ShareQuota = &shareQuota
		}
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &StorageAccountsFileServicesShare_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsFileServicesShare_Spec{}
	err := share.AssignProperties_To_StorageAccountsFileServicesShare_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_StorageAccountsFileServicesShare_Spec populates our StorageAccountsFileServicesShare_Spec from the provided source StorageAccountsFileServicesShare_Spec
func (share *StorageAccountsFileServicesShare_Spec) AssignProperties_From_StorageAccountsFileServicesShare_Spec(source *storage.StorageAccountsFileServicesShare_Spec) error {

	// AccessTier
	if source.AccessTier != nil {
		accessTier := *source.AccessTier
		accessTierTemp := genruntime.ToEnum(accessTier, fileShareProperties_AccessTier_Values)
		share.AccessTier = &accessTierTemp
	} else {
		share.AccessTier = nil
	}

	// AzureName
	share.AzureName = source.AzureName

	// EnabledProtocols
	if source.EnabledProtocols != nil {
		enabledProtocol := *source.EnabledProtocols
		enabledProtocolTemp := genruntime.ToEnum(enabledProtocol, fileShareProperties_EnabledProtocols_Values)
		share.EnabledProtocols = &enabledProtocolTemp
	} else {
		share.EnabledProtocols = nil
	}

	// Metadata
	share.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)

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

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

	// RootSquash
	if source.RootSquash != nil {
		rootSquash := *source.RootSquash
		rootSquashTemp := genruntime.ToEnum(rootSquash, fileShareProperties_RootSquash_Values)
		share.RootSquash = &rootSquashTemp
	} else {
		share.RootSquash = nil
	}

	// ShareQuota
	share.ShareQuota = genruntime.ClonePointerToInt(source.ShareQuota)

	// SignedIdentifiers
	if source.SignedIdentifiers != nil {
		signedIdentifierList := make([]SignedIdentifier, len(source.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
			var signedIdentifier SignedIdentifier
			err := signedIdentifier.AssignProperties_From_SignedIdentifier(&signedIdentifierItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SignedIdentifier() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		share.SignedIdentifiers = signedIdentifierList
	} else {
		share.SignedIdentifiers = nil
	}

	// No error
	return nil
}

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

	// AccessTier
	if share.AccessTier != nil {
		accessTier := string(*share.AccessTier)
		destination.AccessTier = &accessTier
	} else {
		destination.AccessTier = nil
	}

	// AzureName
	destination.AzureName = share.AzureName

	// EnabledProtocols
	if share.EnabledProtocols != nil {
		enabledProtocol := string(*share.EnabledProtocols)
		destination.EnabledProtocols = &enabledProtocol
	} else {
		destination.EnabledProtocols = nil
	}

	// Metadata
	destination.Metadata = genruntime.CloneMapOfStringToString(share.Metadata)

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

	// OriginalVersion
	destination.OriginalVersion = share.OriginalVersion()

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

	// RootSquash
	if share.RootSquash != nil {
		rootSquash := string(*share.RootSquash)
		destination.RootSquash = &rootSquash
	} else {
		destination.RootSquash = nil
	}

	// ShareQuota
	destination.ShareQuota = genruntime.ClonePointerToInt(share.ShareQuota)

	// SignedIdentifiers
	if share.SignedIdentifiers != nil {
		signedIdentifierList := make([]storage.SignedIdentifier, len(share.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range share.SignedIdentifiers {
			var signedIdentifier storage.SignedIdentifier
			err := signedIdentifierItem.AssignProperties_To_SignedIdentifier(&signedIdentifier)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SignedIdentifier() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		destination.SignedIdentifiers = signedIdentifierList
	} else {
		destination.SignedIdentifiers = nil
	}

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

	// No error
	return nil
}

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

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

type StorageAccountsFileServicesShare_STATUS struct {
	// AccessTier: Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and
	// Cool. FileStorage account can choose Premium.
	AccessTier *FileShareProperties_AccessTier_STATUS `json:"accessTier,omitempty"`

	// AccessTierChangeTime: Indicates the last modification time for share access tier.
	AccessTierChangeTime *string `json:"accessTierChangeTime,omitempty"`

	// AccessTierStatus: Indicates if there is a pending transition for access tier.
	AccessTierStatus *string `json:"accessTierStatus,omitempty"`

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

	// Deleted: Indicates whether the share was deleted.
	Deleted *bool `json:"deleted,omitempty"`

	// DeletedTime: The deleted time if the share was deleted.
	DeletedTime *string `json:"deletedTime,omitempty"`

	// EnabledProtocols: The authentication protocol that is used for the file share. Can only be specified when creating a
	// share.
	EnabledProtocols *FileShareProperties_EnabledProtocols_STATUS `json:"enabledProtocols,omitempty"`

	// Etag: Resource Etag.
	Etag *string `json:"etag,omitempty"`

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

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

	// LeaseDuration: Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased.
	LeaseDuration *FileShareProperties_LeaseDuration_STATUS `json:"leaseDuration,omitempty"`

	// LeaseState: Lease state of the share.
	LeaseState *FileShareProperties_LeaseState_STATUS `json:"leaseState,omitempty"`

	// LeaseStatus: The lease status of the share.
	LeaseStatus *FileShareProperties_LeaseStatus_STATUS `json:"leaseStatus,omitempty"`

	// Metadata: A name-value pair to associate with the share as metadata.
	Metadata map[string]string `json:"metadata,omitempty"`

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

	// RemainingRetentionDays: Remaining retention days for share that was soft deleted.
	RemainingRetentionDays *int `json:"remainingRetentionDays,omitempty"`

	// RootSquash: The property is for NFS share only. The default is NoRootSquash.
	RootSquash *FileShareProperties_RootSquash_STATUS `json:"rootSquash,omitempty"`

	// ShareQuota: The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120).
	// For Large File Shares, the maximum size is 102400.
	ShareQuota *int `json:"shareQuota,omitempty"`

	// ShareUsageBytes: The approximate size of the data stored on the share. Note that this value may not include all recently
	// created or recently resized files.
	ShareUsageBytes *int `json:"shareUsageBytes,omitempty"`

	// SignedIdentifiers: List of stored access policies specified on the share.
	SignedIdentifiers []SignedIdentifier_STATUS `json:"signedIdentifiers,omitempty"`

	// SnapshotTime: Creation time of share snapshot returned in the response of list shares with expand param "snapshots".
	SnapshotTime *string `json:"snapshotTime,omitempty"`

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

	// Version: The version of the share.
	Version *string `json:"version,omitempty"`
}

var _ genruntime.ConvertibleStatus = &StorageAccountsFileServicesShare_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsFileServicesShare_STATUS{}
	err := share.AssignProperties_To_StorageAccountsFileServicesShare_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 = &StorageAccountsFileServicesShare_STATUS{}

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

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

	// Set property "AccessTier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AccessTier != nil {
			var temp string
			temp = string(*typedInput.Properties.AccessTier)
			accessTier := FileShareProperties_AccessTier_STATUS(temp)
			share.AccessTier = &accessTier
		}
	}

	// Set property "AccessTierChangeTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AccessTierChangeTime != nil {
			accessTierChangeTime := *typedInput.Properties.AccessTierChangeTime
			share.AccessTierChangeTime = &accessTierChangeTime
		}
	}

	// Set property "AccessTierStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AccessTierStatus != nil {
			accessTierStatus := *typedInput.Properties.AccessTierStatus
			share.AccessTierStatus = &accessTierStatus
		}
	}

	// no assignment for property "Conditions"

	// Set property "Deleted":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Deleted != nil {
			deleted := *typedInput.Properties.Deleted
			share.Deleted = &deleted
		}
	}

	// Set property "DeletedTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeletedTime != nil {
			deletedTime := *typedInput.Properties.DeletedTime
			share.DeletedTime = &deletedTime
		}
	}

	// Set property "EnabledProtocols":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnabledProtocols != nil {
			var temp string
			temp = string(*typedInput.Properties.EnabledProtocols)
			enabledProtocols := FileShareProperties_EnabledProtocols_STATUS(temp)
			share.EnabledProtocols = &enabledProtocols
		}
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		share.Etag = &etag
	}

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

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

	// Set property "LeaseDuration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LeaseDuration != nil {
			var temp string
			temp = string(*typedInput.Properties.LeaseDuration)
			leaseDuration := FileShareProperties_LeaseDuration_STATUS(temp)
			share.LeaseDuration = &leaseDuration
		}
	}

	// Set property "LeaseState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LeaseState != nil {
			var temp string
			temp = string(*typedInput.Properties.LeaseState)
			leaseState := FileShareProperties_LeaseState_STATUS(temp)
			share.LeaseState = &leaseState
		}
	}

	// Set property "LeaseStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LeaseStatus != nil {
			var temp string
			temp = string(*typedInput.Properties.LeaseStatus)
			leaseStatus := FileShareProperties_LeaseStatus_STATUS(temp)
			share.LeaseStatus = &leaseStatus
		}
	}

	// Set property "Metadata":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Metadata != nil {
			share.Metadata = make(map[string]string, len(typedInput.Properties.Metadata))
			for key, value := range typedInput.Properties.Metadata {
				share.Metadata[key] = value
			}
		}
	}

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

	// Set property "RemainingRetentionDays":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RemainingRetentionDays != nil {
			remainingRetentionDays := *typedInput.Properties.RemainingRetentionDays
			share.RemainingRetentionDays = &remainingRetentionDays
		}
	}

	// Set property "RootSquash":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RootSquash != nil {
			var temp string
			temp = string(*typedInput.Properties.RootSquash)
			rootSquash := FileShareProperties_RootSquash_STATUS(temp)
			share.RootSquash = &rootSquash
		}
	}

	// Set property "ShareQuota":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ShareQuota != nil {
			shareQuota := *typedInput.Properties.ShareQuota
			share.ShareQuota = &shareQuota
		}
	}

	// Set property "ShareUsageBytes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ShareUsageBytes != nil {
			shareUsageBytes := *typedInput.Properties.ShareUsageBytes
			share.ShareUsageBytes = &shareUsageBytes
		}
	}

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

	// Set property "SnapshotTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SnapshotTime != nil {
			snapshotTime := *typedInput.Properties.SnapshotTime
			share.SnapshotTime = &snapshotTime
		}
	}

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

	// Set property "Version":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Version != nil {
			version := *typedInput.Properties.Version
			share.Version = &version
		}
	}

	// No error
	return nil
}

// AssignProperties_From_StorageAccountsFileServicesShare_STATUS populates our StorageAccountsFileServicesShare_STATUS from the provided source StorageAccountsFileServicesShare_STATUS
func (share *StorageAccountsFileServicesShare_STATUS) AssignProperties_From_StorageAccountsFileServicesShare_STATUS(source *storage.StorageAccountsFileServicesShare_STATUS) error {

	// AccessTier
	if source.AccessTier != nil {
		accessTier := *source.AccessTier
		accessTierTemp := genruntime.ToEnum(accessTier, fileShareProperties_AccessTier_STATUS_Values)
		share.AccessTier = &accessTierTemp
	} else {
		share.AccessTier = nil
	}

	// AccessTierChangeTime
	share.AccessTierChangeTime = genruntime.ClonePointerToString(source.AccessTierChangeTime)

	// AccessTierStatus
	share.AccessTierStatus = genruntime.ClonePointerToString(source.AccessTierStatus)

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

	// Deleted
	if source.Deleted != nil {
		deleted := *source.Deleted
		share.Deleted = &deleted
	} else {
		share.Deleted = nil
	}

	// DeletedTime
	share.DeletedTime = genruntime.ClonePointerToString(source.DeletedTime)

	// EnabledProtocols
	if source.EnabledProtocols != nil {
		enabledProtocol := *source.EnabledProtocols
		enabledProtocolTemp := genruntime.ToEnum(enabledProtocol, fileShareProperties_EnabledProtocols_STATUS_Values)
		share.EnabledProtocols = &enabledProtocolTemp
	} else {
		share.EnabledProtocols = nil
	}

	// Etag
	share.Etag = genruntime.ClonePointerToString(source.Etag)

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

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

	// LeaseDuration
	if source.LeaseDuration != nil {
		leaseDuration := *source.LeaseDuration
		leaseDurationTemp := genruntime.ToEnum(leaseDuration, fileShareProperties_LeaseDuration_STATUS_Values)
		share.LeaseDuration = &leaseDurationTemp
	} else {
		share.LeaseDuration = nil
	}

	// LeaseState
	if source.LeaseState != nil {
		leaseState := *source.LeaseState
		leaseStateTemp := genruntime.ToEnum(leaseState, fileShareProperties_LeaseState_STATUS_Values)
		share.LeaseState = &leaseStateTemp
	} else {
		share.LeaseState = nil
	}

	// LeaseStatus
	if source.LeaseStatus != nil {
		leaseStatus := *source.LeaseStatus
		leaseStatusTemp := genruntime.ToEnum(leaseStatus, fileShareProperties_LeaseStatus_STATUS_Values)
		share.LeaseStatus = &leaseStatusTemp
	} else {
		share.LeaseStatus = nil
	}

	// Metadata
	share.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)

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

	// RemainingRetentionDays
	share.RemainingRetentionDays = genruntime.ClonePointerToInt(source.RemainingRetentionDays)

	// RootSquash
	if source.RootSquash != nil {
		rootSquash := *source.RootSquash
		rootSquashTemp := genruntime.ToEnum(rootSquash, fileShareProperties_RootSquash_STATUS_Values)
		share.RootSquash = &rootSquashTemp
	} else {
		share.RootSquash = nil
	}

	// ShareQuota
	share.ShareQuota = genruntime.ClonePointerToInt(source.ShareQuota)

	// ShareUsageBytes
	share.ShareUsageBytes = genruntime.ClonePointerToInt(source.ShareUsageBytes)

	// SignedIdentifiers
	if source.SignedIdentifiers != nil {
		signedIdentifierList := make([]SignedIdentifier_STATUS, len(source.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
			var signedIdentifier SignedIdentifier_STATUS
			err := signedIdentifier.AssignProperties_From_SignedIdentifier_STATUS(&signedIdentifierItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SignedIdentifier_STATUS() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		share.SignedIdentifiers = signedIdentifierList
	} else {
		share.SignedIdentifiers = nil
	}

	// SnapshotTime
	share.SnapshotTime = genruntime.ClonePointerToString(source.SnapshotTime)

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

	// Version
	share.Version = genruntime.ClonePointerToString(source.Version)

	// No error
	return nil
}

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

	// AccessTier
	if share.AccessTier != nil {
		accessTier := string(*share.AccessTier)
		destination.AccessTier = &accessTier
	} else {
		destination.AccessTier = nil
	}

	// AccessTierChangeTime
	destination.AccessTierChangeTime = genruntime.ClonePointerToString(share.AccessTierChangeTime)

	// AccessTierStatus
	destination.AccessTierStatus = genruntime.ClonePointerToString(share.AccessTierStatus)

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

	// Deleted
	if share.Deleted != nil {
		deleted := *share.Deleted
		destination.Deleted = &deleted
	} else {
		destination.Deleted = nil
	}

	// DeletedTime
	destination.DeletedTime = genruntime.ClonePointerToString(share.DeletedTime)

	// EnabledProtocols
	if share.EnabledProtocols != nil {
		enabledProtocol := string(*share.EnabledProtocols)
		destination.EnabledProtocols = &enabledProtocol
	} else {
		destination.EnabledProtocols = nil
	}

	// Etag
	destination.Etag = genruntime.ClonePointerToString(share.Etag)

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

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

	// LeaseDuration
	if share.LeaseDuration != nil {
		leaseDuration := string(*share.LeaseDuration)
		destination.LeaseDuration = &leaseDuration
	} else {
		destination.LeaseDuration = nil
	}

	// LeaseState
	if share.LeaseState != nil {
		leaseState := string(*share.LeaseState)
		destination.LeaseState = &leaseState
	} else {
		destination.LeaseState = nil
	}

	// LeaseStatus
	if share.LeaseStatus != nil {
		leaseStatus := string(*share.LeaseStatus)
		destination.LeaseStatus = &leaseStatus
	} else {
		destination.LeaseStatus = nil
	}

	// Metadata
	destination.Metadata = genruntime.CloneMapOfStringToString(share.Metadata)

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

	// RemainingRetentionDays
	destination.RemainingRetentionDays = genruntime.ClonePointerToInt(share.RemainingRetentionDays)

	// RootSquash
	if share.RootSquash != nil {
		rootSquash := string(*share.RootSquash)
		destination.RootSquash = &rootSquash
	} else {
		destination.RootSquash = nil
	}

	// ShareQuota
	destination.ShareQuota = genruntime.ClonePointerToInt(share.ShareQuota)

	// ShareUsageBytes
	destination.ShareUsageBytes = genruntime.ClonePointerToInt(share.ShareUsageBytes)

	// SignedIdentifiers
	if share.SignedIdentifiers != nil {
		signedIdentifierList := make([]storage.SignedIdentifier_STATUS, len(share.SignedIdentifiers))
		for signedIdentifierIndex, signedIdentifierItem := range share.SignedIdentifiers {
			var signedIdentifier storage.SignedIdentifier_STATUS
			err := signedIdentifierItem.AssignProperties_To_SignedIdentifier_STATUS(&signedIdentifier)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SignedIdentifier_STATUS() to populate field SignedIdentifiers")
			}
			signedIdentifierList[signedIdentifierIndex] = signedIdentifier
		}
		destination.SignedIdentifiers = signedIdentifierList
	} else {
		destination.SignedIdentifiers = nil
	}

	// SnapshotTime
	destination.SnapshotTime = genruntime.ClonePointerToString(share.SnapshotTime)

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

	// Version
	destination.Version = genruntime.ClonePointerToString(share.Version)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Cool","Hot","Premium","TransactionOptimized"}
type FileShareProperties_AccessTier string

const (
	FileShareProperties_AccessTier_Cool                 = FileShareProperties_AccessTier("Cool")
	FileShareProperties_AccessTier_Hot                  = FileShareProperties_AccessTier("Hot")
	FileShareProperties_AccessTier_Premium              = FileShareProperties_AccessTier("Premium")
	FileShareProperties_AccessTier_TransactionOptimized = FileShareProperties_AccessTier("TransactionOptimized")
)

// Mapping from string to FileShareProperties_AccessTier
var fileShareProperties_AccessTier_Values = map[string]FileShareProperties_AccessTier{
	"cool":                 FileShareProperties_AccessTier_Cool,
	"hot":                  FileShareProperties_AccessTier_Hot,
	"premium":              FileShareProperties_AccessTier_Premium,
	"transactionoptimized": FileShareProperties_AccessTier_TransactionOptimized,
}

type FileShareProperties_AccessTier_STATUS string

const (
	FileShareProperties_AccessTier_STATUS_Cool                 = FileShareProperties_AccessTier_STATUS("Cool")
	FileShareProperties_AccessTier_STATUS_Hot                  = FileShareProperties_AccessTier_STATUS("Hot")
	FileShareProperties_AccessTier_STATUS_Premium              = FileShareProperties_AccessTier_STATUS("Premium")
	FileShareProperties_AccessTier_STATUS_TransactionOptimized = FileShareProperties_AccessTier_STATUS("TransactionOptimized")
)

// Mapping from string to FileShareProperties_AccessTier_STATUS
var fileShareProperties_AccessTier_STATUS_Values = map[string]FileShareProperties_AccessTier_STATUS{
	"cool":                 FileShareProperties_AccessTier_STATUS_Cool,
	"hot":                  FileShareProperties_AccessTier_STATUS_Hot,
	"premium":              FileShareProperties_AccessTier_STATUS_Premium,
	"transactionoptimized": FileShareProperties_AccessTier_STATUS_TransactionOptimized,
}

// +kubebuilder:validation:Enum={"NFS","SMB"}
type FileShareProperties_EnabledProtocols string

const (
	FileShareProperties_EnabledProtocols_NFS = FileShareProperties_EnabledProtocols("NFS")
	FileShareProperties_EnabledProtocols_SMB = FileShareProperties_EnabledProtocols("SMB")
)

// Mapping from string to FileShareProperties_EnabledProtocols
var fileShareProperties_EnabledProtocols_Values = map[string]FileShareProperties_EnabledProtocols{
	"nfs": FileShareProperties_EnabledProtocols_NFS,
	"smb": FileShareProperties_EnabledProtocols_SMB,
}

type FileShareProperties_EnabledProtocols_STATUS string

const (
	FileShareProperties_EnabledProtocols_STATUS_NFS = FileShareProperties_EnabledProtocols_STATUS("NFS")
	FileShareProperties_EnabledProtocols_STATUS_SMB = FileShareProperties_EnabledProtocols_STATUS("SMB")
)

// Mapping from string to FileShareProperties_EnabledProtocols_STATUS
var fileShareProperties_EnabledProtocols_STATUS_Values = map[string]FileShareProperties_EnabledProtocols_STATUS{
	"nfs": FileShareProperties_EnabledProtocols_STATUS_NFS,
	"smb": FileShareProperties_EnabledProtocols_STATUS_SMB,
}

type FileShareProperties_LeaseDuration_STATUS string

const (
	FileShareProperties_LeaseDuration_STATUS_Fixed    = FileShareProperties_LeaseDuration_STATUS("Fixed")
	FileShareProperties_LeaseDuration_STATUS_Infinite = FileShareProperties_LeaseDuration_STATUS("Infinite")
)

// Mapping from string to FileShareProperties_LeaseDuration_STATUS
var fileShareProperties_LeaseDuration_STATUS_Values = map[string]FileShareProperties_LeaseDuration_STATUS{
	"fixed":    FileShareProperties_LeaseDuration_STATUS_Fixed,
	"infinite": FileShareProperties_LeaseDuration_STATUS_Infinite,
}

type FileShareProperties_LeaseState_STATUS string

const (
	FileShareProperties_LeaseState_STATUS_Available = FileShareProperties_LeaseState_STATUS("Available")
	FileShareProperties_LeaseState_STATUS_Breaking  = FileShareProperties_LeaseState_STATUS("Breaking")
	FileShareProperties_LeaseState_STATUS_Broken    = FileShareProperties_LeaseState_STATUS("Broken")
	FileShareProperties_LeaseState_STATUS_Expired   = FileShareProperties_LeaseState_STATUS("Expired")
	FileShareProperties_LeaseState_STATUS_Leased    = FileShareProperties_LeaseState_STATUS("Leased")
)

// Mapping from string to FileShareProperties_LeaseState_STATUS
var fileShareProperties_LeaseState_STATUS_Values = map[string]FileShareProperties_LeaseState_STATUS{
	"available": FileShareProperties_LeaseState_STATUS_Available,
	"breaking":  FileShareProperties_LeaseState_STATUS_Breaking,
	"broken":    FileShareProperties_LeaseState_STATUS_Broken,
	"expired":   FileShareProperties_LeaseState_STATUS_Expired,
	"leased":    FileShareProperties_LeaseState_STATUS_Leased,
}

type FileShareProperties_LeaseStatus_STATUS string

const (
	FileShareProperties_LeaseStatus_STATUS_Locked   = FileShareProperties_LeaseStatus_STATUS("Locked")
	FileShareProperties_LeaseStatus_STATUS_Unlocked = FileShareProperties_LeaseStatus_STATUS("Unlocked")
)

// Mapping from string to FileShareProperties_LeaseStatus_STATUS
var fileShareProperties_LeaseStatus_STATUS_Values = map[string]FileShareProperties_LeaseStatus_STATUS{
	"locked":   FileShareProperties_LeaseStatus_STATUS_Locked,
	"unlocked": FileShareProperties_LeaseStatus_STATUS_Unlocked,
}

// +kubebuilder:validation:Enum={"AllSquash","NoRootSquash","RootSquash"}
type FileShareProperties_RootSquash string

const (
	FileShareProperties_RootSquash_AllSquash    = FileShareProperties_RootSquash("AllSquash")
	FileShareProperties_RootSquash_NoRootSquash = FileShareProperties_RootSquash("NoRootSquash")
	FileShareProperties_RootSquash_RootSquash   = FileShareProperties_RootSquash("RootSquash")
)

// Mapping from string to FileShareProperties_RootSquash
var fileShareProperties_RootSquash_Values = map[string]FileShareProperties_RootSquash{
	"allsquash":    FileShareProperties_RootSquash_AllSquash,
	"norootsquash": FileShareProperties_RootSquash_NoRootSquash,
	"rootsquash":   FileShareProperties_RootSquash_RootSquash,
}

type FileShareProperties_RootSquash_STATUS string

const (
	FileShareProperties_RootSquash_STATUS_AllSquash    = FileShareProperties_RootSquash_STATUS("AllSquash")
	FileShareProperties_RootSquash_STATUS_NoRootSquash = FileShareProperties_RootSquash_STATUS("NoRootSquash")
	FileShareProperties_RootSquash_STATUS_RootSquash   = FileShareProperties_RootSquash_STATUS("RootSquash")
)

// Mapping from string to FileShareProperties_RootSquash_STATUS
var fileShareProperties_RootSquash_STATUS_Values = map[string]FileShareProperties_RootSquash_STATUS{
	"allsquash":    FileShareProperties_RootSquash_STATUS_AllSquash,
	"norootsquash": FileShareProperties_RootSquash_STATUS_NoRootSquash,
	"rootsquash":   FileShareProperties_RootSquash_STATUS_RootSquash,
}

type SignedIdentifier struct {
	// AccessPolicy: Access policy
	AccessPolicy *AccessPolicy `json:"accessPolicy,omitempty"`

	// Reference: An unique identifier of the stored access policy.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &SignedIdentifier{}

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

	// Set property "AccessPolicy":
	if identifier.AccessPolicy != nil {
		accessPolicy_ARM, err := identifier.AccessPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		accessPolicy := *accessPolicy_ARM.(*arm.AccessPolicy)
		result.AccessPolicy = &accessPolicy
	}

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

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

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

	// Set property "AccessPolicy":
	if typedInput.AccessPolicy != nil {
		var accessPolicy1 AccessPolicy
		err := accessPolicy1.PopulateFromARM(owner, *typedInput.AccessPolicy)
		if err != nil {
			return err
		}
		accessPolicy := accessPolicy1
		identifier.AccessPolicy = &accessPolicy
	}

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_SignedIdentifier populates our SignedIdentifier from the provided source SignedIdentifier
func (identifier *SignedIdentifier) AssignProperties_From_SignedIdentifier(source *storage.SignedIdentifier) error {

	// AccessPolicy
	if source.AccessPolicy != nil {
		var accessPolicy AccessPolicy
		err := accessPolicy.AssignProperties_From_AccessPolicy(source.AccessPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AccessPolicy() to populate field AccessPolicy")
		}
		identifier.AccessPolicy = &accessPolicy
	} else {
		identifier.AccessPolicy = nil
	}

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

	// No error
	return nil
}

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

	// AccessPolicy
	if identifier.AccessPolicy != nil {
		var accessPolicy storage.AccessPolicy
		err := identifier.AccessPolicy.AssignProperties_To_AccessPolicy(&accessPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AccessPolicy() to populate field AccessPolicy")
		}
		destination.AccessPolicy = &accessPolicy
	} else {
		destination.AccessPolicy = nil
	}

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

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

	// No error
	return nil
}

type SignedIdentifier_STATUS struct {
	// AccessPolicy: Access policy
	AccessPolicy *AccessPolicy_STATUS `json:"accessPolicy,omitempty"`

	// Id: An unique identifier of the stored access policy.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &SignedIdentifier_STATUS{}

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

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

	// Set property "AccessPolicy":
	if typedInput.AccessPolicy != nil {
		var accessPolicy1 AccessPolicy_STATUS
		err := accessPolicy1.PopulateFromARM(owner, *typedInput.AccessPolicy)
		if err != nil {
			return err
		}
		accessPolicy := accessPolicy1
		identifier.AccessPolicy = &accessPolicy
	}

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

	// No error
	return nil
}

// AssignProperties_From_SignedIdentifier_STATUS populates our SignedIdentifier_STATUS from the provided source SignedIdentifier_STATUS
func (identifier *SignedIdentifier_STATUS) AssignProperties_From_SignedIdentifier_STATUS(source *storage.SignedIdentifier_STATUS) error {

	// AccessPolicy
	if source.AccessPolicy != nil {
		var accessPolicy AccessPolicy_STATUS
		err := accessPolicy.AssignProperties_From_AccessPolicy_STATUS(source.AccessPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AccessPolicy_STATUS() to populate field AccessPolicy")
		}
		identifier.AccessPolicy = &accessPolicy
	} else {
		identifier.AccessPolicy = nil
	}

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

	// No error
	return nil
}

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

	// AccessPolicy
	if identifier.AccessPolicy != nil {
		var accessPolicy storage.AccessPolicy_STATUS
		err := identifier.AccessPolicy.AssignProperties_To_AccessPolicy_STATUS(&accessPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AccessPolicy_STATUS() to populate field AccessPolicy")
		}
		destination.AccessPolicy = &accessPolicy
	} else {
		destination.AccessPolicy = nil
	}

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

	// 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 StorageAccountsFileServicesShareOperatorSpec 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_StorageAccountsFileServicesShareOperatorSpec populates our StorageAccountsFileServicesShareOperatorSpec from the provided source StorageAccountsFileServicesShareOperatorSpec
func (operator *StorageAccountsFileServicesShareOperatorSpec) AssignProperties_From_StorageAccountsFileServicesShareOperatorSpec(source *storage.StorageAccountsFileServicesShareOperatorSpec) 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_StorageAccountsFileServicesShareOperatorSpec populates the provided destination StorageAccountsFileServicesShareOperatorSpec from our StorageAccountsFileServicesShareOperatorSpec
func (operator *StorageAccountsFileServicesShareOperatorSpec) AssignProperties_To_StorageAccountsFileServicesShareOperatorSpec(destination *storage.StorageAccountsFileServicesShareOperatorSpec) 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
}

type AccessPolicy struct {
	// ExpiryTime: Expiry time of the access policy
	ExpiryTime *string `json:"expiryTime,omitempty"`

	// Permission: List of abbreviated permissions.
	Permission *string `json:"permission,omitempty"`

	// StartTime: Start time of the access policy
	StartTime *string `json:"startTime,omitempty"`
}

var _ genruntime.ARMTransformer = &AccessPolicy{}

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

type AccessPolicy_STATUS struct {
	// ExpiryTime: Expiry time of the access policy
	ExpiryTime *string `json:"expiryTime,omitempty"`

	// Permission: List of abbreviated permissions.
	Permission *string `json:"permission,omitempty"`

	// StartTime: Start time of the access policy
	StartTime *string `json:"startTime,omitempty"`
}

var _ genruntime.FromARMConverter = &AccessPolicy_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&StorageAccountsFileServicesShare{}, &StorageAccountsFileServicesShareList{})
}
