// 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/blob.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}
type StorageAccountsBlobServicesContainer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              StorageAccountsBlobServicesContainer_Spec   `json:"spec,omitempty"`
	Status            StorageAccountsBlobServicesContainer_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &StorageAccountsBlobServicesContainer{}

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

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

var _ conversion.Convertible = &StorageAccountsBlobServicesContainer{}

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

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

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

	return nil
}

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

	return nil
}

var _ configmaps.Exporter = &StorageAccountsBlobServicesContainer{}

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

var _ secrets.Exporter = &StorageAccountsBlobServicesContainer{}

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

var _ genruntime.KubernetesResource = &StorageAccountsBlobServicesContainer{}

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

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

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

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

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

// GetSupportedOperations returns the operations supported by the resource
func (container *StorageAccountsBlobServicesContainer) 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/blobServices/containers"
func (container *StorageAccountsBlobServicesContainer) GetType() string {
	return "Microsoft.Storage/storageAccounts/blobServices/containers"
}

// NewEmptyStatus returns a new empty (blank) status
func (container *StorageAccountsBlobServicesContainer) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &StorageAccountsBlobServicesContainer_STATUS{}
}

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

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

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

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

	container.Status = st
	return nil
}

// AssignProperties_From_StorageAccountsBlobServicesContainer populates our StorageAccountsBlobServicesContainer from the provided source StorageAccountsBlobServicesContainer
func (container *StorageAccountsBlobServicesContainer) AssignProperties_From_StorageAccountsBlobServicesContainer(source *storage.StorageAccountsBlobServicesContainer) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_StorageAccountsBlobServicesContainer populates the provided destination StorageAccountsBlobServicesContainer from our StorageAccountsBlobServicesContainer
func (container *StorageAccountsBlobServicesContainer) AssignProperties_To_StorageAccountsBlobServicesContainer(destination *storage.StorageAccountsBlobServicesContainer) error {

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

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

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

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

type StorageAccountsBlobServicesContainer_Spec struct {
	// +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"`

	// DefaultEncryptionScope: Default the container to use specified encryption scope for all writes.
	DefaultEncryptionScope *string `json:"defaultEncryptionScope,omitempty"`

	// DenyEncryptionScopeOverride: Block override of encryption scope from the container default.
	DenyEncryptionScopeOverride *bool `json:"denyEncryptionScopeOverride,omitempty"`

	// EnableNfsV3AllSquash: Enable NFSv3 all squash on blob container.
	EnableNfsV3AllSquash *bool `json:"enableNfsV3AllSquash,omitempty"`

	// EnableNfsV3RootSquash: Enable NFSv3 root squash on blob container.
	EnableNfsV3RootSquash *bool `json:"enableNfsV3RootSquash,omitempty"`

	// ImmutableStorageWithVersioning: The object level immutability property of the container. The property is immutable and
	// can only be set to true at the container creation time. Existing containers must undergo a migration process.
	ImmutableStorageWithVersioning *ImmutableStorageWithVersioning `json:"immutableStorageWithVersioning,omitempty"`

	// Metadata: A name-value pair to associate with the container 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 *StorageAccountsBlobServicesContainerOperatorSpec `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/StorageAccountsBlobService resource
	Owner *genruntime.KnownResourceReference `group:"storage.azure.com" json:"owner,omitempty" kind:"StorageAccountsBlobService"`

	// PublicAccess: Specifies whether data in the container may be accessed publicly and the level of access.
	PublicAccess *ContainerProperties_PublicAccess `json:"publicAccess,omitempty"`
}

var _ genruntime.ARMTransformer = &StorageAccountsBlobServicesContainer_Spec{}

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

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

	// Set property "Properties":
	if container.DefaultEncryptionScope != nil ||
		container.DenyEncryptionScopeOverride != nil ||
		container.EnableNfsV3AllSquash != nil ||
		container.EnableNfsV3RootSquash != nil ||
		container.ImmutableStorageWithVersioning != nil ||
		container.Metadata != nil ||
		container.PublicAccess != nil {
		result.Properties = &arm.ContainerProperties{}
	}
	if container.DefaultEncryptionScope != nil {
		defaultEncryptionScope := *container.DefaultEncryptionScope
		result.Properties.DefaultEncryptionScope = &defaultEncryptionScope
	}
	if container.DenyEncryptionScopeOverride != nil {
		denyEncryptionScopeOverride := *container.DenyEncryptionScopeOverride
		result.Properties.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
	}
	if container.EnableNfsV3AllSquash != nil {
		enableNfsV3AllSquash := *container.EnableNfsV3AllSquash
		result.Properties.EnableNfsV3AllSquash = &enableNfsV3AllSquash
	}
	if container.EnableNfsV3RootSquash != nil {
		enableNfsV3RootSquash := *container.EnableNfsV3RootSquash
		result.Properties.EnableNfsV3RootSquash = &enableNfsV3RootSquash
	}
	if container.ImmutableStorageWithVersioning != nil {
		immutableStorageWithVersioning_ARM, err := container.ImmutableStorageWithVersioning.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		immutableStorageWithVersioning := *immutableStorageWithVersioning_ARM.(*arm.ImmutableStorageWithVersioning)
		result.Properties.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
	}
	if container.Metadata != nil {
		result.Properties.Metadata = make(map[string]string, len(container.Metadata))
		for key, value := range container.Metadata {
			result.Properties.Metadata[key] = value
		}
	}
	if container.PublicAccess != nil {
		var temp string
		temp = string(*container.PublicAccess)
		publicAccess := arm.ContainerProperties_PublicAccess(temp)
		result.Properties.PublicAccess = &publicAccess
	}
	return result, nil
}

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

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

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

	// Set property "DefaultEncryptionScope":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultEncryptionScope != nil {
			defaultEncryptionScope := *typedInput.Properties.DefaultEncryptionScope
			container.DefaultEncryptionScope = &defaultEncryptionScope
		}
	}

	// Set property "DenyEncryptionScopeOverride":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DenyEncryptionScopeOverride != nil {
			denyEncryptionScopeOverride := *typedInput.Properties.DenyEncryptionScopeOverride
			container.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
		}
	}

	// Set property "EnableNfsV3AllSquash":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableNfsV3AllSquash != nil {
			enableNfsV3AllSquash := *typedInput.Properties.EnableNfsV3AllSquash
			container.EnableNfsV3AllSquash = &enableNfsV3AllSquash
		}
	}

	// Set property "EnableNfsV3RootSquash":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableNfsV3RootSquash != nil {
			enableNfsV3RootSquash := *typedInput.Properties.EnableNfsV3RootSquash
			container.EnableNfsV3RootSquash = &enableNfsV3RootSquash
		}
	}

	// Set property "ImmutableStorageWithVersioning":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImmutableStorageWithVersioning != nil {
			var immutableStorageWithVersioning1 ImmutableStorageWithVersioning
			err := immutableStorageWithVersioning1.PopulateFromARM(owner, *typedInput.Properties.ImmutableStorageWithVersioning)
			if err != nil {
				return err
			}
			immutableStorageWithVersioning := immutableStorageWithVersioning1
			container.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
		}
	}

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

	// no assignment for property "OperatorSpec"

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

	// Set property "PublicAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicAccess)
			publicAccess := ContainerProperties_PublicAccess(temp)
			container.PublicAccess = &publicAccess
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &StorageAccountsBlobServicesContainer_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsBlobServicesContainer_Spec{}
	err := container.AssignProperties_To_StorageAccountsBlobServicesContainer_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_StorageAccountsBlobServicesContainer_Spec populates our StorageAccountsBlobServicesContainer_Spec from the provided source StorageAccountsBlobServicesContainer_Spec
func (container *StorageAccountsBlobServicesContainer_Spec) AssignProperties_From_StorageAccountsBlobServicesContainer_Spec(source *storage.StorageAccountsBlobServicesContainer_Spec) error {

	// AzureName
	container.AzureName = source.AzureName

	// DefaultEncryptionScope
	container.DefaultEncryptionScope = genruntime.ClonePointerToString(source.DefaultEncryptionScope)

	// DenyEncryptionScopeOverride
	if source.DenyEncryptionScopeOverride != nil {
		denyEncryptionScopeOverride := *source.DenyEncryptionScopeOverride
		container.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
	} else {
		container.DenyEncryptionScopeOverride = nil
	}

	// EnableNfsV3AllSquash
	if source.EnableNfsV3AllSquash != nil {
		enableNfsV3AllSquash := *source.EnableNfsV3AllSquash
		container.EnableNfsV3AllSquash = &enableNfsV3AllSquash
	} else {
		container.EnableNfsV3AllSquash = nil
	}

	// EnableNfsV3RootSquash
	if source.EnableNfsV3RootSquash != nil {
		enableNfsV3RootSquash := *source.EnableNfsV3RootSquash
		container.EnableNfsV3RootSquash = &enableNfsV3RootSquash
	} else {
		container.EnableNfsV3RootSquash = nil
	}

	// ImmutableStorageWithVersioning
	if source.ImmutableStorageWithVersioning != nil {
		var immutableStorageWithVersioning ImmutableStorageWithVersioning
		err := immutableStorageWithVersioning.AssignProperties_From_ImmutableStorageWithVersioning(source.ImmutableStorageWithVersioning)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImmutableStorageWithVersioning() to populate field ImmutableStorageWithVersioning")
		}
		container.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
	} else {
		container.ImmutableStorageWithVersioning = nil
	}

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

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

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

	// PublicAccess
	if source.PublicAccess != nil {
		publicAccess := *source.PublicAccess
		publicAccessTemp := genruntime.ToEnum(publicAccess, containerProperties_PublicAccess_Values)
		container.PublicAccess = &publicAccessTemp
	} else {
		container.PublicAccess = nil
	}

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = container.AzureName

	// DefaultEncryptionScope
	destination.DefaultEncryptionScope = genruntime.ClonePointerToString(container.DefaultEncryptionScope)

	// DenyEncryptionScopeOverride
	if container.DenyEncryptionScopeOverride != nil {
		denyEncryptionScopeOverride := *container.DenyEncryptionScopeOverride
		destination.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
	} else {
		destination.DenyEncryptionScopeOverride = nil
	}

	// EnableNfsV3AllSquash
	if container.EnableNfsV3AllSquash != nil {
		enableNfsV3AllSquash := *container.EnableNfsV3AllSquash
		destination.EnableNfsV3AllSquash = &enableNfsV3AllSquash
	} else {
		destination.EnableNfsV3AllSquash = nil
	}

	// EnableNfsV3RootSquash
	if container.EnableNfsV3RootSquash != nil {
		enableNfsV3RootSquash := *container.EnableNfsV3RootSquash
		destination.EnableNfsV3RootSquash = &enableNfsV3RootSquash
	} else {
		destination.EnableNfsV3RootSquash = nil
	}

	// ImmutableStorageWithVersioning
	if container.ImmutableStorageWithVersioning != nil {
		var immutableStorageWithVersioning storage.ImmutableStorageWithVersioning
		err := container.ImmutableStorageWithVersioning.AssignProperties_To_ImmutableStorageWithVersioning(&immutableStorageWithVersioning)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImmutableStorageWithVersioning() to populate field ImmutableStorageWithVersioning")
		}
		destination.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
	} else {
		destination.ImmutableStorageWithVersioning = nil
	}

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

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

	// OriginalVersion
	destination.OriginalVersion = container.OriginalVersion()

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

	// PublicAccess
	if container.PublicAccess != nil {
		publicAccess := string(*container.PublicAccess)
		destination.PublicAccess = &publicAccess
	} else {
		destination.PublicAccess = 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 (container *StorageAccountsBlobServicesContainer_Spec) OriginalVersion() string {
	return GroupVersion.Version
}

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

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

	// DefaultEncryptionScope: Default the container to use specified encryption scope for all writes.
	DefaultEncryptionScope *string `json:"defaultEncryptionScope,omitempty"`

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

	// DeletedTime: Blob container deletion time.
	DeletedTime *string `json:"deletedTime,omitempty"`

	// DenyEncryptionScopeOverride: Block override of encryption scope from the container default.
	DenyEncryptionScopeOverride *bool `json:"denyEncryptionScopeOverride,omitempty"`

	// EnableNfsV3AllSquash: Enable NFSv3 all squash on blob container.
	EnableNfsV3AllSquash *bool `json:"enableNfsV3AllSquash,omitempty"`

	// EnableNfsV3RootSquash: Enable NFSv3 root squash on blob container.
	EnableNfsV3RootSquash *bool `json:"enableNfsV3RootSquash,omitempty"`

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

	// HasImmutabilityPolicy: The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been
	// created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has
	// not been created for this container.
	HasImmutabilityPolicy *bool `json:"hasImmutabilityPolicy,omitempty"`

	// HasLegalHold: The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The
	// hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a
	// maximum of 1000 blob containers with hasLegalHold=true for a given account.
	HasLegalHold *bool `json:"hasLegalHold,omitempty"`

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

	// ImmutabilityPolicy: The ImmutabilityPolicy property of the container.
	ImmutabilityPolicy *ImmutabilityPolicyProperties_STATUS `json:"immutabilityPolicy,omitempty"`

	// ImmutableStorageWithVersioning: The object level immutability property of the container. The property is immutable and
	// can only be set to true at the container creation time. Existing containers must undergo a migration process.
	ImmutableStorageWithVersioning *ImmutableStorageWithVersioning_STATUS `json:"immutableStorageWithVersioning,omitempty"`

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

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

	// LeaseState: Lease state of the container.
	LeaseState *ContainerProperties_LeaseState_STATUS `json:"leaseState,omitempty"`

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

	// LegalHold: The LegalHold property of the container.
	LegalHold *LegalHoldProperties_STATUS `json:"legalHold,omitempty"`

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

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

	// PublicAccess: Specifies whether data in the container may be accessed publicly and the level of access.
	PublicAccess *ContainerProperties_PublicAccess_STATUS `json:"publicAccess,omitempty"`

	// RemainingRetentionDays: Remaining retention days for soft deleted blob container.
	RemainingRetentionDays *int `json:"remainingRetentionDays,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 deleted blob container.
	Version *string `json:"version,omitempty"`
}

var _ genruntime.ConvertibleStatus = &StorageAccountsBlobServicesContainer_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.StorageAccountsBlobServicesContainer_STATUS{}
	err := container.AssignProperties_To_StorageAccountsBlobServicesContainer_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 = &StorageAccountsBlobServicesContainer_STATUS{}

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

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

	// no assignment for property "Conditions"

	// Set property "DefaultEncryptionScope":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultEncryptionScope != nil {
			defaultEncryptionScope := *typedInput.Properties.DefaultEncryptionScope
			container.DefaultEncryptionScope = &defaultEncryptionScope
		}
	}

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

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

	// Set property "DenyEncryptionScopeOverride":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DenyEncryptionScopeOverride != nil {
			denyEncryptionScopeOverride := *typedInput.Properties.DenyEncryptionScopeOverride
			container.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
		}
	}

	// Set property "EnableNfsV3AllSquash":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableNfsV3AllSquash != nil {
			enableNfsV3AllSquash := *typedInput.Properties.EnableNfsV3AllSquash
			container.EnableNfsV3AllSquash = &enableNfsV3AllSquash
		}
	}

	// Set property "EnableNfsV3RootSquash":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableNfsV3RootSquash != nil {
			enableNfsV3RootSquash := *typedInput.Properties.EnableNfsV3RootSquash
			container.EnableNfsV3RootSquash = &enableNfsV3RootSquash
		}
	}

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

	// Set property "HasImmutabilityPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HasImmutabilityPolicy != nil {
			hasImmutabilityPolicy := *typedInput.Properties.HasImmutabilityPolicy
			container.HasImmutabilityPolicy = &hasImmutabilityPolicy
		}
	}

	// Set property "HasLegalHold":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HasLegalHold != nil {
			hasLegalHold := *typedInput.Properties.HasLegalHold
			container.HasLegalHold = &hasLegalHold
		}
	}

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

	// Set property "ImmutabilityPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImmutabilityPolicy != nil {
			var immutabilityPolicy1 ImmutabilityPolicyProperties_STATUS
			err := immutabilityPolicy1.PopulateFromARM(owner, *typedInput.Properties.ImmutabilityPolicy)
			if err != nil {
				return err
			}
			immutabilityPolicy := immutabilityPolicy1
			container.ImmutabilityPolicy = &immutabilityPolicy
		}
	}

	// Set property "ImmutableStorageWithVersioning":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImmutableStorageWithVersioning != nil {
			var immutableStorageWithVersioning1 ImmutableStorageWithVersioning_STATUS
			err := immutableStorageWithVersioning1.PopulateFromARM(owner, *typedInput.Properties.ImmutableStorageWithVersioning)
			if err != nil {
				return err
			}
			immutableStorageWithVersioning := immutableStorageWithVersioning1
			container.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
		}
	}

	// Set property "LastModifiedTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LastModifiedTime != nil {
			lastModifiedTime := *typedInput.Properties.LastModifiedTime
			container.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 := ContainerProperties_LeaseDuration_STATUS(temp)
			container.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 := ContainerProperties_LeaseState_STATUS(temp)
			container.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 := ContainerProperties_LeaseStatus_STATUS(temp)
			container.LeaseStatus = &leaseStatus
		}
	}

	// Set property "LegalHold":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LegalHold != nil {
			var legalHold1 LegalHoldProperties_STATUS
			err := legalHold1.PopulateFromARM(owner, *typedInput.Properties.LegalHold)
			if err != nil {
				return err
			}
			legalHold := legalHold1
			container.LegalHold = &legalHold
		}
	}

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

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

	// Set property "PublicAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicAccess)
			publicAccess := ContainerProperties_PublicAccess_STATUS(temp)
			container.PublicAccess = &publicAccess
		}
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_StorageAccountsBlobServicesContainer_STATUS populates our StorageAccountsBlobServicesContainer_STATUS from the provided source StorageAccountsBlobServicesContainer_STATUS
func (container *StorageAccountsBlobServicesContainer_STATUS) AssignProperties_From_StorageAccountsBlobServicesContainer_STATUS(source *storage.StorageAccountsBlobServicesContainer_STATUS) error {

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

	// DefaultEncryptionScope
	container.DefaultEncryptionScope = genruntime.ClonePointerToString(source.DefaultEncryptionScope)

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

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

	// DenyEncryptionScopeOverride
	if source.DenyEncryptionScopeOverride != nil {
		denyEncryptionScopeOverride := *source.DenyEncryptionScopeOverride
		container.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
	} else {
		container.DenyEncryptionScopeOverride = nil
	}

	// EnableNfsV3AllSquash
	if source.EnableNfsV3AllSquash != nil {
		enableNfsV3AllSquash := *source.EnableNfsV3AllSquash
		container.EnableNfsV3AllSquash = &enableNfsV3AllSquash
	} else {
		container.EnableNfsV3AllSquash = nil
	}

	// EnableNfsV3RootSquash
	if source.EnableNfsV3RootSquash != nil {
		enableNfsV3RootSquash := *source.EnableNfsV3RootSquash
		container.EnableNfsV3RootSquash = &enableNfsV3RootSquash
	} else {
		container.EnableNfsV3RootSquash = nil
	}

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

	// HasImmutabilityPolicy
	if source.HasImmutabilityPolicy != nil {
		hasImmutabilityPolicy := *source.HasImmutabilityPolicy
		container.HasImmutabilityPolicy = &hasImmutabilityPolicy
	} else {
		container.HasImmutabilityPolicy = nil
	}

	// HasLegalHold
	if source.HasLegalHold != nil {
		hasLegalHold := *source.HasLegalHold
		container.HasLegalHold = &hasLegalHold
	} else {
		container.HasLegalHold = nil
	}

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

	// ImmutabilityPolicy
	if source.ImmutabilityPolicy != nil {
		var immutabilityPolicy ImmutabilityPolicyProperties_STATUS
		err := immutabilityPolicy.AssignProperties_From_ImmutabilityPolicyProperties_STATUS(source.ImmutabilityPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImmutabilityPolicyProperties_STATUS() to populate field ImmutabilityPolicy")
		}
		container.ImmutabilityPolicy = &immutabilityPolicy
	} else {
		container.ImmutabilityPolicy = nil
	}

	// ImmutableStorageWithVersioning
	if source.ImmutableStorageWithVersioning != nil {
		var immutableStorageWithVersioning ImmutableStorageWithVersioning_STATUS
		err := immutableStorageWithVersioning.AssignProperties_From_ImmutableStorageWithVersioning_STATUS(source.ImmutableStorageWithVersioning)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImmutableStorageWithVersioning_STATUS() to populate field ImmutableStorageWithVersioning")
		}
		container.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
	} else {
		container.ImmutableStorageWithVersioning = nil
	}

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

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

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

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

	// LegalHold
	if source.LegalHold != nil {
		var legalHold LegalHoldProperties_STATUS
		err := legalHold.AssignProperties_From_LegalHoldProperties_STATUS(source.LegalHold)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LegalHoldProperties_STATUS() to populate field LegalHold")
		}
		container.LegalHold = &legalHold
	} else {
		container.LegalHold = nil
	}

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

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

	// PublicAccess
	if source.PublicAccess != nil {
		publicAccess := *source.PublicAccess
		publicAccessTemp := genruntime.ToEnum(publicAccess, containerProperties_PublicAccess_STATUS_Values)
		container.PublicAccess = &publicAccessTemp
	} else {
		container.PublicAccess = nil
	}

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

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

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

	// No error
	return nil
}

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

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

	// DefaultEncryptionScope
	destination.DefaultEncryptionScope = genruntime.ClonePointerToString(container.DefaultEncryptionScope)

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

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

	// DenyEncryptionScopeOverride
	if container.DenyEncryptionScopeOverride != nil {
		denyEncryptionScopeOverride := *container.DenyEncryptionScopeOverride
		destination.DenyEncryptionScopeOverride = &denyEncryptionScopeOverride
	} else {
		destination.DenyEncryptionScopeOverride = nil
	}

	// EnableNfsV3AllSquash
	if container.EnableNfsV3AllSquash != nil {
		enableNfsV3AllSquash := *container.EnableNfsV3AllSquash
		destination.EnableNfsV3AllSquash = &enableNfsV3AllSquash
	} else {
		destination.EnableNfsV3AllSquash = nil
	}

	// EnableNfsV3RootSquash
	if container.EnableNfsV3RootSquash != nil {
		enableNfsV3RootSquash := *container.EnableNfsV3RootSquash
		destination.EnableNfsV3RootSquash = &enableNfsV3RootSquash
	} else {
		destination.EnableNfsV3RootSquash = nil
	}

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

	// HasImmutabilityPolicy
	if container.HasImmutabilityPolicy != nil {
		hasImmutabilityPolicy := *container.HasImmutabilityPolicy
		destination.HasImmutabilityPolicy = &hasImmutabilityPolicy
	} else {
		destination.HasImmutabilityPolicy = nil
	}

	// HasLegalHold
	if container.HasLegalHold != nil {
		hasLegalHold := *container.HasLegalHold
		destination.HasLegalHold = &hasLegalHold
	} else {
		destination.HasLegalHold = nil
	}

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

	// ImmutabilityPolicy
	if container.ImmutabilityPolicy != nil {
		var immutabilityPolicy storage.ImmutabilityPolicyProperties_STATUS
		err := container.ImmutabilityPolicy.AssignProperties_To_ImmutabilityPolicyProperties_STATUS(&immutabilityPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImmutabilityPolicyProperties_STATUS() to populate field ImmutabilityPolicy")
		}
		destination.ImmutabilityPolicy = &immutabilityPolicy
	} else {
		destination.ImmutabilityPolicy = nil
	}

	// ImmutableStorageWithVersioning
	if container.ImmutableStorageWithVersioning != nil {
		var immutableStorageWithVersioning storage.ImmutableStorageWithVersioning_STATUS
		err := container.ImmutableStorageWithVersioning.AssignProperties_To_ImmutableStorageWithVersioning_STATUS(&immutableStorageWithVersioning)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImmutableStorageWithVersioning_STATUS() to populate field ImmutableStorageWithVersioning")
		}
		destination.ImmutableStorageWithVersioning = &immutableStorageWithVersioning
	} else {
		destination.ImmutableStorageWithVersioning = nil
	}

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

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

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

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

	// LegalHold
	if container.LegalHold != nil {
		var legalHold storage.LegalHoldProperties_STATUS
		err := container.LegalHold.AssignProperties_To_LegalHoldProperties_STATUS(&legalHold)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_LegalHoldProperties_STATUS() to populate field LegalHold")
		}
		destination.LegalHold = &legalHold
	} else {
		destination.LegalHold = nil
	}

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

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

	// PublicAccess
	if container.PublicAccess != nil {
		publicAccess := string(*container.PublicAccess)
		destination.PublicAccess = &publicAccess
	} else {
		destination.PublicAccess = nil
	}

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

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

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

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

	// No error
	return nil
}

type ContainerProperties_LeaseDuration_STATUS string

const (
	ContainerProperties_LeaseDuration_STATUS_Fixed    = ContainerProperties_LeaseDuration_STATUS("Fixed")
	ContainerProperties_LeaseDuration_STATUS_Infinite = ContainerProperties_LeaseDuration_STATUS("Infinite")
)

// Mapping from string to ContainerProperties_LeaseDuration_STATUS
var containerProperties_LeaseDuration_STATUS_Values = map[string]ContainerProperties_LeaseDuration_STATUS{
	"fixed":    ContainerProperties_LeaseDuration_STATUS_Fixed,
	"infinite": ContainerProperties_LeaseDuration_STATUS_Infinite,
}

type ContainerProperties_LeaseState_STATUS string

const (
	ContainerProperties_LeaseState_STATUS_Available = ContainerProperties_LeaseState_STATUS("Available")
	ContainerProperties_LeaseState_STATUS_Breaking  = ContainerProperties_LeaseState_STATUS("Breaking")
	ContainerProperties_LeaseState_STATUS_Broken    = ContainerProperties_LeaseState_STATUS("Broken")
	ContainerProperties_LeaseState_STATUS_Expired   = ContainerProperties_LeaseState_STATUS("Expired")
	ContainerProperties_LeaseState_STATUS_Leased    = ContainerProperties_LeaseState_STATUS("Leased")
)

// Mapping from string to ContainerProperties_LeaseState_STATUS
var containerProperties_LeaseState_STATUS_Values = map[string]ContainerProperties_LeaseState_STATUS{
	"available": ContainerProperties_LeaseState_STATUS_Available,
	"breaking":  ContainerProperties_LeaseState_STATUS_Breaking,
	"broken":    ContainerProperties_LeaseState_STATUS_Broken,
	"expired":   ContainerProperties_LeaseState_STATUS_Expired,
	"leased":    ContainerProperties_LeaseState_STATUS_Leased,
}

type ContainerProperties_LeaseStatus_STATUS string

const (
	ContainerProperties_LeaseStatus_STATUS_Locked   = ContainerProperties_LeaseStatus_STATUS("Locked")
	ContainerProperties_LeaseStatus_STATUS_Unlocked = ContainerProperties_LeaseStatus_STATUS("Unlocked")
)

// Mapping from string to ContainerProperties_LeaseStatus_STATUS
var containerProperties_LeaseStatus_STATUS_Values = map[string]ContainerProperties_LeaseStatus_STATUS{
	"locked":   ContainerProperties_LeaseStatus_STATUS_Locked,
	"unlocked": ContainerProperties_LeaseStatus_STATUS_Unlocked,
}

// +kubebuilder:validation:Enum={"Blob","Container","None"}
type ContainerProperties_PublicAccess string

const (
	ContainerProperties_PublicAccess_Blob      = ContainerProperties_PublicAccess("Blob")
	ContainerProperties_PublicAccess_Container = ContainerProperties_PublicAccess("Container")
	ContainerProperties_PublicAccess_None      = ContainerProperties_PublicAccess("None")
)

// Mapping from string to ContainerProperties_PublicAccess
var containerProperties_PublicAccess_Values = map[string]ContainerProperties_PublicAccess{
	"blob":      ContainerProperties_PublicAccess_Blob,
	"container": ContainerProperties_PublicAccess_Container,
	"none":      ContainerProperties_PublicAccess_None,
}

type ContainerProperties_PublicAccess_STATUS string

const (
	ContainerProperties_PublicAccess_STATUS_Blob      = ContainerProperties_PublicAccess_STATUS("Blob")
	ContainerProperties_PublicAccess_STATUS_Container = ContainerProperties_PublicAccess_STATUS("Container")
	ContainerProperties_PublicAccess_STATUS_None      = ContainerProperties_PublicAccess_STATUS("None")
)

// Mapping from string to ContainerProperties_PublicAccess_STATUS
var containerProperties_PublicAccess_STATUS_Values = map[string]ContainerProperties_PublicAccess_STATUS{
	"blob":      ContainerProperties_PublicAccess_STATUS_Blob,
	"container": ContainerProperties_PublicAccess_STATUS_Container,
	"none":      ContainerProperties_PublicAccess_STATUS_None,
}

// The properties of an ImmutabilityPolicy of a blob container.
type ImmutabilityPolicyProperties_STATUS struct {
	// AllowProtectedAppendWrites: This property can only be changed for unlocked time-based retention policies. When enabled,
	// new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks
	// can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with
	// ExtendImmutabilityPolicy API.
	AllowProtectedAppendWrites *bool `json:"allowProtectedAppendWrites,omitempty"`

	// AllowProtectedAppendWritesAll: This property can only be changed for unlocked time-based retention policies. When
	// enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and
	// compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be
	// changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll'
	// properties are mutually exclusive.
	AllowProtectedAppendWritesAll *bool `json:"allowProtectedAppendWritesAll,omitempty"`

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

	// ImmutabilityPeriodSinceCreationInDays: The immutability period for the blobs in the container since the policy creation,
	// in days.
	ImmutabilityPeriodSinceCreationInDays *int `json:"immutabilityPeriodSinceCreationInDays,omitempty"`

	// State: The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.
	State *ImmutabilityPolicyProperty_State_STATUS `json:"state,omitempty"`

	// UpdateHistory: The ImmutabilityPolicy update history of the blob container.
	UpdateHistory []UpdateHistoryProperty_STATUS `json:"updateHistory,omitempty"`
}

var _ genruntime.FromARMConverter = &ImmutabilityPolicyProperties_STATUS{}

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

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

	// Set property "AllowProtectedAppendWrites":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowProtectedAppendWrites != nil {
			allowProtectedAppendWrites := *typedInput.Properties.AllowProtectedAppendWrites
			properties.AllowProtectedAppendWrites = &allowProtectedAppendWrites
		}
	}

	// Set property "AllowProtectedAppendWritesAll":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AllowProtectedAppendWritesAll != nil {
			allowProtectedAppendWritesAll := *typedInput.Properties.AllowProtectedAppendWritesAll
			properties.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
		}
	}

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

	// Set property "ImmutabilityPeriodSinceCreationInDays":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImmutabilityPeriodSinceCreationInDays != nil {
			immutabilityPeriodSinceCreationInDays := *typedInput.Properties.ImmutabilityPeriodSinceCreationInDays
			properties.ImmutabilityPeriodSinceCreationInDays = &immutabilityPeriodSinceCreationInDays
		}
	}

	// Set property "State":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.State != nil {
			var temp string
			temp = string(*typedInput.Properties.State)
			state := ImmutabilityPolicyProperty_State_STATUS(temp)
			properties.State = &state
		}
	}

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

	// No error
	return nil
}

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

	// AllowProtectedAppendWrites
	if source.AllowProtectedAppendWrites != nil {
		allowProtectedAppendWrite := *source.AllowProtectedAppendWrites
		properties.AllowProtectedAppendWrites = &allowProtectedAppendWrite
	} else {
		properties.AllowProtectedAppendWrites = nil
	}

	// AllowProtectedAppendWritesAll
	if source.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *source.AllowProtectedAppendWritesAll
		properties.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	} else {
		properties.AllowProtectedAppendWritesAll = nil
	}

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

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

	// State
	if source.State != nil {
		state := *source.State
		stateTemp := genruntime.ToEnum(state, immutabilityPolicyProperty_State_STATUS_Values)
		properties.State = &stateTemp
	} else {
		properties.State = nil
	}

	// UpdateHistory
	if source.UpdateHistory != nil {
		updateHistoryList := make([]UpdateHistoryProperty_STATUS, len(source.UpdateHistory))
		for updateHistoryIndex, updateHistoryItem := range source.UpdateHistory {
			var updateHistory UpdateHistoryProperty_STATUS
			err := updateHistory.AssignProperties_From_UpdateHistoryProperty_STATUS(&updateHistoryItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_UpdateHistoryProperty_STATUS() to populate field UpdateHistory")
			}
			updateHistoryList[updateHistoryIndex] = updateHistory
		}
		properties.UpdateHistory = updateHistoryList
	} else {
		properties.UpdateHistory = nil
	}

	// No error
	return nil
}

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

	// AllowProtectedAppendWrites
	if properties.AllowProtectedAppendWrites != nil {
		allowProtectedAppendWrite := *properties.AllowProtectedAppendWrites
		destination.AllowProtectedAppendWrites = &allowProtectedAppendWrite
	} else {
		destination.AllowProtectedAppendWrites = nil
	}

	// AllowProtectedAppendWritesAll
	if properties.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *properties.AllowProtectedAppendWritesAll
		destination.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	} else {
		destination.AllowProtectedAppendWritesAll = nil
	}

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

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

	// State
	if properties.State != nil {
		state := string(*properties.State)
		destination.State = &state
	} else {
		destination.State = nil
	}

	// UpdateHistory
	if properties.UpdateHistory != nil {
		updateHistoryList := make([]storage.UpdateHistoryProperty_STATUS, len(properties.UpdateHistory))
		for updateHistoryIndex, updateHistoryItem := range properties.UpdateHistory {
			var updateHistory storage.UpdateHistoryProperty_STATUS
			err := updateHistoryItem.AssignProperties_To_UpdateHistoryProperty_STATUS(&updateHistory)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UpdateHistoryProperty_STATUS() to populate field UpdateHistory")
			}
			updateHistoryList[updateHistoryIndex] = updateHistory
		}
		destination.UpdateHistory = updateHistoryList
	} else {
		destination.UpdateHistory = nil
	}

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

	// No error
	return nil
}

// Object level immutability properties of the container.
type ImmutableStorageWithVersioning struct {
	// Enabled: This is an immutable property, when set to true it enables object level immutability at the container level.
	Enabled *bool `json:"enabled,omitempty"`
}

var _ genruntime.ARMTransformer = &ImmutableStorageWithVersioning{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ImmutableStorageWithVersioning populates our ImmutableStorageWithVersioning from the provided source ImmutableStorageWithVersioning
func (versioning *ImmutableStorageWithVersioning) AssignProperties_From_ImmutableStorageWithVersioning(source *storage.ImmutableStorageWithVersioning) error {

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

	// No error
	return nil
}

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

	// Enabled
	if versioning.Enabled != nil {
		enabled := *versioning.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
}

// Object level immutability properties of the container.
type ImmutableStorageWithVersioning_STATUS struct {
	// Enabled: This is an immutable property, when set to true it enables object level immutability at the container level.
	Enabled *bool `json:"enabled,omitempty"`

	// MigrationState: This property denotes the container level immutability to object level immutability migration state.
	MigrationState *ImmutableStorageWithVersioning_MigrationState_STATUS `json:"migrationState,omitempty"`

	// TimeStamp: Returns the date and time the object level immutability was enabled.
	TimeStamp *string `json:"timeStamp,omitempty"`
}

var _ genruntime.FromARMConverter = &ImmutableStorageWithVersioning_STATUS{}

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

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

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

	// Set property "MigrationState":
	if typedInput.MigrationState != nil {
		var temp string
		temp = string(*typedInput.MigrationState)
		migrationState := ImmutableStorageWithVersioning_MigrationState_STATUS(temp)
		versioning.MigrationState = &migrationState
	}

	// Set property "TimeStamp":
	if typedInput.TimeStamp != nil {
		timeStamp := *typedInput.TimeStamp
		versioning.TimeStamp = &timeStamp
	}

	// No error
	return nil
}

// AssignProperties_From_ImmutableStorageWithVersioning_STATUS populates our ImmutableStorageWithVersioning_STATUS from the provided source ImmutableStorageWithVersioning_STATUS
func (versioning *ImmutableStorageWithVersioning_STATUS) AssignProperties_From_ImmutableStorageWithVersioning_STATUS(source *storage.ImmutableStorageWithVersioning_STATUS) error {

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

	// MigrationState
	if source.MigrationState != nil {
		migrationState := *source.MigrationState
		migrationStateTemp := genruntime.ToEnum(migrationState, immutableStorageWithVersioning_MigrationState_STATUS_Values)
		versioning.MigrationState = &migrationStateTemp
	} else {
		versioning.MigrationState = nil
	}

	// TimeStamp
	versioning.TimeStamp = genruntime.ClonePointerToString(source.TimeStamp)

	// No error
	return nil
}

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

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

	// MigrationState
	if versioning.MigrationState != nil {
		migrationState := string(*versioning.MigrationState)
		destination.MigrationState = &migrationState
	} else {
		destination.MigrationState = nil
	}

	// TimeStamp
	destination.TimeStamp = genruntime.ClonePointerToString(versioning.TimeStamp)

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

	// No error
	return nil
}

// The LegalHold property of a blob container.
type LegalHoldProperties_STATUS struct {
	// HasLegalHold: The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The
	// hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a
	// maximum of 1000 blob containers with hasLegalHold=true for a given account.
	HasLegalHold *bool `json:"hasLegalHold,omitempty"`

	// ProtectedAppendWritesHistory: Protected append blob writes history.
	ProtectedAppendWritesHistory *ProtectedAppendWritesHistory_STATUS `json:"protectedAppendWritesHistory,omitempty"`

	// Tags: The list of LegalHold tags of a blob container.
	Tags []TagProperty_STATUS `json:"tags,omitempty"`
}

var _ genruntime.FromARMConverter = &LegalHoldProperties_STATUS{}

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

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

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

	// Set property "ProtectedAppendWritesHistory":
	if typedInput.ProtectedAppendWritesHistory != nil {
		var protectedAppendWritesHistory1 ProtectedAppendWritesHistory_STATUS
		err := protectedAppendWritesHistory1.PopulateFromARM(owner, *typedInput.ProtectedAppendWritesHistory)
		if err != nil {
			return err
		}
		protectedAppendWritesHistory := protectedAppendWritesHistory1
		properties.ProtectedAppendWritesHistory = &protectedAppendWritesHistory
	}

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

	// No error
	return nil
}

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

	// HasLegalHold
	if source.HasLegalHold != nil {
		hasLegalHold := *source.HasLegalHold
		properties.HasLegalHold = &hasLegalHold
	} else {
		properties.HasLegalHold = nil
	}

	// ProtectedAppendWritesHistory
	if source.ProtectedAppendWritesHistory != nil {
		var protectedAppendWritesHistory ProtectedAppendWritesHistory_STATUS
		err := protectedAppendWritesHistory.AssignProperties_From_ProtectedAppendWritesHistory_STATUS(source.ProtectedAppendWritesHistory)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ProtectedAppendWritesHistory_STATUS() to populate field ProtectedAppendWritesHistory")
		}
		properties.ProtectedAppendWritesHistory = &protectedAppendWritesHistory
	} else {
		properties.ProtectedAppendWritesHistory = nil
	}

	// Tags
	if source.Tags != nil {
		tagList := make([]TagProperty_STATUS, len(source.Tags))
		for tagIndex, tagItem := range source.Tags {
			var tag TagProperty_STATUS
			err := tag.AssignProperties_From_TagProperty_STATUS(&tagItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_TagProperty_STATUS() to populate field Tags")
			}
			tagList[tagIndex] = tag
		}
		properties.Tags = tagList
	} else {
		properties.Tags = nil
	}

	// No error
	return nil
}

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

	// HasLegalHold
	if properties.HasLegalHold != nil {
		hasLegalHold := *properties.HasLegalHold
		destination.HasLegalHold = &hasLegalHold
	} else {
		destination.HasLegalHold = nil
	}

	// ProtectedAppendWritesHistory
	if properties.ProtectedAppendWritesHistory != nil {
		var protectedAppendWritesHistory storage.ProtectedAppendWritesHistory_STATUS
		err := properties.ProtectedAppendWritesHistory.AssignProperties_To_ProtectedAppendWritesHistory_STATUS(&protectedAppendWritesHistory)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ProtectedAppendWritesHistory_STATUS() to populate field ProtectedAppendWritesHistory")
		}
		destination.ProtectedAppendWritesHistory = &protectedAppendWritesHistory
	} else {
		destination.ProtectedAppendWritesHistory = nil
	}

	// Tags
	if properties.Tags != nil {
		tagList := make([]storage.TagProperty_STATUS, len(properties.Tags))
		for tagIndex, tagItem := range properties.Tags {
			var tag storage.TagProperty_STATUS
			err := tagItem.AssignProperties_To_TagProperty_STATUS(&tag)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_TagProperty_STATUS() to populate field Tags")
			}
			tagList[tagIndex] = tag
		}
		destination.Tags = tagList
	} else {
		destination.Tags = nil
	}

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

	// No error
	return nil
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type StorageAccountsBlobServicesContainerOperatorSpec 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_StorageAccountsBlobServicesContainerOperatorSpec populates our StorageAccountsBlobServicesContainerOperatorSpec from the provided source StorageAccountsBlobServicesContainerOperatorSpec
func (operator *StorageAccountsBlobServicesContainerOperatorSpec) AssignProperties_From_StorageAccountsBlobServicesContainerOperatorSpec(source *storage.StorageAccountsBlobServicesContainerOperatorSpec) 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_StorageAccountsBlobServicesContainerOperatorSpec populates the provided destination StorageAccountsBlobServicesContainerOperatorSpec from our StorageAccountsBlobServicesContainerOperatorSpec
func (operator *StorageAccountsBlobServicesContainerOperatorSpec) AssignProperties_To_StorageAccountsBlobServicesContainerOperatorSpec(destination *storage.StorageAccountsBlobServicesContainerOperatorSpec) 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 ImmutabilityPolicyProperty_State_STATUS string

const (
	ImmutabilityPolicyProperty_State_STATUS_Locked   = ImmutabilityPolicyProperty_State_STATUS("Locked")
	ImmutabilityPolicyProperty_State_STATUS_Unlocked = ImmutabilityPolicyProperty_State_STATUS("Unlocked")
)

// Mapping from string to ImmutabilityPolicyProperty_State_STATUS
var immutabilityPolicyProperty_State_STATUS_Values = map[string]ImmutabilityPolicyProperty_State_STATUS{
	"locked":   ImmutabilityPolicyProperty_State_STATUS_Locked,
	"unlocked": ImmutabilityPolicyProperty_State_STATUS_Unlocked,
}

type ImmutableStorageWithVersioning_MigrationState_STATUS string

const (
	ImmutableStorageWithVersioning_MigrationState_STATUS_Completed  = ImmutableStorageWithVersioning_MigrationState_STATUS("Completed")
	ImmutableStorageWithVersioning_MigrationState_STATUS_InProgress = ImmutableStorageWithVersioning_MigrationState_STATUS("InProgress")
)

// Mapping from string to ImmutableStorageWithVersioning_MigrationState_STATUS
var immutableStorageWithVersioning_MigrationState_STATUS_Values = map[string]ImmutableStorageWithVersioning_MigrationState_STATUS{
	"completed":  ImmutableStorageWithVersioning_MigrationState_STATUS_Completed,
	"inprogress": ImmutableStorageWithVersioning_MigrationState_STATUS_InProgress,
}

// Protected append writes history setting for the blob container with Legal holds.
type ProtectedAppendWritesHistory_STATUS struct {
	// AllowProtectedAppendWritesAll: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining
	// legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.
	AllowProtectedAppendWritesAll *bool `json:"allowProtectedAppendWritesAll,omitempty"`

	// Timestamp: Returns the date and time the tag was added.
	Timestamp *string `json:"timestamp,omitempty"`
}

var _ genruntime.FromARMConverter = &ProtectedAppendWritesHistory_STATUS{}

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

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

	// Set property "AllowProtectedAppendWritesAll":
	if typedInput.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *typedInput.AllowProtectedAppendWritesAll
		history.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	}

	// Set property "Timestamp":
	if typedInput.Timestamp != nil {
		timestamp := *typedInput.Timestamp
		history.Timestamp = &timestamp
	}

	// No error
	return nil
}

// AssignProperties_From_ProtectedAppendWritesHistory_STATUS populates our ProtectedAppendWritesHistory_STATUS from the provided source ProtectedAppendWritesHistory_STATUS
func (history *ProtectedAppendWritesHistory_STATUS) AssignProperties_From_ProtectedAppendWritesHistory_STATUS(source *storage.ProtectedAppendWritesHistory_STATUS) error {

	// AllowProtectedAppendWritesAll
	if source.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *source.AllowProtectedAppendWritesAll
		history.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	} else {
		history.AllowProtectedAppendWritesAll = nil
	}

	// Timestamp
	history.Timestamp = genruntime.ClonePointerToString(source.Timestamp)

	// No error
	return nil
}

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

	// AllowProtectedAppendWritesAll
	if history.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *history.AllowProtectedAppendWritesAll
		destination.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	} else {
		destination.AllowProtectedAppendWritesAll = nil
	}

	// Timestamp
	destination.Timestamp = genruntime.ClonePointerToString(history.Timestamp)

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

	// No error
	return nil
}

// A tag of the LegalHold of a blob container.
type TagProperty_STATUS struct {
	// ObjectIdentifier: Returns the Object ID of the user who added the tag.
	ObjectIdentifier *string `json:"objectIdentifier,omitempty"`

	// Tag: The tag value.
	Tag *string `json:"tag,omitempty"`

	// TenantId: Returns the Tenant ID that issued the token for the user who added the tag.
	TenantId *string `json:"tenantId,omitempty"`

	// Timestamp: Returns the date and time the tag was added.
	Timestamp *string `json:"timestamp,omitempty"`

	// Upn: Returns the User Principal Name of the user who added the tag.
	Upn *string `json:"upn,omitempty"`
}

var _ genruntime.FromARMConverter = &TagProperty_STATUS{}

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

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

	// Set property "ObjectIdentifier":
	if typedInput.ObjectIdentifier != nil {
		objectIdentifier := *typedInput.ObjectIdentifier
		property.ObjectIdentifier = &objectIdentifier
	}

	// Set property "Tag":
	if typedInput.Tag != nil {
		tag := *typedInput.Tag
		property.Tag = &tag
	}

	// Set property "TenantId":
	if typedInput.TenantId != nil {
		tenantId := *typedInput.TenantId
		property.TenantId = &tenantId
	}

	// Set property "Timestamp":
	if typedInput.Timestamp != nil {
		timestamp := *typedInput.Timestamp
		property.Timestamp = &timestamp
	}

	// Set property "Upn":
	if typedInput.Upn != nil {
		upn := *typedInput.Upn
		property.Upn = &upn
	}

	// No error
	return nil
}

// AssignProperties_From_TagProperty_STATUS populates our TagProperty_STATUS from the provided source TagProperty_STATUS
func (property *TagProperty_STATUS) AssignProperties_From_TagProperty_STATUS(source *storage.TagProperty_STATUS) error {

	// ObjectIdentifier
	property.ObjectIdentifier = genruntime.ClonePointerToString(source.ObjectIdentifier)

	// Tag
	property.Tag = genruntime.ClonePointerToString(source.Tag)

	// TenantId
	property.TenantId = genruntime.ClonePointerToString(source.TenantId)

	// Timestamp
	property.Timestamp = genruntime.ClonePointerToString(source.Timestamp)

	// Upn
	property.Upn = genruntime.ClonePointerToString(source.Upn)

	// No error
	return nil
}

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

	// ObjectIdentifier
	destination.ObjectIdentifier = genruntime.ClonePointerToString(property.ObjectIdentifier)

	// Tag
	destination.Tag = genruntime.ClonePointerToString(property.Tag)

	// TenantId
	destination.TenantId = genruntime.ClonePointerToString(property.TenantId)

	// Timestamp
	destination.Timestamp = genruntime.ClonePointerToString(property.Timestamp)

	// Upn
	destination.Upn = genruntime.ClonePointerToString(property.Upn)

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

	// No error
	return nil
}

// An update history of the ImmutabilityPolicy of a blob container.
type UpdateHistoryProperty_STATUS struct {
	// AllowProtectedAppendWrites: This property can only be changed for unlocked time-based retention policies. When enabled,
	// new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks
	// can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with
	// ExtendImmutabilityPolicy API.
	AllowProtectedAppendWrites *bool `json:"allowProtectedAppendWrites,omitempty"`

	// AllowProtectedAppendWritesAll: This property can only be changed for unlocked time-based retention policies. When
	// enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and
	// compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be
	// changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll'
	// properties are mutually exclusive.
	AllowProtectedAppendWritesAll *bool `json:"allowProtectedAppendWritesAll,omitempty"`

	// ImmutabilityPeriodSinceCreationInDays: The immutability period for the blobs in the container since the policy creation,
	// in days.
	ImmutabilityPeriodSinceCreationInDays *int `json:"immutabilityPeriodSinceCreationInDays,omitempty"`

	// ObjectIdentifier: Returns the Object ID of the user who updated the ImmutabilityPolicy.
	ObjectIdentifier *string `json:"objectIdentifier,omitempty"`

	// TenantId: Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy.
	TenantId *string `json:"tenantId,omitempty"`

	// Timestamp: Returns the date and time the ImmutabilityPolicy was updated.
	Timestamp *string `json:"timestamp,omitempty"`

	// Update: The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend.
	Update *UpdateHistoryProperty_Update_STATUS `json:"update,omitempty"`

	// Upn: Returns the User Principal Name of the user who updated the ImmutabilityPolicy.
	Upn *string `json:"upn,omitempty"`
}

var _ genruntime.FromARMConverter = &UpdateHistoryProperty_STATUS{}

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

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

	// Set property "AllowProtectedAppendWrites":
	if typedInput.AllowProtectedAppendWrites != nil {
		allowProtectedAppendWrites := *typedInput.AllowProtectedAppendWrites
		property.AllowProtectedAppendWrites = &allowProtectedAppendWrites
	}

	// Set property "AllowProtectedAppendWritesAll":
	if typedInput.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *typedInput.AllowProtectedAppendWritesAll
		property.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	}

	// Set property "ImmutabilityPeriodSinceCreationInDays":
	if typedInput.ImmutabilityPeriodSinceCreationInDays != nil {
		immutabilityPeriodSinceCreationInDays := *typedInput.ImmutabilityPeriodSinceCreationInDays
		property.ImmutabilityPeriodSinceCreationInDays = &immutabilityPeriodSinceCreationInDays
	}

	// Set property "ObjectIdentifier":
	if typedInput.ObjectIdentifier != nil {
		objectIdentifier := *typedInput.ObjectIdentifier
		property.ObjectIdentifier = &objectIdentifier
	}

	// Set property "TenantId":
	if typedInput.TenantId != nil {
		tenantId := *typedInput.TenantId
		property.TenantId = &tenantId
	}

	// Set property "Timestamp":
	if typedInput.Timestamp != nil {
		timestamp := *typedInput.Timestamp
		property.Timestamp = &timestamp
	}

	// Set property "Update":
	if typedInput.Update != nil {
		var temp string
		temp = string(*typedInput.Update)
		update := UpdateHistoryProperty_Update_STATUS(temp)
		property.Update = &update
	}

	// Set property "Upn":
	if typedInput.Upn != nil {
		upn := *typedInput.Upn
		property.Upn = &upn
	}

	// No error
	return nil
}

// AssignProperties_From_UpdateHistoryProperty_STATUS populates our UpdateHistoryProperty_STATUS from the provided source UpdateHistoryProperty_STATUS
func (property *UpdateHistoryProperty_STATUS) AssignProperties_From_UpdateHistoryProperty_STATUS(source *storage.UpdateHistoryProperty_STATUS) error {

	// AllowProtectedAppendWrites
	if source.AllowProtectedAppendWrites != nil {
		allowProtectedAppendWrite := *source.AllowProtectedAppendWrites
		property.AllowProtectedAppendWrites = &allowProtectedAppendWrite
	} else {
		property.AllowProtectedAppendWrites = nil
	}

	// AllowProtectedAppendWritesAll
	if source.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *source.AllowProtectedAppendWritesAll
		property.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	} else {
		property.AllowProtectedAppendWritesAll = nil
	}

	// ImmutabilityPeriodSinceCreationInDays
	property.ImmutabilityPeriodSinceCreationInDays = genruntime.ClonePointerToInt(source.ImmutabilityPeriodSinceCreationInDays)

	// ObjectIdentifier
	property.ObjectIdentifier = genruntime.ClonePointerToString(source.ObjectIdentifier)

	// TenantId
	property.TenantId = genruntime.ClonePointerToString(source.TenantId)

	// Timestamp
	property.Timestamp = genruntime.ClonePointerToString(source.Timestamp)

	// Update
	if source.Update != nil {
		update := *source.Update
		updateTemp := genruntime.ToEnum(update, updateHistoryProperty_Update_STATUS_Values)
		property.Update = &updateTemp
	} else {
		property.Update = nil
	}

	// Upn
	property.Upn = genruntime.ClonePointerToString(source.Upn)

	// No error
	return nil
}

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

	// AllowProtectedAppendWrites
	if property.AllowProtectedAppendWrites != nil {
		allowProtectedAppendWrite := *property.AllowProtectedAppendWrites
		destination.AllowProtectedAppendWrites = &allowProtectedAppendWrite
	} else {
		destination.AllowProtectedAppendWrites = nil
	}

	// AllowProtectedAppendWritesAll
	if property.AllowProtectedAppendWritesAll != nil {
		allowProtectedAppendWritesAll := *property.AllowProtectedAppendWritesAll
		destination.AllowProtectedAppendWritesAll = &allowProtectedAppendWritesAll
	} else {
		destination.AllowProtectedAppendWritesAll = nil
	}

	// ImmutabilityPeriodSinceCreationInDays
	destination.ImmutabilityPeriodSinceCreationInDays = genruntime.ClonePointerToInt(property.ImmutabilityPeriodSinceCreationInDays)

	// ObjectIdentifier
	destination.ObjectIdentifier = genruntime.ClonePointerToString(property.ObjectIdentifier)

	// TenantId
	destination.TenantId = genruntime.ClonePointerToString(property.TenantId)

	// Timestamp
	destination.Timestamp = genruntime.ClonePointerToString(property.Timestamp)

	// Update
	if property.Update != nil {
		update := string(*property.Update)
		destination.Update = &update
	} else {
		destination.Update = nil
	}

	// Upn
	destination.Upn = genruntime.ClonePointerToString(property.Upn)

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

	// No error
	return nil
}

type UpdateHistoryProperty_Update_STATUS string

const (
	UpdateHistoryProperty_Update_STATUS_Extend = UpdateHistoryProperty_Update_STATUS("extend")
	UpdateHistoryProperty_Update_STATUS_Lock   = UpdateHistoryProperty_Update_STATUS("lock")
	UpdateHistoryProperty_Update_STATUS_Put    = UpdateHistoryProperty_Update_STATUS("put")
)

// Mapping from string to UpdateHistoryProperty_Update_STATUS
var updateHistoryProperty_Update_STATUS_Values = map[string]UpdateHistoryProperty_Update_STATUS{
	"extend": UpdateHistoryProperty_Update_STATUS_Extend,
	"lock":   UpdateHistoryProperty_Update_STATUS_Lock,
	"put":    UpdateHistoryProperty_Update_STATUS_Put,
}

func init() {
	SchemeBuilder.Register(&StorageAccountsBlobServicesContainer{}, &StorageAccountsBlobServicesContainerList{})
}
