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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/documentdb/v1api20231115/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/documentdb/v1api20231115/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,documentdb}
// +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: /cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/cosmos-db.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}
type DatabaseAccount struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DatabaseAccount_Spec   `json:"spec,omitempty"`
	Status            DatabaseAccount_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &DatabaseAccount{}

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

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

var _ conversion.Convertible = &DatabaseAccount{}

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

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

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

	return nil
}

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

	return nil
}

var _ configmaps.Exporter = &DatabaseAccount{}

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

var _ secrets.Exporter = &DatabaseAccount{}

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

var _ genruntime.KubernetesResource = &DatabaseAccount{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2023-11-15"
func (account DatabaseAccount) GetAPIVersion() string {
	return "2023-11-15"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.DocumentDB/databaseAccounts"
func (account *DatabaseAccount) GetType() string {
	return "Microsoft.DocumentDB/databaseAccounts"
}

// NewEmptyStatus returns a new empty (blank) status
func (account *DatabaseAccount) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &DatabaseAccount_STATUS{}
}

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

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

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

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

	account.Status = st
	return nil
}

// AssignProperties_From_DatabaseAccount populates our DatabaseAccount from the provided source DatabaseAccount
func (account *DatabaseAccount) AssignProperties_From_DatabaseAccount(source *storage.DatabaseAccount) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_DatabaseAccount populates the provided destination DatabaseAccount from our DatabaseAccount
func (account *DatabaseAccount) AssignProperties_To_DatabaseAccount(destination *storage.DatabaseAccount) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2023-11-15/cosmos-db.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}
type DatabaseAccountList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DatabaseAccount `json:"items"`
}

// +kubebuilder:validation:Enum={"2023-11-15"}
type APIVersion string

const APIVersion_Value = APIVersion("2023-11-15")

type DatabaseAccount_Spec struct {
	// AnalyticalStorageConfiguration: Analytical storage specific properties.
	AnalyticalStorageConfiguration *AnalyticalStorageConfiguration `json:"analyticalStorageConfiguration,omitempty"`

	// ApiProperties: API specific properties. Currently, supported only for MongoDB API.
	ApiProperties *ApiProperties `json:"apiProperties,omitempty"`

	// +kubebuilder:validation:MaxLength=50
	// +kubebuilder:validation:MinLength=3
	// +kubebuilder:validation:Pattern="^[a-z0-9]+(-[a-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"`

	// BackupPolicy: The object representing the policy for taking backups on an account.
	BackupPolicy *BackupPolicy `json:"backupPolicy,omitempty"`

	// Capabilities: List of Cosmos DB capabilities for the account
	Capabilities []Capability `json:"capabilities,omitempty"`

	// Capacity: The object that represents all properties related to capacity enforcement on an account.
	Capacity *Capacity `json:"capacity,omitempty"`

	// ConnectorOffer: The cassandra connector offer type for the Cosmos DB database C* account.
	ConnectorOffer *ConnectorOffer `json:"connectorOffer,omitempty"`

	// ConsistencyPolicy: The consistency policy for the Cosmos DB account.
	ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"`

	// Cors: The CORS policy for the Cosmos DB database account.
	Cors []CorsPolicy `json:"cors,omitempty"`

	// CreateMode: Enum to indicate the mode of account creation.
	CreateMode *CreateMode `json:"createMode,omitempty"`

	// +kubebuilder:validation:Required
	// DatabaseAccountOfferType: The offer type for the database
	DatabaseAccountOfferType *DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"`

	// DefaultIdentity: The default identity for accessing key vault used in features like customer managed keys. The default
	// identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more.
	DefaultIdentity *string `json:"defaultIdentity,omitempty"`

	// DisableKeyBasedMetadataWriteAccess: Disable write operations on metadata resources (databases, containers, throughput)
	// via account keys
	DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`

	// DisableLocalAuth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// EnableAnalyticalStorage: Flag to indicate whether to enable storage analytics.
	EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`

	// EnableAutomaticFailover: Enables automatic failover of the write region in the rare event that the region is unavailable
	// due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the
	// failover priorities configured for the account.
	EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`

	// EnableBurstCapacity: Flag to indicate enabling/disabling of Burst Capacity feature on the account
	EnableBurstCapacity *bool `json:"enableBurstCapacity,omitempty"`

	// EnableCassandraConnector: Enables the cassandra connector on the Cosmos DB C* account
	EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`

	// EnableFreeTier: Flag to indicate whether Free Tier is enabled.
	EnableFreeTier *bool `json:"enableFreeTier,omitempty"`

	// EnableMultipleWriteLocations: Enables the account to write in multiple locations
	EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`

	// EnablePartitionMerge: Flag to indicate enabling/disabling of Partition Merge feature on the account
	EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"`

	// Identity: Identity for the resource.
	Identity *ManagedServiceIdentity `json:"identity,omitempty"`

	// IpRules: List of IpRules.
	IpRules []IpAddressOrRange `json:"ipRules,omitempty"`

	// IsVirtualNetworkFilterEnabled: Flag to indicate whether to enable/disable Virtual Network ACL rules.
	IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`

	// KeyVaultKeyUri: The URI of the key vault
	KeyVaultKeyUri *string `json:"keyVaultKeyUri,omitempty"`

	// Kind: Indicates the type of database account. This can only be set at database account creation.
	Kind *DatabaseAccount_Kind_Spec `json:"kind,omitempty"`

	// Location: The location of the resource group to which the resource belongs.
	Location *string `json:"location,omitempty"`

	// +kubebuilder:validation:Required
	// Locations: An array that contains the georeplication locations enabled for the Cosmos DB account.
	Locations []Location `json:"locations,omitempty"`

	// MinimalTlsVersion: Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs
	// only work with Tls 1.2.
	MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"`

	// NetworkAclBypass: Indicates what services are allowed to bypass firewall checks.
	NetworkAclBypass *NetworkAclBypass `json:"networkAclBypass,omitempty"`

	// NetworkAclBypassResourceReferences: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB
	// account.
	NetworkAclBypassResourceReferences []genruntime.ResourceReference `armReference:"NetworkAclBypassResourceIds" json:"networkAclBypassResourceReferences,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *DatabaseAccountOperatorSpec `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: Whether requests from Public Network are allowed
	PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// RestoreParameters: Parameters to indicate the information about the restore.
	RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"`
	Tags              map[string]string  `json:"tags,omitempty"`

	// VirtualNetworkRules: List of Virtual Network ACL rules configured for the Cosmos DB account.
	VirtualNetworkRules []VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
}

var _ genruntime.ARMTransformer = &DatabaseAccount_Spec{}

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

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

	// Set property "Kind":
	if account.Kind != nil {
		var temp string
		temp = string(*account.Kind)
		kind := arm.DatabaseAccount_Kind_Spec(temp)
		result.Kind = &kind
	}

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

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

	// Set property "Properties":
	if account.AnalyticalStorageConfiguration != nil ||
		account.ApiProperties != nil ||
		account.BackupPolicy != nil ||
		account.Capabilities != nil ||
		account.Capacity != nil ||
		account.ConnectorOffer != nil ||
		account.ConsistencyPolicy != nil ||
		account.Cors != nil ||
		account.CreateMode != nil ||
		account.DatabaseAccountOfferType != nil ||
		account.DefaultIdentity != nil ||
		account.DisableKeyBasedMetadataWriteAccess != nil ||
		account.DisableLocalAuth != nil ||
		account.EnableAnalyticalStorage != nil ||
		account.EnableAutomaticFailover != nil ||
		account.EnableBurstCapacity != nil ||
		account.EnableCassandraConnector != nil ||
		account.EnableFreeTier != nil ||
		account.EnableMultipleWriteLocations != nil ||
		account.EnablePartitionMerge != nil ||
		account.IpRules != nil ||
		account.IsVirtualNetworkFilterEnabled != nil ||
		account.KeyVaultKeyUri != nil ||
		account.Locations != nil ||
		account.MinimalTlsVersion != nil ||
		account.NetworkAclBypass != nil ||
		account.NetworkAclBypassResourceReferences != nil ||
		account.PublicNetworkAccess != nil ||
		account.RestoreParameters != nil ||
		account.VirtualNetworkRules != nil {
		result.Properties = &arm.DatabaseAccountCreateUpdateProperties{}
	}
	if account.AnalyticalStorageConfiguration != nil {
		analyticalStorageConfiguration_ARM, err := account.AnalyticalStorageConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		analyticalStorageConfiguration := *analyticalStorageConfiguration_ARM.(*arm.AnalyticalStorageConfiguration)
		result.Properties.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
	}
	if account.ApiProperties != nil {
		apiProperties_ARM, err := account.ApiProperties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		apiProperties := *apiProperties_ARM.(*arm.ApiProperties)
		result.Properties.ApiProperties = &apiProperties
	}
	if account.BackupPolicy != nil {
		backupPolicy_ARM, err := account.BackupPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		backupPolicy := *backupPolicy_ARM.(*arm.BackupPolicy)
		result.Properties.BackupPolicy = &backupPolicy
	}
	for _, item := range account.Capabilities {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.Capabilities = append(result.Properties.Capabilities, *item_ARM.(*arm.Capability))
	}
	if account.Capacity != nil {
		capacity_ARM, err := account.Capacity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		capacity := *capacity_ARM.(*arm.Capacity)
		result.Properties.Capacity = &capacity
	}
	if account.ConnectorOffer != nil {
		var temp string
		temp = string(*account.ConnectorOffer)
		connectorOffer := arm.ConnectorOffer(temp)
		result.Properties.ConnectorOffer = &connectorOffer
	}
	if account.ConsistencyPolicy != nil {
		consistencyPolicy_ARM, err := account.ConsistencyPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		consistencyPolicy := *consistencyPolicy_ARM.(*arm.ConsistencyPolicy)
		result.Properties.ConsistencyPolicy = &consistencyPolicy
	}
	for _, item := range account.Cors {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.Cors = append(result.Properties.Cors, *item_ARM.(*arm.CorsPolicy))
	}
	if account.CreateMode != nil {
		var temp string
		temp = string(*account.CreateMode)
		createMode := arm.CreateMode(temp)
		result.Properties.CreateMode = &createMode
	}
	if account.DatabaseAccountOfferType != nil {
		var temp string
		temp = string(*account.DatabaseAccountOfferType)
		databaseAccountOfferType := arm.DatabaseAccountOfferType(temp)
		result.Properties.DatabaseAccountOfferType = &databaseAccountOfferType
	}
	if account.DefaultIdentity != nil {
		defaultIdentity := *account.DefaultIdentity
		result.Properties.DefaultIdentity = &defaultIdentity
	}
	if account.DisableKeyBasedMetadataWriteAccess != nil {
		disableKeyBasedMetadataWriteAccess := *account.DisableKeyBasedMetadataWriteAccess
		result.Properties.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
	}
	if account.DisableLocalAuth != nil {
		disableLocalAuth := *account.DisableLocalAuth
		result.Properties.DisableLocalAuth = &disableLocalAuth
	}
	if account.EnableAnalyticalStorage != nil {
		enableAnalyticalStorage := *account.EnableAnalyticalStorage
		result.Properties.EnableAnalyticalStorage = &enableAnalyticalStorage
	}
	if account.EnableAutomaticFailover != nil {
		enableAutomaticFailover := *account.EnableAutomaticFailover
		result.Properties.EnableAutomaticFailover = &enableAutomaticFailover
	}
	if account.EnableBurstCapacity != nil {
		enableBurstCapacity := *account.EnableBurstCapacity
		result.Properties.EnableBurstCapacity = &enableBurstCapacity
	}
	if account.EnableCassandraConnector != nil {
		enableCassandraConnector := *account.EnableCassandraConnector
		result.Properties.EnableCassandraConnector = &enableCassandraConnector
	}
	if account.EnableFreeTier != nil {
		enableFreeTier := *account.EnableFreeTier
		result.Properties.EnableFreeTier = &enableFreeTier
	}
	if account.EnableMultipleWriteLocations != nil {
		enableMultipleWriteLocations := *account.EnableMultipleWriteLocations
		result.Properties.EnableMultipleWriteLocations = &enableMultipleWriteLocations
	}
	if account.EnablePartitionMerge != nil {
		enablePartitionMerge := *account.EnablePartitionMerge
		result.Properties.EnablePartitionMerge = &enablePartitionMerge
	}
	for _, item := range account.IpRules {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.IpRules = append(result.Properties.IpRules, *item_ARM.(*arm.IpAddressOrRange))
	}
	if account.IsVirtualNetworkFilterEnabled != nil {
		isVirtualNetworkFilterEnabled := *account.IsVirtualNetworkFilterEnabled
		result.Properties.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
	}
	if account.KeyVaultKeyUri != nil {
		keyVaultKeyUri := *account.KeyVaultKeyUri
		result.Properties.KeyVaultKeyUri = &keyVaultKeyUri
	}
	for _, item := range account.Locations {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.Locations = append(result.Properties.Locations, *item_ARM.(*arm.Location))
	}
	if account.MinimalTlsVersion != nil {
		var temp string
		temp = string(*account.MinimalTlsVersion)
		minimalTlsVersion := arm.MinimalTlsVersion(temp)
		result.Properties.MinimalTlsVersion = &minimalTlsVersion
	}
	if account.NetworkAclBypass != nil {
		var temp string
		temp = string(*account.NetworkAclBypass)
		networkAclBypass := arm.NetworkAclBypass(temp)
		result.Properties.NetworkAclBypass = &networkAclBypass
	}
	for _, item := range account.NetworkAclBypassResourceReferences {
		itemARMID, err := resolved.ResolvedReferences.Lookup(item)
		if err != nil {
			return nil, err
		}
		result.Properties.NetworkAclBypassResourceIds = append(result.Properties.NetworkAclBypassResourceIds, itemARMID)
	}
	if account.PublicNetworkAccess != nil {
		var temp string
		temp = string(*account.PublicNetworkAccess)
		publicNetworkAccess := arm.PublicNetworkAccess(temp)
		result.Properties.PublicNetworkAccess = &publicNetworkAccess
	}
	if account.RestoreParameters != nil {
		restoreParameters_ARM, err := account.RestoreParameters.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		restoreParameters := *restoreParameters_ARM.(*arm.RestoreParameters)
		result.Properties.RestoreParameters = &restoreParameters
	}
	for _, item := range account.VirtualNetworkRules {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.VirtualNetworkRules = append(result.Properties.VirtualNetworkRules, *item_ARM.(*arm.VirtualNetworkRule))
	}

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

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

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

	// Set property "AnalyticalStorageConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AnalyticalStorageConfiguration != nil {
			var analyticalStorageConfiguration1 AnalyticalStorageConfiguration
			err := analyticalStorageConfiguration1.PopulateFromARM(owner, *typedInput.Properties.AnalyticalStorageConfiguration)
			if err != nil {
				return err
			}
			analyticalStorageConfiguration := analyticalStorageConfiguration1
			account.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
		}
	}

	// Set property "ApiProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiProperties != nil {
			var apiProperties1 ApiProperties
			err := apiProperties1.PopulateFromARM(owner, *typedInput.Properties.ApiProperties)
			if err != nil {
				return err
			}
			apiProperties := apiProperties1
			account.ApiProperties = &apiProperties
		}
	}

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

	// Set property "BackupPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BackupPolicy != nil {
			var backupPolicy1 BackupPolicy
			err := backupPolicy1.PopulateFromARM(owner, *typedInput.Properties.BackupPolicy)
			if err != nil {
				return err
			}
			backupPolicy := backupPolicy1
			account.BackupPolicy = &backupPolicy
		}
	}

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

	// Set property "Capacity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Capacity != nil {
			var capacity1 Capacity
			err := capacity1.PopulateFromARM(owner, *typedInput.Properties.Capacity)
			if err != nil {
				return err
			}
			capacity := capacity1
			account.Capacity = &capacity
		}
	}

	// Set property "ConnectorOffer":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConnectorOffer != nil {
			var temp string
			temp = string(*typedInput.Properties.ConnectorOffer)
			connectorOffer := ConnectorOffer(temp)
			account.ConnectorOffer = &connectorOffer
		}
	}

	// Set property "ConsistencyPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConsistencyPolicy != nil {
			var consistencyPolicy1 ConsistencyPolicy
			err := consistencyPolicy1.PopulateFromARM(owner, *typedInput.Properties.ConsistencyPolicy)
			if err != nil {
				return err
			}
			consistencyPolicy := consistencyPolicy1
			account.ConsistencyPolicy = &consistencyPolicy
		}
	}

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

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

	// Set property "DatabaseAccountOfferType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DatabaseAccountOfferType != nil {
			var temp string
			temp = string(*typedInput.Properties.DatabaseAccountOfferType)
			databaseAccountOfferType := DatabaseAccountOfferType(temp)
			account.DatabaseAccountOfferType = &databaseAccountOfferType
		}
	}

	// Set property "DefaultIdentity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultIdentity != nil {
			defaultIdentity := *typedInput.Properties.DefaultIdentity
			account.DefaultIdentity = &defaultIdentity
		}
	}

	// Set property "DisableKeyBasedMetadataWriteAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableKeyBasedMetadataWriteAccess != nil {
			disableKeyBasedMetadataWriteAccess := *typedInput.Properties.DisableKeyBasedMetadataWriteAccess
			account.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
		}
	}

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

	// Set property "EnableAnalyticalStorage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableAnalyticalStorage != nil {
			enableAnalyticalStorage := *typedInput.Properties.EnableAnalyticalStorage
			account.EnableAnalyticalStorage = &enableAnalyticalStorage
		}
	}

	// Set property "EnableAutomaticFailover":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableAutomaticFailover != nil {
			enableAutomaticFailover := *typedInput.Properties.EnableAutomaticFailover
			account.EnableAutomaticFailover = &enableAutomaticFailover
		}
	}

	// Set property "EnableBurstCapacity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableBurstCapacity != nil {
			enableBurstCapacity := *typedInput.Properties.EnableBurstCapacity
			account.EnableBurstCapacity = &enableBurstCapacity
		}
	}

	// Set property "EnableCassandraConnector":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableCassandraConnector != nil {
			enableCassandraConnector := *typedInput.Properties.EnableCassandraConnector
			account.EnableCassandraConnector = &enableCassandraConnector
		}
	}

	// Set property "EnableFreeTier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableFreeTier != nil {
			enableFreeTier := *typedInput.Properties.EnableFreeTier
			account.EnableFreeTier = &enableFreeTier
		}
	}

	// Set property "EnableMultipleWriteLocations":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableMultipleWriteLocations != nil {
			enableMultipleWriteLocations := *typedInput.Properties.EnableMultipleWriteLocations
			account.EnableMultipleWriteLocations = &enableMultipleWriteLocations
		}
	}

	// Set property "EnablePartitionMerge":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnablePartitionMerge != nil {
			enablePartitionMerge := *typedInput.Properties.EnablePartitionMerge
			account.EnablePartitionMerge = &enablePartitionMerge
		}
	}

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

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

	// Set property "IsVirtualNetworkFilterEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsVirtualNetworkFilterEnabled != nil {
			isVirtualNetworkFilterEnabled := *typedInput.Properties.IsVirtualNetworkFilterEnabled
			account.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
		}
	}

	// Set property "KeyVaultKeyUri":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KeyVaultKeyUri != nil {
			keyVaultKeyUri := *typedInput.Properties.KeyVaultKeyUri
			account.KeyVaultKeyUri = &keyVaultKeyUri
		}
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		var temp string
		temp = string(*typedInput.Kind)
		kind := DatabaseAccount_Kind_Spec(temp)
		account.Kind = &kind
	}

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

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

	// Set property "MinimalTlsVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinimalTlsVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.MinimalTlsVersion)
			minimalTlsVersion := MinimalTlsVersion(temp)
			account.MinimalTlsVersion = &minimalTlsVersion
		}
	}

	// Set property "NetworkAclBypass":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAclBypass != nil {
			var temp string
			temp = string(*typedInput.Properties.NetworkAclBypass)
			networkAclBypass := NetworkAclBypass(temp)
			account.NetworkAclBypass = &networkAclBypass
		}
	}

	// no assignment for property "NetworkAclBypassResourceReferences"

	// no assignment for property "OperatorSpec"

	// Set property "Owner":
	account.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 := PublicNetworkAccess(temp)
			account.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "RestoreParameters":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestoreParameters != nil {
			var restoreParameters1 RestoreParameters
			err := restoreParameters1.PopulateFromARM(owner, *typedInput.Properties.RestoreParameters)
			if err != nil {
				return err
			}
			restoreParameters := restoreParameters1
			account.RestoreParameters = &restoreParameters
		}
	}

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &DatabaseAccount_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.DatabaseAccount_Spec{}
	err := account.AssignProperties_To_DatabaseAccount_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_DatabaseAccount_Spec populates our DatabaseAccount_Spec from the provided source DatabaseAccount_Spec
func (account *DatabaseAccount_Spec) AssignProperties_From_DatabaseAccount_Spec(source *storage.DatabaseAccount_Spec) error {

	// AnalyticalStorageConfiguration
	if source.AnalyticalStorageConfiguration != nil {
		var analyticalStorageConfiguration AnalyticalStorageConfiguration
		err := analyticalStorageConfiguration.AssignProperties_From_AnalyticalStorageConfiguration(source.AnalyticalStorageConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AnalyticalStorageConfiguration() to populate field AnalyticalStorageConfiguration")
		}
		account.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
	} else {
		account.AnalyticalStorageConfiguration = nil
	}

	// ApiProperties
	if source.ApiProperties != nil {
		var apiProperty ApiProperties
		err := apiProperty.AssignProperties_From_ApiProperties(source.ApiProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiProperties() to populate field ApiProperties")
		}
		account.ApiProperties = &apiProperty
	} else {
		account.ApiProperties = nil
	}

	// AzureName
	account.AzureName = source.AzureName

	// BackupPolicy
	if source.BackupPolicy != nil {
		var backupPolicy BackupPolicy
		err := backupPolicy.AssignProperties_From_BackupPolicy(source.BackupPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BackupPolicy() to populate field BackupPolicy")
		}
		account.BackupPolicy = &backupPolicy
	} else {
		account.BackupPolicy = nil
	}

	// Capabilities
	if source.Capabilities != nil {
		capabilityList := make([]Capability, len(source.Capabilities))
		for capabilityIndex, capabilityItem := range source.Capabilities {
			var capability Capability
			err := capability.AssignProperties_From_Capability(&capabilityItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Capability() to populate field Capabilities")
			}
			capabilityList[capabilityIndex] = capability
		}
		account.Capabilities = capabilityList
	} else {
		account.Capabilities = nil
	}

	// Capacity
	if source.Capacity != nil {
		var capacity Capacity
		err := capacity.AssignProperties_From_Capacity(source.Capacity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Capacity() to populate field Capacity")
		}
		account.Capacity = &capacity
	} else {
		account.Capacity = nil
	}

	// ConnectorOffer
	if source.ConnectorOffer != nil {
		connectorOffer := *source.ConnectorOffer
		connectorOfferTemp := genruntime.ToEnum(connectorOffer, connectorOffer_Values)
		account.ConnectorOffer = &connectorOfferTemp
	} else {
		account.ConnectorOffer = nil
	}

	// ConsistencyPolicy
	if source.ConsistencyPolicy != nil {
		var consistencyPolicy ConsistencyPolicy
		err := consistencyPolicy.AssignProperties_From_ConsistencyPolicy(source.ConsistencyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConsistencyPolicy() to populate field ConsistencyPolicy")
		}
		account.ConsistencyPolicy = &consistencyPolicy
	} else {
		account.ConsistencyPolicy = nil
	}

	// Cors
	if source.Cors != nil {
		corList := make([]CorsPolicy, len(source.Cors))
		for corIndex, corItem := range source.Cors {
			var cor CorsPolicy
			err := cor.AssignProperties_From_CorsPolicy(&corItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CorsPolicy() to populate field Cors")
			}
			corList[corIndex] = cor
		}
		account.Cors = corList
	} else {
		account.Cors = nil
	}

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

	// DatabaseAccountOfferType
	if source.DatabaseAccountOfferType != nil {
		databaseAccountOfferType := *source.DatabaseAccountOfferType
		databaseAccountOfferTypeTemp := genruntime.ToEnum(databaseAccountOfferType, databaseAccountOfferType_Values)
		account.DatabaseAccountOfferType = &databaseAccountOfferTypeTemp
	} else {
		account.DatabaseAccountOfferType = nil
	}

	// DefaultIdentity
	account.DefaultIdentity = genruntime.ClonePointerToString(source.DefaultIdentity)

	// DisableKeyBasedMetadataWriteAccess
	if source.DisableKeyBasedMetadataWriteAccess != nil {
		disableKeyBasedMetadataWriteAccess := *source.DisableKeyBasedMetadataWriteAccess
		account.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
	} else {
		account.DisableKeyBasedMetadataWriteAccess = nil
	}

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

	// EnableAnalyticalStorage
	if source.EnableAnalyticalStorage != nil {
		enableAnalyticalStorage := *source.EnableAnalyticalStorage
		account.EnableAnalyticalStorage = &enableAnalyticalStorage
	} else {
		account.EnableAnalyticalStorage = nil
	}

	// EnableAutomaticFailover
	if source.EnableAutomaticFailover != nil {
		enableAutomaticFailover := *source.EnableAutomaticFailover
		account.EnableAutomaticFailover = &enableAutomaticFailover
	} else {
		account.EnableAutomaticFailover = nil
	}

	// EnableBurstCapacity
	if source.EnableBurstCapacity != nil {
		enableBurstCapacity := *source.EnableBurstCapacity
		account.EnableBurstCapacity = &enableBurstCapacity
	} else {
		account.EnableBurstCapacity = nil
	}

	// EnableCassandraConnector
	if source.EnableCassandraConnector != nil {
		enableCassandraConnector := *source.EnableCassandraConnector
		account.EnableCassandraConnector = &enableCassandraConnector
	} else {
		account.EnableCassandraConnector = nil
	}

	// EnableFreeTier
	if source.EnableFreeTier != nil {
		enableFreeTier := *source.EnableFreeTier
		account.EnableFreeTier = &enableFreeTier
	} else {
		account.EnableFreeTier = nil
	}

	// EnableMultipleWriteLocations
	if source.EnableMultipleWriteLocations != nil {
		enableMultipleWriteLocation := *source.EnableMultipleWriteLocations
		account.EnableMultipleWriteLocations = &enableMultipleWriteLocation
	} else {
		account.EnableMultipleWriteLocations = nil
	}

	// EnablePartitionMerge
	if source.EnablePartitionMerge != nil {
		enablePartitionMerge := *source.EnablePartitionMerge
		account.EnablePartitionMerge = &enablePartitionMerge
	} else {
		account.EnablePartitionMerge = nil
	}

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

	// IpRules
	if source.IpRules != nil {
		ipRuleList := make([]IpAddressOrRange, len(source.IpRules))
		for ipRuleIndex, ipRuleItem := range source.IpRules {
			var ipRule IpAddressOrRange
			err := ipRule.AssignProperties_From_IpAddressOrRange(&ipRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IpAddressOrRange() to populate field IpRules")
			}
			ipRuleList[ipRuleIndex] = ipRule
		}
		account.IpRules = ipRuleList
	} else {
		account.IpRules = nil
	}

	// IsVirtualNetworkFilterEnabled
	if source.IsVirtualNetworkFilterEnabled != nil {
		isVirtualNetworkFilterEnabled := *source.IsVirtualNetworkFilterEnabled
		account.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
	} else {
		account.IsVirtualNetworkFilterEnabled = nil
	}

	// KeyVaultKeyUri
	account.KeyVaultKeyUri = genruntime.ClonePointerToString(source.KeyVaultKeyUri)

	// Kind
	if source.Kind != nil {
		kind := *source.Kind
		kindTemp := genruntime.ToEnum(kind, databaseAccount_Kind_Spec_Values)
		account.Kind = &kindTemp
	} else {
		account.Kind = nil
	}

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

	// Locations
	if source.Locations != nil {
		locationList := make([]Location, len(source.Locations))
		for locationIndex, locationItem := range source.Locations {
			var location Location
			err := location.AssignProperties_From_Location(&locationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Location() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		account.Locations = locationList
	} else {
		account.Locations = nil
	}

	// MinimalTlsVersion
	if source.MinimalTlsVersion != nil {
		minimalTlsVersion := *source.MinimalTlsVersion
		minimalTlsVersionTemp := genruntime.ToEnum(minimalTlsVersion, minimalTlsVersion_Values)
		account.MinimalTlsVersion = &minimalTlsVersionTemp
	} else {
		account.MinimalTlsVersion = nil
	}

	// NetworkAclBypass
	if source.NetworkAclBypass != nil {
		networkAclBypass := *source.NetworkAclBypass
		networkAclBypassTemp := genruntime.ToEnum(networkAclBypass, networkAclBypass_Values)
		account.NetworkAclBypass = &networkAclBypassTemp
	} else {
		account.NetworkAclBypass = nil
	}

	// NetworkAclBypassResourceReferences
	if source.NetworkAclBypassResourceReferences != nil {
		networkAclBypassResourceReferenceList := make([]genruntime.ResourceReference, len(source.NetworkAclBypassResourceReferences))
		for networkAclBypassResourceReferenceIndex, networkAclBypassResourceReferenceItem := range source.NetworkAclBypassResourceReferences {
			networkAclBypassResourceReferenceList[networkAclBypassResourceReferenceIndex] = networkAclBypassResourceReferenceItem.Copy()
		}
		account.NetworkAclBypassResourceReferences = networkAclBypassResourceReferenceList
	} else {
		account.NetworkAclBypassResourceReferences = nil
	}

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

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

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

	// RestoreParameters
	if source.RestoreParameters != nil {
		var restoreParameter RestoreParameters
		err := restoreParameter.AssignProperties_From_RestoreParameters(source.RestoreParameters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_RestoreParameters() to populate field RestoreParameters")
		}
		account.RestoreParameters = &restoreParameter
	} else {
		account.RestoreParameters = nil
	}

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

	// VirtualNetworkRules
	if source.VirtualNetworkRules != nil {
		virtualNetworkRuleList := make([]VirtualNetworkRule, len(source.VirtualNetworkRules))
		for virtualNetworkRuleIndex, virtualNetworkRuleItem := range source.VirtualNetworkRules {
			var virtualNetworkRule VirtualNetworkRule
			err := virtualNetworkRule.AssignProperties_From_VirtualNetworkRule(&virtualNetworkRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkRule() to populate field VirtualNetworkRules")
			}
			virtualNetworkRuleList[virtualNetworkRuleIndex] = virtualNetworkRule
		}
		account.VirtualNetworkRules = virtualNetworkRuleList
	} else {
		account.VirtualNetworkRules = nil
	}

	// No error
	return nil
}

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

	// AnalyticalStorageConfiguration
	if account.AnalyticalStorageConfiguration != nil {
		var analyticalStorageConfiguration storage.AnalyticalStorageConfiguration
		err := account.AnalyticalStorageConfiguration.AssignProperties_To_AnalyticalStorageConfiguration(&analyticalStorageConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AnalyticalStorageConfiguration() to populate field AnalyticalStorageConfiguration")
		}
		destination.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
	} else {
		destination.AnalyticalStorageConfiguration = nil
	}

	// ApiProperties
	if account.ApiProperties != nil {
		var apiProperty storage.ApiProperties
		err := account.ApiProperties.AssignProperties_To_ApiProperties(&apiProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiProperties() to populate field ApiProperties")
		}
		destination.ApiProperties = &apiProperty
	} else {
		destination.ApiProperties = nil
	}

	// AzureName
	destination.AzureName = account.AzureName

	// BackupPolicy
	if account.BackupPolicy != nil {
		var backupPolicy storage.BackupPolicy
		err := account.BackupPolicy.AssignProperties_To_BackupPolicy(&backupPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BackupPolicy() to populate field BackupPolicy")
		}
		destination.BackupPolicy = &backupPolicy
	} else {
		destination.BackupPolicy = nil
	}

	// Capabilities
	if account.Capabilities != nil {
		capabilityList := make([]storage.Capability, len(account.Capabilities))
		for capabilityIndex, capabilityItem := range account.Capabilities {
			var capability storage.Capability
			err := capabilityItem.AssignProperties_To_Capability(&capability)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Capability() to populate field Capabilities")
			}
			capabilityList[capabilityIndex] = capability
		}
		destination.Capabilities = capabilityList
	} else {
		destination.Capabilities = nil
	}

	// Capacity
	if account.Capacity != nil {
		var capacity storage.Capacity
		err := account.Capacity.AssignProperties_To_Capacity(&capacity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Capacity() to populate field Capacity")
		}
		destination.Capacity = &capacity
	} else {
		destination.Capacity = nil
	}

	// ConnectorOffer
	if account.ConnectorOffer != nil {
		connectorOffer := string(*account.ConnectorOffer)
		destination.ConnectorOffer = &connectorOffer
	} else {
		destination.ConnectorOffer = nil
	}

	// ConsistencyPolicy
	if account.ConsistencyPolicy != nil {
		var consistencyPolicy storage.ConsistencyPolicy
		err := account.ConsistencyPolicy.AssignProperties_To_ConsistencyPolicy(&consistencyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConsistencyPolicy() to populate field ConsistencyPolicy")
		}
		destination.ConsistencyPolicy = &consistencyPolicy
	} else {
		destination.ConsistencyPolicy = nil
	}

	// Cors
	if account.Cors != nil {
		corList := make([]storage.CorsPolicy, len(account.Cors))
		for corIndex, corItem := range account.Cors {
			var cor storage.CorsPolicy
			err := corItem.AssignProperties_To_CorsPolicy(&cor)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CorsPolicy() to populate field Cors")
			}
			corList[corIndex] = cor
		}
		destination.Cors = corList
	} else {
		destination.Cors = nil
	}

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

	// DatabaseAccountOfferType
	if account.DatabaseAccountOfferType != nil {
		databaseAccountOfferType := string(*account.DatabaseAccountOfferType)
		destination.DatabaseAccountOfferType = &databaseAccountOfferType
	} else {
		destination.DatabaseAccountOfferType = nil
	}

	// DefaultIdentity
	destination.DefaultIdentity = genruntime.ClonePointerToString(account.DefaultIdentity)

	// DisableKeyBasedMetadataWriteAccess
	if account.DisableKeyBasedMetadataWriteAccess != nil {
		disableKeyBasedMetadataWriteAccess := *account.DisableKeyBasedMetadataWriteAccess
		destination.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
	} else {
		destination.DisableKeyBasedMetadataWriteAccess = nil
	}

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

	// EnableAnalyticalStorage
	if account.EnableAnalyticalStorage != nil {
		enableAnalyticalStorage := *account.EnableAnalyticalStorage
		destination.EnableAnalyticalStorage = &enableAnalyticalStorage
	} else {
		destination.EnableAnalyticalStorage = nil
	}

	// EnableAutomaticFailover
	if account.EnableAutomaticFailover != nil {
		enableAutomaticFailover := *account.EnableAutomaticFailover
		destination.EnableAutomaticFailover = &enableAutomaticFailover
	} else {
		destination.EnableAutomaticFailover = nil
	}

	// EnableBurstCapacity
	if account.EnableBurstCapacity != nil {
		enableBurstCapacity := *account.EnableBurstCapacity
		destination.EnableBurstCapacity = &enableBurstCapacity
	} else {
		destination.EnableBurstCapacity = nil
	}

	// EnableCassandraConnector
	if account.EnableCassandraConnector != nil {
		enableCassandraConnector := *account.EnableCassandraConnector
		destination.EnableCassandraConnector = &enableCassandraConnector
	} else {
		destination.EnableCassandraConnector = nil
	}

	// EnableFreeTier
	if account.EnableFreeTier != nil {
		enableFreeTier := *account.EnableFreeTier
		destination.EnableFreeTier = &enableFreeTier
	} else {
		destination.EnableFreeTier = nil
	}

	// EnableMultipleWriteLocations
	if account.EnableMultipleWriteLocations != nil {
		enableMultipleWriteLocation := *account.EnableMultipleWriteLocations
		destination.EnableMultipleWriteLocations = &enableMultipleWriteLocation
	} else {
		destination.EnableMultipleWriteLocations = nil
	}

	// EnablePartitionMerge
	if account.EnablePartitionMerge != nil {
		enablePartitionMerge := *account.EnablePartitionMerge
		destination.EnablePartitionMerge = &enablePartitionMerge
	} else {
		destination.EnablePartitionMerge = nil
	}

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

	// IpRules
	if account.IpRules != nil {
		ipRuleList := make([]storage.IpAddressOrRange, len(account.IpRules))
		for ipRuleIndex, ipRuleItem := range account.IpRules {
			var ipRule storage.IpAddressOrRange
			err := ipRuleItem.AssignProperties_To_IpAddressOrRange(&ipRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IpAddressOrRange() to populate field IpRules")
			}
			ipRuleList[ipRuleIndex] = ipRule
		}
		destination.IpRules = ipRuleList
	} else {
		destination.IpRules = nil
	}

	// IsVirtualNetworkFilterEnabled
	if account.IsVirtualNetworkFilterEnabled != nil {
		isVirtualNetworkFilterEnabled := *account.IsVirtualNetworkFilterEnabled
		destination.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
	} else {
		destination.IsVirtualNetworkFilterEnabled = nil
	}

	// KeyVaultKeyUri
	destination.KeyVaultKeyUri = genruntime.ClonePointerToString(account.KeyVaultKeyUri)

	// Kind
	if account.Kind != nil {
		kind := string(*account.Kind)
		destination.Kind = &kind
	} else {
		destination.Kind = nil
	}

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

	// Locations
	if account.Locations != nil {
		locationList := make([]storage.Location, len(account.Locations))
		for locationIndex, locationItem := range account.Locations {
			var location storage.Location
			err := locationItem.AssignProperties_To_Location(&location)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Location() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		destination.Locations = locationList
	} else {
		destination.Locations = nil
	}

	// MinimalTlsVersion
	if account.MinimalTlsVersion != nil {
		minimalTlsVersion := string(*account.MinimalTlsVersion)
		destination.MinimalTlsVersion = &minimalTlsVersion
	} else {
		destination.MinimalTlsVersion = nil
	}

	// NetworkAclBypass
	if account.NetworkAclBypass != nil {
		networkAclBypass := string(*account.NetworkAclBypass)
		destination.NetworkAclBypass = &networkAclBypass
	} else {
		destination.NetworkAclBypass = nil
	}

	// NetworkAclBypassResourceReferences
	if account.NetworkAclBypassResourceReferences != nil {
		networkAclBypassResourceReferenceList := make([]genruntime.ResourceReference, len(account.NetworkAclBypassResourceReferences))
		for networkAclBypassResourceReferenceIndex, networkAclBypassResourceReferenceItem := range account.NetworkAclBypassResourceReferences {
			networkAclBypassResourceReferenceList[networkAclBypassResourceReferenceIndex] = networkAclBypassResourceReferenceItem.Copy()
		}
		destination.NetworkAclBypassResourceReferences = networkAclBypassResourceReferenceList
	} else {
		destination.NetworkAclBypassResourceReferences = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = account.OriginalVersion()

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

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

	// RestoreParameters
	if account.RestoreParameters != nil {
		var restoreParameter storage.RestoreParameters
		err := account.RestoreParameters.AssignProperties_To_RestoreParameters(&restoreParameter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_RestoreParameters() to populate field RestoreParameters")
		}
		destination.RestoreParameters = &restoreParameter
	} else {
		destination.RestoreParameters = nil
	}

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

	// VirtualNetworkRules
	if account.VirtualNetworkRules != nil {
		virtualNetworkRuleList := make([]storage.VirtualNetworkRule, len(account.VirtualNetworkRules))
		for virtualNetworkRuleIndex, virtualNetworkRuleItem := range account.VirtualNetworkRules {
			var virtualNetworkRule storage.VirtualNetworkRule
			err := virtualNetworkRuleItem.AssignProperties_To_VirtualNetworkRule(&virtualNetworkRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkRule() to populate field VirtualNetworkRules")
			}
			virtualNetworkRuleList[virtualNetworkRuleIndex] = virtualNetworkRule
		}
		destination.VirtualNetworkRules = virtualNetworkRuleList
	} else {
		destination.VirtualNetworkRules = nil
	}

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

	// No error
	return nil
}

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

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

type DatabaseAccount_STATUS struct {
	// AnalyticalStorageConfiguration: Analytical storage specific properties.
	AnalyticalStorageConfiguration *AnalyticalStorageConfiguration_STATUS `json:"analyticalStorageConfiguration,omitempty"`

	// ApiProperties: API specific properties.
	ApiProperties *ApiProperties_STATUS `json:"apiProperties,omitempty"`

	// BackupPolicy: The object representing the policy for taking backups on an account.
	BackupPolicy *BackupPolicy_STATUS `json:"backupPolicy,omitempty"`

	// Capabilities: List of Cosmos DB capabilities for the account
	Capabilities []Capability_STATUS `json:"capabilities,omitempty"`

	// Capacity: The object that represents all properties related to capacity enforcement on an account.
	Capacity *Capacity_STATUS `json:"capacity,omitempty"`

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

	// ConnectorOffer: The cassandra connector offer type for the Cosmos DB database C* account.
	ConnectorOffer *ConnectorOffer_STATUS `json:"connectorOffer,omitempty"`

	// ConsistencyPolicy: The consistency policy for the Cosmos DB database account.
	ConsistencyPolicy *ConsistencyPolicy_STATUS `json:"consistencyPolicy,omitempty"`

	// Cors: The CORS policy for the Cosmos DB database account.
	Cors []CorsPolicy_STATUS `json:"cors,omitempty"`

	// CreateMode: Enum to indicate the mode of account creation.
	CreateMode *CreateMode_STATUS `json:"createMode,omitempty"`

	// CustomerManagedKeyStatus: Indicates the status of the Customer Managed Key feature on the account. In case there are
	// errors, the property provides troubleshooting guidance.
	CustomerManagedKeyStatus *string `json:"customerManagedKeyStatus,omitempty"`

	// DatabaseAccountOfferType: The offer type for the Cosmos DB database account. Default value: Standard.
	DatabaseAccountOfferType *DatabaseAccountOfferType_STATUS `json:"databaseAccountOfferType,omitempty"`

	// DefaultIdentity: The default identity for accessing key vault used in features like customer managed keys. The default
	// identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more.
	DefaultIdentity *string `json:"defaultIdentity,omitempty"`

	// DisableKeyBasedMetadataWriteAccess: Disable write operations on metadata resources (databases, containers, throughput)
	// via account keys
	DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`

	// DisableLocalAuth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// DocumentEndpoint: The connection endpoint for the Cosmos DB database account.
	DocumentEndpoint *string `json:"documentEndpoint,omitempty"`

	// EnableAnalyticalStorage: Flag to indicate whether to enable storage analytics.
	EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`

	// EnableAutomaticFailover: Enables automatic failover of the write region in the rare event that the region is unavailable
	// due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the
	// failover priorities configured for the account.
	EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`

	// EnableBurstCapacity: Flag to indicate enabling/disabling of Burst Capacity feature on the account
	EnableBurstCapacity *bool `json:"enableBurstCapacity,omitempty"`

	// EnableCassandraConnector: Enables the cassandra connector on the Cosmos DB C* account
	EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`

	// EnableFreeTier: Flag to indicate whether Free Tier is enabled.
	EnableFreeTier *bool `json:"enableFreeTier,omitempty"`

	// EnableMultipleWriteLocations: Enables the account to write in multiple locations
	EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`

	// EnablePartitionMerge: Flag to indicate enabling/disabling of Partition Merge feature on the account
	EnablePartitionMerge *bool `json:"enablePartitionMerge,omitempty"`

	// FailoverPolicies: An array that contains the regions ordered by their failover priorities.
	FailoverPolicies []FailoverPolicy_STATUS `json:"failoverPolicies,omitempty"`

	// Id: The unique resource identifier of the ARM resource.
	Id *string `json:"id,omitempty"`

	// Identity: Identity for the resource.
	Identity *ManagedServiceIdentity_STATUS `json:"identity,omitempty"`

	// InstanceId: A unique identifier assigned to the database account
	InstanceId *string `json:"instanceId,omitempty"`

	// IpRules: List of IpRules.
	IpRules []IpAddressOrRange_STATUS `json:"ipRules,omitempty"`

	// IsVirtualNetworkFilterEnabled: Flag to indicate whether to enable/disable Virtual Network ACL rules.
	IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`

	// KeyVaultKeyUri: The URI of the key vault
	KeyVaultKeyUri *string `json:"keyVaultKeyUri,omitempty"`

	// KeysMetadata: The object that represents the metadata for the Account Keys of the Cosmos DB account.
	KeysMetadata *DatabaseAccountKeysMetadata_STATUS `json:"keysMetadata,omitempty"`

	// Kind: Indicates the type of database account. This can only be set at database account creation.
	Kind *DatabaseAccount_Kind_STATUS `json:"kind,omitempty"`

	// Location: The location of the resource group to which the resource belongs.
	Location *string `json:"location,omitempty"`

	// Locations: An array that contains all of the locations enabled for the Cosmos DB account.
	Locations []Location_STATUS `json:"locations,omitempty"`

	// MinimalTlsVersion: Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs
	// only work with Tls 1.2.
	MinimalTlsVersion *MinimalTlsVersion_STATUS `json:"minimalTlsVersion,omitempty"`

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

	// NetworkAclBypass: Indicates what services are allowed to bypass firewall checks.
	NetworkAclBypass *NetworkAclBypass_STATUS `json:"networkAclBypass,omitempty"`

	// NetworkAclBypassResourceIds: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
	NetworkAclBypassResourceIds []string `json:"networkAclBypassResourceIds,omitempty"`

	// PrivateEndpointConnections: List of Private Endpoint Connections configured for the Cosmos DB account.
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"`
	ProvisioningState          *string                            `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Whether requests from Public Network are allowed
	PublicNetworkAccess *PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// ReadLocations: An array that contains of the read locations enabled for the Cosmos DB account.
	ReadLocations []Location_STATUS `json:"readLocations,omitempty"`

	// RestoreParameters: Parameters to indicate the information about the restore.
	RestoreParameters *RestoreParameters_STATUS `json:"restoreParameters,omitempty"`

	// SystemData: The system meta data relating to this resource.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`
	Tags       map[string]string  `json:"tags,omitempty"`

	// Type: The type of Azure resource.
	Type *string `json:"type,omitempty"`

	// VirtualNetworkRules: List of Virtual Network ACL rules configured for the Cosmos DB account.
	VirtualNetworkRules []VirtualNetworkRule_STATUS `json:"virtualNetworkRules,omitempty"`

	// WriteLocations: An array that contains the write location for the Cosmos DB account.
	WriteLocations []Location_STATUS `json:"writeLocations,omitempty"`
}

var _ genruntime.ConvertibleStatus = &DatabaseAccount_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.DatabaseAccount_STATUS{}
	err := account.AssignProperties_To_DatabaseAccount_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 = &DatabaseAccount_STATUS{}

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

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

	// Set property "AnalyticalStorageConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AnalyticalStorageConfiguration != nil {
			var analyticalStorageConfiguration1 AnalyticalStorageConfiguration_STATUS
			err := analyticalStorageConfiguration1.PopulateFromARM(owner, *typedInput.Properties.AnalyticalStorageConfiguration)
			if err != nil {
				return err
			}
			analyticalStorageConfiguration := analyticalStorageConfiguration1
			account.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
		}
	}

	// Set property "ApiProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiProperties != nil {
			var apiProperties1 ApiProperties_STATUS
			err := apiProperties1.PopulateFromARM(owner, *typedInput.Properties.ApiProperties)
			if err != nil {
				return err
			}
			apiProperties := apiProperties1
			account.ApiProperties = &apiProperties
		}
	}

	// Set property "BackupPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.BackupPolicy != nil {
			var backupPolicy1 BackupPolicy_STATUS
			err := backupPolicy1.PopulateFromARM(owner, *typedInput.Properties.BackupPolicy)
			if err != nil {
				return err
			}
			backupPolicy := backupPolicy1
			account.BackupPolicy = &backupPolicy
		}
	}

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

	// Set property "Capacity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Capacity != nil {
			var capacity1 Capacity_STATUS
			err := capacity1.PopulateFromARM(owner, *typedInput.Properties.Capacity)
			if err != nil {
				return err
			}
			capacity := capacity1
			account.Capacity = &capacity
		}
	}

	// no assignment for property "Conditions"

	// Set property "ConnectorOffer":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConnectorOffer != nil {
			var temp string
			temp = string(*typedInput.Properties.ConnectorOffer)
			connectorOffer := ConnectorOffer_STATUS(temp)
			account.ConnectorOffer = &connectorOffer
		}
	}

	// Set property "ConsistencyPolicy":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConsistencyPolicy != nil {
			var consistencyPolicy1 ConsistencyPolicy_STATUS
			err := consistencyPolicy1.PopulateFromARM(owner, *typedInput.Properties.ConsistencyPolicy)
			if err != nil {
				return err
			}
			consistencyPolicy := consistencyPolicy1
			account.ConsistencyPolicy = &consistencyPolicy
		}
	}

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

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

	// Set property "CustomerManagedKeyStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomerManagedKeyStatus != nil {
			customerManagedKeyStatus := *typedInput.Properties.CustomerManagedKeyStatus
			account.CustomerManagedKeyStatus = &customerManagedKeyStatus
		}
	}

	// Set property "DatabaseAccountOfferType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DatabaseAccountOfferType != nil {
			var temp string
			temp = string(*typedInput.Properties.DatabaseAccountOfferType)
			databaseAccountOfferType := DatabaseAccountOfferType_STATUS(temp)
			account.DatabaseAccountOfferType = &databaseAccountOfferType
		}
	}

	// Set property "DefaultIdentity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultIdentity != nil {
			defaultIdentity := *typedInput.Properties.DefaultIdentity
			account.DefaultIdentity = &defaultIdentity
		}
	}

	// Set property "DisableKeyBasedMetadataWriteAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableKeyBasedMetadataWriteAccess != nil {
			disableKeyBasedMetadataWriteAccess := *typedInput.Properties.DisableKeyBasedMetadataWriteAccess
			account.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
		}
	}

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

	// Set property "DocumentEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DocumentEndpoint != nil {
			documentEndpoint := *typedInput.Properties.DocumentEndpoint
			account.DocumentEndpoint = &documentEndpoint
		}
	}

	// Set property "EnableAnalyticalStorage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableAnalyticalStorage != nil {
			enableAnalyticalStorage := *typedInput.Properties.EnableAnalyticalStorage
			account.EnableAnalyticalStorage = &enableAnalyticalStorage
		}
	}

	// Set property "EnableAutomaticFailover":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableAutomaticFailover != nil {
			enableAutomaticFailover := *typedInput.Properties.EnableAutomaticFailover
			account.EnableAutomaticFailover = &enableAutomaticFailover
		}
	}

	// Set property "EnableBurstCapacity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableBurstCapacity != nil {
			enableBurstCapacity := *typedInput.Properties.EnableBurstCapacity
			account.EnableBurstCapacity = &enableBurstCapacity
		}
	}

	// Set property "EnableCassandraConnector":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableCassandraConnector != nil {
			enableCassandraConnector := *typedInput.Properties.EnableCassandraConnector
			account.EnableCassandraConnector = &enableCassandraConnector
		}
	}

	// Set property "EnableFreeTier":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableFreeTier != nil {
			enableFreeTier := *typedInput.Properties.EnableFreeTier
			account.EnableFreeTier = &enableFreeTier
		}
	}

	// Set property "EnableMultipleWriteLocations":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableMultipleWriteLocations != nil {
			enableMultipleWriteLocations := *typedInput.Properties.EnableMultipleWriteLocations
			account.EnableMultipleWriteLocations = &enableMultipleWriteLocations
		}
	}

	// Set property "EnablePartitionMerge":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnablePartitionMerge != nil {
			enablePartitionMerge := *typedInput.Properties.EnablePartitionMerge
			account.EnablePartitionMerge = &enablePartitionMerge
		}
	}

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

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

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

	// Set property "InstanceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.InstanceId != nil {
			instanceId := *typedInput.Properties.InstanceId
			account.InstanceId = &instanceId
		}
	}

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

	// Set property "IsVirtualNetworkFilterEnabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IsVirtualNetworkFilterEnabled != nil {
			isVirtualNetworkFilterEnabled := *typedInput.Properties.IsVirtualNetworkFilterEnabled
			account.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
		}
	}

	// Set property "KeyVaultKeyUri":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KeyVaultKeyUri != nil {
			keyVaultKeyUri := *typedInput.Properties.KeyVaultKeyUri
			account.KeyVaultKeyUri = &keyVaultKeyUri
		}
	}

	// Set property "KeysMetadata":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.KeysMetadata != nil {
			var keysMetadata1 DatabaseAccountKeysMetadata_STATUS
			err := keysMetadata1.PopulateFromARM(owner, *typedInput.Properties.KeysMetadata)
			if err != nil {
				return err
			}
			keysMetadata := keysMetadata1
			account.KeysMetadata = &keysMetadata
		}
	}

	// Set property "Kind":
	if typedInput.Kind != nil {
		var temp string
		temp = string(*typedInput.Kind)
		kind := DatabaseAccount_Kind_STATUS(temp)
		account.Kind = &kind
	}

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

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

	// Set property "MinimalTlsVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinimalTlsVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.MinimalTlsVersion)
			minimalTlsVersion := MinimalTlsVersion_STATUS(temp)
			account.MinimalTlsVersion = &minimalTlsVersion
		}
	}

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

	// Set property "NetworkAclBypass":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAclBypass != nil {
			var temp string
			temp = string(*typedInput.Properties.NetworkAclBypass)
			networkAclBypass := NetworkAclBypass_STATUS(temp)
			account.NetworkAclBypass = &networkAclBypass
		}
	}

	// Set property "NetworkAclBypassResourceIds":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.NetworkAclBypassResourceIds {
			account.NetworkAclBypassResourceIds = append(account.NetworkAclBypassResourceIds, item)
		}
	}

	// 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
			}
			account.PrivateEndpointConnections = append(account.PrivateEndpointConnections, item1)
		}
	}

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

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

	// Set property "RestoreParameters":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestoreParameters != nil {
			var restoreParameters1 RestoreParameters_STATUS
			err := restoreParameters1.PopulateFromARM(owner, *typedInput.Properties.RestoreParameters)
			if err != nil {
				return err
			}
			restoreParameters := restoreParameters1
			account.RestoreParameters = &restoreParameters
		}
	}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_DatabaseAccount_STATUS populates our DatabaseAccount_STATUS from the provided source DatabaseAccount_STATUS
func (account *DatabaseAccount_STATUS) AssignProperties_From_DatabaseAccount_STATUS(source *storage.DatabaseAccount_STATUS) error {

	// AnalyticalStorageConfiguration
	if source.AnalyticalStorageConfiguration != nil {
		var analyticalStorageConfiguration AnalyticalStorageConfiguration_STATUS
		err := analyticalStorageConfiguration.AssignProperties_From_AnalyticalStorageConfiguration_STATUS(source.AnalyticalStorageConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AnalyticalStorageConfiguration_STATUS() to populate field AnalyticalStorageConfiguration")
		}
		account.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
	} else {
		account.AnalyticalStorageConfiguration = nil
	}

	// ApiProperties
	if source.ApiProperties != nil {
		var apiProperty ApiProperties_STATUS
		err := apiProperty.AssignProperties_From_ApiProperties_STATUS(source.ApiProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiProperties_STATUS() to populate field ApiProperties")
		}
		account.ApiProperties = &apiProperty
	} else {
		account.ApiProperties = nil
	}

	// BackupPolicy
	if source.BackupPolicy != nil {
		var backupPolicy BackupPolicy_STATUS
		err := backupPolicy.AssignProperties_From_BackupPolicy_STATUS(source.BackupPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BackupPolicy_STATUS() to populate field BackupPolicy")
		}
		account.BackupPolicy = &backupPolicy
	} else {
		account.BackupPolicy = nil
	}

	// Capabilities
	if source.Capabilities != nil {
		capabilityList := make([]Capability_STATUS, len(source.Capabilities))
		for capabilityIndex, capabilityItem := range source.Capabilities {
			var capability Capability_STATUS
			err := capability.AssignProperties_From_Capability_STATUS(&capabilityItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Capability_STATUS() to populate field Capabilities")
			}
			capabilityList[capabilityIndex] = capability
		}
		account.Capabilities = capabilityList
	} else {
		account.Capabilities = nil
	}

	// Capacity
	if source.Capacity != nil {
		var capacity Capacity_STATUS
		err := capacity.AssignProperties_From_Capacity_STATUS(source.Capacity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Capacity_STATUS() to populate field Capacity")
		}
		account.Capacity = &capacity
	} else {
		account.Capacity = nil
	}

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

	// ConnectorOffer
	if source.ConnectorOffer != nil {
		connectorOffer := *source.ConnectorOffer
		connectorOfferTemp := genruntime.ToEnum(connectorOffer, connectorOffer_STATUS_Values)
		account.ConnectorOffer = &connectorOfferTemp
	} else {
		account.ConnectorOffer = nil
	}

	// ConsistencyPolicy
	if source.ConsistencyPolicy != nil {
		var consistencyPolicy ConsistencyPolicy_STATUS
		err := consistencyPolicy.AssignProperties_From_ConsistencyPolicy_STATUS(source.ConsistencyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConsistencyPolicy_STATUS() to populate field ConsistencyPolicy")
		}
		account.ConsistencyPolicy = &consistencyPolicy
	} else {
		account.ConsistencyPolicy = nil
	}

	// Cors
	if source.Cors != nil {
		corList := make([]CorsPolicy_STATUS, len(source.Cors))
		for corIndex, corItem := range source.Cors {
			var cor CorsPolicy_STATUS
			err := cor.AssignProperties_From_CorsPolicy_STATUS(&corItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CorsPolicy_STATUS() to populate field Cors")
			}
			corList[corIndex] = cor
		}
		account.Cors = corList
	} else {
		account.Cors = nil
	}

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

	// CustomerManagedKeyStatus
	account.CustomerManagedKeyStatus = genruntime.ClonePointerToString(source.CustomerManagedKeyStatus)

	// DatabaseAccountOfferType
	if source.DatabaseAccountOfferType != nil {
		databaseAccountOfferType := *source.DatabaseAccountOfferType
		databaseAccountOfferTypeTemp := genruntime.ToEnum(databaseAccountOfferType, databaseAccountOfferType_STATUS_Values)
		account.DatabaseAccountOfferType = &databaseAccountOfferTypeTemp
	} else {
		account.DatabaseAccountOfferType = nil
	}

	// DefaultIdentity
	account.DefaultIdentity = genruntime.ClonePointerToString(source.DefaultIdentity)

	// DisableKeyBasedMetadataWriteAccess
	if source.DisableKeyBasedMetadataWriteAccess != nil {
		disableKeyBasedMetadataWriteAccess := *source.DisableKeyBasedMetadataWriteAccess
		account.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
	} else {
		account.DisableKeyBasedMetadataWriteAccess = nil
	}

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

	// DocumentEndpoint
	account.DocumentEndpoint = genruntime.ClonePointerToString(source.DocumentEndpoint)

	// EnableAnalyticalStorage
	if source.EnableAnalyticalStorage != nil {
		enableAnalyticalStorage := *source.EnableAnalyticalStorage
		account.EnableAnalyticalStorage = &enableAnalyticalStorage
	} else {
		account.EnableAnalyticalStorage = nil
	}

	// EnableAutomaticFailover
	if source.EnableAutomaticFailover != nil {
		enableAutomaticFailover := *source.EnableAutomaticFailover
		account.EnableAutomaticFailover = &enableAutomaticFailover
	} else {
		account.EnableAutomaticFailover = nil
	}

	// EnableBurstCapacity
	if source.EnableBurstCapacity != nil {
		enableBurstCapacity := *source.EnableBurstCapacity
		account.EnableBurstCapacity = &enableBurstCapacity
	} else {
		account.EnableBurstCapacity = nil
	}

	// EnableCassandraConnector
	if source.EnableCassandraConnector != nil {
		enableCassandraConnector := *source.EnableCassandraConnector
		account.EnableCassandraConnector = &enableCassandraConnector
	} else {
		account.EnableCassandraConnector = nil
	}

	// EnableFreeTier
	if source.EnableFreeTier != nil {
		enableFreeTier := *source.EnableFreeTier
		account.EnableFreeTier = &enableFreeTier
	} else {
		account.EnableFreeTier = nil
	}

	// EnableMultipleWriteLocations
	if source.EnableMultipleWriteLocations != nil {
		enableMultipleWriteLocation := *source.EnableMultipleWriteLocations
		account.EnableMultipleWriteLocations = &enableMultipleWriteLocation
	} else {
		account.EnableMultipleWriteLocations = nil
	}

	// EnablePartitionMerge
	if source.EnablePartitionMerge != nil {
		enablePartitionMerge := *source.EnablePartitionMerge
		account.EnablePartitionMerge = &enablePartitionMerge
	} else {
		account.EnablePartitionMerge = nil
	}

	// FailoverPolicies
	if source.FailoverPolicies != nil {
		failoverPolicyList := make([]FailoverPolicy_STATUS, len(source.FailoverPolicies))
		for failoverPolicyIndex, failoverPolicyItem := range source.FailoverPolicies {
			var failoverPolicy FailoverPolicy_STATUS
			err := failoverPolicy.AssignProperties_From_FailoverPolicy_STATUS(&failoverPolicyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_FailoverPolicy_STATUS() to populate field FailoverPolicies")
			}
			failoverPolicyList[failoverPolicyIndex] = failoverPolicy
		}
		account.FailoverPolicies = failoverPolicyList
	} else {
		account.FailoverPolicies = nil
	}

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

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

	// InstanceId
	account.InstanceId = genruntime.ClonePointerToString(source.InstanceId)

	// IpRules
	if source.IpRules != nil {
		ipRuleList := make([]IpAddressOrRange_STATUS, len(source.IpRules))
		for ipRuleIndex, ipRuleItem := range source.IpRules {
			var ipRule IpAddressOrRange_STATUS
			err := ipRule.AssignProperties_From_IpAddressOrRange_STATUS(&ipRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IpAddressOrRange_STATUS() to populate field IpRules")
			}
			ipRuleList[ipRuleIndex] = ipRule
		}
		account.IpRules = ipRuleList
	} else {
		account.IpRules = nil
	}

	// IsVirtualNetworkFilterEnabled
	if source.IsVirtualNetworkFilterEnabled != nil {
		isVirtualNetworkFilterEnabled := *source.IsVirtualNetworkFilterEnabled
		account.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
	} else {
		account.IsVirtualNetworkFilterEnabled = nil
	}

	// KeyVaultKeyUri
	account.KeyVaultKeyUri = genruntime.ClonePointerToString(source.KeyVaultKeyUri)

	// KeysMetadata
	if source.KeysMetadata != nil {
		var keysMetadatum DatabaseAccountKeysMetadata_STATUS
		err := keysMetadatum.AssignProperties_From_DatabaseAccountKeysMetadata_STATUS(source.KeysMetadata)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DatabaseAccountKeysMetadata_STATUS() to populate field KeysMetadata")
		}
		account.KeysMetadata = &keysMetadatum
	} else {
		account.KeysMetadata = nil
	}

	// Kind
	if source.Kind != nil {
		kind := *source.Kind
		kindTemp := genruntime.ToEnum(kind, databaseAccount_Kind_STATUS_Values)
		account.Kind = &kindTemp
	} else {
		account.Kind = nil
	}

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

	// Locations
	if source.Locations != nil {
		locationList := make([]Location_STATUS, len(source.Locations))
		for locationIndex, locationItem := range source.Locations {
			var location Location_STATUS
			err := location.AssignProperties_From_Location_STATUS(&locationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Location_STATUS() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		account.Locations = locationList
	} else {
		account.Locations = nil
	}

	// MinimalTlsVersion
	if source.MinimalTlsVersion != nil {
		minimalTlsVersion := *source.MinimalTlsVersion
		minimalTlsVersionTemp := genruntime.ToEnum(minimalTlsVersion, minimalTlsVersion_STATUS_Values)
		account.MinimalTlsVersion = &minimalTlsVersionTemp
	} else {
		account.MinimalTlsVersion = nil
	}

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

	// NetworkAclBypass
	if source.NetworkAclBypass != nil {
		networkAclBypass := *source.NetworkAclBypass
		networkAclBypassTemp := genruntime.ToEnum(networkAclBypass, networkAclBypass_STATUS_Values)
		account.NetworkAclBypass = &networkAclBypassTemp
	} else {
		account.NetworkAclBypass = nil
	}

	// NetworkAclBypassResourceIds
	account.NetworkAclBypassResourceIds = genruntime.CloneSliceOfString(source.NetworkAclBypassResourceIds)

	// 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
		}
		account.PrivateEndpointConnections = privateEndpointConnectionList
	} else {
		account.PrivateEndpointConnections = nil
	}

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

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

	// ReadLocations
	if source.ReadLocations != nil {
		readLocationList := make([]Location_STATUS, len(source.ReadLocations))
		for readLocationIndex, readLocationItem := range source.ReadLocations {
			var readLocation Location_STATUS
			err := readLocation.AssignProperties_From_Location_STATUS(&readLocationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Location_STATUS() to populate field ReadLocations")
			}
			readLocationList[readLocationIndex] = readLocation
		}
		account.ReadLocations = readLocationList
	} else {
		account.ReadLocations = nil
	}

	// RestoreParameters
	if source.RestoreParameters != nil {
		var restoreParameter RestoreParameters_STATUS
		err := restoreParameter.AssignProperties_From_RestoreParameters_STATUS(source.RestoreParameters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_RestoreParameters_STATUS() to populate field RestoreParameters")
		}
		account.RestoreParameters = &restoreParameter
	} else {
		account.RestoreParameters = nil
	}

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

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

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

	// VirtualNetworkRules
	if source.VirtualNetworkRules != nil {
		virtualNetworkRuleList := make([]VirtualNetworkRule_STATUS, len(source.VirtualNetworkRules))
		for virtualNetworkRuleIndex, virtualNetworkRuleItem := range source.VirtualNetworkRules {
			var virtualNetworkRule VirtualNetworkRule_STATUS
			err := virtualNetworkRule.AssignProperties_From_VirtualNetworkRule_STATUS(&virtualNetworkRuleItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkRule_STATUS() to populate field VirtualNetworkRules")
			}
			virtualNetworkRuleList[virtualNetworkRuleIndex] = virtualNetworkRule
		}
		account.VirtualNetworkRules = virtualNetworkRuleList
	} else {
		account.VirtualNetworkRules = nil
	}

	// WriteLocations
	if source.WriteLocations != nil {
		writeLocationList := make([]Location_STATUS, len(source.WriteLocations))
		for writeLocationIndex, writeLocationItem := range source.WriteLocations {
			var writeLocation Location_STATUS
			err := writeLocation.AssignProperties_From_Location_STATUS(&writeLocationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Location_STATUS() to populate field WriteLocations")
			}
			writeLocationList[writeLocationIndex] = writeLocation
		}
		account.WriteLocations = writeLocationList
	} else {
		account.WriteLocations = nil
	}

	// No error
	return nil
}

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

	// AnalyticalStorageConfiguration
	if account.AnalyticalStorageConfiguration != nil {
		var analyticalStorageConfiguration storage.AnalyticalStorageConfiguration_STATUS
		err := account.AnalyticalStorageConfiguration.AssignProperties_To_AnalyticalStorageConfiguration_STATUS(&analyticalStorageConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AnalyticalStorageConfiguration_STATUS() to populate field AnalyticalStorageConfiguration")
		}
		destination.AnalyticalStorageConfiguration = &analyticalStorageConfiguration
	} else {
		destination.AnalyticalStorageConfiguration = nil
	}

	// ApiProperties
	if account.ApiProperties != nil {
		var apiProperty storage.ApiProperties_STATUS
		err := account.ApiProperties.AssignProperties_To_ApiProperties_STATUS(&apiProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiProperties_STATUS() to populate field ApiProperties")
		}
		destination.ApiProperties = &apiProperty
	} else {
		destination.ApiProperties = nil
	}

	// BackupPolicy
	if account.BackupPolicy != nil {
		var backupPolicy storage.BackupPolicy_STATUS
		err := account.BackupPolicy.AssignProperties_To_BackupPolicy_STATUS(&backupPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BackupPolicy_STATUS() to populate field BackupPolicy")
		}
		destination.BackupPolicy = &backupPolicy
	} else {
		destination.BackupPolicy = nil
	}

	// Capabilities
	if account.Capabilities != nil {
		capabilityList := make([]storage.Capability_STATUS, len(account.Capabilities))
		for capabilityIndex, capabilityItem := range account.Capabilities {
			var capability storage.Capability_STATUS
			err := capabilityItem.AssignProperties_To_Capability_STATUS(&capability)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Capability_STATUS() to populate field Capabilities")
			}
			capabilityList[capabilityIndex] = capability
		}
		destination.Capabilities = capabilityList
	} else {
		destination.Capabilities = nil
	}

	// Capacity
	if account.Capacity != nil {
		var capacity storage.Capacity_STATUS
		err := account.Capacity.AssignProperties_To_Capacity_STATUS(&capacity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Capacity_STATUS() to populate field Capacity")
		}
		destination.Capacity = &capacity
	} else {
		destination.Capacity = nil
	}

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

	// ConnectorOffer
	if account.ConnectorOffer != nil {
		connectorOffer := string(*account.ConnectorOffer)
		destination.ConnectorOffer = &connectorOffer
	} else {
		destination.ConnectorOffer = nil
	}

	// ConsistencyPolicy
	if account.ConsistencyPolicy != nil {
		var consistencyPolicy storage.ConsistencyPolicy_STATUS
		err := account.ConsistencyPolicy.AssignProperties_To_ConsistencyPolicy_STATUS(&consistencyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConsistencyPolicy_STATUS() to populate field ConsistencyPolicy")
		}
		destination.ConsistencyPolicy = &consistencyPolicy
	} else {
		destination.ConsistencyPolicy = nil
	}

	// Cors
	if account.Cors != nil {
		corList := make([]storage.CorsPolicy_STATUS, len(account.Cors))
		for corIndex, corItem := range account.Cors {
			var cor storage.CorsPolicy_STATUS
			err := corItem.AssignProperties_To_CorsPolicy_STATUS(&cor)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CorsPolicy_STATUS() to populate field Cors")
			}
			corList[corIndex] = cor
		}
		destination.Cors = corList
	} else {
		destination.Cors = nil
	}

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

	// CustomerManagedKeyStatus
	destination.CustomerManagedKeyStatus = genruntime.ClonePointerToString(account.CustomerManagedKeyStatus)

	// DatabaseAccountOfferType
	if account.DatabaseAccountOfferType != nil {
		databaseAccountOfferType := string(*account.DatabaseAccountOfferType)
		destination.DatabaseAccountOfferType = &databaseAccountOfferType
	} else {
		destination.DatabaseAccountOfferType = nil
	}

	// DefaultIdentity
	destination.DefaultIdentity = genruntime.ClonePointerToString(account.DefaultIdentity)

	// DisableKeyBasedMetadataWriteAccess
	if account.DisableKeyBasedMetadataWriteAccess != nil {
		disableKeyBasedMetadataWriteAccess := *account.DisableKeyBasedMetadataWriteAccess
		destination.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess
	} else {
		destination.DisableKeyBasedMetadataWriteAccess = nil
	}

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

	// DocumentEndpoint
	destination.DocumentEndpoint = genruntime.ClonePointerToString(account.DocumentEndpoint)

	// EnableAnalyticalStorage
	if account.EnableAnalyticalStorage != nil {
		enableAnalyticalStorage := *account.EnableAnalyticalStorage
		destination.EnableAnalyticalStorage = &enableAnalyticalStorage
	} else {
		destination.EnableAnalyticalStorage = nil
	}

	// EnableAutomaticFailover
	if account.EnableAutomaticFailover != nil {
		enableAutomaticFailover := *account.EnableAutomaticFailover
		destination.EnableAutomaticFailover = &enableAutomaticFailover
	} else {
		destination.EnableAutomaticFailover = nil
	}

	// EnableBurstCapacity
	if account.EnableBurstCapacity != nil {
		enableBurstCapacity := *account.EnableBurstCapacity
		destination.EnableBurstCapacity = &enableBurstCapacity
	} else {
		destination.EnableBurstCapacity = nil
	}

	// EnableCassandraConnector
	if account.EnableCassandraConnector != nil {
		enableCassandraConnector := *account.EnableCassandraConnector
		destination.EnableCassandraConnector = &enableCassandraConnector
	} else {
		destination.EnableCassandraConnector = nil
	}

	// EnableFreeTier
	if account.EnableFreeTier != nil {
		enableFreeTier := *account.EnableFreeTier
		destination.EnableFreeTier = &enableFreeTier
	} else {
		destination.EnableFreeTier = nil
	}

	// EnableMultipleWriteLocations
	if account.EnableMultipleWriteLocations != nil {
		enableMultipleWriteLocation := *account.EnableMultipleWriteLocations
		destination.EnableMultipleWriteLocations = &enableMultipleWriteLocation
	} else {
		destination.EnableMultipleWriteLocations = nil
	}

	// EnablePartitionMerge
	if account.EnablePartitionMerge != nil {
		enablePartitionMerge := *account.EnablePartitionMerge
		destination.EnablePartitionMerge = &enablePartitionMerge
	} else {
		destination.EnablePartitionMerge = nil
	}

	// FailoverPolicies
	if account.FailoverPolicies != nil {
		failoverPolicyList := make([]storage.FailoverPolicy_STATUS, len(account.FailoverPolicies))
		for failoverPolicyIndex, failoverPolicyItem := range account.FailoverPolicies {
			var failoverPolicy storage.FailoverPolicy_STATUS
			err := failoverPolicyItem.AssignProperties_To_FailoverPolicy_STATUS(&failoverPolicy)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_FailoverPolicy_STATUS() to populate field FailoverPolicies")
			}
			failoverPolicyList[failoverPolicyIndex] = failoverPolicy
		}
		destination.FailoverPolicies = failoverPolicyList
	} else {
		destination.FailoverPolicies = nil
	}

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

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

	// InstanceId
	destination.InstanceId = genruntime.ClonePointerToString(account.InstanceId)

	// IpRules
	if account.IpRules != nil {
		ipRuleList := make([]storage.IpAddressOrRange_STATUS, len(account.IpRules))
		for ipRuleIndex, ipRuleItem := range account.IpRules {
			var ipRule storage.IpAddressOrRange_STATUS
			err := ipRuleItem.AssignProperties_To_IpAddressOrRange_STATUS(&ipRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IpAddressOrRange_STATUS() to populate field IpRules")
			}
			ipRuleList[ipRuleIndex] = ipRule
		}
		destination.IpRules = ipRuleList
	} else {
		destination.IpRules = nil
	}

	// IsVirtualNetworkFilterEnabled
	if account.IsVirtualNetworkFilterEnabled != nil {
		isVirtualNetworkFilterEnabled := *account.IsVirtualNetworkFilterEnabled
		destination.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled
	} else {
		destination.IsVirtualNetworkFilterEnabled = nil
	}

	// KeyVaultKeyUri
	destination.KeyVaultKeyUri = genruntime.ClonePointerToString(account.KeyVaultKeyUri)

	// KeysMetadata
	if account.KeysMetadata != nil {
		var keysMetadatum storage.DatabaseAccountKeysMetadata_STATUS
		err := account.KeysMetadata.AssignProperties_To_DatabaseAccountKeysMetadata_STATUS(&keysMetadatum)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DatabaseAccountKeysMetadata_STATUS() to populate field KeysMetadata")
		}
		destination.KeysMetadata = &keysMetadatum
	} else {
		destination.KeysMetadata = nil
	}

	// Kind
	if account.Kind != nil {
		kind := string(*account.Kind)
		destination.Kind = &kind
	} else {
		destination.Kind = nil
	}

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

	// Locations
	if account.Locations != nil {
		locationList := make([]storage.Location_STATUS, len(account.Locations))
		for locationIndex, locationItem := range account.Locations {
			var location storage.Location_STATUS
			err := locationItem.AssignProperties_To_Location_STATUS(&location)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Location_STATUS() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		destination.Locations = locationList
	} else {
		destination.Locations = nil
	}

	// MinimalTlsVersion
	if account.MinimalTlsVersion != nil {
		minimalTlsVersion := string(*account.MinimalTlsVersion)
		destination.MinimalTlsVersion = &minimalTlsVersion
	} else {
		destination.MinimalTlsVersion = nil
	}

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

	// NetworkAclBypass
	if account.NetworkAclBypass != nil {
		networkAclBypass := string(*account.NetworkAclBypass)
		destination.NetworkAclBypass = &networkAclBypass
	} else {
		destination.NetworkAclBypass = nil
	}

	// NetworkAclBypassResourceIds
	destination.NetworkAclBypassResourceIds = genruntime.CloneSliceOfString(account.NetworkAclBypassResourceIds)

	// PrivateEndpointConnections
	if account.PrivateEndpointConnections != nil {
		privateEndpointConnectionList := make([]storage.PrivateEndpointConnection_STATUS, len(account.PrivateEndpointConnections))
		for privateEndpointConnectionIndex, privateEndpointConnectionItem := range account.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(account.ProvisioningState)

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

	// ReadLocations
	if account.ReadLocations != nil {
		readLocationList := make([]storage.Location_STATUS, len(account.ReadLocations))
		for readLocationIndex, readLocationItem := range account.ReadLocations {
			var readLocation storage.Location_STATUS
			err := readLocationItem.AssignProperties_To_Location_STATUS(&readLocation)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Location_STATUS() to populate field ReadLocations")
			}
			readLocationList[readLocationIndex] = readLocation
		}
		destination.ReadLocations = readLocationList
	} else {
		destination.ReadLocations = nil
	}

	// RestoreParameters
	if account.RestoreParameters != nil {
		var restoreParameter storage.RestoreParameters_STATUS
		err := account.RestoreParameters.AssignProperties_To_RestoreParameters_STATUS(&restoreParameter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_RestoreParameters_STATUS() to populate field RestoreParameters")
		}
		destination.RestoreParameters = &restoreParameter
	} else {
		destination.RestoreParameters = nil
	}

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

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

	// VirtualNetworkRules
	if account.VirtualNetworkRules != nil {
		virtualNetworkRuleList := make([]storage.VirtualNetworkRule_STATUS, len(account.VirtualNetworkRules))
		for virtualNetworkRuleIndex, virtualNetworkRuleItem := range account.VirtualNetworkRules {
			var virtualNetworkRule storage.VirtualNetworkRule_STATUS
			err := virtualNetworkRuleItem.AssignProperties_To_VirtualNetworkRule_STATUS(&virtualNetworkRule)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkRule_STATUS() to populate field VirtualNetworkRules")
			}
			virtualNetworkRuleList[virtualNetworkRuleIndex] = virtualNetworkRule
		}
		destination.VirtualNetworkRules = virtualNetworkRuleList
	} else {
		destination.VirtualNetworkRules = nil
	}

	// WriteLocations
	if account.WriteLocations != nil {
		writeLocationList := make([]storage.Location_STATUS, len(account.WriteLocations))
		for writeLocationIndex, writeLocationItem := range account.WriteLocations {
			var writeLocation storage.Location_STATUS
			err := writeLocationItem.AssignProperties_To_Location_STATUS(&writeLocation)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Location_STATUS() to populate field WriteLocations")
			}
			writeLocationList[writeLocationIndex] = writeLocation
		}
		destination.WriteLocations = writeLocationList
	} else {
		destination.WriteLocations = nil
	}

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

	// No error
	return nil
}

// Analytical storage specific properties.
type AnalyticalStorageConfiguration struct {
	// SchemaType: Describes the types of schema for analytical storage.
	SchemaType *AnalyticalStorageSchemaType `json:"schemaType,omitempty"`
}

var _ genruntime.ARMTransformer = &AnalyticalStorageConfiguration{}

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

	// Set property "SchemaType":
	if configuration.SchemaType != nil {
		var temp string
		temp = string(*configuration.SchemaType)
		schemaType := arm.AnalyticalStorageSchemaType(temp)
		result.SchemaType = &schemaType
	}
	return result, nil
}

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

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

	// Set property "SchemaType":
	if typedInput.SchemaType != nil {
		var temp string
		temp = string(*typedInput.SchemaType)
		schemaType := AnalyticalStorageSchemaType(temp)
		configuration.SchemaType = &schemaType
	}

	// No error
	return nil
}

// AssignProperties_From_AnalyticalStorageConfiguration populates our AnalyticalStorageConfiguration from the provided source AnalyticalStorageConfiguration
func (configuration *AnalyticalStorageConfiguration) AssignProperties_From_AnalyticalStorageConfiguration(source *storage.AnalyticalStorageConfiguration) error {

	// SchemaType
	if source.SchemaType != nil {
		schemaType := *source.SchemaType
		schemaTypeTemp := genruntime.ToEnum(schemaType, analyticalStorageSchemaType_Values)
		configuration.SchemaType = &schemaTypeTemp
	} else {
		configuration.SchemaType = nil
	}

	// No error
	return nil
}

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

	// SchemaType
	if configuration.SchemaType != nil {
		schemaType := string(*configuration.SchemaType)
		destination.SchemaType = &schemaType
	} else {
		destination.SchemaType = nil
	}

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

	// No error
	return nil
}

// Analytical storage specific properties.
type AnalyticalStorageConfiguration_STATUS struct {
	// SchemaType: Describes the types of schema for analytical storage.
	SchemaType *AnalyticalStorageSchemaType_STATUS `json:"schemaType,omitempty"`
}

var _ genruntime.FromARMConverter = &AnalyticalStorageConfiguration_STATUS{}

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

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

	// Set property "SchemaType":
	if typedInput.SchemaType != nil {
		var temp string
		temp = string(*typedInput.SchemaType)
		schemaType := AnalyticalStorageSchemaType_STATUS(temp)
		configuration.SchemaType = &schemaType
	}

	// No error
	return nil
}

// AssignProperties_From_AnalyticalStorageConfiguration_STATUS populates our AnalyticalStorageConfiguration_STATUS from the provided source AnalyticalStorageConfiguration_STATUS
func (configuration *AnalyticalStorageConfiguration_STATUS) AssignProperties_From_AnalyticalStorageConfiguration_STATUS(source *storage.AnalyticalStorageConfiguration_STATUS) error {

	// SchemaType
	if source.SchemaType != nil {
		schemaType := *source.SchemaType
		schemaTypeTemp := genruntime.ToEnum(schemaType, analyticalStorageSchemaType_STATUS_Values)
		configuration.SchemaType = &schemaTypeTemp
	} else {
		configuration.SchemaType = nil
	}

	// No error
	return nil
}

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

	// SchemaType
	if configuration.SchemaType != nil {
		schemaType := string(*configuration.SchemaType)
		destination.SchemaType = &schemaType
	} else {
		destination.SchemaType = nil
	}

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

	// No error
	return nil
}

type ApiProperties struct {
	// ServerVersion: Describes the ServerVersion of an a MongoDB account.
	ServerVersion *ApiProperties_ServerVersion `json:"serverVersion,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiProperties{}

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

	// Set property "ServerVersion":
	if properties.ServerVersion != nil {
		var temp string
		temp = string(*properties.ServerVersion)
		serverVersion := arm.ApiProperties_ServerVersion(temp)
		result.ServerVersion = &serverVersion
	}
	return result, nil
}

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

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

	// Set property "ServerVersion":
	if typedInput.ServerVersion != nil {
		var temp string
		temp = string(*typedInput.ServerVersion)
		serverVersion := ApiProperties_ServerVersion(temp)
		properties.ServerVersion = &serverVersion
	}

	// No error
	return nil
}

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

	// ServerVersion
	if source.ServerVersion != nil {
		serverVersion := *source.ServerVersion
		serverVersionTemp := genruntime.ToEnum(serverVersion, apiProperties_ServerVersion_Values)
		properties.ServerVersion = &serverVersionTemp
	} else {
		properties.ServerVersion = nil
	}

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

type ApiProperties_STATUS struct {
	// ServerVersion: Describes the ServerVersion of an a MongoDB account.
	ServerVersion *ApiProperties_ServerVersion_STATUS `json:"serverVersion,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiProperties_STATUS{}

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

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

	// Set property "ServerVersion":
	if typedInput.ServerVersion != nil {
		var temp string
		temp = string(*typedInput.ServerVersion)
		serverVersion := ApiProperties_ServerVersion_STATUS(temp)
		properties.ServerVersion = &serverVersion
	}

	// No error
	return nil
}

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

	// ServerVersion
	if source.ServerVersion != nil {
		serverVersion := *source.ServerVersion
		serverVersionTemp := genruntime.ToEnum(serverVersion, apiProperties_ServerVersion_STATUS_Values)
		properties.ServerVersion = &serverVersionTemp
	} else {
		properties.ServerVersion = nil
	}

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

type BackupPolicy struct {
	// Continuous: Mutually exclusive with all other properties
	Continuous *ContinuousModeBackupPolicy `json:"continuous,omitempty"`

	// Periodic: Mutually exclusive with all other properties
	Periodic *PeriodicModeBackupPolicy `json:"periodic,omitempty"`
}

var _ genruntime.ARMTransformer = &BackupPolicy{}

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

	// Set property "Continuous":
	if policy.Continuous != nil {
		continuous_ARM, err := policy.Continuous.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		continuous := *continuous_ARM.(*arm.ContinuousModeBackupPolicy)
		result.Continuous = &continuous
	}

	// Set property "Periodic":
	if policy.Periodic != nil {
		periodic_ARM, err := policy.Periodic.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		periodic := *periodic_ARM.(*arm.PeriodicModeBackupPolicy)
		result.Periodic = &periodic
	}
	return result, nil
}

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

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

	// Set property "Continuous":
	if typedInput.Continuous != nil {
		var continuous1 ContinuousModeBackupPolicy
		err := continuous1.PopulateFromARM(owner, *typedInput.Continuous)
		if err != nil {
			return err
		}
		continuous := continuous1
		policy.Continuous = &continuous
	}

	// Set property "Periodic":
	if typedInput.Periodic != nil {
		var periodic1 PeriodicModeBackupPolicy
		err := periodic1.PopulateFromARM(owner, *typedInput.Periodic)
		if err != nil {
			return err
		}
		periodic := periodic1
		policy.Periodic = &periodic
	}

	// No error
	return nil
}

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

	// Continuous
	if source.Continuous != nil {
		var continuous ContinuousModeBackupPolicy
		err := continuous.AssignProperties_From_ContinuousModeBackupPolicy(source.Continuous)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ContinuousModeBackupPolicy() to populate field Continuous")
		}
		policy.Continuous = &continuous
	} else {
		policy.Continuous = nil
	}

	// Periodic
	if source.Periodic != nil {
		var periodic PeriodicModeBackupPolicy
		err := periodic.AssignProperties_From_PeriodicModeBackupPolicy(source.Periodic)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PeriodicModeBackupPolicy() to populate field Periodic")
		}
		policy.Periodic = &periodic
	} else {
		policy.Periodic = nil
	}

	// No error
	return nil
}

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

	// Continuous
	if policy.Continuous != nil {
		var continuous storage.ContinuousModeBackupPolicy
		err := policy.Continuous.AssignProperties_To_ContinuousModeBackupPolicy(&continuous)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ContinuousModeBackupPolicy() to populate field Continuous")
		}
		destination.Continuous = &continuous
	} else {
		destination.Continuous = nil
	}

	// Periodic
	if policy.Periodic != nil {
		var periodic storage.PeriodicModeBackupPolicy
		err := policy.Periodic.AssignProperties_To_PeriodicModeBackupPolicy(&periodic)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PeriodicModeBackupPolicy() to populate field Periodic")
		}
		destination.Periodic = &periodic
	} else {
		destination.Periodic = nil
	}

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

	// No error
	return nil
}

type BackupPolicy_STATUS struct {
	// Continuous: Mutually exclusive with all other properties
	Continuous *ContinuousModeBackupPolicy_STATUS `json:"continuous,omitempty"`

	// Periodic: Mutually exclusive with all other properties
	Periodic *PeriodicModeBackupPolicy_STATUS `json:"periodic,omitempty"`
}

var _ genruntime.FromARMConverter = &BackupPolicy_STATUS{}

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

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

	// Set property "Continuous":
	if typedInput.Continuous != nil {
		var continuous1 ContinuousModeBackupPolicy_STATUS
		err := continuous1.PopulateFromARM(owner, *typedInput.Continuous)
		if err != nil {
			return err
		}
		continuous := continuous1
		policy.Continuous = &continuous
	}

	// Set property "Periodic":
	if typedInput.Periodic != nil {
		var periodic1 PeriodicModeBackupPolicy_STATUS
		err := periodic1.PopulateFromARM(owner, *typedInput.Periodic)
		if err != nil {
			return err
		}
		periodic := periodic1
		policy.Periodic = &periodic
	}

	// No error
	return nil
}

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

	// Continuous
	if source.Continuous != nil {
		var continuous ContinuousModeBackupPolicy_STATUS
		err := continuous.AssignProperties_From_ContinuousModeBackupPolicy_STATUS(source.Continuous)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ContinuousModeBackupPolicy_STATUS() to populate field Continuous")
		}
		policy.Continuous = &continuous
	} else {
		policy.Continuous = nil
	}

	// Periodic
	if source.Periodic != nil {
		var periodic PeriodicModeBackupPolicy_STATUS
		err := periodic.AssignProperties_From_PeriodicModeBackupPolicy_STATUS(source.Periodic)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PeriodicModeBackupPolicy_STATUS() to populate field Periodic")
		}
		policy.Periodic = &periodic
	} else {
		policy.Periodic = nil
	}

	// No error
	return nil
}

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

	// Continuous
	if policy.Continuous != nil {
		var continuous storage.ContinuousModeBackupPolicy_STATUS
		err := policy.Continuous.AssignProperties_To_ContinuousModeBackupPolicy_STATUS(&continuous)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ContinuousModeBackupPolicy_STATUS() to populate field Continuous")
		}
		destination.Continuous = &continuous
	} else {
		destination.Continuous = nil
	}

	// Periodic
	if policy.Periodic != nil {
		var periodic storage.PeriodicModeBackupPolicy_STATUS
		err := policy.Periodic.AssignProperties_To_PeriodicModeBackupPolicy_STATUS(&periodic)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PeriodicModeBackupPolicy_STATUS() to populate field Periodic")
		}
		destination.Periodic = &periodic
	} else {
		destination.Periodic = nil
	}

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

	// No error
	return nil
}

// Cosmos DB capability object
type Capability struct {
	// Name: Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include
	// "EnableTable" and "EnableGremlin".
	Name *string `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &Capability{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Capability populates our Capability from the provided source Capability
func (capability *Capability) AssignProperties_From_Capability(source *storage.Capability) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Cosmos DB capability object
type Capability_STATUS struct {
	// Name: Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include
	// "EnableTable" and "EnableGremlin".
	Name *string `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &Capability_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Capability_STATUS populates our Capability_STATUS from the provided source Capability_STATUS
func (capability *Capability_STATUS) AssignProperties_From_Capability_STATUS(source *storage.Capability_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// The object that represents all properties related to capacity enforcement on an account.
type Capacity struct {
	// +kubebuilder:validation:Minimum=-1
	// TotalThroughputLimit: The total throughput limit imposed on the account. A totalThroughputLimit of 2000 imposes a strict
	// limit of max throughput that can be provisioned on that account to be 2000. A totalThroughputLimit of -1 indicates no
	// limits on provisioning of throughput.
	TotalThroughputLimit *int `json:"totalThroughputLimit,omitempty"`
}

var _ genruntime.ARMTransformer = &Capacity{}

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

	// Set property "TotalThroughputLimit":
	if capacity.TotalThroughputLimit != nil {
		totalThroughputLimit := *capacity.TotalThroughputLimit
		result.TotalThroughputLimit = &totalThroughputLimit
	}
	return result, nil
}

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

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

	// Set property "TotalThroughputLimit":
	if typedInput.TotalThroughputLimit != nil {
		totalThroughputLimit := *typedInput.TotalThroughputLimit
		capacity.TotalThroughputLimit = &totalThroughputLimit
	}

	// No error
	return nil
}

// AssignProperties_From_Capacity populates our Capacity from the provided source Capacity
func (capacity *Capacity) AssignProperties_From_Capacity(source *storage.Capacity) error {

	// TotalThroughputLimit
	capacity.TotalThroughputLimit = genruntime.ClonePointerToInt(source.TotalThroughputLimit)

	// No error
	return nil
}

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

	// TotalThroughputLimit
	destination.TotalThroughputLimit = genruntime.ClonePointerToInt(capacity.TotalThroughputLimit)

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

	// No error
	return nil
}

// The object that represents all properties related to capacity enforcement on an account.
type Capacity_STATUS struct {
	// TotalThroughputLimit: The total throughput limit imposed on the account. A totalThroughputLimit of 2000 imposes a strict
	// limit of max throughput that can be provisioned on that account to be 2000. A totalThroughputLimit of -1 indicates no
	// limits on provisioning of throughput.
	TotalThroughputLimit *int `json:"totalThroughputLimit,omitempty"`
}

var _ genruntime.FromARMConverter = &Capacity_STATUS{}

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

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

	// Set property "TotalThroughputLimit":
	if typedInput.TotalThroughputLimit != nil {
		totalThroughputLimit := *typedInput.TotalThroughputLimit
		capacity.TotalThroughputLimit = &totalThroughputLimit
	}

	// No error
	return nil
}

// AssignProperties_From_Capacity_STATUS populates our Capacity_STATUS from the provided source Capacity_STATUS
func (capacity *Capacity_STATUS) AssignProperties_From_Capacity_STATUS(source *storage.Capacity_STATUS) error {

	// TotalThroughputLimit
	capacity.TotalThroughputLimit = genruntime.ClonePointerToInt(source.TotalThroughputLimit)

	// No error
	return nil
}

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

	// TotalThroughputLimit
	destination.TotalThroughputLimit = genruntime.ClonePointerToInt(capacity.TotalThroughputLimit)

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

	// No error
	return nil
}

// The cassandra connector offer type for the Cosmos DB C* database account.
// +kubebuilder:validation:Enum={"Small"}
type ConnectorOffer string

const ConnectorOffer_Small = ConnectorOffer("Small")

// Mapping from string to ConnectorOffer
var connectorOffer_Values = map[string]ConnectorOffer{
	"small": ConnectorOffer_Small,
}

// The cassandra connector offer type for the Cosmos DB C* database account.
type ConnectorOffer_STATUS string

const ConnectorOffer_STATUS_Small = ConnectorOffer_STATUS("Small")

// Mapping from string to ConnectorOffer_STATUS
var connectorOffer_STATUS_Values = map[string]ConnectorOffer_STATUS{
	"small": ConnectorOffer_STATUS_Small,
}

// The consistency policy for the Cosmos DB database account.
type ConsistencyPolicy struct {
	// +kubebuilder:validation:Required
	// DefaultConsistencyLevel: The default consistency level and configuration settings of the Cosmos DB account.
	DefaultConsistencyLevel *ConsistencyPolicy_DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"`

	// +kubebuilder:validation:Maximum=86400
	// +kubebuilder:validation:Minimum=5
	// MaxIntervalInSeconds: When used with the Bounded Staleness consistency level, this value represents the time amount of
	// staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is
	// set to 'BoundedStaleness'.
	MaxIntervalInSeconds *int `json:"maxIntervalInSeconds,omitempty"`

	// +kubebuilder:validation:Maximum=2147483647
	// +kubebuilder:validation:Minimum=1
	// MaxStalenessPrefix: When used with the Bounded Staleness consistency level, this value represents the number of stale
	// requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set
	// to 'BoundedStaleness'.
	MaxStalenessPrefix *int `json:"maxStalenessPrefix,omitempty"`
}

var _ genruntime.ARMTransformer = &ConsistencyPolicy{}

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

	// Set property "DefaultConsistencyLevel":
	if policy.DefaultConsistencyLevel != nil {
		var temp string
		temp = string(*policy.DefaultConsistencyLevel)
		defaultConsistencyLevel := arm.ConsistencyPolicy_DefaultConsistencyLevel(temp)
		result.DefaultConsistencyLevel = &defaultConsistencyLevel
	}

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

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

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

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

	// Set property "DefaultConsistencyLevel":
	if typedInput.DefaultConsistencyLevel != nil {
		var temp string
		temp = string(*typedInput.DefaultConsistencyLevel)
		defaultConsistencyLevel := ConsistencyPolicy_DefaultConsistencyLevel(temp)
		policy.DefaultConsistencyLevel = &defaultConsistencyLevel
	}

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

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

	// No error
	return nil
}

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

	// DefaultConsistencyLevel
	if source.DefaultConsistencyLevel != nil {
		defaultConsistencyLevel := *source.DefaultConsistencyLevel
		defaultConsistencyLevelTemp := genruntime.ToEnum(defaultConsistencyLevel, consistencyPolicy_DefaultConsistencyLevel_Values)
		policy.DefaultConsistencyLevel = &defaultConsistencyLevelTemp
	} else {
		policy.DefaultConsistencyLevel = nil
	}

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// The consistency policy for the Cosmos DB database account.
type ConsistencyPolicy_STATUS struct {
	// DefaultConsistencyLevel: The default consistency level and configuration settings of the Cosmos DB account.
	DefaultConsistencyLevel *ConsistencyPolicy_DefaultConsistencyLevel_STATUS `json:"defaultConsistencyLevel,omitempty"`

	// MaxIntervalInSeconds: When used with the Bounded Staleness consistency level, this value represents the time amount of
	// staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is
	// set to 'BoundedStaleness'.
	MaxIntervalInSeconds *int `json:"maxIntervalInSeconds,omitempty"`

	// MaxStalenessPrefix: When used with the Bounded Staleness consistency level, this value represents the number of stale
	// requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set
	// to 'BoundedStaleness'.
	MaxStalenessPrefix *int `json:"maxStalenessPrefix,omitempty"`
}

var _ genruntime.FromARMConverter = &ConsistencyPolicy_STATUS{}

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

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

	// Set property "DefaultConsistencyLevel":
	if typedInput.DefaultConsistencyLevel != nil {
		var temp string
		temp = string(*typedInput.DefaultConsistencyLevel)
		defaultConsistencyLevel := ConsistencyPolicy_DefaultConsistencyLevel_STATUS(temp)
		policy.DefaultConsistencyLevel = &defaultConsistencyLevel
	}

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

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

	// No error
	return nil
}

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

	// DefaultConsistencyLevel
	if source.DefaultConsistencyLevel != nil {
		defaultConsistencyLevel := *source.DefaultConsistencyLevel
		defaultConsistencyLevelTemp := genruntime.ToEnum(defaultConsistencyLevel, consistencyPolicy_DefaultConsistencyLevel_STATUS_Values)
		policy.DefaultConsistencyLevel = &defaultConsistencyLevelTemp
	} else {
		policy.DefaultConsistencyLevel = nil
	}

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// The CORS policy for the Cosmos DB database account.
type CorsPolicy struct {
	// AllowedHeaders: The request headers that the origin domain may specify on the CORS request.
	AllowedHeaders *string `json:"allowedHeaders,omitempty"`

	// AllowedMethods: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
	AllowedMethods *string `json:"allowedMethods,omitempty"`

	// +kubebuilder:validation:Required
	// AllowedOrigins: The origin domains that are permitted to make a request against the service via CORS.
	AllowedOrigins *string `json:"allowedOrigins,omitempty"`

	// ExposedHeaders: The response headers that may be sent in the response to the CORS request and exposed by the browser to
	// the request issuer.
	ExposedHeaders *string `json:"exposedHeaders,omitempty"`

	// +kubebuilder:validation:Maximum=2147483647
	// +kubebuilder:validation:Minimum=1
	// MaxAgeInSeconds: The maximum amount time that a browser should cache the preflight OPTIONS request.
	MaxAgeInSeconds *int `json:"maxAgeInSeconds,omitempty"`
}

var _ genruntime.ARMTransformer = &CorsPolicy{}

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

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

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

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

// The CORS policy for the Cosmos DB database account.
type CorsPolicy_STATUS struct {
	// AllowedHeaders: The request headers that the origin domain may specify on the CORS request.
	AllowedHeaders *string `json:"allowedHeaders,omitempty"`

	// AllowedMethods: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
	AllowedMethods *string `json:"allowedMethods,omitempty"`

	// AllowedOrigins: The origin domains that are permitted to make a request against the service via CORS.
	AllowedOrigins *string `json:"allowedOrigins,omitempty"`

	// ExposedHeaders: The response headers that may be sent in the response to the CORS request and exposed by the browser to
	// the request issuer.
	ExposedHeaders *string `json:"exposedHeaders,omitempty"`

	// MaxAgeInSeconds: The maximum amount time that a browser should cache the preflight OPTIONS request.
	MaxAgeInSeconds *int `json:"maxAgeInSeconds,omitempty"`
}

var _ genruntime.FromARMConverter = &CorsPolicy_STATUS{}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

// Enum to indicate the mode of account creation.
// +kubebuilder:validation:Enum={"Default","Restore"}
type CreateMode string

const (
	CreateMode_Default = CreateMode("Default")
	CreateMode_Restore = CreateMode("Restore")
)

// Mapping from string to CreateMode
var createMode_Values = map[string]CreateMode{
	"default": CreateMode_Default,
	"restore": CreateMode_Restore,
}

// Enum to indicate the mode of account creation.
type CreateMode_STATUS string

const (
	CreateMode_STATUS_Default = CreateMode_STATUS("Default")
	CreateMode_STATUS_Restore = CreateMode_STATUS("Restore")
)

// Mapping from string to CreateMode_STATUS
var createMode_STATUS_Values = map[string]CreateMode_STATUS{
	"default": CreateMode_STATUS_Default,
	"restore": CreateMode_STATUS_Restore,
}

// +kubebuilder:validation:Enum={"GlobalDocumentDB","MongoDB","Parse"}
type DatabaseAccount_Kind_Spec string

const (
	DatabaseAccount_Kind_Spec_GlobalDocumentDB = DatabaseAccount_Kind_Spec("GlobalDocumentDB")
	DatabaseAccount_Kind_Spec_MongoDB          = DatabaseAccount_Kind_Spec("MongoDB")
	DatabaseAccount_Kind_Spec_Parse            = DatabaseAccount_Kind_Spec("Parse")
)

// Mapping from string to DatabaseAccount_Kind_Spec
var databaseAccount_Kind_Spec_Values = map[string]DatabaseAccount_Kind_Spec{
	"globaldocumentdb": DatabaseAccount_Kind_Spec_GlobalDocumentDB,
	"mongodb":          DatabaseAccount_Kind_Spec_MongoDB,
	"parse":            DatabaseAccount_Kind_Spec_Parse,
}

type DatabaseAccount_Kind_STATUS string

const (
	DatabaseAccount_Kind_STATUS_GlobalDocumentDB = DatabaseAccount_Kind_STATUS("GlobalDocumentDB")
	DatabaseAccount_Kind_STATUS_MongoDB          = DatabaseAccount_Kind_STATUS("MongoDB")
	DatabaseAccount_Kind_STATUS_Parse            = DatabaseAccount_Kind_STATUS("Parse")
)

// Mapping from string to DatabaseAccount_Kind_STATUS
var databaseAccount_Kind_STATUS_Values = map[string]DatabaseAccount_Kind_STATUS{
	"globaldocumentdb": DatabaseAccount_Kind_STATUS_GlobalDocumentDB,
	"mongodb":          DatabaseAccount_Kind_STATUS_MongoDB,
	"parse":            DatabaseAccount_Kind_STATUS_Parse,
}

// The metadata related to each access key for the given Cosmos DB database account.
type DatabaseAccountKeysMetadata_STATUS struct {
	// PrimaryMasterKey: The metadata related to the Primary Read-Write Key for the given Cosmos DB database account.
	PrimaryMasterKey *AccountKeyMetadata_STATUS `json:"primaryMasterKey,omitempty"`

	// PrimaryReadonlyMasterKey: The metadata related to the Primary Read-Only Key for the given Cosmos DB database account.
	PrimaryReadonlyMasterKey *AccountKeyMetadata_STATUS `json:"primaryReadonlyMasterKey,omitempty"`

	// SecondaryMasterKey: The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account.
	SecondaryMasterKey *AccountKeyMetadata_STATUS `json:"secondaryMasterKey,omitempty"`

	// SecondaryReadonlyMasterKey: The metadata related to the Secondary Read-Only Key for the given Cosmos DB database account.
	SecondaryReadonlyMasterKey *AccountKeyMetadata_STATUS `json:"secondaryReadonlyMasterKey,omitempty"`
}

var _ genruntime.FromARMConverter = &DatabaseAccountKeysMetadata_STATUS{}

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

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

	// Set property "PrimaryMasterKey":
	if typedInput.PrimaryMasterKey != nil {
		var primaryMasterKey1 AccountKeyMetadata_STATUS
		err := primaryMasterKey1.PopulateFromARM(owner, *typedInput.PrimaryMasterKey)
		if err != nil {
			return err
		}
		primaryMasterKey := primaryMasterKey1
		metadata.PrimaryMasterKey = &primaryMasterKey
	}

	// Set property "PrimaryReadonlyMasterKey":
	if typedInput.PrimaryReadonlyMasterKey != nil {
		var primaryReadonlyMasterKey1 AccountKeyMetadata_STATUS
		err := primaryReadonlyMasterKey1.PopulateFromARM(owner, *typedInput.PrimaryReadonlyMasterKey)
		if err != nil {
			return err
		}
		primaryReadonlyMasterKey := primaryReadonlyMasterKey1
		metadata.PrimaryReadonlyMasterKey = &primaryReadonlyMasterKey
	}

	// Set property "SecondaryMasterKey":
	if typedInput.SecondaryMasterKey != nil {
		var secondaryMasterKey1 AccountKeyMetadata_STATUS
		err := secondaryMasterKey1.PopulateFromARM(owner, *typedInput.SecondaryMasterKey)
		if err != nil {
			return err
		}
		secondaryMasterKey := secondaryMasterKey1
		metadata.SecondaryMasterKey = &secondaryMasterKey
	}

	// Set property "SecondaryReadonlyMasterKey":
	if typedInput.SecondaryReadonlyMasterKey != nil {
		var secondaryReadonlyMasterKey1 AccountKeyMetadata_STATUS
		err := secondaryReadonlyMasterKey1.PopulateFromARM(owner, *typedInput.SecondaryReadonlyMasterKey)
		if err != nil {
			return err
		}
		secondaryReadonlyMasterKey := secondaryReadonlyMasterKey1
		metadata.SecondaryReadonlyMasterKey = &secondaryReadonlyMasterKey
	}

	// No error
	return nil
}

// AssignProperties_From_DatabaseAccountKeysMetadata_STATUS populates our DatabaseAccountKeysMetadata_STATUS from the provided source DatabaseAccountKeysMetadata_STATUS
func (metadata *DatabaseAccountKeysMetadata_STATUS) AssignProperties_From_DatabaseAccountKeysMetadata_STATUS(source *storage.DatabaseAccountKeysMetadata_STATUS) error {

	// PrimaryMasterKey
	if source.PrimaryMasterKey != nil {
		var primaryMasterKey AccountKeyMetadata_STATUS
		err := primaryMasterKey.AssignProperties_From_AccountKeyMetadata_STATUS(source.PrimaryMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AccountKeyMetadata_STATUS() to populate field PrimaryMasterKey")
		}
		metadata.PrimaryMasterKey = &primaryMasterKey
	} else {
		metadata.PrimaryMasterKey = nil
	}

	// PrimaryReadonlyMasterKey
	if source.PrimaryReadonlyMasterKey != nil {
		var primaryReadonlyMasterKey AccountKeyMetadata_STATUS
		err := primaryReadonlyMasterKey.AssignProperties_From_AccountKeyMetadata_STATUS(source.PrimaryReadonlyMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AccountKeyMetadata_STATUS() to populate field PrimaryReadonlyMasterKey")
		}
		metadata.PrimaryReadonlyMasterKey = &primaryReadonlyMasterKey
	} else {
		metadata.PrimaryReadonlyMasterKey = nil
	}

	// SecondaryMasterKey
	if source.SecondaryMasterKey != nil {
		var secondaryMasterKey AccountKeyMetadata_STATUS
		err := secondaryMasterKey.AssignProperties_From_AccountKeyMetadata_STATUS(source.SecondaryMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AccountKeyMetadata_STATUS() to populate field SecondaryMasterKey")
		}
		metadata.SecondaryMasterKey = &secondaryMasterKey
	} else {
		metadata.SecondaryMasterKey = nil
	}

	// SecondaryReadonlyMasterKey
	if source.SecondaryReadonlyMasterKey != nil {
		var secondaryReadonlyMasterKey AccountKeyMetadata_STATUS
		err := secondaryReadonlyMasterKey.AssignProperties_From_AccountKeyMetadata_STATUS(source.SecondaryReadonlyMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AccountKeyMetadata_STATUS() to populate field SecondaryReadonlyMasterKey")
		}
		metadata.SecondaryReadonlyMasterKey = &secondaryReadonlyMasterKey
	} else {
		metadata.SecondaryReadonlyMasterKey = nil
	}

	// No error
	return nil
}

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

	// PrimaryMasterKey
	if metadata.PrimaryMasterKey != nil {
		var primaryMasterKey storage.AccountKeyMetadata_STATUS
		err := metadata.PrimaryMasterKey.AssignProperties_To_AccountKeyMetadata_STATUS(&primaryMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AccountKeyMetadata_STATUS() to populate field PrimaryMasterKey")
		}
		destination.PrimaryMasterKey = &primaryMasterKey
	} else {
		destination.PrimaryMasterKey = nil
	}

	// PrimaryReadonlyMasterKey
	if metadata.PrimaryReadonlyMasterKey != nil {
		var primaryReadonlyMasterKey storage.AccountKeyMetadata_STATUS
		err := metadata.PrimaryReadonlyMasterKey.AssignProperties_To_AccountKeyMetadata_STATUS(&primaryReadonlyMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AccountKeyMetadata_STATUS() to populate field PrimaryReadonlyMasterKey")
		}
		destination.PrimaryReadonlyMasterKey = &primaryReadonlyMasterKey
	} else {
		destination.PrimaryReadonlyMasterKey = nil
	}

	// SecondaryMasterKey
	if metadata.SecondaryMasterKey != nil {
		var secondaryMasterKey storage.AccountKeyMetadata_STATUS
		err := metadata.SecondaryMasterKey.AssignProperties_To_AccountKeyMetadata_STATUS(&secondaryMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AccountKeyMetadata_STATUS() to populate field SecondaryMasterKey")
		}
		destination.SecondaryMasterKey = &secondaryMasterKey
	} else {
		destination.SecondaryMasterKey = nil
	}

	// SecondaryReadonlyMasterKey
	if metadata.SecondaryReadonlyMasterKey != nil {
		var secondaryReadonlyMasterKey storage.AccountKeyMetadata_STATUS
		err := metadata.SecondaryReadonlyMasterKey.AssignProperties_To_AccountKeyMetadata_STATUS(&secondaryReadonlyMasterKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AccountKeyMetadata_STATUS() to populate field SecondaryReadonlyMasterKey")
		}
		destination.SecondaryReadonlyMasterKey = &secondaryReadonlyMasterKey
	} else {
		destination.SecondaryReadonlyMasterKey = nil
	}

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

	// No error
	return nil
}

// The offer type for the Cosmos DB database account.
// +kubebuilder:validation:Enum={"Standard"}
type DatabaseAccountOfferType string

const DatabaseAccountOfferType_Standard = DatabaseAccountOfferType("Standard")

// Mapping from string to DatabaseAccountOfferType
var databaseAccountOfferType_Values = map[string]DatabaseAccountOfferType{
	"standard": DatabaseAccountOfferType_Standard,
}

// The offer type for the Cosmos DB database account.
type DatabaseAccountOfferType_STATUS string

const DatabaseAccountOfferType_STATUS_Standard = DatabaseAccountOfferType_STATUS("Standard")

// Mapping from string to DatabaseAccountOfferType_STATUS
var databaseAccountOfferType_STATUS_Values = map[string]DatabaseAccountOfferType_STATUS{
	"standard": DatabaseAccountOfferType_STATUS_Standard,
}

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

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

	// No error
	return nil
}

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

// The failover policy for a given region of a database account.
type FailoverPolicy_STATUS struct {
	// FailoverPriority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum
	// value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the
	// regions in which the database account exists.
	FailoverPriority *int `json:"failoverPriority,omitempty"`

	// Id: The unique identifier of the region in which the database account replicates to. Example:
	// &lt;accountName&gt;-&lt;locationName&gt;.
	Id *string `json:"id,omitempty"`

	// LocationName: The name of the region in which the database account exists.
	LocationName *string `json:"locationName,omitempty"`
}

var _ genruntime.FromARMConverter = &FailoverPolicy_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// IpAddressOrRange object
type IpAddressOrRange struct {
	// IpAddressOrRange: A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be
	// well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12,
	// 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245”
	// or “23.40.210.0/8”.
	IpAddressOrRange *string `json:"ipAddressOrRange,omitempty"`
}

var _ genruntime.ARMTransformer = &IpAddressOrRange{}

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

	// Set property "IpAddressOrRange":
	if orRange.IpAddressOrRange != nil {
		ipAddressOrRange := *orRange.IpAddressOrRange
		result.IpAddressOrRange = &ipAddressOrRange
	}
	return result, nil
}

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

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

	// Set property "IpAddressOrRange":
	if typedInput.IpAddressOrRange != nil {
		ipAddressOrRange := *typedInput.IpAddressOrRange
		orRange.IpAddressOrRange = &ipAddressOrRange
	}

	// No error
	return nil
}

// AssignProperties_From_IpAddressOrRange populates our IpAddressOrRange from the provided source IpAddressOrRange
func (orRange *IpAddressOrRange) AssignProperties_From_IpAddressOrRange(source *storage.IpAddressOrRange) error {

	// IpAddressOrRange
	orRange.IpAddressOrRange = genruntime.ClonePointerToString(source.IpAddressOrRange)

	// No error
	return nil
}

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

	// IpAddressOrRange
	destination.IpAddressOrRange = genruntime.ClonePointerToString(orRange.IpAddressOrRange)

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

	// No error
	return nil
}

// IpAddressOrRange object
type IpAddressOrRange_STATUS struct {
	// IpAddressOrRange: A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be
	// well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12,
	// 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245”
	// or “23.40.210.0/8”.
	IpAddressOrRange *string `json:"ipAddressOrRange,omitempty"`
}

var _ genruntime.FromARMConverter = &IpAddressOrRange_STATUS{}

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

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

	// Set property "IpAddressOrRange":
	if typedInput.IpAddressOrRange != nil {
		ipAddressOrRange := *typedInput.IpAddressOrRange
		orRange.IpAddressOrRange = &ipAddressOrRange
	}

	// No error
	return nil
}

// AssignProperties_From_IpAddressOrRange_STATUS populates our IpAddressOrRange_STATUS from the provided source IpAddressOrRange_STATUS
func (orRange *IpAddressOrRange_STATUS) AssignProperties_From_IpAddressOrRange_STATUS(source *storage.IpAddressOrRange_STATUS) error {

	// IpAddressOrRange
	orRange.IpAddressOrRange = genruntime.ClonePointerToString(source.IpAddressOrRange)

	// No error
	return nil
}

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

	// IpAddressOrRange
	destination.IpAddressOrRange = genruntime.ClonePointerToString(orRange.IpAddressOrRange)

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

	// No error
	return nil
}

// A region in which the Azure Cosmos DB database account is deployed.
type Location struct {
	// +kubebuilder:validation:Minimum=0
	// FailoverPriority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum
	// value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the
	// regions in which the database account exists.
	FailoverPriority *int `json:"failoverPriority,omitempty"`

	// IsZoneRedundant: Flag to indicate whether or not this region is an AvailabilityZone region
	IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`

	// LocationName: The name of the region.
	LocationName *string `json:"locationName,omitempty"`
}

var _ genruntime.ARMTransformer = &Location{}

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

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

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

	// Set property "LocationName":
	if location.LocationName != nil {
		locationName := *location.LocationName
		result.LocationName = &locationName
	}
	return result, nil
}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Location populates our Location from the provided source Location
func (location *Location) AssignProperties_From_Location(source *storage.Location) error {

	// FailoverPriority
	location.FailoverPriority = genruntime.ClonePointerToInt(source.FailoverPriority)

	// IsZoneRedundant
	if source.IsZoneRedundant != nil {
		isZoneRedundant := *source.IsZoneRedundant
		location.IsZoneRedundant = &isZoneRedundant
	} else {
		location.IsZoneRedundant = nil
	}

	// LocationName
	location.LocationName = genruntime.ClonePointerToString(source.LocationName)

	// No error
	return nil
}

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

	// FailoverPriority
	destination.FailoverPriority = genruntime.ClonePointerToInt(location.FailoverPriority)

	// IsZoneRedundant
	if location.IsZoneRedundant != nil {
		isZoneRedundant := *location.IsZoneRedundant
		destination.IsZoneRedundant = &isZoneRedundant
	} else {
		destination.IsZoneRedundant = nil
	}

	// LocationName
	destination.LocationName = genruntime.ClonePointerToString(location.LocationName)

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

	// No error
	return nil
}

// A region in which the Azure Cosmos DB database account is deployed.
type Location_STATUS struct {
	// DocumentEndpoint: The connection endpoint for the specific region. Example:
	// https://&lt;accountName&gt;-&lt;locationName&gt;.documents.azure.com:443/
	DocumentEndpoint *string `json:"documentEndpoint,omitempty"`

	// FailoverPriority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum
	// value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the
	// regions in which the database account exists.
	FailoverPriority *int `json:"failoverPriority,omitempty"`

	// Id: The unique identifier of the region within the database account. Example: &lt;accountName&gt;-&lt;locationName&gt;.
	Id *string `json:"id,omitempty"`

	// IsZoneRedundant: Flag to indicate whether or not this region is an AvailabilityZone region
	IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`

	// LocationName: The name of the region.
	LocationName      *string `json:"locationName,omitempty"`
	ProvisioningState *string `json:"provisioningState,omitempty"`
}

var _ genruntime.FromARMConverter = &Location_STATUS{}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Location_STATUS populates our Location_STATUS from the provided source Location_STATUS
func (location *Location_STATUS) AssignProperties_From_Location_STATUS(source *storage.Location_STATUS) error {

	// DocumentEndpoint
	location.DocumentEndpoint = genruntime.ClonePointerToString(source.DocumentEndpoint)

	// FailoverPriority
	location.FailoverPriority = genruntime.ClonePointerToInt(source.FailoverPriority)

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

	// IsZoneRedundant
	if source.IsZoneRedundant != nil {
		isZoneRedundant := *source.IsZoneRedundant
		location.IsZoneRedundant = &isZoneRedundant
	} else {
		location.IsZoneRedundant = nil
	}

	// LocationName
	location.LocationName = genruntime.ClonePointerToString(source.LocationName)

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

	// No error
	return nil
}

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

	// DocumentEndpoint
	destination.DocumentEndpoint = genruntime.ClonePointerToString(location.DocumentEndpoint)

	// FailoverPriority
	destination.FailoverPriority = genruntime.ClonePointerToInt(location.FailoverPriority)

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

	// IsZoneRedundant
	if location.IsZoneRedundant != nil {
		isZoneRedundant := *location.IsZoneRedundant
		destination.IsZoneRedundant = &isZoneRedundant
	} else {
		destination.IsZoneRedundant = nil
	}

	// LocationName
	destination.LocationName = genruntime.ClonePointerToString(location.LocationName)

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

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

	// No error
	return nil
}

// Identity for the resource.
type ManagedServiceIdentity struct {
	// Type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly
	// created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.
	Type *ManagedServiceIdentity_Type `json:"type,omitempty"`

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

var _ genruntime.ARMTransformer = &ManagedServiceIdentity{}

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

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

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

	// Type
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, managedServiceIdentity_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_ManagedServiceIdentity populates the provided destination ManagedServiceIdentity from our ManagedServiceIdentity
func (identity *ManagedServiceIdentity) AssignProperties_To_ManagedServiceIdentity(destination *storage.ManagedServiceIdentity) 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
}

// Identity for the resource.
type ManagedServiceIdentity_STATUS struct {
	// PrincipalId: The principal id of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: The tenant id of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	TenantId *string `json:"tenantId,omitempty"`

	// Type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly
	// created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.
	Type *ManagedServiceIdentity_Type_STATUS `json:"type,omitempty"`

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

var _ genruntime.FromARMConverter = &ManagedServiceIdentity_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagedServiceIdentity_STATUS populates our ManagedServiceIdentity_STATUS from the provided source ManagedServiceIdentity_STATUS
func (identity *ManagedServiceIdentity_STATUS) AssignProperties_From_ManagedServiceIdentity_STATUS(source *storage.ManagedServiceIdentity_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, managedServiceIdentity_Type_STATUS_Values)
		identity.Type = &typeTemp
	} else {
		identity.Type = nil
	}

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

	// No error
	return nil
}

// AssignProperties_To_ManagedServiceIdentity_STATUS populates the provided destination ManagedServiceIdentity_STATUS from our ManagedServiceIdentity_STATUS
func (identity *ManagedServiceIdentity_STATUS) AssignProperties_To_ManagedServiceIdentity_STATUS(destination *storage.ManagedServiceIdentity_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.ManagedServiceIdentity_UserAssignedIdentities_STATUS, len(identity.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities {
			var userAssignedIdentity storage.ManagedServiceIdentity_UserAssignedIdentities_STATUS
			err := userAssignedIdentityValue.AssignProperties_To_ManagedServiceIdentity_UserAssignedIdentities_STATUS(&userAssignedIdentity)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ManagedServiceIdentity_UserAssignedIdentities_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
}

// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2.
// +kubebuilder:validation:Enum={"Tls","Tls11","Tls12"}
type MinimalTlsVersion string

const (
	MinimalTlsVersion_Tls   = MinimalTlsVersion("Tls")
	MinimalTlsVersion_Tls11 = MinimalTlsVersion("Tls11")
	MinimalTlsVersion_Tls12 = MinimalTlsVersion("Tls12")
)

// Mapping from string to MinimalTlsVersion
var minimalTlsVersion_Values = map[string]MinimalTlsVersion{
	"tls":   MinimalTlsVersion_Tls,
	"tls11": MinimalTlsVersion_Tls11,
	"tls12": MinimalTlsVersion_Tls12,
}

// Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2.
type MinimalTlsVersion_STATUS string

const (
	MinimalTlsVersion_STATUS_Tls   = MinimalTlsVersion_STATUS("Tls")
	MinimalTlsVersion_STATUS_Tls11 = MinimalTlsVersion_STATUS("Tls11")
	MinimalTlsVersion_STATUS_Tls12 = MinimalTlsVersion_STATUS("Tls12")
)

// Mapping from string to MinimalTlsVersion_STATUS
var minimalTlsVersion_STATUS_Values = map[string]MinimalTlsVersion_STATUS{
	"tls":   MinimalTlsVersion_STATUS_Tls,
	"tls11": MinimalTlsVersion_STATUS_Tls11,
	"tls12": MinimalTlsVersion_STATUS_Tls12,
}

// Indicates what services are allowed to bypass firewall checks.
// +kubebuilder:validation:Enum={"AzureServices","None"}
type NetworkAclBypass string

const (
	NetworkAclBypass_AzureServices = NetworkAclBypass("AzureServices")
	NetworkAclBypass_None          = NetworkAclBypass("None")
)

// Mapping from string to NetworkAclBypass
var networkAclBypass_Values = map[string]NetworkAclBypass{
	"azureservices": NetworkAclBypass_AzureServices,
	"none":          NetworkAclBypass_None,
}

// Indicates what services are allowed to bypass firewall checks.
type NetworkAclBypass_STATUS string

const (
	NetworkAclBypass_STATUS_AzureServices = NetworkAclBypass_STATUS("AzureServices")
	NetworkAclBypass_STATUS_None          = NetworkAclBypass_STATUS("None")
)

// Mapping from string to NetworkAclBypass_STATUS
var networkAclBypass_STATUS_Values = map[string]NetworkAclBypass_STATUS{
	"azureservices": NetworkAclBypass_STATUS_AzureServices,
	"none":          NetworkAclBypass_STATUS_None,
}

// A private endpoint connection
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
}

// Whether requests from Public Network are allowed
// +kubebuilder:validation:Enum={"Disabled","Enabled","SecuredByPerimeter"}
type PublicNetworkAccess string

const (
	PublicNetworkAccess_Disabled           = PublicNetworkAccess("Disabled")
	PublicNetworkAccess_Enabled            = PublicNetworkAccess("Enabled")
	PublicNetworkAccess_SecuredByPerimeter = PublicNetworkAccess("SecuredByPerimeter")
)

// Mapping from string to PublicNetworkAccess
var publicNetworkAccess_Values = map[string]PublicNetworkAccess{
	"disabled":           PublicNetworkAccess_Disabled,
	"enabled":            PublicNetworkAccess_Enabled,
	"securedbyperimeter": PublicNetworkAccess_SecuredByPerimeter,
}

// Whether requests from Public Network are allowed
type PublicNetworkAccess_STATUS string

const (
	PublicNetworkAccess_STATUS_Disabled           = PublicNetworkAccess_STATUS("Disabled")
	PublicNetworkAccess_STATUS_Enabled            = PublicNetworkAccess_STATUS("Enabled")
	PublicNetworkAccess_STATUS_SecuredByPerimeter = PublicNetworkAccess_STATUS("SecuredByPerimeter")
)

// Mapping from string to PublicNetworkAccess_STATUS
var publicNetworkAccess_STATUS_Values = map[string]PublicNetworkAccess_STATUS{
	"disabled":           PublicNetworkAccess_STATUS_Disabled,
	"enabled":            PublicNetworkAccess_STATUS_Enabled,
	"securedbyperimeter": PublicNetworkAccess_STATUS_SecuredByPerimeter,
}

// Parameters to indicate the information about the restore.
type RestoreParameters struct {
	// DatabasesToRestore: List of specific databases available for restore.
	DatabasesToRestore []DatabaseRestoreResource `json:"databasesToRestore,omitempty"`

	// GremlinDatabasesToRestore: List of specific gremlin databases available for restore.
	GremlinDatabasesToRestore []GremlinDatabaseRestoreResource `json:"gremlinDatabasesToRestore,omitempty"`

	// RestoreMode: Describes the mode of the restore.
	RestoreMode *RestoreParameters_RestoreMode `json:"restoreMode,omitempty"`

	// RestoreSource: The id of the restorable database account from which the restore has to be initiated. For example:
	// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
	RestoreSource *string `json:"restoreSource,omitempty"`

	// RestoreTimestampInUtc: Time to which the account has to be restored (ISO-8601 format).
	RestoreTimestampInUtc *string `json:"restoreTimestampInUtc,omitempty"`

	// TablesToRestore: List of specific tables available for restore.
	TablesToRestore []string `json:"tablesToRestore,omitempty"`
}

var _ genruntime.ARMTransformer = &RestoreParameters{}

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

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

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

	// Set property "RestoreMode":
	if parameters.RestoreMode != nil {
		var temp string
		temp = string(*parameters.RestoreMode)
		restoreMode := arm.RestoreParameters_RestoreMode(temp)
		result.RestoreMode = &restoreMode
	}

	// Set property "RestoreSource":
	if parameters.RestoreSource != nil {
		restoreSource := *parameters.RestoreSource
		result.RestoreSource = &restoreSource
	}

	// Set property "RestoreTimestampInUtc":
	if parameters.RestoreTimestampInUtc != nil {
		restoreTimestampInUtc := *parameters.RestoreTimestampInUtc
		result.RestoreTimestampInUtc = &restoreTimestampInUtc
	}

	// Set property "TablesToRestore":
	for _, item := range parameters.TablesToRestore {
		result.TablesToRestore = append(result.TablesToRestore, item)
	}
	return result, nil
}

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

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

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

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

	// Set property "RestoreMode":
	if typedInput.RestoreMode != nil {
		var temp string
		temp = string(*typedInput.RestoreMode)
		restoreMode := RestoreParameters_RestoreMode(temp)
		parameters.RestoreMode = &restoreMode
	}

	// Set property "RestoreSource":
	if typedInput.RestoreSource != nil {
		restoreSource := *typedInput.RestoreSource
		parameters.RestoreSource = &restoreSource
	}

	// Set property "RestoreTimestampInUtc":
	if typedInput.RestoreTimestampInUtc != nil {
		restoreTimestampInUtc := *typedInput.RestoreTimestampInUtc
		parameters.RestoreTimestampInUtc = &restoreTimestampInUtc
	}

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

	// No error
	return nil
}

// AssignProperties_From_RestoreParameters populates our RestoreParameters from the provided source RestoreParameters
func (parameters *RestoreParameters) AssignProperties_From_RestoreParameters(source *storage.RestoreParameters) error {

	// DatabasesToRestore
	if source.DatabasesToRestore != nil {
		databasesToRestoreList := make([]DatabaseRestoreResource, len(source.DatabasesToRestore))
		for databasesToRestoreIndex, databasesToRestoreItem := range source.DatabasesToRestore {
			var databasesToRestore DatabaseRestoreResource
			err := databasesToRestore.AssignProperties_From_DatabaseRestoreResource(&databasesToRestoreItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_DatabaseRestoreResource() to populate field DatabasesToRestore")
			}
			databasesToRestoreList[databasesToRestoreIndex] = databasesToRestore
		}
		parameters.DatabasesToRestore = databasesToRestoreList
	} else {
		parameters.DatabasesToRestore = nil
	}

	// GremlinDatabasesToRestore
	if source.GremlinDatabasesToRestore != nil {
		gremlinDatabasesToRestoreList := make([]GremlinDatabaseRestoreResource, len(source.GremlinDatabasesToRestore))
		for gremlinDatabasesToRestoreIndex, gremlinDatabasesToRestoreItem := range source.GremlinDatabasesToRestore {
			var gremlinDatabasesToRestore GremlinDatabaseRestoreResource
			err := gremlinDatabasesToRestore.AssignProperties_From_GremlinDatabaseRestoreResource(&gremlinDatabasesToRestoreItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_GremlinDatabaseRestoreResource() to populate field GremlinDatabasesToRestore")
			}
			gremlinDatabasesToRestoreList[gremlinDatabasesToRestoreIndex] = gremlinDatabasesToRestore
		}
		parameters.GremlinDatabasesToRestore = gremlinDatabasesToRestoreList
	} else {
		parameters.GremlinDatabasesToRestore = nil
	}

	// RestoreMode
	if source.RestoreMode != nil {
		restoreMode := *source.RestoreMode
		restoreModeTemp := genruntime.ToEnum(restoreMode, restoreParameters_RestoreMode_Values)
		parameters.RestoreMode = &restoreModeTemp
	} else {
		parameters.RestoreMode = nil
	}

	// RestoreSource
	parameters.RestoreSource = genruntime.ClonePointerToString(source.RestoreSource)

	// RestoreTimestampInUtc
	parameters.RestoreTimestampInUtc = genruntime.ClonePointerToString(source.RestoreTimestampInUtc)

	// TablesToRestore
	parameters.TablesToRestore = genruntime.CloneSliceOfString(source.TablesToRestore)

	// No error
	return nil
}

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

	// DatabasesToRestore
	if parameters.DatabasesToRestore != nil {
		databasesToRestoreList := make([]storage.DatabaseRestoreResource, len(parameters.DatabasesToRestore))
		for databasesToRestoreIndex, databasesToRestoreItem := range parameters.DatabasesToRestore {
			var databasesToRestore storage.DatabaseRestoreResource
			err := databasesToRestoreItem.AssignProperties_To_DatabaseRestoreResource(&databasesToRestore)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_DatabaseRestoreResource() to populate field DatabasesToRestore")
			}
			databasesToRestoreList[databasesToRestoreIndex] = databasesToRestore
		}
		destination.DatabasesToRestore = databasesToRestoreList
	} else {
		destination.DatabasesToRestore = nil
	}

	// GremlinDatabasesToRestore
	if parameters.GremlinDatabasesToRestore != nil {
		gremlinDatabasesToRestoreList := make([]storage.GremlinDatabaseRestoreResource, len(parameters.GremlinDatabasesToRestore))
		for gremlinDatabasesToRestoreIndex, gremlinDatabasesToRestoreItem := range parameters.GremlinDatabasesToRestore {
			var gremlinDatabasesToRestore storage.GremlinDatabaseRestoreResource
			err := gremlinDatabasesToRestoreItem.AssignProperties_To_GremlinDatabaseRestoreResource(&gremlinDatabasesToRestore)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_GremlinDatabaseRestoreResource() to populate field GremlinDatabasesToRestore")
			}
			gremlinDatabasesToRestoreList[gremlinDatabasesToRestoreIndex] = gremlinDatabasesToRestore
		}
		destination.GremlinDatabasesToRestore = gremlinDatabasesToRestoreList
	} else {
		destination.GremlinDatabasesToRestore = nil
	}

	// RestoreMode
	if parameters.RestoreMode != nil {
		restoreMode := string(*parameters.RestoreMode)
		destination.RestoreMode = &restoreMode
	} else {
		destination.RestoreMode = nil
	}

	// RestoreSource
	destination.RestoreSource = genruntime.ClonePointerToString(parameters.RestoreSource)

	// RestoreTimestampInUtc
	destination.RestoreTimestampInUtc = genruntime.ClonePointerToString(parameters.RestoreTimestampInUtc)

	// TablesToRestore
	destination.TablesToRestore = genruntime.CloneSliceOfString(parameters.TablesToRestore)

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

	// No error
	return nil
}

// Parameters to indicate the information about the restore.
type RestoreParameters_STATUS struct {
	// DatabasesToRestore: List of specific databases available for restore.
	DatabasesToRestore []DatabaseRestoreResource_STATUS `json:"databasesToRestore,omitempty"`

	// GremlinDatabasesToRestore: List of specific gremlin databases available for restore.
	GremlinDatabasesToRestore []GremlinDatabaseRestoreResource_STATUS `json:"gremlinDatabasesToRestore,omitempty"`

	// RestoreMode: Describes the mode of the restore.
	RestoreMode *RestoreParameters_RestoreMode_STATUS `json:"restoreMode,omitempty"`

	// RestoreSource: The id of the restorable database account from which the restore has to be initiated. For example:
	// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
	RestoreSource *string `json:"restoreSource,omitempty"`

	// RestoreTimestampInUtc: Time to which the account has to be restored (ISO-8601 format).
	RestoreTimestampInUtc *string `json:"restoreTimestampInUtc,omitempty"`

	// TablesToRestore: List of specific tables available for restore.
	TablesToRestore []string `json:"tablesToRestore,omitempty"`
}

var _ genruntime.FromARMConverter = &RestoreParameters_STATUS{}

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

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

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

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

	// Set property "RestoreMode":
	if typedInput.RestoreMode != nil {
		var temp string
		temp = string(*typedInput.RestoreMode)
		restoreMode := RestoreParameters_RestoreMode_STATUS(temp)
		parameters.RestoreMode = &restoreMode
	}

	// Set property "RestoreSource":
	if typedInput.RestoreSource != nil {
		restoreSource := *typedInput.RestoreSource
		parameters.RestoreSource = &restoreSource
	}

	// Set property "RestoreTimestampInUtc":
	if typedInput.RestoreTimestampInUtc != nil {
		restoreTimestampInUtc := *typedInput.RestoreTimestampInUtc
		parameters.RestoreTimestampInUtc = &restoreTimestampInUtc
	}

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

	// No error
	return nil
}

// AssignProperties_From_RestoreParameters_STATUS populates our RestoreParameters_STATUS from the provided source RestoreParameters_STATUS
func (parameters *RestoreParameters_STATUS) AssignProperties_From_RestoreParameters_STATUS(source *storage.RestoreParameters_STATUS) error {

	// DatabasesToRestore
	if source.DatabasesToRestore != nil {
		databasesToRestoreList := make([]DatabaseRestoreResource_STATUS, len(source.DatabasesToRestore))
		for databasesToRestoreIndex, databasesToRestoreItem := range source.DatabasesToRestore {
			var databasesToRestore DatabaseRestoreResource_STATUS
			err := databasesToRestore.AssignProperties_From_DatabaseRestoreResource_STATUS(&databasesToRestoreItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_DatabaseRestoreResource_STATUS() to populate field DatabasesToRestore")
			}
			databasesToRestoreList[databasesToRestoreIndex] = databasesToRestore
		}
		parameters.DatabasesToRestore = databasesToRestoreList
	} else {
		parameters.DatabasesToRestore = nil
	}

	// GremlinDatabasesToRestore
	if source.GremlinDatabasesToRestore != nil {
		gremlinDatabasesToRestoreList := make([]GremlinDatabaseRestoreResource_STATUS, len(source.GremlinDatabasesToRestore))
		for gremlinDatabasesToRestoreIndex, gremlinDatabasesToRestoreItem := range source.GremlinDatabasesToRestore {
			var gremlinDatabasesToRestore GremlinDatabaseRestoreResource_STATUS
			err := gremlinDatabasesToRestore.AssignProperties_From_GremlinDatabaseRestoreResource_STATUS(&gremlinDatabasesToRestoreItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_GremlinDatabaseRestoreResource_STATUS() to populate field GremlinDatabasesToRestore")
			}
			gremlinDatabasesToRestoreList[gremlinDatabasesToRestoreIndex] = gremlinDatabasesToRestore
		}
		parameters.GremlinDatabasesToRestore = gremlinDatabasesToRestoreList
	} else {
		parameters.GremlinDatabasesToRestore = nil
	}

	// RestoreMode
	if source.RestoreMode != nil {
		restoreMode := *source.RestoreMode
		restoreModeTemp := genruntime.ToEnum(restoreMode, restoreParameters_RestoreMode_STATUS_Values)
		parameters.RestoreMode = &restoreModeTemp
	} else {
		parameters.RestoreMode = nil
	}

	// RestoreSource
	parameters.RestoreSource = genruntime.ClonePointerToString(source.RestoreSource)

	// RestoreTimestampInUtc
	parameters.RestoreTimestampInUtc = genruntime.ClonePointerToString(source.RestoreTimestampInUtc)

	// TablesToRestore
	parameters.TablesToRestore = genruntime.CloneSliceOfString(source.TablesToRestore)

	// No error
	return nil
}

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

	// DatabasesToRestore
	if parameters.DatabasesToRestore != nil {
		databasesToRestoreList := make([]storage.DatabaseRestoreResource_STATUS, len(parameters.DatabasesToRestore))
		for databasesToRestoreIndex, databasesToRestoreItem := range parameters.DatabasesToRestore {
			var databasesToRestore storage.DatabaseRestoreResource_STATUS
			err := databasesToRestoreItem.AssignProperties_To_DatabaseRestoreResource_STATUS(&databasesToRestore)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_DatabaseRestoreResource_STATUS() to populate field DatabasesToRestore")
			}
			databasesToRestoreList[databasesToRestoreIndex] = databasesToRestore
		}
		destination.DatabasesToRestore = databasesToRestoreList
	} else {
		destination.DatabasesToRestore = nil
	}

	// GremlinDatabasesToRestore
	if parameters.GremlinDatabasesToRestore != nil {
		gremlinDatabasesToRestoreList := make([]storage.GremlinDatabaseRestoreResource_STATUS, len(parameters.GremlinDatabasesToRestore))
		for gremlinDatabasesToRestoreIndex, gremlinDatabasesToRestoreItem := range parameters.GremlinDatabasesToRestore {
			var gremlinDatabasesToRestore storage.GremlinDatabaseRestoreResource_STATUS
			err := gremlinDatabasesToRestoreItem.AssignProperties_To_GremlinDatabaseRestoreResource_STATUS(&gremlinDatabasesToRestore)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_GremlinDatabaseRestoreResource_STATUS() to populate field GremlinDatabasesToRestore")
			}
			gremlinDatabasesToRestoreList[gremlinDatabasesToRestoreIndex] = gremlinDatabasesToRestore
		}
		destination.GremlinDatabasesToRestore = gremlinDatabasesToRestoreList
	} else {
		destination.GremlinDatabasesToRestore = nil
	}

	// RestoreMode
	if parameters.RestoreMode != nil {
		restoreMode := string(*parameters.RestoreMode)
		destination.RestoreMode = &restoreMode
	} else {
		destination.RestoreMode = nil
	}

	// RestoreSource
	destination.RestoreSource = genruntime.ClonePointerToString(parameters.RestoreSource)

	// RestoreTimestampInUtc
	destination.RestoreTimestampInUtc = genruntime.ClonePointerToString(parameters.RestoreTimestampInUtc)

	// TablesToRestore
	destination.TablesToRestore = genruntime.CloneSliceOfString(parameters.TablesToRestore)

	// 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 timestamp of resource last modification (UTC)
	LastModifiedAt *string `json:"lastModifiedAt,omitempty"`

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

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

var _ genruntime.FromARMConverter = &SystemData_STATUS{}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Virtual Network ACL Rule object
type VirtualNetworkRule struct {
	// IgnoreMissingVNetServiceEndpoint: Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`

	// Reference: Resource ID of a subnet, for example:
	// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkRule{}

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

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

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

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

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

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

	// no assignment for property "Reference"

	// No error
	return nil
}

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

	// IgnoreMissingVNetServiceEndpoint
	if source.IgnoreMissingVNetServiceEndpoint != nil {
		ignoreMissingVNetServiceEndpoint := *source.IgnoreMissingVNetServiceEndpoint
		rule.IgnoreMissingVNetServiceEndpoint = &ignoreMissingVNetServiceEndpoint
	} else {
		rule.IgnoreMissingVNetServiceEndpoint = nil
	}

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

	// No error
	return nil
}

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

	// IgnoreMissingVNetServiceEndpoint
	if rule.IgnoreMissingVNetServiceEndpoint != nil {
		ignoreMissingVNetServiceEndpoint := *rule.IgnoreMissingVNetServiceEndpoint
		destination.IgnoreMissingVNetServiceEndpoint = &ignoreMissingVNetServiceEndpoint
	} else {
		destination.IgnoreMissingVNetServiceEndpoint = nil
	}

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

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

	// No error
	return nil
}

// Virtual Network ACL Rule object
type VirtualNetworkRule_STATUS struct {
	// Id: Resource ID of a subnet, for example:
	// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
	Id *string `json:"id,omitempty"`

	// IgnoreMissingVNetServiceEndpoint: Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkRule_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

	// IgnoreMissingVNetServiceEndpoint
	if source.IgnoreMissingVNetServiceEndpoint != nil {
		ignoreMissingVNetServiceEndpoint := *source.IgnoreMissingVNetServiceEndpoint
		rule.IgnoreMissingVNetServiceEndpoint = &ignoreMissingVNetServiceEndpoint
	} else {
		rule.IgnoreMissingVNetServiceEndpoint = nil
	}

	// No error
	return nil
}

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

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

	// IgnoreMissingVNetServiceEndpoint
	if rule.IgnoreMissingVNetServiceEndpoint != nil {
		ignoreMissingVNetServiceEndpoint := *rule.IgnoreMissingVNetServiceEndpoint
		destination.IgnoreMissingVNetServiceEndpoint = &ignoreMissingVNetServiceEndpoint
	} else {
		destination.IgnoreMissingVNetServiceEndpoint = nil
	}

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

	// No error
	return nil
}

// The metadata related to an access key for a given database account.
type AccountKeyMetadata_STATUS struct {
	// GenerationTime: Generation time in UTC of the key in ISO-8601 format. If the value is missing from the object, it means
	// that the last key regeneration was triggered before 2022-06-18.
	GenerationTime *string `json:"generationTime,omitempty"`
}

var _ genruntime.FromARMConverter = &AccountKeyMetadata_STATUS{}

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

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

	// Set property "GenerationTime":
	if typedInput.GenerationTime != nil {
		generationTime := *typedInput.GenerationTime
		metadata.GenerationTime = &generationTime
	}

	// No error
	return nil
}

// AssignProperties_From_AccountKeyMetadata_STATUS populates our AccountKeyMetadata_STATUS from the provided source AccountKeyMetadata_STATUS
func (metadata *AccountKeyMetadata_STATUS) AssignProperties_From_AccountKeyMetadata_STATUS(source *storage.AccountKeyMetadata_STATUS) error {

	// GenerationTime
	metadata.GenerationTime = genruntime.ClonePointerToString(source.GenerationTime)

	// No error
	return nil
}

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

	// GenerationTime
	destination.GenerationTime = genruntime.ClonePointerToString(metadata.GenerationTime)

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

	// No error
	return nil
}

// Describes the types of schema for analytical storage.
// +kubebuilder:validation:Enum={"FullFidelity","WellDefined"}
type AnalyticalStorageSchemaType string

const (
	AnalyticalStorageSchemaType_FullFidelity = AnalyticalStorageSchemaType("FullFidelity")
	AnalyticalStorageSchemaType_WellDefined  = AnalyticalStorageSchemaType("WellDefined")
)

// Mapping from string to AnalyticalStorageSchemaType
var analyticalStorageSchemaType_Values = map[string]AnalyticalStorageSchemaType{
	"fullfidelity": AnalyticalStorageSchemaType_FullFidelity,
	"welldefined":  AnalyticalStorageSchemaType_WellDefined,
}

// Describes the types of schema for analytical storage.
type AnalyticalStorageSchemaType_STATUS string

const (
	AnalyticalStorageSchemaType_STATUS_FullFidelity = AnalyticalStorageSchemaType_STATUS("FullFidelity")
	AnalyticalStorageSchemaType_STATUS_WellDefined  = AnalyticalStorageSchemaType_STATUS("WellDefined")
)

// Mapping from string to AnalyticalStorageSchemaType_STATUS
var analyticalStorageSchemaType_STATUS_Values = map[string]AnalyticalStorageSchemaType_STATUS{
	"fullfidelity": AnalyticalStorageSchemaType_STATUS_FullFidelity,
	"welldefined":  AnalyticalStorageSchemaType_STATUS_WellDefined,
}

// +kubebuilder:validation:Enum={"3.2","3.6","4.0","4.2"}
type ApiProperties_ServerVersion string

const (
	ApiProperties_ServerVersion_32 = ApiProperties_ServerVersion("3.2")
	ApiProperties_ServerVersion_36 = ApiProperties_ServerVersion("3.6")
	ApiProperties_ServerVersion_40 = ApiProperties_ServerVersion("4.0")
	ApiProperties_ServerVersion_42 = ApiProperties_ServerVersion("4.2")
)

// Mapping from string to ApiProperties_ServerVersion
var apiProperties_ServerVersion_Values = map[string]ApiProperties_ServerVersion{
	"3.2": ApiProperties_ServerVersion_32,
	"3.6": ApiProperties_ServerVersion_36,
	"4.0": ApiProperties_ServerVersion_40,
	"4.2": ApiProperties_ServerVersion_42,
}

type ApiProperties_ServerVersion_STATUS string

const (
	ApiProperties_ServerVersion_STATUS_32 = ApiProperties_ServerVersion_STATUS("3.2")
	ApiProperties_ServerVersion_STATUS_36 = ApiProperties_ServerVersion_STATUS("3.6")
	ApiProperties_ServerVersion_STATUS_40 = ApiProperties_ServerVersion_STATUS("4.0")
	ApiProperties_ServerVersion_STATUS_42 = ApiProperties_ServerVersion_STATUS("4.2")
)

// Mapping from string to ApiProperties_ServerVersion_STATUS
var apiProperties_ServerVersion_STATUS_Values = map[string]ApiProperties_ServerVersion_STATUS{
	"3.2": ApiProperties_ServerVersion_STATUS_32,
	"3.6": ApiProperties_ServerVersion_STATUS_36,
	"4.0": ApiProperties_ServerVersion_STATUS_40,
	"4.2": ApiProperties_ServerVersion_STATUS_42,
}

// +kubebuilder:validation:Enum={"BoundedStaleness","ConsistentPrefix","Eventual","Session","Strong"}
type ConsistencyPolicy_DefaultConsistencyLevel string

const (
	ConsistencyPolicy_DefaultConsistencyLevel_BoundedStaleness = ConsistencyPolicy_DefaultConsistencyLevel("BoundedStaleness")
	ConsistencyPolicy_DefaultConsistencyLevel_ConsistentPrefix = ConsistencyPolicy_DefaultConsistencyLevel("ConsistentPrefix")
	ConsistencyPolicy_DefaultConsistencyLevel_Eventual         = ConsistencyPolicy_DefaultConsistencyLevel("Eventual")
	ConsistencyPolicy_DefaultConsistencyLevel_Session          = ConsistencyPolicy_DefaultConsistencyLevel("Session")
	ConsistencyPolicy_DefaultConsistencyLevel_Strong           = ConsistencyPolicy_DefaultConsistencyLevel("Strong")
)

// Mapping from string to ConsistencyPolicy_DefaultConsistencyLevel
var consistencyPolicy_DefaultConsistencyLevel_Values = map[string]ConsistencyPolicy_DefaultConsistencyLevel{
	"boundedstaleness": ConsistencyPolicy_DefaultConsistencyLevel_BoundedStaleness,
	"consistentprefix": ConsistencyPolicy_DefaultConsistencyLevel_ConsistentPrefix,
	"eventual":         ConsistencyPolicy_DefaultConsistencyLevel_Eventual,
	"session":          ConsistencyPolicy_DefaultConsistencyLevel_Session,
	"strong":           ConsistencyPolicy_DefaultConsistencyLevel_Strong,
}

type ConsistencyPolicy_DefaultConsistencyLevel_STATUS string

const (
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_BoundedStaleness = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("BoundedStaleness")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_ConsistentPrefix = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("ConsistentPrefix")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Eventual         = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("Eventual")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Session          = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("Session")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Strong           = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("Strong")
)

// Mapping from string to ConsistencyPolicy_DefaultConsistencyLevel_STATUS
var consistencyPolicy_DefaultConsistencyLevel_STATUS_Values = map[string]ConsistencyPolicy_DefaultConsistencyLevel_STATUS{
	"boundedstaleness": ConsistencyPolicy_DefaultConsistencyLevel_STATUS_BoundedStaleness,
	"consistentprefix": ConsistencyPolicy_DefaultConsistencyLevel_STATUS_ConsistentPrefix,
	"eventual":         ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Eventual,
	"session":          ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Session,
	"strong":           ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Strong,
}

type ContinuousModeBackupPolicy struct {
	// ContinuousModeProperties: Configuration values for continuous mode backup
	ContinuousModeProperties *ContinuousModeProperties `json:"continuousModeProperties,omitempty"`

	// MigrationState: The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"`

	// +kubebuilder:validation:Required
	// Type: Describes the mode of backups.
	Type *ContinuousModeBackupPolicy_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &ContinuousModeBackupPolicy{}

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

	// Set property "ContinuousModeProperties":
	if policy.ContinuousModeProperties != nil {
		continuousModeProperties_ARM, err := policy.ContinuousModeProperties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		continuousModeProperties := *continuousModeProperties_ARM.(*arm.ContinuousModeProperties)
		result.ContinuousModeProperties = &continuousModeProperties
	}

	// Set property "MigrationState":
	if policy.MigrationState != nil {
		migrationState_ARM, err := policy.MigrationState.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		migrationState := *migrationState_ARM.(*arm.BackupPolicyMigrationState)
		result.MigrationState = &migrationState
	}

	// Set property "Type":
	if policy.Type != nil {
		var temp arm.ContinuousModeBackupPolicy_Type
		var temp1 string
		temp1 = string(*policy.Type)
		temp = arm.ContinuousModeBackupPolicy_Type(temp1)
		result.Type = temp
	}
	return result, nil
}

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

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

	// Set property "ContinuousModeProperties":
	if typedInput.ContinuousModeProperties != nil {
		var continuousModeProperties1 ContinuousModeProperties
		err := continuousModeProperties1.PopulateFromARM(owner, *typedInput.ContinuousModeProperties)
		if err != nil {
			return err
		}
		continuousModeProperties := continuousModeProperties1
		policy.ContinuousModeProperties = &continuousModeProperties
	}

	// Set property "MigrationState":
	if typedInput.MigrationState != nil {
		var migrationState1 BackupPolicyMigrationState
		err := migrationState1.PopulateFromARM(owner, *typedInput.MigrationState)
		if err != nil {
			return err
		}
		migrationState := migrationState1
		policy.MigrationState = &migrationState
	}

	// Set property "Type":
	var temp ContinuousModeBackupPolicy_Type
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = ContinuousModeBackupPolicy_Type(temp1)
	policy.Type = &temp

	// No error
	return nil
}

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

	// ContinuousModeProperties
	if source.ContinuousModeProperties != nil {
		var continuousModeProperty ContinuousModeProperties
		err := continuousModeProperty.AssignProperties_From_ContinuousModeProperties(source.ContinuousModeProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ContinuousModeProperties() to populate field ContinuousModeProperties")
		}
		policy.ContinuousModeProperties = &continuousModeProperty
	} else {
		policy.ContinuousModeProperties = nil
	}

	// MigrationState
	if source.MigrationState != nil {
		var migrationState BackupPolicyMigrationState
		err := migrationState.AssignProperties_From_BackupPolicyMigrationState(source.MigrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BackupPolicyMigrationState() to populate field MigrationState")
		}
		policy.MigrationState = &migrationState
	} else {
		policy.MigrationState = nil
	}

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

	// No error
	return nil
}

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

	// ContinuousModeProperties
	if policy.ContinuousModeProperties != nil {
		var continuousModeProperty storage.ContinuousModeProperties
		err := policy.ContinuousModeProperties.AssignProperties_To_ContinuousModeProperties(&continuousModeProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ContinuousModeProperties() to populate field ContinuousModeProperties")
		}
		destination.ContinuousModeProperties = &continuousModeProperty
	} else {
		destination.ContinuousModeProperties = nil
	}

	// MigrationState
	if policy.MigrationState != nil {
		var migrationState storage.BackupPolicyMigrationState
		err := policy.MigrationState.AssignProperties_To_BackupPolicyMigrationState(&migrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BackupPolicyMigrationState() to populate field MigrationState")
		}
		destination.MigrationState = &migrationState
	} else {
		destination.MigrationState = nil
	}

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

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

	// No error
	return nil
}

type ContinuousModeBackupPolicy_STATUS struct {
	// ContinuousModeProperties: Configuration values for continuous mode backup
	ContinuousModeProperties *ContinuousModeProperties_STATUS `json:"continuousModeProperties,omitempty"`

	// MigrationState: The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState_STATUS `json:"migrationState,omitempty"`

	// Type: Describes the mode of backups.
	Type *ContinuousModeBackupPolicy_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &ContinuousModeBackupPolicy_STATUS{}

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

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

	// Set property "ContinuousModeProperties":
	if typedInput.ContinuousModeProperties != nil {
		var continuousModeProperties1 ContinuousModeProperties_STATUS
		err := continuousModeProperties1.PopulateFromARM(owner, *typedInput.ContinuousModeProperties)
		if err != nil {
			return err
		}
		continuousModeProperties := continuousModeProperties1
		policy.ContinuousModeProperties = &continuousModeProperties
	}

	// Set property "MigrationState":
	if typedInput.MigrationState != nil {
		var migrationState1 BackupPolicyMigrationState_STATUS
		err := migrationState1.PopulateFromARM(owner, *typedInput.MigrationState)
		if err != nil {
			return err
		}
		migrationState := migrationState1
		policy.MigrationState = &migrationState
	}

	// Set property "Type":
	var temp ContinuousModeBackupPolicy_Type_STATUS
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = ContinuousModeBackupPolicy_Type_STATUS(temp1)
	policy.Type = &temp

	// No error
	return nil
}

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

	// ContinuousModeProperties
	if source.ContinuousModeProperties != nil {
		var continuousModeProperty ContinuousModeProperties_STATUS
		err := continuousModeProperty.AssignProperties_From_ContinuousModeProperties_STATUS(source.ContinuousModeProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ContinuousModeProperties_STATUS() to populate field ContinuousModeProperties")
		}
		policy.ContinuousModeProperties = &continuousModeProperty
	} else {
		policy.ContinuousModeProperties = nil
	}

	// MigrationState
	if source.MigrationState != nil {
		var migrationState BackupPolicyMigrationState_STATUS
		err := migrationState.AssignProperties_From_BackupPolicyMigrationState_STATUS(source.MigrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BackupPolicyMigrationState_STATUS() to populate field MigrationState")
		}
		policy.MigrationState = &migrationState
	} else {
		policy.MigrationState = nil
	}

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

	// No error
	return nil
}

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

	// ContinuousModeProperties
	if policy.ContinuousModeProperties != nil {
		var continuousModeProperty storage.ContinuousModeProperties_STATUS
		err := policy.ContinuousModeProperties.AssignProperties_To_ContinuousModeProperties_STATUS(&continuousModeProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ContinuousModeProperties_STATUS() to populate field ContinuousModeProperties")
		}
		destination.ContinuousModeProperties = &continuousModeProperty
	} else {
		destination.ContinuousModeProperties = nil
	}

	// MigrationState
	if policy.MigrationState != nil {
		var migrationState storage.BackupPolicyMigrationState_STATUS
		err := policy.MigrationState.AssignProperties_To_BackupPolicyMigrationState_STATUS(&migrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BackupPolicyMigrationState_STATUS() to populate field MigrationState")
		}
		destination.MigrationState = &migrationState
	} else {
		destination.MigrationState = nil
	}

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

	// No error
	return nil
}

// Specific Databases to restore.
type DatabaseRestoreResource struct {
	// CollectionNames: The names of the collections available for restore.
	CollectionNames []string `json:"collectionNames,omitempty"`

	// DatabaseName: The name of the database available for restore.
	DatabaseName *string `json:"databaseName,omitempty"`
}

var _ genruntime.ARMTransformer = &DatabaseRestoreResource{}

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

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

	// Set property "DatabaseName":
	if resource.DatabaseName != nil {
		databaseName := *resource.DatabaseName
		result.DatabaseName = &databaseName
	}
	return result, nil
}

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

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

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

	// Set property "DatabaseName":
	if typedInput.DatabaseName != nil {
		databaseName := *typedInput.DatabaseName
		resource.DatabaseName = &databaseName
	}

	// No error
	return nil
}

// AssignProperties_From_DatabaseRestoreResource populates our DatabaseRestoreResource from the provided source DatabaseRestoreResource
func (resource *DatabaseRestoreResource) AssignProperties_From_DatabaseRestoreResource(source *storage.DatabaseRestoreResource) error {

	// CollectionNames
	resource.CollectionNames = genruntime.CloneSliceOfString(source.CollectionNames)

	// DatabaseName
	resource.DatabaseName = genruntime.ClonePointerToString(source.DatabaseName)

	// No error
	return nil
}

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

	// CollectionNames
	destination.CollectionNames = genruntime.CloneSliceOfString(resource.CollectionNames)

	// DatabaseName
	destination.DatabaseName = genruntime.ClonePointerToString(resource.DatabaseName)

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

	// No error
	return nil
}

// Specific Databases to restore.
type DatabaseRestoreResource_STATUS struct {
	// CollectionNames: The names of the collections available for restore.
	CollectionNames []string `json:"collectionNames,omitempty"`

	// DatabaseName: The name of the database available for restore.
	DatabaseName *string `json:"databaseName,omitempty"`
}

var _ genruntime.FromARMConverter = &DatabaseRestoreResource_STATUS{}

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

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

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

	// Set property "DatabaseName":
	if typedInput.DatabaseName != nil {
		databaseName := *typedInput.DatabaseName
		resource.DatabaseName = &databaseName
	}

	// No error
	return nil
}

// AssignProperties_From_DatabaseRestoreResource_STATUS populates our DatabaseRestoreResource_STATUS from the provided source DatabaseRestoreResource_STATUS
func (resource *DatabaseRestoreResource_STATUS) AssignProperties_From_DatabaseRestoreResource_STATUS(source *storage.DatabaseRestoreResource_STATUS) error {

	// CollectionNames
	resource.CollectionNames = genruntime.CloneSliceOfString(source.CollectionNames)

	// DatabaseName
	resource.DatabaseName = genruntime.ClonePointerToString(source.DatabaseName)

	// No error
	return nil
}

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

	// CollectionNames
	destination.CollectionNames = genruntime.CloneSliceOfString(resource.CollectionNames)

	// DatabaseName
	destination.DatabaseName = genruntime.ClonePointerToString(resource.DatabaseName)

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

	// No error
	return nil
}

// Specific Gremlin Databases to restore.
type GremlinDatabaseRestoreResource struct {
	// DatabaseName: The name of the gremlin database available for restore.
	DatabaseName *string `json:"databaseName,omitempty"`

	// GraphNames: The names of the graphs available for restore.
	GraphNames []string `json:"graphNames,omitempty"`
}

var _ genruntime.ARMTransformer = &GremlinDatabaseRestoreResource{}

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

	// Set property "DatabaseName":
	if resource.DatabaseName != nil {
		databaseName := *resource.DatabaseName
		result.DatabaseName = &databaseName
	}

	// Set property "GraphNames":
	for _, item := range resource.GraphNames {
		result.GraphNames = append(result.GraphNames, item)
	}
	return result, nil
}

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

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

	// Set property "DatabaseName":
	if typedInput.DatabaseName != nil {
		databaseName := *typedInput.DatabaseName
		resource.DatabaseName = &databaseName
	}

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

	// No error
	return nil
}

// AssignProperties_From_GremlinDatabaseRestoreResource populates our GremlinDatabaseRestoreResource from the provided source GremlinDatabaseRestoreResource
func (resource *GremlinDatabaseRestoreResource) AssignProperties_From_GremlinDatabaseRestoreResource(source *storage.GremlinDatabaseRestoreResource) error {

	// DatabaseName
	resource.DatabaseName = genruntime.ClonePointerToString(source.DatabaseName)

	// GraphNames
	resource.GraphNames = genruntime.CloneSliceOfString(source.GraphNames)

	// No error
	return nil
}

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

	// DatabaseName
	destination.DatabaseName = genruntime.ClonePointerToString(resource.DatabaseName)

	// GraphNames
	destination.GraphNames = genruntime.CloneSliceOfString(resource.GraphNames)

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

	// No error
	return nil
}

// Specific Gremlin Databases to restore.
type GremlinDatabaseRestoreResource_STATUS struct {
	// DatabaseName: The name of the gremlin database available for restore.
	DatabaseName *string `json:"databaseName,omitempty"`

	// GraphNames: The names of the graphs available for restore.
	GraphNames []string `json:"graphNames,omitempty"`
}

var _ genruntime.FromARMConverter = &GremlinDatabaseRestoreResource_STATUS{}

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

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

	// Set property "DatabaseName":
	if typedInput.DatabaseName != nil {
		databaseName := *typedInput.DatabaseName
		resource.DatabaseName = &databaseName
	}

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

	// No error
	return nil
}

// AssignProperties_From_GremlinDatabaseRestoreResource_STATUS populates our GremlinDatabaseRestoreResource_STATUS from the provided source GremlinDatabaseRestoreResource_STATUS
func (resource *GremlinDatabaseRestoreResource_STATUS) AssignProperties_From_GremlinDatabaseRestoreResource_STATUS(source *storage.GremlinDatabaseRestoreResource_STATUS) error {

	// DatabaseName
	resource.DatabaseName = genruntime.ClonePointerToString(source.DatabaseName)

	// GraphNames
	resource.GraphNames = genruntime.CloneSliceOfString(source.GraphNames)

	// No error
	return nil
}

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

	// DatabaseName
	destination.DatabaseName = genruntime.ClonePointerToString(resource.DatabaseName)

	// GraphNames
	destination.GraphNames = genruntime.CloneSliceOfString(resource.GraphNames)

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

	// No error
	return nil
}

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

const (
	ManagedServiceIdentity_Type_None                       = ManagedServiceIdentity_Type("None")
	ManagedServiceIdentity_Type_SystemAssigned             = ManagedServiceIdentity_Type("SystemAssigned")
	ManagedServiceIdentity_Type_SystemAssignedUserAssigned = ManagedServiceIdentity_Type("SystemAssigned,UserAssigned")
	ManagedServiceIdentity_Type_UserAssigned               = ManagedServiceIdentity_Type("UserAssigned")
)

// Mapping from string to ManagedServiceIdentity_Type
var managedServiceIdentity_Type_Values = map[string]ManagedServiceIdentity_Type{
	"none":                        ManagedServiceIdentity_Type_None,
	"systemassigned":              ManagedServiceIdentity_Type_SystemAssigned,
	"systemassigned,userassigned": ManagedServiceIdentity_Type_SystemAssignedUserAssigned,
	"userassigned":                ManagedServiceIdentity_Type_UserAssigned,
}

type ManagedServiceIdentity_Type_STATUS string

const (
	ManagedServiceIdentity_Type_STATUS_None                       = ManagedServiceIdentity_Type_STATUS("None")
	ManagedServiceIdentity_Type_STATUS_SystemAssigned             = ManagedServiceIdentity_Type_STATUS("SystemAssigned")
	ManagedServiceIdentity_Type_STATUS_SystemAssignedUserAssigned = ManagedServiceIdentity_Type_STATUS("SystemAssigned,UserAssigned")
	ManagedServiceIdentity_Type_STATUS_UserAssigned               = ManagedServiceIdentity_Type_STATUS("UserAssigned")
)

// Mapping from string to ManagedServiceIdentity_Type_STATUS
var managedServiceIdentity_Type_STATUS_Values = map[string]ManagedServiceIdentity_Type_STATUS{
	"none":                        ManagedServiceIdentity_Type_STATUS_None,
	"systemassigned":              ManagedServiceIdentity_Type_STATUS_SystemAssigned,
	"systemassigned,userassigned": ManagedServiceIdentity_Type_STATUS_SystemAssignedUserAssigned,
	"userassigned":                ManagedServiceIdentity_Type_STATUS_UserAssigned,
}

type ManagedServiceIdentity_UserAssignedIdentities_STATUS struct {
	// ClientId: The client id of user assigned identity.
	ClientId *string `json:"clientId,omitempty"`

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

var _ genruntime.FromARMConverter = &ManagedServiceIdentity_UserAssignedIdentities_STATUS{}

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ManagedServiceIdentity_UserAssignedIdentities_STATUS populates our ManagedServiceIdentity_UserAssignedIdentities_STATUS from the provided source ManagedServiceIdentity_UserAssignedIdentities_STATUS
func (identities *ManagedServiceIdentity_UserAssignedIdentities_STATUS) AssignProperties_From_ManagedServiceIdentity_UserAssignedIdentities_STATUS(source *storage.ManagedServiceIdentity_UserAssignedIdentities_STATUS) error {

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

type PeriodicModeBackupPolicy struct {
	// MigrationState: The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"`

	// PeriodicModeProperties: Configuration values for periodic mode backup
	PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"`

	// +kubebuilder:validation:Required
	// Type: Describes the mode of backups.
	Type *PeriodicModeBackupPolicy_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &PeriodicModeBackupPolicy{}

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

	// Set property "MigrationState":
	if policy.MigrationState != nil {
		migrationState_ARM, err := policy.MigrationState.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		migrationState := *migrationState_ARM.(*arm.BackupPolicyMigrationState)
		result.MigrationState = &migrationState
	}

	// Set property "PeriodicModeProperties":
	if policy.PeriodicModeProperties != nil {
		periodicModeProperties_ARM, err := policy.PeriodicModeProperties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		periodicModeProperties := *periodicModeProperties_ARM.(*arm.PeriodicModeProperties)
		result.PeriodicModeProperties = &periodicModeProperties
	}

	// Set property "Type":
	if policy.Type != nil {
		var temp arm.PeriodicModeBackupPolicy_Type
		var temp1 string
		temp1 = string(*policy.Type)
		temp = arm.PeriodicModeBackupPolicy_Type(temp1)
		result.Type = temp
	}
	return result, nil
}

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

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

	// Set property "MigrationState":
	if typedInput.MigrationState != nil {
		var migrationState1 BackupPolicyMigrationState
		err := migrationState1.PopulateFromARM(owner, *typedInput.MigrationState)
		if err != nil {
			return err
		}
		migrationState := migrationState1
		policy.MigrationState = &migrationState
	}

	// Set property "PeriodicModeProperties":
	if typedInput.PeriodicModeProperties != nil {
		var periodicModeProperties1 PeriodicModeProperties
		err := periodicModeProperties1.PopulateFromARM(owner, *typedInput.PeriodicModeProperties)
		if err != nil {
			return err
		}
		periodicModeProperties := periodicModeProperties1
		policy.PeriodicModeProperties = &periodicModeProperties
	}

	// Set property "Type":
	var temp PeriodicModeBackupPolicy_Type
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = PeriodicModeBackupPolicy_Type(temp1)
	policy.Type = &temp

	// No error
	return nil
}

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

	// MigrationState
	if source.MigrationState != nil {
		var migrationState BackupPolicyMigrationState
		err := migrationState.AssignProperties_From_BackupPolicyMigrationState(source.MigrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BackupPolicyMigrationState() to populate field MigrationState")
		}
		policy.MigrationState = &migrationState
	} else {
		policy.MigrationState = nil
	}

	// PeriodicModeProperties
	if source.PeriodicModeProperties != nil {
		var periodicModeProperty PeriodicModeProperties
		err := periodicModeProperty.AssignProperties_From_PeriodicModeProperties(source.PeriodicModeProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PeriodicModeProperties() to populate field PeriodicModeProperties")
		}
		policy.PeriodicModeProperties = &periodicModeProperty
	} else {
		policy.PeriodicModeProperties = nil
	}

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

	// No error
	return nil
}

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

	// MigrationState
	if policy.MigrationState != nil {
		var migrationState storage.BackupPolicyMigrationState
		err := policy.MigrationState.AssignProperties_To_BackupPolicyMigrationState(&migrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BackupPolicyMigrationState() to populate field MigrationState")
		}
		destination.MigrationState = &migrationState
	} else {
		destination.MigrationState = nil
	}

	// PeriodicModeProperties
	if policy.PeriodicModeProperties != nil {
		var periodicModeProperty storage.PeriodicModeProperties
		err := policy.PeriodicModeProperties.AssignProperties_To_PeriodicModeProperties(&periodicModeProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PeriodicModeProperties() to populate field PeriodicModeProperties")
		}
		destination.PeriodicModeProperties = &periodicModeProperty
	} else {
		destination.PeriodicModeProperties = nil
	}

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

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

	// No error
	return nil
}

type PeriodicModeBackupPolicy_STATUS struct {
	// MigrationState: The object representing the state of the migration between the backup policies.
	MigrationState *BackupPolicyMigrationState_STATUS `json:"migrationState,omitempty"`

	// PeriodicModeProperties: Configuration values for periodic mode backup
	PeriodicModeProperties *PeriodicModeProperties_STATUS `json:"periodicModeProperties,omitempty"`

	// Type: Describes the mode of backups.
	Type *PeriodicModeBackupPolicy_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &PeriodicModeBackupPolicy_STATUS{}

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

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

	// Set property "MigrationState":
	if typedInput.MigrationState != nil {
		var migrationState1 BackupPolicyMigrationState_STATUS
		err := migrationState1.PopulateFromARM(owner, *typedInput.MigrationState)
		if err != nil {
			return err
		}
		migrationState := migrationState1
		policy.MigrationState = &migrationState
	}

	// Set property "PeriodicModeProperties":
	if typedInput.PeriodicModeProperties != nil {
		var periodicModeProperties1 PeriodicModeProperties_STATUS
		err := periodicModeProperties1.PopulateFromARM(owner, *typedInput.PeriodicModeProperties)
		if err != nil {
			return err
		}
		periodicModeProperties := periodicModeProperties1
		policy.PeriodicModeProperties = &periodicModeProperties
	}

	// Set property "Type":
	var temp PeriodicModeBackupPolicy_Type_STATUS
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = PeriodicModeBackupPolicy_Type_STATUS(temp1)
	policy.Type = &temp

	// No error
	return nil
}

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

	// MigrationState
	if source.MigrationState != nil {
		var migrationState BackupPolicyMigrationState_STATUS
		err := migrationState.AssignProperties_From_BackupPolicyMigrationState_STATUS(source.MigrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_BackupPolicyMigrationState_STATUS() to populate field MigrationState")
		}
		policy.MigrationState = &migrationState
	} else {
		policy.MigrationState = nil
	}

	// PeriodicModeProperties
	if source.PeriodicModeProperties != nil {
		var periodicModeProperty PeriodicModeProperties_STATUS
		err := periodicModeProperty.AssignProperties_From_PeriodicModeProperties_STATUS(source.PeriodicModeProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PeriodicModeProperties_STATUS() to populate field PeriodicModeProperties")
		}
		policy.PeriodicModeProperties = &periodicModeProperty
	} else {
		policy.PeriodicModeProperties = nil
	}

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

	// No error
	return nil
}

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

	// MigrationState
	if policy.MigrationState != nil {
		var migrationState storage.BackupPolicyMigrationState_STATUS
		err := policy.MigrationState.AssignProperties_To_BackupPolicyMigrationState_STATUS(&migrationState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_BackupPolicyMigrationState_STATUS() to populate field MigrationState")
		}
		destination.MigrationState = &migrationState
	} else {
		destination.MigrationState = nil
	}

	// PeriodicModeProperties
	if policy.PeriodicModeProperties != nil {
		var periodicModeProperty storage.PeriodicModeProperties_STATUS
		err := policy.PeriodicModeProperties.AssignProperties_To_PeriodicModeProperties_STATUS(&periodicModeProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PeriodicModeProperties_STATUS() to populate field PeriodicModeProperties")
		}
		destination.PeriodicModeProperties = &periodicModeProperty
	} else {
		destination.PeriodicModeProperties = nil
	}

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"PointInTime"}
type RestoreParameters_RestoreMode string

const RestoreParameters_RestoreMode_PointInTime = RestoreParameters_RestoreMode("PointInTime")

// Mapping from string to RestoreParameters_RestoreMode
var restoreParameters_RestoreMode_Values = map[string]RestoreParameters_RestoreMode{
	"pointintime": RestoreParameters_RestoreMode_PointInTime,
}

type RestoreParameters_RestoreMode_STATUS string

const RestoreParameters_RestoreMode_STATUS_PointInTime = RestoreParameters_RestoreMode_STATUS("PointInTime")

// Mapping from string to RestoreParameters_RestoreMode_STATUS
var restoreParameters_RestoreMode_STATUS_Values = map[string]RestoreParameters_RestoreMode_STATUS{
	"pointintime": RestoreParameters_RestoreMode_STATUS_PointInTime,
}

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

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

// The object representing the state of the migration between the backup policies.
type BackupPolicyMigrationState struct {
	// StartTime: Time at which the backup policy migration started (ISO-8601 format).
	StartTime *string `json:"startTime,omitempty"`

	// Status: Describes the status of migration between backup policy types.
	Status *BackupPolicyMigrationStatus `json:"status,omitempty"`

	// TargetType: Describes the target backup policy type of the backup policy migration.
	TargetType *BackupPolicyType `json:"targetType,omitempty"`
}

var _ genruntime.ARMTransformer = &BackupPolicyMigrationState{}

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

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

	// Set property "Status":
	if state.Status != nil {
		var temp string
		temp = string(*state.Status)
		status := arm.BackupPolicyMigrationStatus(temp)
		result.Status = &status
	}

	// Set property "TargetType":
	if state.TargetType != nil {
		var temp string
		temp = string(*state.TargetType)
		targetType := arm.BackupPolicyType(temp)
		result.TargetType = &targetType
	}
	return result, nil
}

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

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

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

	// Set property "Status":
	if typedInput.Status != nil {
		var temp string
		temp = string(*typedInput.Status)
		status := BackupPolicyMigrationStatus(temp)
		state.Status = &status
	}

	// Set property "TargetType":
	if typedInput.TargetType != nil {
		var temp string
		temp = string(*typedInput.TargetType)
		targetType := BackupPolicyType(temp)
		state.TargetType = &targetType
	}

	// No error
	return nil
}

// AssignProperties_From_BackupPolicyMigrationState populates our BackupPolicyMigrationState from the provided source BackupPolicyMigrationState
func (state *BackupPolicyMigrationState) AssignProperties_From_BackupPolicyMigrationState(source *storage.BackupPolicyMigrationState) error {

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

	// Status
	if source.Status != nil {
		status := *source.Status
		statusTemp := genruntime.ToEnum(status, backupPolicyMigrationStatus_Values)
		state.Status = &statusTemp
	} else {
		state.Status = nil
	}

	// TargetType
	if source.TargetType != nil {
		targetType := *source.TargetType
		targetTypeTemp := genruntime.ToEnum(targetType, backupPolicyType_Values)
		state.TargetType = &targetTypeTemp
	} else {
		state.TargetType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// The object representing the state of the migration between the backup policies.
type BackupPolicyMigrationState_STATUS struct {
	// StartTime: Time at which the backup policy migration started (ISO-8601 format).
	StartTime *string `json:"startTime,omitempty"`

	// Status: Describes the status of migration between backup policy types.
	Status *BackupPolicyMigrationStatus_STATUS `json:"status,omitempty"`

	// TargetType: Describes the target backup policy type of the backup policy migration.
	TargetType *BackupPolicyType_STATUS `json:"targetType,omitempty"`
}

var _ genruntime.FromARMConverter = &BackupPolicyMigrationState_STATUS{}

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

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

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

	// Set property "Status":
	if typedInput.Status != nil {
		var temp string
		temp = string(*typedInput.Status)
		status := BackupPolicyMigrationStatus_STATUS(temp)
		state.Status = &status
	}

	// Set property "TargetType":
	if typedInput.TargetType != nil {
		var temp string
		temp = string(*typedInput.TargetType)
		targetType := BackupPolicyType_STATUS(temp)
		state.TargetType = &targetType
	}

	// No error
	return nil
}

// AssignProperties_From_BackupPolicyMigrationState_STATUS populates our BackupPolicyMigrationState_STATUS from the provided source BackupPolicyMigrationState_STATUS
func (state *BackupPolicyMigrationState_STATUS) AssignProperties_From_BackupPolicyMigrationState_STATUS(source *storage.BackupPolicyMigrationState_STATUS) error {

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

	// Status
	if source.Status != nil {
		status := *source.Status
		statusTemp := genruntime.ToEnum(status, backupPolicyMigrationStatus_STATUS_Values)
		state.Status = &statusTemp
	} else {
		state.Status = nil
	}

	// TargetType
	if source.TargetType != nil {
		targetType := *source.TargetType
		targetTypeTemp := genruntime.ToEnum(targetType, backupPolicyType_STATUS_Values)
		state.TargetType = &targetTypeTemp
	} else {
		state.TargetType = nil
	}

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Continuous"}
type ContinuousModeBackupPolicy_Type string

const ContinuousModeBackupPolicy_Type_Continuous = ContinuousModeBackupPolicy_Type("Continuous")

// Mapping from string to ContinuousModeBackupPolicy_Type
var continuousModeBackupPolicy_Type_Values = map[string]ContinuousModeBackupPolicy_Type{
	"continuous": ContinuousModeBackupPolicy_Type_Continuous,
}

type ContinuousModeBackupPolicy_Type_STATUS string

const ContinuousModeBackupPolicy_Type_STATUS_Continuous = ContinuousModeBackupPolicy_Type_STATUS("Continuous")

// Mapping from string to ContinuousModeBackupPolicy_Type_STATUS
var continuousModeBackupPolicy_Type_STATUS_Values = map[string]ContinuousModeBackupPolicy_Type_STATUS{
	"continuous": ContinuousModeBackupPolicy_Type_STATUS_Continuous,
}

// Configuration values for periodic mode backup
type ContinuousModeProperties struct {
	// Tier: Enum to indicate type of Continuous backup mode
	Tier *ContinuousTier `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &ContinuousModeProperties{}

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

	// Set property "Tier":
	if properties.Tier != nil {
		var temp string
		temp = string(*properties.Tier)
		tier := arm.ContinuousTier(temp)
		result.Tier = &tier
	}
	return result, nil
}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

	// Tier
	if properties.Tier != nil {
		tier := string(*properties.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
}

// Configuration values for periodic mode backup
type ContinuousModeProperties_STATUS struct {
	// Tier: Enum to indicate type of Continuous backup mode
	Tier *ContinuousTier_STATUS `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &ContinuousModeProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

	// Tier
	if properties.Tier != nil {
		tier := string(*properties.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
}

// +kubebuilder:validation:Enum={"Periodic"}
type PeriodicModeBackupPolicy_Type string

const PeriodicModeBackupPolicy_Type_Periodic = PeriodicModeBackupPolicy_Type("Periodic")

// Mapping from string to PeriodicModeBackupPolicy_Type
var periodicModeBackupPolicy_Type_Values = map[string]PeriodicModeBackupPolicy_Type{
	"periodic": PeriodicModeBackupPolicy_Type_Periodic,
}

type PeriodicModeBackupPolicy_Type_STATUS string

const PeriodicModeBackupPolicy_Type_STATUS_Periodic = PeriodicModeBackupPolicy_Type_STATUS("Periodic")

// Mapping from string to PeriodicModeBackupPolicy_Type_STATUS
var periodicModeBackupPolicy_Type_STATUS_Values = map[string]PeriodicModeBackupPolicy_Type_STATUS{
	"periodic": PeriodicModeBackupPolicy_Type_STATUS_Periodic,
}

// Configuration values for periodic mode backup
type PeriodicModeProperties struct {
	// +kubebuilder:validation:Minimum=0
	// BackupIntervalInMinutes: An integer representing the interval in minutes between two backups
	BackupIntervalInMinutes *int `json:"backupIntervalInMinutes,omitempty"`

	// +kubebuilder:validation:Minimum=0
	// BackupRetentionIntervalInHours: An integer representing the time (in hours) that each backup is retained
	BackupRetentionIntervalInHours *int `json:"backupRetentionIntervalInHours,omitempty"`

	// BackupStorageRedundancy: Enum to indicate type of backup residency
	BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"`
}

var _ genruntime.ARMTransformer = &PeriodicModeProperties{}

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

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

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

	// Set property "BackupStorageRedundancy":
	if properties.BackupStorageRedundancy != nil {
		var temp string
		temp = string(*properties.BackupStorageRedundancy)
		backupStorageRedundancy := arm.BackupStorageRedundancy(temp)
		result.BackupStorageRedundancy = &backupStorageRedundancy
	}
	return result, nil
}

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

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

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

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

	// Set property "BackupStorageRedundancy":
	if typedInput.BackupStorageRedundancy != nil {
		var temp string
		temp = string(*typedInput.BackupStorageRedundancy)
		backupStorageRedundancy := BackupStorageRedundancy(temp)
		properties.BackupStorageRedundancy = &backupStorageRedundancy
	}

	// No error
	return nil
}

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

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

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

	// BackupStorageRedundancy
	if source.BackupStorageRedundancy != nil {
		backupStorageRedundancy := *source.BackupStorageRedundancy
		backupStorageRedundancyTemp := genruntime.ToEnum(backupStorageRedundancy, backupStorageRedundancy_Values)
		properties.BackupStorageRedundancy = &backupStorageRedundancyTemp
	} else {
		properties.BackupStorageRedundancy = nil
	}

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// Configuration values for periodic mode backup
type PeriodicModeProperties_STATUS struct {
	// BackupIntervalInMinutes: An integer representing the interval in minutes between two backups
	BackupIntervalInMinutes *int `json:"backupIntervalInMinutes,omitempty"`

	// BackupRetentionIntervalInHours: An integer representing the time (in hours) that each backup is retained
	BackupRetentionIntervalInHours *int `json:"backupRetentionIntervalInHours,omitempty"`

	// BackupStorageRedundancy: Enum to indicate type of backup residency
	BackupStorageRedundancy *BackupStorageRedundancy_STATUS `json:"backupStorageRedundancy,omitempty"`
}

var _ genruntime.FromARMConverter = &PeriodicModeProperties_STATUS{}

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

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

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

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

	// Set property "BackupStorageRedundancy":
	if typedInput.BackupStorageRedundancy != nil {
		var temp string
		temp = string(*typedInput.BackupStorageRedundancy)
		backupStorageRedundancy := BackupStorageRedundancy_STATUS(temp)
		properties.BackupStorageRedundancy = &backupStorageRedundancy
	}

	// No error
	return nil
}

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

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

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

	// BackupStorageRedundancy
	if source.BackupStorageRedundancy != nil {
		backupStorageRedundancy := *source.BackupStorageRedundancy
		backupStorageRedundancyTemp := genruntime.ToEnum(backupStorageRedundancy, backupStorageRedundancy_STATUS_Values)
		properties.BackupStorageRedundancy = &backupStorageRedundancyTemp
	} else {
		properties.BackupStorageRedundancy = nil
	}

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// Describes the status of migration between backup policy types.
// +kubebuilder:validation:Enum={"Completed","Failed","InProgress","Invalid"}
type BackupPolicyMigrationStatus string

const (
	BackupPolicyMigrationStatus_Completed  = BackupPolicyMigrationStatus("Completed")
	BackupPolicyMigrationStatus_Failed     = BackupPolicyMigrationStatus("Failed")
	BackupPolicyMigrationStatus_InProgress = BackupPolicyMigrationStatus("InProgress")
	BackupPolicyMigrationStatus_Invalid    = BackupPolicyMigrationStatus("Invalid")
)

// Mapping from string to BackupPolicyMigrationStatus
var backupPolicyMigrationStatus_Values = map[string]BackupPolicyMigrationStatus{
	"completed":  BackupPolicyMigrationStatus_Completed,
	"failed":     BackupPolicyMigrationStatus_Failed,
	"inprogress": BackupPolicyMigrationStatus_InProgress,
	"invalid":    BackupPolicyMigrationStatus_Invalid,
}

// Describes the status of migration between backup policy types.
type BackupPolicyMigrationStatus_STATUS string

const (
	BackupPolicyMigrationStatus_STATUS_Completed  = BackupPolicyMigrationStatus_STATUS("Completed")
	BackupPolicyMigrationStatus_STATUS_Failed     = BackupPolicyMigrationStatus_STATUS("Failed")
	BackupPolicyMigrationStatus_STATUS_InProgress = BackupPolicyMigrationStatus_STATUS("InProgress")
	BackupPolicyMigrationStatus_STATUS_Invalid    = BackupPolicyMigrationStatus_STATUS("Invalid")
)

// Mapping from string to BackupPolicyMigrationStatus_STATUS
var backupPolicyMigrationStatus_STATUS_Values = map[string]BackupPolicyMigrationStatus_STATUS{
	"completed":  BackupPolicyMigrationStatus_STATUS_Completed,
	"failed":     BackupPolicyMigrationStatus_STATUS_Failed,
	"inprogress": BackupPolicyMigrationStatus_STATUS_InProgress,
	"invalid":    BackupPolicyMigrationStatus_STATUS_Invalid,
}

// Describes the mode of backups.
// +kubebuilder:validation:Enum={"Continuous","Periodic"}
type BackupPolicyType string

const (
	BackupPolicyType_Continuous = BackupPolicyType("Continuous")
	BackupPolicyType_Periodic   = BackupPolicyType("Periodic")
)

// Mapping from string to BackupPolicyType
var backupPolicyType_Values = map[string]BackupPolicyType{
	"continuous": BackupPolicyType_Continuous,
	"periodic":   BackupPolicyType_Periodic,
}

// Describes the mode of backups.
type BackupPolicyType_STATUS string

const (
	BackupPolicyType_STATUS_Continuous = BackupPolicyType_STATUS("Continuous")
	BackupPolicyType_STATUS_Periodic   = BackupPolicyType_STATUS("Periodic")
)

// Mapping from string to BackupPolicyType_STATUS
var backupPolicyType_STATUS_Values = map[string]BackupPolicyType_STATUS{
	"continuous": BackupPolicyType_STATUS_Continuous,
	"periodic":   BackupPolicyType_STATUS_Periodic,
}

// Enum to indicate type of backup storage redundancy.
// +kubebuilder:validation:Enum={"Geo","Local","Zone"}
type BackupStorageRedundancy string

const (
	BackupStorageRedundancy_Geo   = BackupStorageRedundancy("Geo")
	BackupStorageRedundancy_Local = BackupStorageRedundancy("Local")
	BackupStorageRedundancy_Zone  = BackupStorageRedundancy("Zone")
)

// Mapping from string to BackupStorageRedundancy
var backupStorageRedundancy_Values = map[string]BackupStorageRedundancy{
	"geo":   BackupStorageRedundancy_Geo,
	"local": BackupStorageRedundancy_Local,
	"zone":  BackupStorageRedundancy_Zone,
}

// Enum to indicate type of backup storage redundancy.
type BackupStorageRedundancy_STATUS string

const (
	BackupStorageRedundancy_STATUS_Geo   = BackupStorageRedundancy_STATUS("Geo")
	BackupStorageRedundancy_STATUS_Local = BackupStorageRedundancy_STATUS("Local")
	BackupStorageRedundancy_STATUS_Zone  = BackupStorageRedundancy_STATUS("Zone")
)

// Mapping from string to BackupStorageRedundancy_STATUS
var backupStorageRedundancy_STATUS_Values = map[string]BackupStorageRedundancy_STATUS{
	"geo":   BackupStorageRedundancy_STATUS_Geo,
	"local": BackupStorageRedundancy_STATUS_Local,
	"zone":  BackupStorageRedundancy_STATUS_Zone,
}

// Enum to indicate type of Continuous backup tier.
// +kubebuilder:validation:Enum={"Continuous30Days","Continuous7Days"}
type ContinuousTier string

const (
	ContinuousTier_Continuous30Days = ContinuousTier("Continuous30Days")
	ContinuousTier_Continuous7Days  = ContinuousTier("Continuous7Days")
)

// Mapping from string to ContinuousTier
var continuousTier_Values = map[string]ContinuousTier{
	"continuous30days": ContinuousTier_Continuous30Days,
	"continuous7days":  ContinuousTier_Continuous7Days,
}

// Enum to indicate type of Continuous backup tier.
type ContinuousTier_STATUS string

const (
	ContinuousTier_STATUS_Continuous30Days = ContinuousTier_STATUS("Continuous30Days")
	ContinuousTier_STATUS_Continuous7Days  = ContinuousTier_STATUS("Continuous7Days")
)

// Mapping from string to ContinuousTier_STATUS
var continuousTier_STATUS_Values = map[string]ContinuousTier_STATUS{
	"continuous30days": ContinuousTier_STATUS_Continuous30Days,
	"continuous7days":  ContinuousTier_STATUS_Continuous7Days,
}

func init() {
	SchemeBuilder.Register(&DatabaseAccount{}, &DatabaseAccountList{})
}
