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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/appconfiguration/v1api20220501/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/appconfiguration/v1api20220501/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,appconfiguration}
// +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: /appconfiguration/resource-manager/Microsoft.AppConfiguration/AppConfiguration/stable/2022-05-01/appconfiguration.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}
type ConfigurationStore struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ConfigurationStore_Spec   `json:"spec,omitempty"`
	Status            ConfigurationStore_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &ConfigurationStore{}

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

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

var _ conversion.Convertible = &ConfigurationStore{}

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

	return store.AssignProperties_From_ConfigurationStore(source)
}

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

	return store.AssignProperties_To_ConfigurationStore(destination)
}

var _ configmaps.Exporter = &ConfigurationStore{}

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

var _ secrets.Exporter = &ConfigurationStore{}

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

var _ genruntime.ImportableResource = &ConfigurationStore{}

// InitializeSpec initializes the spec for this resource from the given status
func (store *ConfigurationStore) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*ConfigurationStore_STATUS); ok {
		return store.Spec.Initialize_From_ConfigurationStore_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &ConfigurationStore{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.AppConfiguration/configurationStores"
func (store *ConfigurationStore) GetType() string {
	return "Microsoft.AppConfiguration/configurationStores"
}

// NewEmptyStatus returns a new empty (blank) status
func (store *ConfigurationStore) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &ConfigurationStore_STATUS{}
}

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

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

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

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

	store.Status = st
	return nil
}

// AssignProperties_From_ConfigurationStore populates our ConfigurationStore from the provided source ConfigurationStore
func (store *ConfigurationStore) AssignProperties_From_ConfigurationStore(source *storage.ConfigurationStore) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ConfigurationStore populates the provided destination ConfigurationStore from our ConfigurationStore
func (store *ConfigurationStore) AssignProperties_To_ConfigurationStore(destination *storage.ConfigurationStore) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /appconfiguration/resource-manager/Microsoft.AppConfiguration/AppConfiguration/stable/2022-05-01/appconfiguration.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}
type ConfigurationStoreList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ConfigurationStore `json:"items"`
}

// +kubebuilder:validation:Enum={"2022-05-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2022-05-01")

type ConfigurationStore_Spec struct {
	// +kubebuilder:validation:MaxLength=50
	// +kubebuilder:validation:MinLength=5
	// +kubebuilder:validation:Pattern="^[a-zA-Z0-9_-]*$"
	// 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"`

	// CreateMode: Indicates whether the configuration store need to be recovered.
	CreateMode *ConfigurationStoreProperties_CreateMode `json:"createMode,omitempty"`

	// DisableLocalAuth: Disables all authentication methods other than AAD authentication.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// EnablePurgeProtection: Property specifying whether protection against purge is enabled for this configuration store.
	EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"`

	// Encryption: The encryption settings of the configuration store.
	Encryption *EncryptionProperties `json:"encryption,omitempty"`

	// Identity: The managed identity information, if configured.
	Identity *ResourceIdentity `json:"identity,omitempty"`

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

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *ConfigurationStoreOperatorSpec `json:"operatorSpec,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`

	// PublicNetworkAccess: Control permission for data plane traffic coming from public networks while private endpoint is
	// enabled.
	PublicNetworkAccess *ConfigurationStoreProperties_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// +kubebuilder:validation:Required
	// Sku: The sku of the configuration store.
	Sku *Sku `json:"sku,omitempty"`

	// SoftDeleteRetentionInDays: The amount of time in days that the configuration store will be retained when it is soft
	// deleted.
	SoftDeleteRetentionInDays *int `json:"softDeleteRetentionInDays,omitempty"`

	// SystemData: Resource system metadata.
	SystemData *SystemData `json:"systemData,omitempty"`

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

var _ genruntime.ARMTransformer = &ConfigurationStore_Spec{}

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

	// Set property "Identity":
	if store.Identity != nil {
		identity_ARM, err := store.Identity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		identity := *identity_ARM.(*arm.ResourceIdentity)
		result.Identity = &identity
	}

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

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

	// Set property "Properties":
	if store.CreateMode != nil ||
		store.DisableLocalAuth != nil ||
		store.EnablePurgeProtection != nil ||
		store.Encryption != nil ||
		store.PublicNetworkAccess != nil ||
		store.SoftDeleteRetentionInDays != nil {
		result.Properties = &arm.ConfigurationStoreProperties{}
	}
	if store.CreateMode != nil {
		var temp string
		temp = string(*store.CreateMode)
		createMode := arm.ConfigurationStoreProperties_CreateMode(temp)
		result.Properties.CreateMode = &createMode
	}
	if store.DisableLocalAuth != nil {
		disableLocalAuth := *store.DisableLocalAuth
		result.Properties.DisableLocalAuth = &disableLocalAuth
	}
	if store.EnablePurgeProtection != nil {
		enablePurgeProtection := *store.EnablePurgeProtection
		result.Properties.EnablePurgeProtection = &enablePurgeProtection
	}
	if store.Encryption != nil {
		encryption_ARM, err := store.Encryption.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		encryption := *encryption_ARM.(*arm.EncryptionProperties)
		result.Properties.Encryption = &encryption
	}
	if store.PublicNetworkAccess != nil {
		var temp string
		temp = string(*store.PublicNetworkAccess)
		publicNetworkAccess := arm.ConfigurationStoreProperties_PublicNetworkAccess(temp)
		result.Properties.PublicNetworkAccess = &publicNetworkAccess
	}
	if store.SoftDeleteRetentionInDays != nil {
		softDeleteRetentionInDays := *store.SoftDeleteRetentionInDays
		result.Properties.SoftDeleteRetentionInDays = &softDeleteRetentionInDays
	}

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

	// Set property "SystemData":
	if store.SystemData != nil {
		systemData_ARM, err := store.SystemData.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		systemData := *systemData_ARM.(*arm.SystemData)
		result.SystemData = &systemData
	}

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

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

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

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

	// Set property "CreateMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreateMode != nil {
			var temp string
			temp = string(*typedInput.Properties.CreateMode)
			createMode := ConfigurationStoreProperties_CreateMode(temp)
			store.CreateMode = &createMode
		}
	}

	// Set property "DisableLocalAuth":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableLocalAuth != nil {
			disableLocalAuth := *typedInput.Properties.DisableLocalAuth
			store.DisableLocalAuth = &disableLocalAuth
		}
	}

	// Set property "EnablePurgeProtection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnablePurgeProtection != nil {
			enablePurgeProtection := *typedInput.Properties.EnablePurgeProtection
			store.EnablePurgeProtection = &enablePurgeProtection
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 EncryptionProperties
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			store.Encryption = &encryption
		}
	}

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ResourceIdentity
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		store.Identity = &identity
	}

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

	// no assignment for property "OperatorSpec"

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

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := ConfigurationStoreProperties_PublicNetworkAccess(temp)
			store.PublicNetworkAccess = &publicNetworkAccess
		}
	}

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

	// Set property "SoftDeleteRetentionInDays":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SoftDeleteRetentionInDays != nil {
			softDeleteRetentionInDays := *typedInput.Properties.SoftDeleteRetentionInDays
			store.SoftDeleteRetentionInDays = &softDeleteRetentionInDays
		}
	}

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &ConfigurationStore_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.ConfigurationStore_Spec{}
	err := store.AssignProperties_To_ConfigurationStore_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_ConfigurationStore_Spec populates our ConfigurationStore_Spec from the provided source ConfigurationStore_Spec
func (store *ConfigurationStore_Spec) AssignProperties_From_ConfigurationStore_Spec(source *storage.ConfigurationStore_Spec) error {

	// AzureName
	store.AzureName = source.AzureName

	// CreateMode
	if source.CreateMode != nil {
		createMode := *source.CreateMode
		createModeTemp := genruntime.ToEnum(createMode, configurationStoreProperties_CreateMode_Values)
		store.CreateMode = &createModeTemp
	} else {
		store.CreateMode = nil
	}

	// DisableLocalAuth
	if source.DisableLocalAuth != nil {
		disableLocalAuth := *source.DisableLocalAuth
		store.DisableLocalAuth = &disableLocalAuth
	} else {
		store.DisableLocalAuth = nil
	}

	// EnablePurgeProtection
	if source.EnablePurgeProtection != nil {
		enablePurgeProtection := *source.EnablePurgeProtection
		store.EnablePurgeProtection = &enablePurgeProtection
	} else {
		store.EnablePurgeProtection = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption EncryptionProperties
		err := encryption.AssignProperties_From_EncryptionProperties(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EncryptionProperties() to populate field Encryption")
		}
		store.Encryption = &encryption
	} else {
		store.Encryption = nil
	}

	// Identity
	if source.Identity != nil {
		var identity ResourceIdentity
		err := identity.AssignProperties_From_ResourceIdentity(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceIdentity() to populate field Identity")
		}
		store.Identity = &identity
	} else {
		store.Identity = nil
	}

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

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

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, configurationStoreProperties_PublicNetworkAccess_Values)
		store.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		store.PublicNetworkAccess = nil
	}

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

	// SoftDeleteRetentionInDays
	store.SoftDeleteRetentionInDays = genruntime.ClonePointerToInt(source.SoftDeleteRetentionInDays)

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = store.AzureName

	// CreateMode
	if store.CreateMode != nil {
		createMode := string(*store.CreateMode)
		destination.CreateMode = &createMode
	} else {
		destination.CreateMode = nil
	}

	// DisableLocalAuth
	if store.DisableLocalAuth != nil {
		disableLocalAuth := *store.DisableLocalAuth
		destination.DisableLocalAuth = &disableLocalAuth
	} else {
		destination.DisableLocalAuth = nil
	}

	// EnablePurgeProtection
	if store.EnablePurgeProtection != nil {
		enablePurgeProtection := *store.EnablePurgeProtection
		destination.EnablePurgeProtection = &enablePurgeProtection
	} else {
		destination.EnablePurgeProtection = nil
	}

	// Encryption
	if store.Encryption != nil {
		var encryption storage.EncryptionProperties
		err := store.Encryption.AssignProperties_To_EncryptionProperties(&encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EncryptionProperties() to populate field Encryption")
		}
		destination.Encryption = &encryption
	} else {
		destination.Encryption = nil
	}

	// Identity
	if store.Identity != nil {
		var identity storage.ResourceIdentity
		err := store.Identity.AssignProperties_To_ResourceIdentity(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceIdentity() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

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

	// OriginalVersion
	destination.OriginalVersion = store.OriginalVersion()

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

	// PublicNetworkAccess
	if store.PublicNetworkAccess != nil {
		publicNetworkAccess := string(*store.PublicNetworkAccess)
		destination.PublicNetworkAccess = &publicNetworkAccess
	} else {
		destination.PublicNetworkAccess = nil
	}

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

	// SoftDeleteRetentionInDays
	destination.SoftDeleteRetentionInDays = genruntime.ClonePointerToInt(store.SoftDeleteRetentionInDays)

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

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

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

	// No error
	return nil
}

// Initialize_From_ConfigurationStore_STATUS populates our ConfigurationStore_Spec from the provided source ConfigurationStore_STATUS
func (store *ConfigurationStore_Spec) Initialize_From_ConfigurationStore_STATUS(source *ConfigurationStore_STATUS) error {

	// CreateMode
	if source.CreateMode != nil {
		createMode := genruntime.ToEnum(string(*source.CreateMode), configurationStoreProperties_CreateMode_Values)
		store.CreateMode = &createMode
	} else {
		store.CreateMode = nil
	}

	// DisableLocalAuth
	if source.DisableLocalAuth != nil {
		disableLocalAuth := *source.DisableLocalAuth
		store.DisableLocalAuth = &disableLocalAuth
	} else {
		store.DisableLocalAuth = nil
	}

	// EnablePurgeProtection
	if source.EnablePurgeProtection != nil {
		enablePurgeProtection := *source.EnablePurgeProtection
		store.EnablePurgeProtection = &enablePurgeProtection
	} else {
		store.EnablePurgeProtection = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption EncryptionProperties
		err := encryption.Initialize_From_EncryptionProperties_STATUS(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_EncryptionProperties_STATUS() to populate field Encryption")
		}
		store.Encryption = &encryption
	} else {
		store.Encryption = nil
	}

	// Identity
	if source.Identity != nil {
		var identity ResourceIdentity
		err := identity.Initialize_From_ResourceIdentity_STATUS(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ResourceIdentity_STATUS() to populate field Identity")
		}
		store.Identity = &identity
	} else {
		store.Identity = nil
	}

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := genruntime.ToEnum(string(*source.PublicNetworkAccess), configurationStoreProperties_PublicNetworkAccess_Values)
		store.PublicNetworkAccess = &publicNetworkAccess
	} else {
		store.PublicNetworkAccess = nil
	}

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

	// SoftDeleteRetentionInDays
	store.SoftDeleteRetentionInDays = genruntime.ClonePointerToInt(source.SoftDeleteRetentionInDays)

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

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

	// No error
	return nil
}

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

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

// The configuration store along with all resource properties. The Configuration Store will have all information to begin
// utilizing it.
type ConfigurationStore_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// CreateMode: Indicates whether the configuration store need to be recovered.
	CreateMode *ConfigurationStoreProperties_CreateMode_STATUS `json:"createMode,omitempty"`

	// CreationDate: The creation date of configuration store.
	CreationDate *string `json:"creationDate,omitempty"`

	// DisableLocalAuth: Disables all authentication methods other than AAD authentication.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// EnablePurgeProtection: Property specifying whether protection against purge is enabled for this configuration store.
	EnablePurgeProtection *bool `json:"enablePurgeProtection,omitempty"`

	// Encryption: The encryption settings of the configuration store.
	Encryption *EncryptionProperties_STATUS `json:"encryption,omitempty"`

	// Endpoint: The DNS endpoint where the configuration store API will be available.
	Endpoint *string `json:"endpoint,omitempty"`

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

	// Identity: The managed identity information, if configured.
	Identity *ResourceIdentity_STATUS `json:"identity,omitempty"`

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

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

	// PrivateEndpointConnections: The list of private endpoint connections that are set up for this resource.
	PrivateEndpointConnections []PrivateEndpointConnectionReference_STATUS `json:"privateEndpointConnections,omitempty"`

	// ProvisioningState: The provisioning state of the configuration store.
	ProvisioningState *ConfigurationStoreProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Control permission for data plane traffic coming from public networks while private endpoint is
	// enabled.
	PublicNetworkAccess *ConfigurationStoreProperties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// Sku: The sku of the configuration store.
	Sku *Sku_STATUS `json:"sku,omitempty"`

	// SoftDeleteRetentionInDays: The amount of time in days that the configuration store will be retained when it is soft
	// deleted.
	SoftDeleteRetentionInDays *int `json:"softDeleteRetentionInDays,omitempty"`

	// SystemData: Resource system metadata.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

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

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

var _ genruntime.ConvertibleStatus = &ConfigurationStore_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.ConfigurationStore_STATUS{}
	err := store.AssignProperties_To_ConfigurationStore_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 = &ConfigurationStore_STATUS{}

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

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

	// no assignment for property "Conditions"

	// Set property "CreateMode":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreateMode != nil {
			var temp string
			temp = string(*typedInput.Properties.CreateMode)
			createMode := ConfigurationStoreProperties_CreateMode_STATUS(temp)
			store.CreateMode = &createMode
		}
	}

	// Set property "CreationDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreationDate != nil {
			creationDate := *typedInput.Properties.CreationDate
			store.CreationDate = &creationDate
		}
	}

	// Set property "DisableLocalAuth":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableLocalAuth != nil {
			disableLocalAuth := *typedInput.Properties.DisableLocalAuth
			store.DisableLocalAuth = &disableLocalAuth
		}
	}

	// Set property "EnablePurgeProtection":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnablePurgeProtection != nil {
			enablePurgeProtection := *typedInput.Properties.EnablePurgeProtection
			store.EnablePurgeProtection = &enablePurgeProtection
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 EncryptionProperties_STATUS
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			store.Encryption = &encryption
		}
	}

	// Set property "Endpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Endpoint != nil {
			endpoint := *typedInput.Properties.Endpoint
			store.Endpoint = &endpoint
		}
	}

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

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ResourceIdentity_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		store.Identity = &identity
	}

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

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

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

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := ConfigurationStoreProperties_ProvisioningState_STATUS(temp)
			store.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := ConfigurationStoreProperties_PublicNetworkAccess_STATUS(temp)
			store.PublicNetworkAccess = &publicNetworkAccess
		}
	}

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

	// Set property "SoftDeleteRetentionInDays":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SoftDeleteRetentionInDays != nil {
			softDeleteRetentionInDays := *typedInput.Properties.SoftDeleteRetentionInDays
			store.SoftDeleteRetentionInDays = &softDeleteRetentionInDays
		}
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ConfigurationStore_STATUS populates our ConfigurationStore_STATUS from the provided source ConfigurationStore_STATUS
func (store *ConfigurationStore_STATUS) AssignProperties_From_ConfigurationStore_STATUS(source *storage.ConfigurationStore_STATUS) error {

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

	// CreateMode
	if source.CreateMode != nil {
		createMode := *source.CreateMode
		createModeTemp := genruntime.ToEnum(createMode, configurationStoreProperties_CreateMode_STATUS_Values)
		store.CreateMode = &createModeTemp
	} else {
		store.CreateMode = nil
	}

	// CreationDate
	store.CreationDate = genruntime.ClonePointerToString(source.CreationDate)

	// DisableLocalAuth
	if source.DisableLocalAuth != nil {
		disableLocalAuth := *source.DisableLocalAuth
		store.DisableLocalAuth = &disableLocalAuth
	} else {
		store.DisableLocalAuth = nil
	}

	// EnablePurgeProtection
	if source.EnablePurgeProtection != nil {
		enablePurgeProtection := *source.EnablePurgeProtection
		store.EnablePurgeProtection = &enablePurgeProtection
	} else {
		store.EnablePurgeProtection = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption EncryptionProperties_STATUS
		err := encryption.AssignProperties_From_EncryptionProperties_STATUS(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EncryptionProperties_STATUS() to populate field Encryption")
		}
		store.Encryption = &encryption
	} else {
		store.Encryption = nil
	}

	// Endpoint
	store.Endpoint = genruntime.ClonePointerToString(source.Endpoint)

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

	// Identity
	if source.Identity != nil {
		var identity ResourceIdentity_STATUS
		err := identity.AssignProperties_From_ResourceIdentity_STATUS(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceIdentity_STATUS() to populate field Identity")
		}
		store.Identity = &identity
	} else {
		store.Identity = nil
	}

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

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

	// PrivateEndpointConnections
	if source.PrivateEndpointConnections != nil {
		privateEndpointConnectionList := make([]PrivateEndpointConnectionReference_STATUS, len(source.PrivateEndpointConnections))
		for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections {
			var privateEndpointConnection PrivateEndpointConnectionReference_STATUS
			err := privateEndpointConnection.AssignProperties_From_PrivateEndpointConnectionReference_STATUS(&privateEndpointConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PrivateEndpointConnectionReference_STATUS() to populate field PrivateEndpointConnections")
			}
			privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection
		}
		store.PrivateEndpointConnections = privateEndpointConnectionList
	} else {
		store.PrivateEndpointConnections = nil
	}

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, configurationStoreProperties_ProvisioningState_STATUS_Values)
		store.ProvisioningState = &provisioningStateTemp
	} else {
		store.ProvisioningState = nil
	}

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, configurationStoreProperties_PublicNetworkAccess_STATUS_Values)
		store.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		store.PublicNetworkAccess = nil
	}

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

	// SoftDeleteRetentionInDays
	store.SoftDeleteRetentionInDays = genruntime.ClonePointerToInt(source.SoftDeleteRetentionInDays)

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

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

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

	// No error
	return nil
}

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

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

	// CreateMode
	if store.CreateMode != nil {
		createMode := string(*store.CreateMode)
		destination.CreateMode = &createMode
	} else {
		destination.CreateMode = nil
	}

	// CreationDate
	destination.CreationDate = genruntime.ClonePointerToString(store.CreationDate)

	// DisableLocalAuth
	if store.DisableLocalAuth != nil {
		disableLocalAuth := *store.DisableLocalAuth
		destination.DisableLocalAuth = &disableLocalAuth
	} else {
		destination.DisableLocalAuth = nil
	}

	// EnablePurgeProtection
	if store.EnablePurgeProtection != nil {
		enablePurgeProtection := *store.EnablePurgeProtection
		destination.EnablePurgeProtection = &enablePurgeProtection
	} else {
		destination.EnablePurgeProtection = nil
	}

	// Encryption
	if store.Encryption != nil {
		var encryption storage.EncryptionProperties_STATUS
		err := store.Encryption.AssignProperties_To_EncryptionProperties_STATUS(&encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EncryptionProperties_STATUS() to populate field Encryption")
		}
		destination.Encryption = &encryption
	} else {
		destination.Encryption = nil
	}

	// Endpoint
	destination.Endpoint = genruntime.ClonePointerToString(store.Endpoint)

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

	// Identity
	if store.Identity != nil {
		var identity storage.ResourceIdentity_STATUS
		err := store.Identity.AssignProperties_To_ResourceIdentity_STATUS(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceIdentity_STATUS() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

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

	// PrivateEndpointConnections
	if store.PrivateEndpointConnections != nil {
		privateEndpointConnectionList := make([]storage.PrivateEndpointConnectionReference_STATUS, len(store.PrivateEndpointConnections))
		for privateEndpointConnectionIndex, privateEndpointConnectionItem := range store.PrivateEndpointConnections {
			var privateEndpointConnection storage.PrivateEndpointConnectionReference_STATUS
			err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnectionReference_STATUS(&privateEndpointConnection)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PrivateEndpointConnectionReference_STATUS() to populate field PrivateEndpointConnections")
			}
			privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection
		}
		destination.PrivateEndpointConnections = privateEndpointConnectionList
	} else {
		destination.PrivateEndpointConnections = nil
	}

	// ProvisioningState
	if store.ProvisioningState != nil {
		provisioningState := string(*store.ProvisioningState)
		destination.ProvisioningState = &provisioningState
	} else {
		destination.ProvisioningState = nil
	}

	// PublicNetworkAccess
	if store.PublicNetworkAccess != nil {
		publicNetworkAccess := string(*store.PublicNetworkAccess)
		destination.PublicNetworkAccess = &publicNetworkAccess
	} else {
		destination.PublicNetworkAccess = nil
	}

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

	// SoftDeleteRetentionInDays
	destination.SoftDeleteRetentionInDays = genruntime.ClonePointerToInt(store.SoftDeleteRetentionInDays)

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

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

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

	// 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 ConfigurationStoreOperatorSpec 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"`

	// Secrets: configures where to place Azure generated secrets.
	Secrets *ConfigurationStoreOperatorSecrets `json:"secrets,omitempty"`
}

// AssignProperties_From_ConfigurationStoreOperatorSpec populates our ConfigurationStoreOperatorSpec from the provided source ConfigurationStoreOperatorSpec
func (operator *ConfigurationStoreOperatorSpec) AssignProperties_From_ConfigurationStoreOperatorSpec(source *storage.ConfigurationStoreOperatorSpec) 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
	}

	// Secrets
	if source.Secrets != nil {
		var secret ConfigurationStoreOperatorSecrets
		err := secret.AssignProperties_From_ConfigurationStoreOperatorSecrets(source.Secrets)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConfigurationStoreOperatorSecrets() to populate field Secrets")
		}
		operator.Secrets = &secret
	} else {
		operator.Secrets = nil
	}

	// No error
	return nil
}

// AssignProperties_To_ConfigurationStoreOperatorSpec populates the provided destination ConfigurationStoreOperatorSpec from our ConfigurationStoreOperatorSpec
func (operator *ConfigurationStoreOperatorSpec) AssignProperties_To_ConfigurationStoreOperatorSpec(destination *storage.ConfigurationStoreOperatorSpec) 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
	}

	// Secrets
	if operator.Secrets != nil {
		var secret storage.ConfigurationStoreOperatorSecrets
		err := operator.Secrets.AssignProperties_To_ConfigurationStoreOperatorSecrets(&secret)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConfigurationStoreOperatorSecrets() to populate field Secrets")
		}
		destination.Secrets = &secret
	} else {
		destination.Secrets = nil
	}

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Default","Recover"}
type ConfigurationStoreProperties_CreateMode string

const (
	ConfigurationStoreProperties_CreateMode_Default = ConfigurationStoreProperties_CreateMode("Default")
	ConfigurationStoreProperties_CreateMode_Recover = ConfigurationStoreProperties_CreateMode("Recover")
)

// Mapping from string to ConfigurationStoreProperties_CreateMode
var configurationStoreProperties_CreateMode_Values = map[string]ConfigurationStoreProperties_CreateMode{
	"default": ConfigurationStoreProperties_CreateMode_Default,
	"recover": ConfigurationStoreProperties_CreateMode_Recover,
}

type ConfigurationStoreProperties_CreateMode_STATUS string

const (
	ConfigurationStoreProperties_CreateMode_STATUS_Default = ConfigurationStoreProperties_CreateMode_STATUS("Default")
	ConfigurationStoreProperties_CreateMode_STATUS_Recover = ConfigurationStoreProperties_CreateMode_STATUS("Recover")
)

// Mapping from string to ConfigurationStoreProperties_CreateMode_STATUS
var configurationStoreProperties_CreateMode_STATUS_Values = map[string]ConfigurationStoreProperties_CreateMode_STATUS{
	"default": ConfigurationStoreProperties_CreateMode_STATUS_Default,
	"recover": ConfigurationStoreProperties_CreateMode_STATUS_Recover,
}

type ConfigurationStoreProperties_ProvisioningState_STATUS string

const (
	ConfigurationStoreProperties_ProvisioningState_STATUS_Canceled  = ConfigurationStoreProperties_ProvisioningState_STATUS("Canceled")
	ConfigurationStoreProperties_ProvisioningState_STATUS_Creating  = ConfigurationStoreProperties_ProvisioningState_STATUS("Creating")
	ConfigurationStoreProperties_ProvisioningState_STATUS_Deleting  = ConfigurationStoreProperties_ProvisioningState_STATUS("Deleting")
	ConfigurationStoreProperties_ProvisioningState_STATUS_Failed    = ConfigurationStoreProperties_ProvisioningState_STATUS("Failed")
	ConfigurationStoreProperties_ProvisioningState_STATUS_Succeeded = ConfigurationStoreProperties_ProvisioningState_STATUS("Succeeded")
	ConfigurationStoreProperties_ProvisioningState_STATUS_Updating  = ConfigurationStoreProperties_ProvisioningState_STATUS("Updating")
)

// Mapping from string to ConfigurationStoreProperties_ProvisioningState_STATUS
var configurationStoreProperties_ProvisioningState_STATUS_Values = map[string]ConfigurationStoreProperties_ProvisioningState_STATUS{
	"canceled":  ConfigurationStoreProperties_ProvisioningState_STATUS_Canceled,
	"creating":  ConfigurationStoreProperties_ProvisioningState_STATUS_Creating,
	"deleting":  ConfigurationStoreProperties_ProvisioningState_STATUS_Deleting,
	"failed":    ConfigurationStoreProperties_ProvisioningState_STATUS_Failed,
	"succeeded": ConfigurationStoreProperties_ProvisioningState_STATUS_Succeeded,
	"updating":  ConfigurationStoreProperties_ProvisioningState_STATUS_Updating,
}

// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type ConfigurationStoreProperties_PublicNetworkAccess string

const (
	ConfigurationStoreProperties_PublicNetworkAccess_Disabled = ConfigurationStoreProperties_PublicNetworkAccess("Disabled")
	ConfigurationStoreProperties_PublicNetworkAccess_Enabled  = ConfigurationStoreProperties_PublicNetworkAccess("Enabled")
)

// Mapping from string to ConfigurationStoreProperties_PublicNetworkAccess
var configurationStoreProperties_PublicNetworkAccess_Values = map[string]ConfigurationStoreProperties_PublicNetworkAccess{
	"disabled": ConfigurationStoreProperties_PublicNetworkAccess_Disabled,
	"enabled":  ConfigurationStoreProperties_PublicNetworkAccess_Enabled,
}

type ConfigurationStoreProperties_PublicNetworkAccess_STATUS string

const (
	ConfigurationStoreProperties_PublicNetworkAccess_STATUS_Disabled = ConfigurationStoreProperties_PublicNetworkAccess_STATUS("Disabled")
	ConfigurationStoreProperties_PublicNetworkAccess_STATUS_Enabled  = ConfigurationStoreProperties_PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to ConfigurationStoreProperties_PublicNetworkAccess_STATUS
var configurationStoreProperties_PublicNetworkAccess_STATUS_Values = map[string]ConfigurationStoreProperties_PublicNetworkAccess_STATUS{
	"disabled": ConfigurationStoreProperties_PublicNetworkAccess_STATUS_Disabled,
	"enabled":  ConfigurationStoreProperties_PublicNetworkAccess_STATUS_Enabled,
}

// The encryption settings for a configuration store.
type EncryptionProperties struct {
	// KeyVaultProperties: Key vault properties.
	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
}

var _ genruntime.ARMTransformer = &EncryptionProperties{}

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

	// Set property "KeyVaultProperties":
	if properties.KeyVaultProperties != nil {
		keyVaultProperties_ARM, err := properties.KeyVaultProperties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		keyVaultProperties := *keyVaultProperties_ARM.(*arm.KeyVaultProperties)
		result.KeyVaultProperties = &keyVaultProperties
	}
	return result, nil
}

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

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

	// Set property "KeyVaultProperties":
	if typedInput.KeyVaultProperties != nil {
		var keyVaultProperties1 KeyVaultProperties
		err := keyVaultProperties1.PopulateFromARM(owner, *typedInput.KeyVaultProperties)
		if err != nil {
			return err
		}
		keyVaultProperties := keyVaultProperties1
		properties.KeyVaultProperties = &keyVaultProperties
	}

	// No error
	return nil
}

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

	// KeyVaultProperties
	if source.KeyVaultProperties != nil {
		var keyVaultProperty KeyVaultProperties
		err := keyVaultProperty.AssignProperties_From_KeyVaultProperties(source.KeyVaultProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KeyVaultProperties() to populate field KeyVaultProperties")
		}
		properties.KeyVaultProperties = &keyVaultProperty
	} else {
		properties.KeyVaultProperties = nil
	}

	// No error
	return nil
}

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

	// KeyVaultProperties
	if properties.KeyVaultProperties != nil {
		var keyVaultProperty storage.KeyVaultProperties
		err := properties.KeyVaultProperties.AssignProperties_To_KeyVaultProperties(&keyVaultProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KeyVaultProperties() to populate field KeyVaultProperties")
		}
		destination.KeyVaultProperties = &keyVaultProperty
	} else {
		destination.KeyVaultProperties = nil
	}

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

	// No error
	return nil
}

// Initialize_From_EncryptionProperties_STATUS populates our EncryptionProperties from the provided source EncryptionProperties_STATUS
func (properties *EncryptionProperties) Initialize_From_EncryptionProperties_STATUS(source *EncryptionProperties_STATUS) error {

	// KeyVaultProperties
	if source.KeyVaultProperties != nil {
		var keyVaultProperty KeyVaultProperties
		err := keyVaultProperty.Initialize_From_KeyVaultProperties_STATUS(source.KeyVaultProperties)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties")
		}
		properties.KeyVaultProperties = &keyVaultProperty
	} else {
		properties.KeyVaultProperties = nil
	}

	// No error
	return nil
}

// The encryption settings for a configuration store.
type EncryptionProperties_STATUS struct {
	// KeyVaultProperties: Key vault properties.
	KeyVaultProperties *KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"`
}

var _ genruntime.FromARMConverter = &EncryptionProperties_STATUS{}

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

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

	// Set property "KeyVaultProperties":
	if typedInput.KeyVaultProperties != nil {
		var keyVaultProperties1 KeyVaultProperties_STATUS
		err := keyVaultProperties1.PopulateFromARM(owner, *typedInput.KeyVaultProperties)
		if err != nil {
			return err
		}
		keyVaultProperties := keyVaultProperties1
		properties.KeyVaultProperties = &keyVaultProperties
	}

	// No error
	return nil
}

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

	// KeyVaultProperties
	if source.KeyVaultProperties != nil {
		var keyVaultProperty KeyVaultProperties_STATUS
		err := keyVaultProperty.AssignProperties_From_KeyVaultProperties_STATUS(source.KeyVaultProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties")
		}
		properties.KeyVaultProperties = &keyVaultProperty
	} else {
		properties.KeyVaultProperties = nil
	}

	// No error
	return nil
}

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

	// KeyVaultProperties
	if properties.KeyVaultProperties != nil {
		var keyVaultProperty storage.KeyVaultProperties_STATUS
		err := properties.KeyVaultProperties.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KeyVaultProperties_STATUS() to populate field KeyVaultProperties")
		}
		destination.KeyVaultProperties = &keyVaultProperty
	} else {
		destination.KeyVaultProperties = nil
	}

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

	// No error
	return nil
}

// A reference to a related private endpoint connection.
type PrivateEndpointConnectionReference_STATUS struct {
	// Id: The resource ID.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &PrivateEndpointConnectionReference_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PrivateEndpointConnectionReference_STATUS populates our PrivateEndpointConnectionReference_STATUS from the provided source PrivateEndpointConnectionReference_STATUS
func (reference *PrivateEndpointConnectionReference_STATUS) AssignProperties_From_PrivateEndpointConnectionReference_STATUS(source *storage.PrivateEndpointConnectionReference_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// An identity that can be associated with a resource.
type ResourceIdentity struct {
	// Type: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created
	// identity and a set of user-assigned identities. The type 'None' will remove any identities.
	Type *ResourceIdentity_Type `json:"type,omitempty"`

	// UserAssignedIdentities: The list of user-assigned identities associated with the resource. The user-assigned identity
	// dictionary keys will be ARM resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.ARMTransformer = &ResourceIdentity{}

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

	// Set property "Type":
	if identity.Type != nil {
		var temp string
		temp = string(*identity.Type)
		typeVar := arm.ResourceIdentity_Type(temp)
		result.Type = &typeVar
	}

	// Set property "UserAssignedIdentities":
	result.UserAssignedIdentities = make(map[string]arm.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities))
	for _, ident := range identity.UserAssignedIdentities {
		identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference)
		if err != nil {
			return nil, err
		}
		key := identARMID
		result.UserAssignedIdentities[key] = arm.UserAssignedIdentityDetails{}
	}
	return result, nil
}

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

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

// AssignProperties_From_ResourceIdentity populates our ResourceIdentity from the provided source ResourceIdentity
func (identity *ResourceIdentity) AssignProperties_From_ResourceIdentity(source *storage.ResourceIdentity) error {

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

	// UserAssignedIdentities
	if source.UserAssignedIdentities != nil {
		userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities))
		for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities {
			var userAssignedIdentity UserAssignedIdentityDetails
			err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities")
			}
			userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity
		}
		identity.UserAssignedIdentities = userAssignedIdentityList
	} else {
		identity.UserAssignedIdentities = nil
	}

	// No error
	return nil
}

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

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

	// UserAssignedIdentities
	if identity.UserAssignedIdentities != nil {
		userAssignedIdentityList := make([]storage.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities))
		for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities {
			var userAssignedIdentity storage.UserAssignedIdentityDetails
			err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities")
			}
			userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity
		}
		destination.UserAssignedIdentities = userAssignedIdentityList
	} else {
		destination.UserAssignedIdentities = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ResourceIdentity_STATUS populates our ResourceIdentity from the provided source ResourceIdentity_STATUS
func (identity *ResourceIdentity) Initialize_From_ResourceIdentity_STATUS(source *ResourceIdentity_STATUS) error {

	// Type
	if source.Type != nil {
		typeVar := genruntime.ToEnum(string(*source.Type), resourceIdentity_Type_Values)
		identity.Type = &typeVar
	} else {
		identity.Type = nil
	}

	// UserAssignedIdentities
	if source.UserAssignedIdentities != nil {
		userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities))
		for userAssignedIdentitiesKey := range source.UserAssignedIdentities {
			userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey)
			userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef})
		}
		identity.UserAssignedIdentities = userAssignedIdentityList
	} else {
		identity.UserAssignedIdentities = nil
	}

	// No error
	return nil
}

// An identity that can be associated with a resource.
type ResourceIdentity_STATUS struct {
	// PrincipalId: The principal id of the identity. This property will only be provided for a system-assigned identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: The tenant id associated with the resource's identity. This property will only be provided for a
	// system-assigned identity.
	TenantId *string `json:"tenantId,omitempty"`

	// Type: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created
	// identity and a set of user-assigned identities. The type 'None' will remove any identities.
	Type *ResourceIdentity_Type_STATUS `json:"type,omitempty"`

	// UserAssignedIdentities: The list of user-assigned identities associated with the resource. The user-assigned identity
	// dictionary keys will be ARM resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]UserIdentity_STATUS `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &ResourceIdentity_STATUS{}

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

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

	// Set property "PrincipalId":
	if typedInput.PrincipalId != nil {
		principalId := *typedInput.PrincipalId
		identity.PrincipalId = &principalId
	}

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

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

	// Set property "UserAssignedIdentities":
	if typedInput.UserAssignedIdentities != nil {
		identity.UserAssignedIdentities = make(map[string]UserIdentity_STATUS, len(typedInput.UserAssignedIdentities))
		for key, value := range typedInput.UserAssignedIdentities {
			var value1 UserIdentity_STATUS
			err := value1.PopulateFromARM(owner, value)
			if err != nil {
				return err
			}
			identity.UserAssignedIdentities[key] = value1
		}
	}

	// No error
	return nil
}

// AssignProperties_From_ResourceIdentity_STATUS populates our ResourceIdentity_STATUS from the provided source ResourceIdentity_STATUS
func (identity *ResourceIdentity_STATUS) AssignProperties_From_ResourceIdentity_STATUS(source *storage.ResourceIdentity_STATUS) error {

	// PrincipalId
	identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId)

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

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

	// UserAssignedIdentities
	if source.UserAssignedIdentities != nil {
		userAssignedIdentityMap := make(map[string]UserIdentity_STATUS, len(source.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range source.UserAssignedIdentities {
			var userAssignedIdentity UserIdentity_STATUS
			err := userAssignedIdentity.AssignProperties_From_UserIdentity_STATUS(&userAssignedIdentityValue)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_UserIdentity_STATUS() to populate field UserAssignedIdentities")
			}
			userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity
		}
		identity.UserAssignedIdentities = userAssignedIdentityMap
	} else {
		identity.UserAssignedIdentities = nil
	}

	// No error
	return nil
}

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

	// PrincipalId
	destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId)

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

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

	// UserAssignedIdentities
	if identity.UserAssignedIdentities != nil {
		userAssignedIdentityMap := make(map[string]storage.UserIdentity_STATUS, len(identity.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities {
			var userAssignedIdentity storage.UserIdentity_STATUS
			err := userAssignedIdentityValue.AssignProperties_To_UserIdentity_STATUS(&userAssignedIdentity)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UserIdentity_STATUS() to populate field UserAssignedIdentities")
			}
			userAssignedIdentityMap[userAssignedIdentityKey] = userAssignedIdentity
		}
		destination.UserAssignedIdentities = userAssignedIdentityMap
	} else {
		destination.UserAssignedIdentities = nil
	}

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

	// No error
	return nil
}

// Describes a configuration store SKU.
type Sku struct {
	// +kubebuilder:validation:Required
	// Name: The SKU name of the configuration store.
	Name *string `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &Sku{}

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

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

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

// Describes a configuration store SKU.
type Sku_STATUS struct {
	// Name: The SKU name of the configuration store.
	Name *string `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &Sku_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

var _ genruntime.ARMTransformer = &SystemData{}

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

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

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

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

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

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

	// Set property "LastModifiedByType":
	if data.LastModifiedByType != nil {
		var temp string
		temp = string(*data.LastModifiedByType)
		lastModifiedByType := arm.SystemData_LastModifiedByType(temp)
		result.LastModifiedByType = &lastModifiedByType
	}
	return result, nil
}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Initialize_From_SystemData_STATUS populates our SystemData from the provided source SystemData_STATUS
func (data *SystemData) Initialize_From_SystemData_STATUS(source *SystemData_STATUS) error {

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

var _ genruntime.FromARMConverter = &SystemData_STATUS{}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

type ConfigurationStoreOperatorSecrets struct {
	// PrimaryConnectionString: indicates where the PrimaryConnectionString secret should be placed. If omitted, the secret
	// will not be retrieved from Azure.
	PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"`

	// PrimaryKey: indicates where the PrimaryKey secret should be placed. If omitted, the secret will not be retrieved from
	// Azure.
	PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"`

	// PrimaryKeyID: indicates where the PrimaryKeyID secret should be placed. If omitted, the secret will not be retrieved
	// from Azure.
	PrimaryKeyID *genruntime.SecretDestination `json:"primaryKeyID,omitempty"`

	// PrimaryReadOnlyConnectionString: indicates where the PrimaryReadOnlyConnectionString secret should be placed. If
	// omitted, the secret will not be retrieved from Azure.
	PrimaryReadOnlyConnectionString *genruntime.SecretDestination `json:"primaryReadOnlyConnectionString,omitempty"`

	// PrimaryReadOnlyKey: indicates where the PrimaryReadOnlyKey secret should be placed. If omitted, the secret will not be
	// retrieved from Azure.
	PrimaryReadOnlyKey *genruntime.SecretDestination `json:"primaryReadOnlyKey,omitempty"`

	// PrimaryReadOnlyKeyID: indicates where the PrimaryReadOnlyKeyID secret should be placed. If omitted, the secret will not
	// be retrieved from Azure.
	PrimaryReadOnlyKeyID *genruntime.SecretDestination `json:"primaryReadOnlyKeyID,omitempty"`

	// SecondaryConnectionString: indicates where the SecondaryConnectionString secret should be placed. If omitted, the secret
	// will not be retrieved from Azure.
	SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"`

	// SecondaryKey: indicates where the SecondaryKey secret should be placed. If omitted, the secret will not be retrieved
	// from Azure.
	SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"`

	// SecondaryKeyID: indicates where the SecondaryKeyID secret should be placed. If omitted, the secret will not be retrieved
	// from Azure.
	SecondaryKeyID *genruntime.SecretDestination `json:"secondaryKeyID,omitempty"`

	// SecondaryReadOnlyConnectionString: indicates where the SecondaryReadOnlyConnectionString secret should be placed. If
	// omitted, the secret will not be retrieved from Azure.
	SecondaryReadOnlyConnectionString *genruntime.SecretDestination `json:"secondaryReadOnlyConnectionString,omitempty"`

	// SecondaryReadOnlyKey: indicates where the SecondaryReadOnlyKey secret should be placed. If omitted, the secret will not
	// be retrieved from Azure.
	SecondaryReadOnlyKey *genruntime.SecretDestination `json:"secondaryReadOnlyKey,omitempty"`

	// SecondaryReadOnlyKeyID: indicates where the SecondaryReadOnlyKeyID secret should be placed. If omitted, the secret will
	// not be retrieved from Azure.
	SecondaryReadOnlyKeyID *genruntime.SecretDestination `json:"secondaryReadOnlyKeyID,omitempty"`
}

// AssignProperties_From_ConfigurationStoreOperatorSecrets populates our ConfigurationStoreOperatorSecrets from the provided source ConfigurationStoreOperatorSecrets
func (secrets *ConfigurationStoreOperatorSecrets) AssignProperties_From_ConfigurationStoreOperatorSecrets(source *storage.ConfigurationStoreOperatorSecrets) error {

	// PrimaryConnectionString
	if source.PrimaryConnectionString != nil {
		primaryConnectionString := source.PrimaryConnectionString.Copy()
		secrets.PrimaryConnectionString = &primaryConnectionString
	} else {
		secrets.PrimaryConnectionString = nil
	}

	// PrimaryKey
	if source.PrimaryKey != nil {
		primaryKey := source.PrimaryKey.Copy()
		secrets.PrimaryKey = &primaryKey
	} else {
		secrets.PrimaryKey = nil
	}

	// PrimaryKeyID
	if source.PrimaryKeyID != nil {
		primaryKeyID := source.PrimaryKeyID.Copy()
		secrets.PrimaryKeyID = &primaryKeyID
	} else {
		secrets.PrimaryKeyID = nil
	}

	// PrimaryReadOnlyConnectionString
	if source.PrimaryReadOnlyConnectionString != nil {
		primaryReadOnlyConnectionString := source.PrimaryReadOnlyConnectionString.Copy()
		secrets.PrimaryReadOnlyConnectionString = &primaryReadOnlyConnectionString
	} else {
		secrets.PrimaryReadOnlyConnectionString = nil
	}

	// PrimaryReadOnlyKey
	if source.PrimaryReadOnlyKey != nil {
		primaryReadOnlyKey := source.PrimaryReadOnlyKey.Copy()
		secrets.PrimaryReadOnlyKey = &primaryReadOnlyKey
	} else {
		secrets.PrimaryReadOnlyKey = nil
	}

	// PrimaryReadOnlyKeyID
	if source.PrimaryReadOnlyKeyID != nil {
		primaryReadOnlyKeyID := source.PrimaryReadOnlyKeyID.Copy()
		secrets.PrimaryReadOnlyKeyID = &primaryReadOnlyKeyID
	} else {
		secrets.PrimaryReadOnlyKeyID = nil
	}

	// SecondaryConnectionString
	if source.SecondaryConnectionString != nil {
		secondaryConnectionString := source.SecondaryConnectionString.Copy()
		secrets.SecondaryConnectionString = &secondaryConnectionString
	} else {
		secrets.SecondaryConnectionString = nil
	}

	// SecondaryKey
	if source.SecondaryKey != nil {
		secondaryKey := source.SecondaryKey.Copy()
		secrets.SecondaryKey = &secondaryKey
	} else {
		secrets.SecondaryKey = nil
	}

	// SecondaryKeyID
	if source.SecondaryKeyID != nil {
		secondaryKeyID := source.SecondaryKeyID.Copy()
		secrets.SecondaryKeyID = &secondaryKeyID
	} else {
		secrets.SecondaryKeyID = nil
	}

	// SecondaryReadOnlyConnectionString
	if source.SecondaryReadOnlyConnectionString != nil {
		secondaryReadOnlyConnectionString := source.SecondaryReadOnlyConnectionString.Copy()
		secrets.SecondaryReadOnlyConnectionString = &secondaryReadOnlyConnectionString
	} else {
		secrets.SecondaryReadOnlyConnectionString = nil
	}

	// SecondaryReadOnlyKey
	if source.SecondaryReadOnlyKey != nil {
		secondaryReadOnlyKey := source.SecondaryReadOnlyKey.Copy()
		secrets.SecondaryReadOnlyKey = &secondaryReadOnlyKey
	} else {
		secrets.SecondaryReadOnlyKey = nil
	}

	// SecondaryReadOnlyKeyID
	if source.SecondaryReadOnlyKeyID != nil {
		secondaryReadOnlyKeyID := source.SecondaryReadOnlyKeyID.Copy()
		secrets.SecondaryReadOnlyKeyID = &secondaryReadOnlyKeyID
	} else {
		secrets.SecondaryReadOnlyKeyID = nil
	}

	// No error
	return nil
}

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

	// PrimaryConnectionString
	if secrets.PrimaryConnectionString != nil {
		primaryConnectionString := secrets.PrimaryConnectionString.Copy()
		destination.PrimaryConnectionString = &primaryConnectionString
	} else {
		destination.PrimaryConnectionString = nil
	}

	// PrimaryKey
	if secrets.PrimaryKey != nil {
		primaryKey := secrets.PrimaryKey.Copy()
		destination.PrimaryKey = &primaryKey
	} else {
		destination.PrimaryKey = nil
	}

	// PrimaryKeyID
	if secrets.PrimaryKeyID != nil {
		primaryKeyID := secrets.PrimaryKeyID.Copy()
		destination.PrimaryKeyID = &primaryKeyID
	} else {
		destination.PrimaryKeyID = nil
	}

	// PrimaryReadOnlyConnectionString
	if secrets.PrimaryReadOnlyConnectionString != nil {
		primaryReadOnlyConnectionString := secrets.PrimaryReadOnlyConnectionString.Copy()
		destination.PrimaryReadOnlyConnectionString = &primaryReadOnlyConnectionString
	} else {
		destination.PrimaryReadOnlyConnectionString = nil
	}

	// PrimaryReadOnlyKey
	if secrets.PrimaryReadOnlyKey != nil {
		primaryReadOnlyKey := secrets.PrimaryReadOnlyKey.Copy()
		destination.PrimaryReadOnlyKey = &primaryReadOnlyKey
	} else {
		destination.PrimaryReadOnlyKey = nil
	}

	// PrimaryReadOnlyKeyID
	if secrets.PrimaryReadOnlyKeyID != nil {
		primaryReadOnlyKeyID := secrets.PrimaryReadOnlyKeyID.Copy()
		destination.PrimaryReadOnlyKeyID = &primaryReadOnlyKeyID
	} else {
		destination.PrimaryReadOnlyKeyID = nil
	}

	// SecondaryConnectionString
	if secrets.SecondaryConnectionString != nil {
		secondaryConnectionString := secrets.SecondaryConnectionString.Copy()
		destination.SecondaryConnectionString = &secondaryConnectionString
	} else {
		destination.SecondaryConnectionString = nil
	}

	// SecondaryKey
	if secrets.SecondaryKey != nil {
		secondaryKey := secrets.SecondaryKey.Copy()
		destination.SecondaryKey = &secondaryKey
	} else {
		destination.SecondaryKey = nil
	}

	// SecondaryKeyID
	if secrets.SecondaryKeyID != nil {
		secondaryKeyID := secrets.SecondaryKeyID.Copy()
		destination.SecondaryKeyID = &secondaryKeyID
	} else {
		destination.SecondaryKeyID = nil
	}

	// SecondaryReadOnlyConnectionString
	if secrets.SecondaryReadOnlyConnectionString != nil {
		secondaryReadOnlyConnectionString := secrets.SecondaryReadOnlyConnectionString.Copy()
		destination.SecondaryReadOnlyConnectionString = &secondaryReadOnlyConnectionString
	} else {
		destination.SecondaryReadOnlyConnectionString = nil
	}

	// SecondaryReadOnlyKey
	if secrets.SecondaryReadOnlyKey != nil {
		secondaryReadOnlyKey := secrets.SecondaryReadOnlyKey.Copy()
		destination.SecondaryReadOnlyKey = &secondaryReadOnlyKey
	} else {
		destination.SecondaryReadOnlyKey = nil
	}

	// SecondaryReadOnlyKeyID
	if secrets.SecondaryReadOnlyKeyID != nil {
		secondaryReadOnlyKeyID := secrets.SecondaryReadOnlyKeyID.Copy()
		destination.SecondaryReadOnlyKeyID = &secondaryReadOnlyKeyID
	} else {
		destination.SecondaryReadOnlyKeyID = nil
	}

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

	// No error
	return nil
}

// Settings concerning key vault encryption for a configuration store.
type KeyVaultProperties struct {
	// IdentityClientId: The client id of the identity which will be used to access key vault.
	IdentityClientId *string `json:"identityClientId,omitempty"`

	// KeyIdentifier: The URI of the key vault key used to encrypt data.
	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
}

var _ genruntime.ARMTransformer = &KeyVaultProperties{}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Initialize_From_KeyVaultProperties_STATUS populates our KeyVaultProperties from the provided source KeyVaultProperties_STATUS
func (properties *KeyVaultProperties) Initialize_From_KeyVaultProperties_STATUS(source *KeyVaultProperties_STATUS) error {

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

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

	// No error
	return nil
}

// Settings concerning key vault encryption for a configuration store.
type KeyVaultProperties_STATUS struct {
	// IdentityClientId: The client id of the identity which will be used to access key vault.
	IdentityClientId *string `json:"identityClientId,omitempty"`

	// KeyIdentifier: The URI of the key vault key used to encrypt data.
	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
}

var _ genruntime.FromARMConverter = &KeyVaultProperties_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned, UserAssigned","UserAssigned"}
type ResourceIdentity_Type string

const (
	ResourceIdentity_Type_None                       = ResourceIdentity_Type("None")
	ResourceIdentity_Type_SystemAssigned             = ResourceIdentity_Type("SystemAssigned")
	ResourceIdentity_Type_SystemAssignedUserAssigned = ResourceIdentity_Type("SystemAssigned, UserAssigned")
	ResourceIdentity_Type_UserAssigned               = ResourceIdentity_Type("UserAssigned")
)

// Mapping from string to ResourceIdentity_Type
var resourceIdentity_Type_Values = map[string]ResourceIdentity_Type{
	"none":                         ResourceIdentity_Type_None,
	"systemassigned":               ResourceIdentity_Type_SystemAssigned,
	"systemassigned, userassigned": ResourceIdentity_Type_SystemAssignedUserAssigned,
	"userassigned":                 ResourceIdentity_Type_UserAssigned,
}

type ResourceIdentity_Type_STATUS string

const (
	ResourceIdentity_Type_STATUS_None                       = ResourceIdentity_Type_STATUS("None")
	ResourceIdentity_Type_STATUS_SystemAssigned             = ResourceIdentity_Type_STATUS("SystemAssigned")
	ResourceIdentity_Type_STATUS_SystemAssignedUserAssigned = ResourceIdentity_Type_STATUS("SystemAssigned, UserAssigned")
	ResourceIdentity_Type_STATUS_UserAssigned               = ResourceIdentity_Type_STATUS("UserAssigned")
)

// Mapping from string to ResourceIdentity_Type_STATUS
var resourceIdentity_Type_STATUS_Values = map[string]ResourceIdentity_Type_STATUS{
	"none":                         ResourceIdentity_Type_STATUS_None,
	"systemassigned":               ResourceIdentity_Type_STATUS_SystemAssigned,
	"systemassigned, userassigned": ResourceIdentity_Type_STATUS_SystemAssignedUserAssigned,
	"userassigned":                 ResourceIdentity_Type_STATUS_UserAssigned,
}

// +kubebuilder:validation:Enum={"Application","Key","ManagedIdentity","User"}
type SystemData_CreatedByType string

const (
	SystemData_CreatedByType_Application     = SystemData_CreatedByType("Application")
	SystemData_CreatedByType_Key             = SystemData_CreatedByType("Key")
	SystemData_CreatedByType_ManagedIdentity = SystemData_CreatedByType("ManagedIdentity")
	SystemData_CreatedByType_User            = SystemData_CreatedByType("User")
)

// Mapping from string to SystemData_CreatedByType
var systemData_CreatedByType_Values = map[string]SystemData_CreatedByType{
	"application":     SystemData_CreatedByType_Application,
	"key":             SystemData_CreatedByType_Key,
	"managedidentity": SystemData_CreatedByType_ManagedIdentity,
	"user":            SystemData_CreatedByType_User,
}

type SystemData_CreatedByType_STATUS string

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

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

// +kubebuilder:validation:Enum={"Application","Key","ManagedIdentity","User"}
type SystemData_LastModifiedByType string

const (
	SystemData_LastModifiedByType_Application     = SystemData_LastModifiedByType("Application")
	SystemData_LastModifiedByType_Key             = SystemData_LastModifiedByType("Key")
	SystemData_LastModifiedByType_ManagedIdentity = SystemData_LastModifiedByType("ManagedIdentity")
	SystemData_LastModifiedByType_User            = SystemData_LastModifiedByType("User")
)

// Mapping from string to SystemData_LastModifiedByType
var systemData_LastModifiedByType_Values = map[string]SystemData_LastModifiedByType{
	"application":     SystemData_LastModifiedByType_Application,
	"key":             SystemData_LastModifiedByType_Key,
	"managedidentity": SystemData_LastModifiedByType_ManagedIdentity,
	"user":            SystemData_LastModifiedByType_User,
}

type SystemData_LastModifiedByType_STATUS string

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

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

// Information about the user assigned identity for the resource
type UserAssignedIdentityDetails struct {
	Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"`
}

// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails
func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *storage.UserAssignedIdentityDetails) error {

	// Reference
	details.Reference = source.Reference.Copy()

	// No error
	return nil
}

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

	// Reference
	destination.Reference = details.Reference.Copy()

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

	// No error
	return nil
}

// A resource identity that is managed by the user of the service.
type UserIdentity_STATUS struct {
	// ClientId: The client ID of the user-assigned identity.
	ClientId *string `json:"clientId,omitempty"`

	// PrincipalId: The principal ID of the user-assigned identity.
	PrincipalId *string `json:"principalId,omitempty"`
}

var _ genruntime.FromARMConverter = &UserIdentity_STATUS{}

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

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

	// Set property "ClientId":
	if typedInput.ClientId != nil {
		clientId := *typedInput.ClientId
		identity.ClientId = &clientId
	}

	// Set property "PrincipalId":
	if typedInput.PrincipalId != nil {
		principalId := *typedInput.PrincipalId
		identity.PrincipalId = &principalId
	}

	// No error
	return nil
}

// AssignProperties_From_UserIdentity_STATUS populates our UserIdentity_STATUS from the provided source UserIdentity_STATUS
func (identity *UserIdentity_STATUS) AssignProperties_From_UserIdentity_STATUS(source *storage.UserIdentity_STATUS) error {

	// ClientId
	identity.ClientId = genruntime.ClonePointerToString(source.ClientId)

	// PrincipalId
	identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId)

	// No error
	return nil
}

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

	// ClientId
	destination.ClientId = genruntime.ClonePointerToString(identity.ClientId)

	// PrincipalId
	destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId)

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&ConfigurationStore{}, &ConfigurationStoreList{})
}
