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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/eventhub/v1api20240101/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,eventhub}
// +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: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}
type Namespace struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Namespace_Spec   `json:"spec,omitempty"`
	Status            Namespace_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Namespace{}

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

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

var _ conversion.Convertible = &Namespace{}

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

	return namespace.AssignProperties_From_Namespace(source)
}

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

	return namespace.AssignProperties_To_Namespace(destination)
}

var _ configmaps.Exporter = &Namespace{}

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

var _ secrets.Exporter = &Namespace{}

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

var _ genruntime.ImportableResource = &Namespace{}

// InitializeSpec initializes the spec for this resource from the given status
func (namespace *Namespace) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Namespace_STATUS); ok {
		return namespace.Spec.Initialize_From_Namespace_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Namespace{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01"
func (namespace Namespace) GetAPIVersion() string {
	return "2024-01-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.EventHub/namespaces"
func (namespace *Namespace) GetType() string {
	return "Microsoft.EventHub/namespaces"
}

// NewEmptyStatus returns a new empty (blank) status
func (namespace *Namespace) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Namespace_STATUS{}
}

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

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

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

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

	namespace.Status = st
	return nil
}

// AssignProperties_From_Namespace populates our Namespace from the provided source Namespace
func (namespace *Namespace) AssignProperties_From_Namespace(source *storage.Namespace) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Namespace populates the provided destination Namespace from our Namespace
func (namespace *Namespace) AssignProperties_To_Namespace(destination *storage.Namespace) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/namespaces.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}
type NamespaceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Namespace `json:"items"`
}

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

const APIVersion_Value = APIVersion("2024-01-01")

type Namespace_Spec struct {
	// AlternateName: Alternate name specified when alias and namespace names are same.
	AlternateName *string `json:"alternateName,omitempty"`

	// +kubebuilder:validation:MaxLength=50
	// +kubebuilder:validation:MinLength=6
	// +kubebuilder:validation:Pattern="^[a-zA-Z][a-zA-Z0-9-]{6,50}[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"`

	// ClusterArmReference: Cluster ARM ID of the Namespace.
	ClusterArmReference *genruntime.ResourceReference `armReference:"ClusterArmId" json:"clusterArmReference,omitempty"`

	// DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// Encryption: Properties of BYOK Encryption description
	Encryption *Encryption `json:"encryption,omitempty"`

	// Identity: Properties of BYOK Identity description
	Identity *Identity `json:"identity,omitempty"`

	// IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace.
	IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"`

	// KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace.
	KafkaEnabled *bool `json:"kafkaEnabled,omitempty"`

	// Location: Resource location.
	Location *string `json:"location,omitempty"`

	// +kubebuilder:validation:Minimum=0
	// MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20
	// throughput units. ( '0' if AutoInflateEnabled = true)
	MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"`

	// MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2'
	MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_Spec `json:"minimumTlsVersion,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *NamespaceOperatorSpec `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: This determines if traffic is allowed over public network. By default it is enabled.
	PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_Spec `json:"publicNetworkAccess,omitempty"`

	// Sku: Properties of sku resource
	Sku *Sku `json:"sku,omitempty"`

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

	// ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
}

var _ genruntime.ARMTransformer = &Namespace_Spec{}

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

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

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

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

	// Set property "Properties":
	if namespace.AlternateName != nil ||
		namespace.ClusterArmReference != nil ||
		namespace.DisableLocalAuth != nil ||
		namespace.Encryption != nil ||
		namespace.IsAutoInflateEnabled != nil ||
		namespace.KafkaEnabled != nil ||
		namespace.MaximumThroughputUnits != nil ||
		namespace.MinimumTlsVersion != nil ||
		namespace.PublicNetworkAccess != nil ||
		namespace.ZoneRedundant != nil {
		result.Properties = &arm.Namespace_Properties_Spec{}
	}
	if namespace.AlternateName != nil {
		alternateName := *namespace.AlternateName
		result.Properties.AlternateName = &alternateName
	}
	if namespace.ClusterArmReference != nil {
		clusterArmIdARMID, err := resolved.ResolvedReferences.Lookup(*namespace.ClusterArmReference)
		if err != nil {
			return nil, err
		}
		clusterArmId := clusterArmIdARMID
		result.Properties.ClusterArmId = &clusterArmId
	}
	if namespace.DisableLocalAuth != nil {
		disableLocalAuth := *namespace.DisableLocalAuth
		result.Properties.DisableLocalAuth = &disableLocalAuth
	}
	if namespace.Encryption != nil {
		encryption_ARM, err := namespace.Encryption.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		encryption := *encryption_ARM.(*arm.Encryption)
		result.Properties.Encryption = &encryption
	}
	if namespace.IsAutoInflateEnabled != nil {
		isAutoInflateEnabled := *namespace.IsAutoInflateEnabled
		result.Properties.IsAutoInflateEnabled = &isAutoInflateEnabled
	}
	if namespace.KafkaEnabled != nil {
		kafkaEnabled := *namespace.KafkaEnabled
		result.Properties.KafkaEnabled = &kafkaEnabled
	}
	if namespace.MaximumThroughputUnits != nil {
		maximumThroughputUnits := *namespace.MaximumThroughputUnits
		result.Properties.MaximumThroughputUnits = &maximumThroughputUnits
	}
	if namespace.MinimumTlsVersion != nil {
		var temp string
		temp = string(*namespace.MinimumTlsVersion)
		minimumTlsVersion := arm.Namespace_Properties_MinimumTlsVersion_Spec(temp)
		result.Properties.MinimumTlsVersion = &minimumTlsVersion
	}
	if namespace.PublicNetworkAccess != nil {
		var temp string
		temp = string(*namespace.PublicNetworkAccess)
		publicNetworkAccess := arm.Namespace_Properties_PublicNetworkAccess_Spec(temp)
		result.Properties.PublicNetworkAccess = &publicNetworkAccess
	}
	if namespace.ZoneRedundant != nil {
		zoneRedundant := *namespace.ZoneRedundant
		result.Properties.ZoneRedundant = &zoneRedundant
	}

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

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

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

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

	// Set property "AlternateName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AlternateName != nil {
			alternateName := *typedInput.Properties.AlternateName
			namespace.AlternateName = &alternateName
		}
	}

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

	// no assignment for property "ClusterArmReference"

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

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

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

	// Set property "IsAutoInflateEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsAutoInflateEnabled != nil {
			isAutoInflateEnabled := *typedInput.Properties.IsAutoInflateEnabled
			namespace.IsAutoInflateEnabled = &isAutoInflateEnabled
		}
	}

	// Set property "KafkaEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KafkaEnabled != nil {
			kafkaEnabled := *typedInput.Properties.KafkaEnabled
			namespace.KafkaEnabled = &kafkaEnabled
		}
	}

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

	// Set property "MaximumThroughputUnits":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaximumThroughputUnits != nil {
			maximumThroughputUnits := *typedInput.Properties.MaximumThroughputUnits
			namespace.MaximumThroughputUnits = &maximumThroughputUnits
		}
	}

	// Set property "MinimumTlsVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinimumTlsVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.MinimumTlsVersion)
			minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_Spec(temp)
			namespace.MinimumTlsVersion = &minimumTlsVersion
		}
	}

	// no assignment for property "OperatorSpec"

	// Set property "Owner":
	namespace.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 := Namespace_Properties_PublicNetworkAccess_Spec(temp)
			namespace.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
		namespace.Sku = &sku
	}

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

	// Set property "ZoneRedundant":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ZoneRedundant != nil {
			zoneRedundant := *typedInput.Properties.ZoneRedundant
			namespace.ZoneRedundant = &zoneRedundant
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Namespace_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Namespace_Spec{}
	err := namespace.AssignProperties_To_Namespace_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_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec
func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *storage.Namespace_Spec) error {

	// AlternateName
	namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName)

	// AzureName
	namespace.AzureName = source.AzureName

	// ClusterArmReference
	if source.ClusterArmReference != nil {
		clusterArmReference := source.ClusterArmReference.Copy()
		namespace.ClusterArmReference = &clusterArmReference
	} else {
		namespace.ClusterArmReference = nil
	}

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

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

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

	// IsAutoInflateEnabled
	if source.IsAutoInflateEnabled != nil {
		isAutoInflateEnabled := *source.IsAutoInflateEnabled
		namespace.IsAutoInflateEnabled = &isAutoInflateEnabled
	} else {
		namespace.IsAutoInflateEnabled = nil
	}

	// KafkaEnabled
	if source.KafkaEnabled != nil {
		kafkaEnabled := *source.KafkaEnabled
		namespace.KafkaEnabled = &kafkaEnabled
	} else {
		namespace.KafkaEnabled = nil
	}

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

	// MaximumThroughputUnits
	namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits)

	// MinimumTlsVersion
	if source.MinimumTlsVersion != nil {
		minimumTlsVersion := *source.MinimumTlsVersion
		minimumTlsVersionTemp := genruntime.ToEnum(minimumTlsVersion, namespace_Properties_MinimumTlsVersion_Spec_Values)
		namespace.MinimumTlsVersion = &minimumTlsVersionTemp
	} else {
		namespace.MinimumTlsVersion = nil
	}

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

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, namespace_Properties_PublicNetworkAccess_Spec_Values)
		namespace.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		namespace.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")
		}
		namespace.Sku = &sku
	} else {
		namespace.Sku = nil
	}

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

	// ZoneRedundant
	if source.ZoneRedundant != nil {
		zoneRedundant := *source.ZoneRedundant
		namespace.ZoneRedundant = &zoneRedundant
	} else {
		namespace.ZoneRedundant = nil
	}

	// No error
	return nil
}

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

	// AlternateName
	destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName)

	// AzureName
	destination.AzureName = namespace.AzureName

	// ClusterArmReference
	if namespace.ClusterArmReference != nil {
		clusterArmReference := namespace.ClusterArmReference.Copy()
		destination.ClusterArmReference = &clusterArmReference
	} else {
		destination.ClusterArmReference = nil
	}

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

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

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

	// IsAutoInflateEnabled
	if namespace.IsAutoInflateEnabled != nil {
		isAutoInflateEnabled := *namespace.IsAutoInflateEnabled
		destination.IsAutoInflateEnabled = &isAutoInflateEnabled
	} else {
		destination.IsAutoInflateEnabled = nil
	}

	// KafkaEnabled
	if namespace.KafkaEnabled != nil {
		kafkaEnabled := *namespace.KafkaEnabled
		destination.KafkaEnabled = &kafkaEnabled
	} else {
		destination.KafkaEnabled = nil
	}

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

	// MaximumThroughputUnits
	destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits)

	// MinimumTlsVersion
	if namespace.MinimumTlsVersion != nil {
		minimumTlsVersion := string(*namespace.MinimumTlsVersion)
		destination.MinimumTlsVersion = &minimumTlsVersion
	} else {
		destination.MinimumTlsVersion = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = namespace.OriginalVersion()

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

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

	// Sku
	if namespace.Sku != nil {
		var sku storage.Sku
		err := namespace.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
	}

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

	// ZoneRedundant
	if namespace.ZoneRedundant != nil {
		zoneRedundant := *namespace.ZoneRedundant
		destination.ZoneRedundant = &zoneRedundant
	} else {
		destination.ZoneRedundant = nil
	}

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

	// No error
	return nil
}

// Initialize_From_Namespace_STATUS populates our Namespace_Spec from the provided source Namespace_STATUS
func (namespace *Namespace_Spec) Initialize_From_Namespace_STATUS(source *Namespace_STATUS) error {

	// AlternateName
	namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName)

	// ClusterArmReference
	if source.ClusterArmId != nil {
		clusterArmReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterArmId)
		namespace.ClusterArmReference = &clusterArmReference
	} else {
		namespace.ClusterArmReference = nil
	}

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

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

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

	// IsAutoInflateEnabled
	if source.IsAutoInflateEnabled != nil {
		isAutoInflateEnabled := *source.IsAutoInflateEnabled
		namespace.IsAutoInflateEnabled = &isAutoInflateEnabled
	} else {
		namespace.IsAutoInflateEnabled = nil
	}

	// KafkaEnabled
	if source.KafkaEnabled != nil {
		kafkaEnabled := *source.KafkaEnabled
		namespace.KafkaEnabled = &kafkaEnabled
	} else {
		namespace.KafkaEnabled = nil
	}

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

	// MaximumThroughputUnits
	namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits)

	// MinimumTlsVersion
	if source.MinimumTlsVersion != nil {
		minimumTlsVersion := genruntime.ToEnum(string(*source.MinimumTlsVersion), namespace_Properties_MinimumTlsVersion_Spec_Values)
		namespace.MinimumTlsVersion = &minimumTlsVersion
	} else {
		namespace.MinimumTlsVersion = nil
	}

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := genruntime.ToEnum(string(*source.PublicNetworkAccess), namespace_Properties_PublicNetworkAccess_Spec_Values)
		namespace.PublicNetworkAccess = &publicNetworkAccess
	} else {
		namespace.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")
		}
		namespace.Sku = &sku
	} else {
		namespace.Sku = nil
	}

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

	// ZoneRedundant
	if source.ZoneRedundant != nil {
		zoneRedundant := *source.ZoneRedundant
		namespace.ZoneRedundant = &zoneRedundant
	} else {
		namespace.ZoneRedundant = nil
	}

	// No error
	return nil
}

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

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

type Namespace_STATUS struct {
	// AlternateName: Alternate name specified when alias and namespace names are same.
	AlternateName *string `json:"alternateName,omitempty"`

	// ClusterArmId: Cluster ARM ID of the Namespace.
	ClusterArmId *string `json:"clusterArmId,omitempty"`

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

	// CreatedAt: The time the Namespace was created.
	CreatedAt *string `json:"createdAt,omitempty"`

	// DisableLocalAuth: This property disables SAS authentication for the Event Hubs namespace.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// Encryption: Properties of BYOK Encryption description
	Encryption *Encryption_STATUS `json:"encryption,omitempty"`

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

	// Identity: Properties of BYOK Identity description
	Identity *Identity_STATUS `json:"identity,omitempty"`

	// IsAutoInflateEnabled: Value that indicates whether AutoInflate is enabled for eventhub namespace.
	IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"`

	// KafkaEnabled: Value that indicates whether Kafka is enabled for eventhub namespace.
	KafkaEnabled *bool `json:"kafkaEnabled,omitempty"`

	// Location: Resource location.
	Location *string `json:"location,omitempty"`

	// MaximumThroughputUnits: Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20
	// throughput units. ( '0' if AutoInflateEnabled = true)
	MaximumThroughputUnits *int `json:"maximumThroughputUnits,omitempty"`

	// MetricId: Identifier for Azure Insights metrics.
	MetricId *string `json:"metricId,omitempty"`

	// MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2'
	MinimumTlsVersion *Namespace_Properties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"`

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

	// PrivateEndpointConnections: List of private endpoint connections.
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"`

	// ProvisioningState: Provisioning state of the Namespace.
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled.
	PublicNetworkAccess *Namespace_Properties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations.
	ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"`

	// Sku: Properties of sku resource
	Sku *Sku_STATUS `json:"sku,omitempty"`

	// Status: Status of the Namespace.
	Status *string `json:"status,omitempty"`

	// SystemData: The system meta data relating to this resource.
	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"`

	// UpdatedAt: The time the Namespace was updated.
	UpdatedAt *string `json:"updatedAt,omitempty"`

	// ZoneRedundant: Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Namespace_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Namespace_STATUS{}
	err := namespace.AssignProperties_To_Namespace_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 = &Namespace_STATUS{}

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

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

	// Set property "AlternateName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AlternateName != nil {
			alternateName := *typedInput.Properties.AlternateName
			namespace.AlternateName = &alternateName
		}
	}

	// Set property "ClusterArmId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ClusterArmId != nil {
			clusterArmId := *typedInput.Properties.ClusterArmId
			namespace.ClusterArmId = &clusterArmId
		}
	}

	// no assignment for property "Conditions"

	// Set property "CreatedAt":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreatedAt != nil {
			createdAt := *typedInput.Properties.CreatedAt
			namespace.CreatedAt = &createdAt
		}
	}

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

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

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

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

	// Set property "IsAutoInflateEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsAutoInflateEnabled != nil {
			isAutoInflateEnabled := *typedInput.Properties.IsAutoInflateEnabled
			namespace.IsAutoInflateEnabled = &isAutoInflateEnabled
		}
	}

	// Set property "KafkaEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KafkaEnabled != nil {
			kafkaEnabled := *typedInput.Properties.KafkaEnabled
			namespace.KafkaEnabled = &kafkaEnabled
		}
	}

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

	// Set property "MaximumThroughputUnits":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaximumThroughputUnits != nil {
			maximumThroughputUnits := *typedInput.Properties.MaximumThroughputUnits
			namespace.MaximumThroughputUnits = &maximumThroughputUnits
		}
	}

	// Set property "MetricId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MetricId != nil {
			metricId := *typedInput.Properties.MetricId
			namespace.MetricId = &metricId
		}
	}

	// Set property "MinimumTlsVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinimumTlsVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.MinimumTlsVersion)
			minimumTlsVersion := Namespace_Properties_MinimumTlsVersion_STATUS(temp)
			namespace.MinimumTlsVersion = &minimumTlsVersion
		}
	}

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

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

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			provisioningState := *typedInput.Properties.ProvisioningState
			namespace.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 := Namespace_Properties_PublicNetworkAccess_STATUS(temp)
			namespace.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "ServiceBusEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServiceBusEndpoint != nil {
			serviceBusEndpoint := *typedInput.Properties.ServiceBusEndpoint
			namespace.ServiceBusEndpoint = &serviceBusEndpoint
		}
	}

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

	// Set property "Status":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Status != nil {
			status := *typedInput.Properties.Status
			namespace.Status = &status
		}
	}

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

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

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

	// Set property "UpdatedAt":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.UpdatedAt != nil {
			updatedAt := *typedInput.Properties.UpdatedAt
			namespace.UpdatedAt = &updatedAt
		}
	}

	// Set property "ZoneRedundant":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ZoneRedundant != nil {
			zoneRedundant := *typedInput.Properties.ZoneRedundant
			namespace.ZoneRedundant = &zoneRedundant
		}
	}

	// No error
	return nil
}

// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS
func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *storage.Namespace_STATUS) error {

	// AlternateName
	namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName)

	// ClusterArmId
	namespace.ClusterArmId = genruntime.ClonePointerToString(source.ClusterArmId)

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

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

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

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

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

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

	// IsAutoInflateEnabled
	if source.IsAutoInflateEnabled != nil {
		isAutoInflateEnabled := *source.IsAutoInflateEnabled
		namespace.IsAutoInflateEnabled = &isAutoInflateEnabled
	} else {
		namespace.IsAutoInflateEnabled = nil
	}

	// KafkaEnabled
	if source.KafkaEnabled != nil {
		kafkaEnabled := *source.KafkaEnabled
		namespace.KafkaEnabled = &kafkaEnabled
	} else {
		namespace.KafkaEnabled = nil
	}

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

	// MaximumThroughputUnits
	namespace.MaximumThroughputUnits = genruntime.ClonePointerToInt(source.MaximumThroughputUnits)

	// MetricId
	namespace.MetricId = genruntime.ClonePointerToString(source.MetricId)

	// MinimumTlsVersion
	if source.MinimumTlsVersion != nil {
		minimumTlsVersion := *source.MinimumTlsVersion
		minimumTlsVersionTemp := genruntime.ToEnum(minimumTlsVersion, namespace_Properties_MinimumTlsVersion_STATUS_Values)
		namespace.MinimumTlsVersion = &minimumTlsVersionTemp
	} else {
		namespace.MinimumTlsVersion = nil
	}

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

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

	// ProvisioningState
	namespace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState)

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

	// ServiceBusEndpoint
	namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint)

	// 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")
		}
		namespace.Sku = &sku
	} else {
		namespace.Sku = nil
	}

	// Status
	namespace.Status = genruntime.ClonePointerToString(source.Status)

	// 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")
		}
		namespace.SystemData = &systemDatum
	} else {
		namespace.SystemData = nil
	}

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

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

	// UpdatedAt
	namespace.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt)

	// ZoneRedundant
	if source.ZoneRedundant != nil {
		zoneRedundant := *source.ZoneRedundant
		namespace.ZoneRedundant = &zoneRedundant
	} else {
		namespace.ZoneRedundant = nil
	}

	// No error
	return nil
}

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

	// AlternateName
	destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName)

	// ClusterArmId
	destination.ClusterArmId = genruntime.ClonePointerToString(namespace.ClusterArmId)

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

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

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

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

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

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

	// IsAutoInflateEnabled
	if namespace.IsAutoInflateEnabled != nil {
		isAutoInflateEnabled := *namespace.IsAutoInflateEnabled
		destination.IsAutoInflateEnabled = &isAutoInflateEnabled
	} else {
		destination.IsAutoInflateEnabled = nil
	}

	// KafkaEnabled
	if namespace.KafkaEnabled != nil {
		kafkaEnabled := *namespace.KafkaEnabled
		destination.KafkaEnabled = &kafkaEnabled
	} else {
		destination.KafkaEnabled = nil
	}

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

	// MaximumThroughputUnits
	destination.MaximumThroughputUnits = genruntime.ClonePointerToInt(namespace.MaximumThroughputUnits)

	// MetricId
	destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId)

	// MinimumTlsVersion
	if namespace.MinimumTlsVersion != nil {
		minimumTlsVersion := string(*namespace.MinimumTlsVersion)
		destination.MinimumTlsVersion = &minimumTlsVersion
	} else {
		destination.MinimumTlsVersion = nil
	}

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

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

	// ProvisioningState
	destination.ProvisioningState = genruntime.ClonePointerToString(namespace.ProvisioningState)

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

	// ServiceBusEndpoint
	destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint)

	// Sku
	if namespace.Sku != nil {
		var sku storage.Sku_STATUS
		err := namespace.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
	}

	// Status
	destination.Status = genruntime.ClonePointerToString(namespace.Status)

	// SystemData
	if namespace.SystemData != nil {
		var systemDatum storage.SystemData_STATUS
		err := namespace.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(namespace.Tags)

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

	// UpdatedAt
	destination.UpdatedAt = genruntime.ClonePointerToString(namespace.UpdatedAt)

	// ZoneRedundant
	if namespace.ZoneRedundant != nil {
		zoneRedundant := *namespace.ZoneRedundant
		destination.ZoneRedundant = &zoneRedundant
	} else {
		destination.ZoneRedundant = nil
	}

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

	// No error
	return nil
}

// Properties to configure Encryption
type Encryption struct {
	// KeySource: Enumerates the possible value of keySource for Encryption
	KeySource *Encryption_KeySource `json:"keySource,omitempty"`

	// KeyVaultProperties: Properties of KeyVault
	KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"`

	// RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption)
	RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"`
}

var _ genruntime.ARMTransformer = &Encryption{}

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

	// Set property "KeySource":
	if encryption.KeySource != nil {
		var temp string
		temp = string(*encryption.KeySource)
		keySource := arm.Encryption_KeySource(temp)
		result.KeySource = &keySource
	}

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

	// Set property "RequireInfrastructureEncryption":
	if encryption.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption
		result.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	}
	return result, nil
}

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

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

	// Set property "KeySource":
	if typedInput.KeySource != nil {
		var temp string
		temp = string(*typedInput.KeySource)
		keySource := Encryption_KeySource(temp)
		encryption.KeySource = &keySource
	}

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

	// Set property "RequireInfrastructureEncryption":
	if typedInput.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *typedInput.RequireInfrastructureEncryption
		encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	}

	// No error
	return nil
}

// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption
func (encryption *Encryption) AssignProperties_From_Encryption(source *storage.Encryption) error {

	// KeySource
	if source.KeySource != nil {
		keySource := *source.KeySource
		keySourceTemp := genruntime.ToEnum(keySource, encryption_KeySource_Values)
		encryption.KeySource = &keySourceTemp
	} else {
		encryption.KeySource = nil
	}

	// KeyVaultProperties
	if source.KeyVaultProperties != nil {
		keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties))
		for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties {
			var keyVaultProperty KeyVaultProperties
			err := keyVaultProperty.AssignProperties_From_KeyVaultProperties(&keyVaultPropertyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_KeyVaultProperties() to populate field KeyVaultProperties")
			}
			keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty
		}
		encryption.KeyVaultProperties = keyVaultPropertyList
	} else {
		encryption.KeyVaultProperties = nil
	}

	// RequireInfrastructureEncryption
	if source.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *source.RequireInfrastructureEncryption
		encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	} else {
		encryption.RequireInfrastructureEncryption = nil
	}

	// No error
	return nil
}

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

	// KeySource
	if encryption.KeySource != nil {
		keySource := string(*encryption.KeySource)
		destination.KeySource = &keySource
	} else {
		destination.KeySource = nil
	}

	// KeyVaultProperties
	if encryption.KeyVaultProperties != nil {
		keyVaultPropertyList := make([]storage.KeyVaultProperties, len(encryption.KeyVaultProperties))
		for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties {
			var keyVaultProperty storage.KeyVaultProperties
			err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_KeyVaultProperties() to populate field KeyVaultProperties")
			}
			keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty
		}
		destination.KeyVaultProperties = keyVaultPropertyList
	} else {
		destination.KeyVaultProperties = nil
	}

	// RequireInfrastructureEncryption
	if encryption.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption
		destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	} else {
		destination.RequireInfrastructureEncryption = nil
	}

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

	// No error
	return nil
}

// Initialize_From_Encryption_STATUS populates our Encryption from the provided source Encryption_STATUS
func (encryption *Encryption) Initialize_From_Encryption_STATUS(source *Encryption_STATUS) error {

	// KeySource
	if source.KeySource != nil {
		keySource := genruntime.ToEnum(string(*source.KeySource), encryption_KeySource_Values)
		encryption.KeySource = &keySource
	} else {
		encryption.KeySource = nil
	}

	// KeyVaultProperties
	if source.KeyVaultProperties != nil {
		keyVaultPropertyList := make([]KeyVaultProperties, len(source.KeyVaultProperties))
		for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties {
			var keyVaultProperty KeyVaultProperties
			err := keyVaultProperty.Initialize_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties")
			}
			keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty
		}
		encryption.KeyVaultProperties = keyVaultPropertyList
	} else {
		encryption.KeyVaultProperties = nil
	}

	// RequireInfrastructureEncryption
	if source.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *source.RequireInfrastructureEncryption
		encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	} else {
		encryption.RequireInfrastructureEncryption = nil
	}

	// No error
	return nil
}

// Properties to configure Encryption
type Encryption_STATUS struct {
	// KeySource: Enumerates the possible value of keySource for Encryption
	KeySource *Encryption_KeySource_STATUS `json:"keySource,omitempty"`

	// KeyVaultProperties: Properties of KeyVault
	KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"`

	// RequireInfrastructureEncryption: Enable Infrastructure Encryption (Double Encryption)
	RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"`
}

var _ genruntime.FromARMConverter = &Encryption_STATUS{}

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

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

	// Set property "KeySource":
	if typedInput.KeySource != nil {
		var temp string
		temp = string(*typedInput.KeySource)
		keySource := Encryption_KeySource_STATUS(temp)
		encryption.KeySource = &keySource
	}

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

	// Set property "RequireInfrastructureEncryption":
	if typedInput.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *typedInput.RequireInfrastructureEncryption
		encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	}

	// No error
	return nil
}

// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS
func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *storage.Encryption_STATUS) error {

	// KeySource
	if source.KeySource != nil {
		keySource := *source.KeySource
		keySourceTemp := genruntime.ToEnum(keySource, encryption_KeySource_STATUS_Values)
		encryption.KeySource = &keySourceTemp
	} else {
		encryption.KeySource = nil
	}

	// KeyVaultProperties
	if source.KeyVaultProperties != nil {
		keyVaultPropertyList := make([]KeyVaultProperties_STATUS, len(source.KeyVaultProperties))
		for keyVaultPropertyIndex, keyVaultPropertyItem := range source.KeyVaultProperties {
			var keyVaultProperty KeyVaultProperties_STATUS
			err := keyVaultProperty.AssignProperties_From_KeyVaultProperties_STATUS(&keyVaultPropertyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_KeyVaultProperties_STATUS() to populate field KeyVaultProperties")
			}
			keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty
		}
		encryption.KeyVaultProperties = keyVaultPropertyList
	} else {
		encryption.KeyVaultProperties = nil
	}

	// RequireInfrastructureEncryption
	if source.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *source.RequireInfrastructureEncryption
		encryption.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	} else {
		encryption.RequireInfrastructureEncryption = nil
	}

	// No error
	return nil
}

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

	// KeySource
	if encryption.KeySource != nil {
		keySource := string(*encryption.KeySource)
		destination.KeySource = &keySource
	} else {
		destination.KeySource = nil
	}

	// KeyVaultProperties
	if encryption.KeyVaultProperties != nil {
		keyVaultPropertyList := make([]storage.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties))
		for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties {
			var keyVaultProperty storage.KeyVaultProperties_STATUS
			err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_KeyVaultProperties_STATUS() to populate field KeyVaultProperties")
			}
			keyVaultPropertyList[keyVaultPropertyIndex] = keyVaultProperty
		}
		destination.KeyVaultProperties = keyVaultPropertyList
	} else {
		destination.KeyVaultProperties = nil
	}

	// RequireInfrastructureEncryption
	if encryption.RequireInfrastructureEncryption != nil {
		requireInfrastructureEncryption := *encryption.RequireInfrastructureEncryption
		destination.RequireInfrastructureEncryption = &requireInfrastructureEncryption
	} else {
		destination.RequireInfrastructureEncryption = nil
	}

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

	// No error
	return nil
}

// Properties to configure Identity for Bring your Own Keys
type Identity struct {
	// Type: Type of managed service identity.
	Type *Identity_Type `json:"type,omitempty"`

	// UserAssignedIdentities: Properties for User Assigned Identities
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.ARMTransformer = &Identity{}

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

	// Set property "Type":
	if identity.Type != nil {
		var temp string
		temp = string(*identity.Type)
		typeVar := arm.Identity_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 *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.Identity{}
}

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

	// Type
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, identity_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_Identity populates the provided destination Identity from our Identity
func (identity *Identity) AssignProperties_To_Identity(destination *storage.Identity) 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_Identity_STATUS populates our Identity from the provided source Identity_STATUS
func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error {

	// Type
	if source.Type != nil {
		typeVar := genruntime.ToEnum(string(*source.Type), identity_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
}

// Properties to configure Identity for Bring your Own Keys
type Identity_STATUS struct {
	// PrincipalId: ObjectId from the KeyVault
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: TenantId from the KeyVault
	TenantId *string `json:"tenantId,omitempty"`

	// Type: Type of managed service identity.
	Type *Identity_Type_STATUS `json:"type,omitempty"`

	// UserAssignedIdentities: Properties for User Assigned Identities
	UserAssignedIdentities map[string]UserAssignedIdentity_STATUS `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &Identity_STATUS{}

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

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (identity *Identity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.Identity_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Identity_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 := Identity_Type_STATUS(temp)
		identity.Type = &typeVar
	}

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

	// No error
	return nil
}

// AssignProperties_From_Identity_STATUS populates our Identity_STATUS from the provided source Identity_STATUS
func (identity *Identity_STATUS) AssignProperties_From_Identity_STATUS(source *storage.Identity_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, identity_Type_STATUS_Values)
		identity.Type = &typeTemp
	} else {
		identity.Type = nil
	}

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

	// No error
	return nil
}

// AssignProperties_To_Identity_STATUS populates the provided destination Identity_STATUS from our Identity_STATUS
func (identity *Identity_STATUS) AssignProperties_To_Identity_STATUS(destination *storage.Identity_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.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities {
			var userAssignedIdentity storage.UserAssignedIdentity_STATUS
			err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_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
}

// +kubebuilder:validation:Enum={"1.0","1.1","1.2"}
type Namespace_Properties_MinimumTlsVersion_Spec string

const (
	Namespace_Properties_MinimumTlsVersion_Spec_10 = Namespace_Properties_MinimumTlsVersion_Spec("1.0")
	Namespace_Properties_MinimumTlsVersion_Spec_11 = Namespace_Properties_MinimumTlsVersion_Spec("1.1")
	Namespace_Properties_MinimumTlsVersion_Spec_12 = Namespace_Properties_MinimumTlsVersion_Spec("1.2")
)

// Mapping from string to Namespace_Properties_MinimumTlsVersion_Spec
var namespace_Properties_MinimumTlsVersion_Spec_Values = map[string]Namespace_Properties_MinimumTlsVersion_Spec{
	"1.0": Namespace_Properties_MinimumTlsVersion_Spec_10,
	"1.1": Namespace_Properties_MinimumTlsVersion_Spec_11,
	"1.2": Namespace_Properties_MinimumTlsVersion_Spec_12,
}

type Namespace_Properties_MinimumTlsVersion_STATUS string

const (
	Namespace_Properties_MinimumTlsVersion_STATUS_10 = Namespace_Properties_MinimumTlsVersion_STATUS("1.0")
	Namespace_Properties_MinimumTlsVersion_STATUS_11 = Namespace_Properties_MinimumTlsVersion_STATUS("1.1")
	Namespace_Properties_MinimumTlsVersion_STATUS_12 = Namespace_Properties_MinimumTlsVersion_STATUS("1.2")
)

// Mapping from string to Namespace_Properties_MinimumTlsVersion_STATUS
var namespace_Properties_MinimumTlsVersion_STATUS_Values = map[string]Namespace_Properties_MinimumTlsVersion_STATUS{
	"1.0": Namespace_Properties_MinimumTlsVersion_STATUS_10,
	"1.1": Namespace_Properties_MinimumTlsVersion_STATUS_11,
	"1.2": Namespace_Properties_MinimumTlsVersion_STATUS_12,
}

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

const (
	Namespace_Properties_PublicNetworkAccess_Spec_Disabled           = Namespace_Properties_PublicNetworkAccess_Spec("Disabled")
	Namespace_Properties_PublicNetworkAccess_Spec_Enabled            = Namespace_Properties_PublicNetworkAccess_Spec("Enabled")
	Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter = Namespace_Properties_PublicNetworkAccess_Spec("SecuredByPerimeter")
)

// Mapping from string to Namespace_Properties_PublicNetworkAccess_Spec
var namespace_Properties_PublicNetworkAccess_Spec_Values = map[string]Namespace_Properties_PublicNetworkAccess_Spec{
	"disabled":           Namespace_Properties_PublicNetworkAccess_Spec_Disabled,
	"enabled":            Namespace_Properties_PublicNetworkAccess_Spec_Enabled,
	"securedbyperimeter": Namespace_Properties_PublicNetworkAccess_Spec_SecuredByPerimeter,
}

type Namespace_Properties_PublicNetworkAccess_STATUS string

const (
	Namespace_Properties_PublicNetworkAccess_STATUS_Disabled           = Namespace_Properties_PublicNetworkAccess_STATUS("Disabled")
	Namespace_Properties_PublicNetworkAccess_STATUS_Enabled            = Namespace_Properties_PublicNetworkAccess_STATUS("Enabled")
	Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter = Namespace_Properties_PublicNetworkAccess_STATUS("SecuredByPerimeter")
)

// Mapping from string to Namespace_Properties_PublicNetworkAccess_STATUS
var namespace_Properties_PublicNetworkAccess_STATUS_Values = map[string]Namespace_Properties_PublicNetworkAccess_STATUS{
	"disabled":           Namespace_Properties_PublicNetworkAccess_STATUS_Disabled,
	"enabled":            Namespace_Properties_PublicNetworkAccess_STATUS_Enabled,
	"securedbyperimeter": Namespace_Properties_PublicNetworkAccess_STATUS_SecuredByPerimeter,
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type NamespaceOperatorSpec 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 *NamespaceOperatorSecrets `json:"secrets,omitempty"`
}

// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec
func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *storage.NamespaceOperatorSpec) 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 NamespaceOperatorSecrets
		err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_NamespaceOperatorSecrets() to populate field Secrets")
		}
		operator.Secrets = &secret
	} else {
		operator.Secrets = nil
	}

	// No error
	return nil
}

// AssignProperties_To_NamespaceOperatorSpec populates the provided destination NamespaceOperatorSpec from our NamespaceOperatorSpec
func (operator *NamespaceOperatorSpec) AssignProperties_To_NamespaceOperatorSpec(destination *storage.NamespaceOperatorSpec) 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.NamespaceOperatorSecrets
		err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_NamespaceOperatorSecrets() 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
}

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

var _ genruntime.FromARMConverter = &PrivateEndpointConnection_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PrivateEndpointConnection_STATUS populates our PrivateEndpointConnection_STATUS from the provided source PrivateEndpointConnection_STATUS
func (connection *PrivateEndpointConnection_STATUS) AssignProperties_From_PrivateEndpointConnection_STATUS(source *storage.PrivateEndpointConnection_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// SKU parameters supplied to the create namespace operation
type Sku struct {
	// +kubebuilder:validation:Minimum=0
	// Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units.
	// The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units.
	Capacity *int `json:"capacity,omitempty"`

	// +kubebuilder:validation:Required
	// Name: Name of this SKU.
	Name *Sku_Name `json:"name,omitempty"`

	// Tier: The billing tier of this particular SKU.
	Tier *Sku_Tier `json:"tier,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 "Capacity":
	if sku.Capacity != nil {
		capacity := *sku.Capacity
		result.Capacity = &capacity
	}

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

	// Set property "Tier":
	if sku.Tier != nil {
		var temp string
		temp = string(*sku.Tier)
		tier := arm.Sku_Tier(temp)
		result.Tier = &tier
	}
	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 "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		sku.Capacity = &capacity
	}

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

	// Set property "Tier":
	if typedInput.Tier != nil {
		var temp string
		temp = string(*typedInput.Tier)
		tier := Sku_Tier(temp)
		sku.Tier = &tier
	}

	// 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 {

	// Capacity
	sku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

	// Tier
	if source.Tier != nil {
		tier := *source.Tier
		tierTemp := genruntime.ToEnum(tier, sku_Tier_Values)
		sku.Tier = &tierTemp
	} else {
		sku.Tier = nil
	}

	// 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()

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity)

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

	// Tier
	if sku.Tier != nil {
		tier := string(*sku.Tier)
		destination.Tier = &tier
	} else {
		destination.Tier = nil
	}

	// 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 {

	// Capacity
	sku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

	// Tier
	if source.Tier != nil {
		tier := genruntime.ToEnum(string(*source.Tier), sku_Tier_Values)
		sku.Tier = &tier
	} else {
		sku.Tier = nil
	}

	// No error
	return nil
}

// SKU parameters supplied to the create namespace operation
type Sku_STATUS struct {
	// Capacity: The Event Hubs throughput units for Basic or Standard tiers, where value should be 0 to 20 throughput units.
	// The Event Hubs premium units for Premium tier, where value should be 0 to 10 premium units.
	Capacity *int `json:"capacity,omitempty"`

	// Name: Name of this SKU.
	Name *Sku_Name_STATUS `json:"name,omitempty"`

	// Tier: The billing tier of this particular SKU.
	Tier *Sku_Tier_STATUS `json:"tier,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 "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		sku.Capacity = &capacity
	}

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

	// Set property "Tier":
	if typedInput.Tier != nil {
		var temp string
		temp = string(*typedInput.Tier)
		tier := Sku_Tier_STATUS(temp)
		sku.Tier = &tier
	}

	// 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 {

	// Capacity
	sku.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

	// Tier
	if source.Tier != nil {
		tier := *source.Tier
		tierTemp := genruntime.ToEnum(tier, sku_Tier_STATUS_Values)
		sku.Tier = &tierTemp
	} else {
		sku.Tier = nil
	}

	// 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()

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(sku.Capacity)

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

	// Tier
	if sku.Tier != nil {
		tier := string(*sku.Tier)
		destination.Tier = &tier
	} else {
		destination.Tier = nil
	}

	// 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_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 type of identity that last modified the resource.
	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
}

// +kubebuilder:validation:Enum={"Microsoft.KeyVault"}
type Encryption_KeySource string

const Encryption_KeySource_MicrosoftKeyVault = Encryption_KeySource("Microsoft.KeyVault")

// Mapping from string to Encryption_KeySource
var encryption_KeySource_Values = map[string]Encryption_KeySource{
	"microsoft.keyvault": Encryption_KeySource_MicrosoftKeyVault,
}

type Encryption_KeySource_STATUS string

const Encryption_KeySource_STATUS_MicrosoftKeyVault = Encryption_KeySource_STATUS("Microsoft.KeyVault")

// Mapping from string to Encryption_KeySource_STATUS
var encryption_KeySource_STATUS_Values = map[string]Encryption_KeySource_STATUS{
	"microsoft.keyvault": Encryption_KeySource_STATUS_MicrosoftKeyVault,
}

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

const (
	Identity_Type_None                       = Identity_Type("None")
	Identity_Type_SystemAssigned             = Identity_Type("SystemAssigned")
	Identity_Type_SystemAssignedUserAssigned = Identity_Type("SystemAssigned, UserAssigned")
	Identity_Type_UserAssigned               = Identity_Type("UserAssigned")
)

// Mapping from string to Identity_Type
var identity_Type_Values = map[string]Identity_Type{
	"none":                         Identity_Type_None,
	"systemassigned":               Identity_Type_SystemAssigned,
	"systemassigned, userassigned": Identity_Type_SystemAssignedUserAssigned,
	"userassigned":                 Identity_Type_UserAssigned,
}

type Identity_Type_STATUS string

const (
	Identity_Type_STATUS_None                       = Identity_Type_STATUS("None")
	Identity_Type_STATUS_SystemAssigned             = Identity_Type_STATUS("SystemAssigned")
	Identity_Type_STATUS_SystemAssignedUserAssigned = Identity_Type_STATUS("SystemAssigned, UserAssigned")
	Identity_Type_STATUS_UserAssigned               = Identity_Type_STATUS("UserAssigned")
)

// Mapping from string to Identity_Type_STATUS
var identity_Type_STATUS_Values = map[string]Identity_Type_STATUS{
	"none":                         Identity_Type_STATUS_None,
	"systemassigned":               Identity_Type_STATUS_SystemAssigned,
	"systemassigned, userassigned": Identity_Type_STATUS_SystemAssignedUserAssigned,
	"userassigned":                 Identity_Type_STATUS_UserAssigned,
}

// Properties to configure keyVault Properties
type KeyVaultProperties struct {
	Identity *UserAssignedIdentityProperties `json:"identity,omitempty"`

	// KeyName: Name of the Key from KeyVault
	KeyName *string `json:"keyName,omitempty"`

	// KeyVaultUri: Uri of KeyVault
	KeyVaultUri *string `json:"keyVaultUri,omitempty"`

	// KeyVersion: Key Version
	KeyVersion *string `json:"keyVersion,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 "Identity":
	if properties.Identity != nil {
		identity_ARM, err := properties.Identity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		identity := *identity_ARM.(*arm.UserAssignedIdentityProperties)
		result.Identity = &identity
	}

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

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

	// Set property "KeyVersion":
	if properties.KeyVersion != nil {
		keyVersion := *properties.KeyVersion
		result.KeyVersion = &keyVersion
	}
	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 "Identity":
	if typedInput.Identity != nil {
		var identity1 UserAssignedIdentityProperties
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		properties.Identity = &identity
	}

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

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

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

	// 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 {

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

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

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

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

	// 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()

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

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

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

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

	// 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 {

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

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

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

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

	// No error
	return nil
}

// Properties to configure keyVault Properties
type KeyVaultProperties_STATUS struct {
	Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"`

	// KeyName: Name of the Key from KeyVault
	KeyName *string `json:"keyName,omitempty"`

	// KeyVaultUri: Uri of KeyVault
	KeyVaultUri *string `json:"keyVaultUri,omitempty"`

	// KeyVersion: Key Version
	KeyVersion *string `json:"keyVersion,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 "Identity":
	if typedInput.Identity != nil {
		var identity1 UserAssignedIdentityProperties_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		properties.Identity = &identity
	}

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

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

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

	// 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 {

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

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

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

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

	// 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()

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

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

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

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

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

	// No error
	return nil
}

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

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

// AssignProperties_From_NamespaceOperatorSecrets populates our NamespaceOperatorSecrets from the provided source NamespaceOperatorSecrets
func (secrets *NamespaceOperatorSecrets) AssignProperties_From_NamespaceOperatorSecrets(source *storage.NamespaceOperatorSecrets) 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
	}

	// 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
	}

	// No error
	return nil
}

// AssignProperties_To_NamespaceOperatorSecrets populates the provided destination NamespaceOperatorSecrets from our NamespaceOperatorSecrets
func (secrets *NamespaceOperatorSecrets) AssignProperties_To_NamespaceOperatorSecrets(destination *storage.NamespaceOperatorSecrets) 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
	}

	// 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
	}

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Basic","Premium","Standard"}
type Sku_Name string

const (
	Sku_Name_Basic    = Sku_Name("Basic")
	Sku_Name_Premium  = Sku_Name("Premium")
	Sku_Name_Standard = Sku_Name("Standard")
)

// Mapping from string to Sku_Name
var sku_Name_Values = map[string]Sku_Name{
	"basic":    Sku_Name_Basic,
	"premium":  Sku_Name_Premium,
	"standard": Sku_Name_Standard,
}

type Sku_Name_STATUS string

const (
	Sku_Name_STATUS_Basic    = Sku_Name_STATUS("Basic")
	Sku_Name_STATUS_Premium  = Sku_Name_STATUS("Premium")
	Sku_Name_STATUS_Standard = Sku_Name_STATUS("Standard")
)

// Mapping from string to Sku_Name_STATUS
var sku_Name_STATUS_Values = map[string]Sku_Name_STATUS{
	"basic":    Sku_Name_STATUS_Basic,
	"premium":  Sku_Name_STATUS_Premium,
	"standard": Sku_Name_STATUS_Standard,
}

// +kubebuilder:validation:Enum={"Basic","Premium","Standard"}
type Sku_Tier string

const (
	Sku_Tier_Basic    = Sku_Tier("Basic")
	Sku_Tier_Premium  = Sku_Tier("Premium")
	Sku_Tier_Standard = Sku_Tier("Standard")
)

// Mapping from string to Sku_Tier
var sku_Tier_Values = map[string]Sku_Tier{
	"basic":    Sku_Tier_Basic,
	"premium":  Sku_Tier_Premium,
	"standard": Sku_Tier_Standard,
}

type Sku_Tier_STATUS string

const (
	Sku_Tier_STATUS_Basic    = Sku_Tier_STATUS("Basic")
	Sku_Tier_STATUS_Premium  = Sku_Tier_STATUS("Premium")
	Sku_Tier_STATUS_Standard = Sku_Tier_STATUS("Standard")
)

// Mapping from string to Sku_Tier_STATUS
var sku_Tier_STATUS_Values = map[string]Sku_Tier_STATUS{
	"basic":    Sku_Tier_STATUS_Basic,
	"premium":  Sku_Tier_STATUS_Premium,
	"standard": Sku_Tier_STATUS_Standard,
}

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,
}

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,
}

// Recognized Dictionary value.
type UserAssignedIdentity_STATUS struct {
	// ClientId: Client Id of user assigned identity
	ClientId *string `json:"clientId,omitempty"`

	// PrincipalId: Principal Id of user assigned identity
	PrincipalId *string `json:"principalId,omitempty"`
}

var _ genruntime.FromARMConverter = &UserAssignedIdentity_STATUS{}

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

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (identity *UserAssignedIdentity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.UserAssignedIdentity_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.UserAssignedIdentity_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_UserAssignedIdentity_STATUS populates our UserAssignedIdentity_STATUS from the provided source UserAssignedIdentity_STATUS
func (identity *UserAssignedIdentity_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *storage.UserAssignedIdentity_STATUS) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_UserAssignedIdentity_STATUS populates the provided destination UserAssignedIdentity_STATUS from our UserAssignedIdentity_STATUS
func (identity *UserAssignedIdentity_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *storage.UserAssignedIdentity_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
}

// 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
}

type UserAssignedIdentityProperties struct {
	// UserAssignedIdentityReference: ARM ID of user Identity selected for encryption
	UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"`
}

var _ genruntime.ARMTransformer = &UserAssignedIdentityProperties{}

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

	// Set property "UserAssignedIdentity":
	if properties.UserAssignedIdentityReference != nil {
		userAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*properties.UserAssignedIdentityReference)
		if err != nil {
			return nil, err
		}
		userAssignedIdentityReference := userAssignedIdentityReferenceARMID
		result.UserAssignedIdentity = &userAssignedIdentityReference
	}
	return result, nil
}

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

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

	// no assignment for property "UserAssignedIdentityReference"

	// No error
	return nil
}

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

	// UserAssignedIdentityReference
	if source.UserAssignedIdentityReference != nil {
		userAssignedIdentityReference := source.UserAssignedIdentityReference.Copy()
		properties.UserAssignedIdentityReference = &userAssignedIdentityReference
	} else {
		properties.UserAssignedIdentityReference = nil
	}

	// No error
	return nil
}

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

	// UserAssignedIdentityReference
	if properties.UserAssignedIdentityReference != nil {
		userAssignedIdentityReference := properties.UserAssignedIdentityReference.Copy()
		destination.UserAssignedIdentityReference = &userAssignedIdentityReference
	} else {
		destination.UserAssignedIdentityReference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties from the provided source UserAssignedIdentityProperties_STATUS
func (properties *UserAssignedIdentityProperties) Initialize_From_UserAssignedIdentityProperties_STATUS(source *UserAssignedIdentityProperties_STATUS) error {

	// No error
	return nil
}

type UserAssignedIdentityProperties_STATUS struct {
	// UserAssignedIdentity: ARM ID of user Identity selected for encryption
	UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}

var _ genruntime.FromARMConverter = &UserAssignedIdentityProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&Namespace{}, &NamespaceList{})
}
