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

import (
	"context"
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/dbformysql/v1api20230630/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/dbformysql/v1api20230630/storage"
	"github.com/Azure/azure-service-operator/v2/internal/genericarmclient"
	"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/go-logr/logr"
	"github.com/rotisserie/eris"
	"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,dbformysql}
// +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: /mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-06-30/FlexibleServers.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}
type FlexibleServer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              FlexibleServer_Spec   `json:"spec,omitempty"`
	Status            FlexibleServer_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &FlexibleServer{}

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

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

var _ conversion.Convertible = &FlexibleServer{}

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

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

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

	return nil
}

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

	return nil
}

var _ configmaps.Exporter = &FlexibleServer{}

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

var _ secrets.Exporter = &FlexibleServer{}

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

var _ genruntime.KubernetesConfigExporter = &FlexibleServer{}

// ExportKubernetesConfigMaps defines a resource which can create ConfigMaps in Kubernetes.
func (server *FlexibleServer) ExportKubernetesConfigMaps(_ context.Context, _ genruntime.MetaObject, _ *genericarmclient.GenericClient, _ logr.Logger) ([]client.Object, error) {
	collector := configmaps.NewCollector(server.Namespace)
	if server.Spec.OperatorSpec != nil && server.Spec.OperatorSpec.ConfigMaps != nil {
		if server.Status.AdministratorLogin != nil {
			collector.AddValue(server.Spec.OperatorSpec.ConfigMaps.AdministratorLogin, *server.Status.AdministratorLogin)
		}
	}
	if server.Spec.OperatorSpec != nil && server.Spec.OperatorSpec.ConfigMaps != nil {
		if server.Status.FullyQualifiedDomainName != nil {
			collector.AddValue(server.Spec.OperatorSpec.ConfigMaps.FullyQualifiedDomainName, *server.Status.FullyQualifiedDomainName)
		}
	}
	result, err := collector.Values()
	if err != nil {
		return nil, err
	}
	return configmaps.SliceToClientObjectSlice(result), nil
}

var _ genruntime.KubernetesResource = &FlexibleServer{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2023-06-30"
func (server FlexibleServer) GetAPIVersion() string {
	return "2023-06-30"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.DBforMySQL/flexibleServers"
func (server *FlexibleServer) GetType() string {
	return "Microsoft.DBforMySQL/flexibleServers"
}

// NewEmptyStatus returns a new empty (blank) status
func (server *FlexibleServer) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &FlexibleServer_STATUS{}
}

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

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

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

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

	server.Status = st
	return nil
}

// AssignProperties_From_FlexibleServer populates our FlexibleServer from the provided source FlexibleServer
func (server *FlexibleServer) AssignProperties_From_FlexibleServer(source *storage.FlexibleServer) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_FlexibleServer populates the provided destination FlexibleServer from our FlexibleServer
func (server *FlexibleServer) AssignProperties_To_FlexibleServer(destination *storage.FlexibleServer) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/stable/2023-06-30/FlexibleServers.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/flexibleServers/{serverName}
type FlexibleServerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []FlexibleServer `json:"items"`
}

// +kubebuilder:validation:Enum={"2023-06-30"}
type APIVersion string

const APIVersion_Value = APIVersion("2023-06-30")

type FlexibleServer_Spec struct {
	// AdministratorLogin: The administrator's login name of a server. Can only be specified when the server is being created
	// (and is required for creation).
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// AdministratorLoginPassword: The password of the administrator login (required for server creation).
	AdministratorLoginPassword *genruntime.SecretReference `json:"administratorLoginPassword,omitempty"`

	// AvailabilityZone: availability Zone information of the server.
	AvailabilityZone *string `json:"availabilityZone,omitempty"`

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

	// Backup: Backup related properties of a server.
	Backup *Backup `json:"backup,omitempty"`

	// CreateMode: The mode to create a new MySQL server.
	CreateMode *ServerProperties_CreateMode `json:"createMode,omitempty"`

	// DataEncryption: The Data Encryption for CMK.
	DataEncryption *DataEncryption `json:"dataEncryption,omitempty"`

	// HighAvailability: High availability related properties of a server.
	HighAvailability *HighAvailability `json:"highAvailability,omitempty"`

	// Identity: The cmk identity for the server.
	Identity *MySQLServerIdentity `json:"identity,omitempty"`

	// ImportSourceProperties: Source properties for import from storage.
	ImportSourceProperties *ImportSourceProperties `json:"importSourceProperties,omitempty"`

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

	// MaintenanceWindow: Maintenance window of a server.
	MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`

	// Network: Network related properties of a server.
	Network *Network `json:"network,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *FlexibleServerOperatorSpec `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"`

	// ReplicationRole: The replication role.
	ReplicationRole *ReplicationRole `json:"replicationRole,omitempty"`

	// RestorePointInTime: Restore point creation time (ISO8601 format), specifying the time to restore from.
	RestorePointInTime *string `json:"restorePointInTime,omitempty"`

	// Sku: The SKU (pricing tier) of the server.
	Sku *MySQLServerSku `json:"sku,omitempty"`

	// SourceServerResourceReference: The source MySQL server id.
	SourceServerResourceReference *genruntime.ResourceReference `armReference:"SourceServerResourceId" json:"sourceServerResourceReference,omitempty"`

	// Storage: Storage related properties of a server.
	Storage *Storage `json:"storage,omitempty"`

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

	// Version: Server version.
	Version *ServerVersion `json:"version,omitempty"`
}

var _ genruntime.ARMTransformer = &FlexibleServer_Spec{}

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

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

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

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

	// Set property "Properties":
	if server.AdministratorLogin != nil ||
		server.AdministratorLoginPassword != nil ||
		server.AvailabilityZone != nil ||
		server.Backup != nil ||
		server.CreateMode != nil ||
		server.DataEncryption != nil ||
		server.HighAvailability != nil ||
		server.ImportSourceProperties != nil ||
		server.MaintenanceWindow != nil ||
		server.Network != nil ||
		server.ReplicationRole != nil ||
		server.RestorePointInTime != nil ||
		server.SourceServerResourceReference != nil ||
		server.Storage != nil ||
		server.Version != nil {
		result.Properties = &arm.ServerProperties{}
	}
	if server.AdministratorLogin != nil {
		administratorLogin := *server.AdministratorLogin
		result.Properties.AdministratorLogin = &administratorLogin
	}
	if server.AdministratorLoginPassword != nil {
		administratorLoginPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*server.AdministratorLoginPassword)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property AdministratorLoginPassword")
		}
		administratorLoginPassword := administratorLoginPasswordSecret
		result.Properties.AdministratorLoginPassword = &administratorLoginPassword
	}
	if server.AvailabilityZone != nil {
		availabilityZone := *server.AvailabilityZone
		result.Properties.AvailabilityZone = &availabilityZone
	}
	if server.Backup != nil {
		backup_ARM, err := server.Backup.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		backup := *backup_ARM.(*arm.Backup)
		result.Properties.Backup = &backup
	}
	if server.CreateMode != nil {
		var temp string
		temp = string(*server.CreateMode)
		createMode := arm.ServerProperties_CreateMode(temp)
		result.Properties.CreateMode = &createMode
	}
	if server.DataEncryption != nil {
		dataEncryption_ARM, err := server.DataEncryption.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		dataEncryption := *dataEncryption_ARM.(*arm.DataEncryption)
		result.Properties.DataEncryption = &dataEncryption
	}
	if server.HighAvailability != nil {
		highAvailability_ARM, err := server.HighAvailability.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		highAvailability := *highAvailability_ARM.(*arm.HighAvailability)
		result.Properties.HighAvailability = &highAvailability
	}
	if server.ImportSourceProperties != nil {
		importSourceProperties_ARM, err := server.ImportSourceProperties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		importSourceProperties := *importSourceProperties_ARM.(*arm.ImportSourceProperties)
		result.Properties.ImportSourceProperties = &importSourceProperties
	}
	if server.MaintenanceWindow != nil {
		maintenanceWindow_ARM, err := server.MaintenanceWindow.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		maintenanceWindow := *maintenanceWindow_ARM.(*arm.MaintenanceWindow)
		result.Properties.MaintenanceWindow = &maintenanceWindow
	}
	if server.Network != nil {
		network_ARM, err := server.Network.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		network := *network_ARM.(*arm.Network)
		result.Properties.Network = &network
	}
	if server.ReplicationRole != nil {
		var temp string
		temp = string(*server.ReplicationRole)
		replicationRole := arm.ReplicationRole(temp)
		result.Properties.ReplicationRole = &replicationRole
	}
	if server.RestorePointInTime != nil {
		restorePointInTime := *server.RestorePointInTime
		result.Properties.RestorePointInTime = &restorePointInTime
	}
	if server.SourceServerResourceReference != nil {
		sourceServerResourceIdARMID, err := resolved.ResolvedReferences.Lookup(*server.SourceServerResourceReference)
		if err != nil {
			return nil, err
		}
		sourceServerResourceId := sourceServerResourceIdARMID
		result.Properties.SourceServerResourceId = &sourceServerResourceId
	}
	if server.Storage != nil {
		storage_ARM, err := server.Storage.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		storage := *storage_ARM.(*arm.Storage)
		result.Properties.Storage = &storage
	}
	if server.Version != nil {
		var temp string
		temp = string(*server.Version)
		version := arm.ServerVersion(temp)
		result.Properties.Version = &version
	}

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

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

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

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

	// Set property "AdministratorLogin":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AdministratorLogin != nil {
			administratorLogin := *typedInput.Properties.AdministratorLogin
			server.AdministratorLogin = &administratorLogin
		}
	}

	// no assignment for property "AdministratorLoginPassword"

	// Set property "AvailabilityZone":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AvailabilityZone != nil {
			availabilityZone := *typedInput.Properties.AvailabilityZone
			server.AvailabilityZone = &availabilityZone
		}
	}

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

	// Set property "Backup":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Backup != nil {
			var backup1 Backup
			err := backup1.PopulateFromARM(owner, *typedInput.Properties.Backup)
			if err != nil {
				return err
			}
			backup := backup1
			server.Backup = &backup
		}
	}

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

	// Set property "DataEncryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DataEncryption != nil {
			var dataEncryption1 DataEncryption
			err := dataEncryption1.PopulateFromARM(owner, *typedInput.Properties.DataEncryption)
			if err != nil {
				return err
			}
			dataEncryption := dataEncryption1
			server.DataEncryption = &dataEncryption
		}
	}

	// Set property "HighAvailability":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HighAvailability != nil {
			var highAvailability1 HighAvailability
			err := highAvailability1.PopulateFromARM(owner, *typedInput.Properties.HighAvailability)
			if err != nil {
				return err
			}
			highAvailability := highAvailability1
			server.HighAvailability = &highAvailability
		}
	}

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

	// Set property "ImportSourceProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImportSourceProperties != nil {
			var importSourceProperties1 ImportSourceProperties
			err := importSourceProperties1.PopulateFromARM(owner, *typedInput.Properties.ImportSourceProperties)
			if err != nil {
				return err
			}
			importSourceProperties := importSourceProperties1
			server.ImportSourceProperties = &importSourceProperties
		}
	}

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

	// Set property "MaintenanceWindow":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaintenanceWindow != nil {
			var maintenanceWindow1 MaintenanceWindow
			err := maintenanceWindow1.PopulateFromARM(owner, *typedInput.Properties.MaintenanceWindow)
			if err != nil {
				return err
			}
			maintenanceWindow := maintenanceWindow1
			server.MaintenanceWindow = &maintenanceWindow
		}
	}

	// Set property "Network":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Network != nil {
			var network1 Network
			err := network1.PopulateFromARM(owner, *typedInput.Properties.Network)
			if err != nil {
				return err
			}
			network := network1
			server.Network = &network
		}
	}

	// no assignment for property "OperatorSpec"

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

	// Set property "ReplicationRole":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReplicationRole != nil {
			var temp string
			temp = string(*typedInput.Properties.ReplicationRole)
			replicationRole := ReplicationRole(temp)
			server.ReplicationRole = &replicationRole
		}
	}

	// Set property "RestorePointInTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestorePointInTime != nil {
			restorePointInTime := *typedInput.Properties.RestorePointInTime
			server.RestorePointInTime = &restorePointInTime
		}
	}

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

	// no assignment for property "SourceServerResourceReference"

	// Set property "Storage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Storage != nil {
			var storage1 Storage
			err := storage1.PopulateFromARM(owner, *typedInput.Properties.Storage)
			if err != nil {
				return err
			}
			storage := storage1
			server.Storage = &storage
		}
	}

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

	// Set property "Version":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Version != nil {
			var temp string
			temp = string(*typedInput.Properties.Version)
			version := ServerVersion(temp)
			server.Version = &version
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &FlexibleServer_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.FlexibleServer_Spec{}
	err := server.AssignProperties_To_FlexibleServer_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_FlexibleServer_Spec populates our FlexibleServer_Spec from the provided source FlexibleServer_Spec
func (server *FlexibleServer_Spec) AssignProperties_From_FlexibleServer_Spec(source *storage.FlexibleServer_Spec) error {

	// AdministratorLogin
	server.AdministratorLogin = genruntime.ClonePointerToString(source.AdministratorLogin)

	// AdministratorLoginPassword
	if source.AdministratorLoginPassword != nil {
		administratorLoginPassword := source.AdministratorLoginPassword.Copy()
		server.AdministratorLoginPassword = &administratorLoginPassword
	} else {
		server.AdministratorLoginPassword = nil
	}

	// AvailabilityZone
	server.AvailabilityZone = genruntime.ClonePointerToString(source.AvailabilityZone)

	// AzureName
	server.AzureName = source.AzureName

	// Backup
	if source.Backup != nil {
		var backup Backup
		err := backup.AssignProperties_From_Backup(source.Backup)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Backup() to populate field Backup")
		}
		server.Backup = &backup
	} else {
		server.Backup = nil
	}

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

	// DataEncryption
	if source.DataEncryption != nil {
		var dataEncryption DataEncryption
		err := dataEncryption.AssignProperties_From_DataEncryption(source.DataEncryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DataEncryption() to populate field DataEncryption")
		}
		server.DataEncryption = &dataEncryption
	} else {
		server.DataEncryption = nil
	}

	// HighAvailability
	if source.HighAvailability != nil {
		var highAvailability HighAvailability
		err := highAvailability.AssignProperties_From_HighAvailability(source.HighAvailability)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_HighAvailability() to populate field HighAvailability")
		}
		server.HighAvailability = &highAvailability
	} else {
		server.HighAvailability = nil
	}

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

	// ImportSourceProperties
	if source.ImportSourceProperties != nil {
		var importSourceProperty ImportSourceProperties
		err := importSourceProperty.AssignProperties_From_ImportSourceProperties(source.ImportSourceProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImportSourceProperties() to populate field ImportSourceProperties")
		}
		server.ImportSourceProperties = &importSourceProperty
	} else {
		server.ImportSourceProperties = nil
	}

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

	// MaintenanceWindow
	if source.MaintenanceWindow != nil {
		var maintenanceWindow MaintenanceWindow
		err := maintenanceWindow.AssignProperties_From_MaintenanceWindow(source.MaintenanceWindow)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MaintenanceWindow() to populate field MaintenanceWindow")
		}
		server.MaintenanceWindow = &maintenanceWindow
	} else {
		server.MaintenanceWindow = nil
	}

	// Network
	if source.Network != nil {
		var network Network
		err := network.AssignProperties_From_Network(source.Network)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Network() to populate field Network")
		}
		server.Network = &network
	} else {
		server.Network = nil
	}

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

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

	// ReplicationRole
	if source.ReplicationRole != nil {
		replicationRole := *source.ReplicationRole
		replicationRoleTemp := genruntime.ToEnum(replicationRole, replicationRole_Values)
		server.ReplicationRole = &replicationRoleTemp
	} else {
		server.ReplicationRole = nil
	}

	// RestorePointInTime
	server.RestorePointInTime = genruntime.ClonePointerToString(source.RestorePointInTime)

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

	// SourceServerResourceReference
	if source.SourceServerResourceReference != nil {
		sourceServerResourceReference := source.SourceServerResourceReference.Copy()
		server.SourceServerResourceReference = &sourceServerResourceReference
	} else {
		server.SourceServerResourceReference = nil
	}

	// Storage
	if source.Storage != nil {
		var storage Storage
		err := storage.AssignProperties_From_Storage(source.Storage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Storage() to populate field Storage")
		}
		server.Storage = &storage
	} else {
		server.Storage = nil
	}

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

	// Version
	if source.Version != nil {
		version := *source.Version
		versionTemp := genruntime.ToEnum(version, serverVersion_Values)
		server.Version = &versionTemp
	} else {
		server.Version = nil
	}

	// No error
	return nil
}

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

	// AdministratorLogin
	destination.AdministratorLogin = genruntime.ClonePointerToString(server.AdministratorLogin)

	// AdministratorLoginPassword
	if server.AdministratorLoginPassword != nil {
		administratorLoginPassword := server.AdministratorLoginPassword.Copy()
		destination.AdministratorLoginPassword = &administratorLoginPassword
	} else {
		destination.AdministratorLoginPassword = nil
	}

	// AvailabilityZone
	destination.AvailabilityZone = genruntime.ClonePointerToString(server.AvailabilityZone)

	// AzureName
	destination.AzureName = server.AzureName

	// Backup
	if server.Backup != nil {
		var backup storage.Backup
		err := server.Backup.AssignProperties_To_Backup(&backup)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Backup() to populate field Backup")
		}
		destination.Backup = &backup
	} else {
		destination.Backup = nil
	}

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

	// DataEncryption
	if server.DataEncryption != nil {
		var dataEncryption storage.DataEncryption
		err := server.DataEncryption.AssignProperties_To_DataEncryption(&dataEncryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DataEncryption() to populate field DataEncryption")
		}
		destination.DataEncryption = &dataEncryption
	} else {
		destination.DataEncryption = nil
	}

	// HighAvailability
	if server.HighAvailability != nil {
		var highAvailability storage.HighAvailability
		err := server.HighAvailability.AssignProperties_To_HighAvailability(&highAvailability)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_HighAvailability() to populate field HighAvailability")
		}
		destination.HighAvailability = &highAvailability
	} else {
		destination.HighAvailability = nil
	}

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

	// ImportSourceProperties
	if server.ImportSourceProperties != nil {
		var importSourceProperty storage.ImportSourceProperties
		err := server.ImportSourceProperties.AssignProperties_To_ImportSourceProperties(&importSourceProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImportSourceProperties() to populate field ImportSourceProperties")
		}
		destination.ImportSourceProperties = &importSourceProperty
	} else {
		destination.ImportSourceProperties = nil
	}

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

	// MaintenanceWindow
	if server.MaintenanceWindow != nil {
		var maintenanceWindow storage.MaintenanceWindow
		err := server.MaintenanceWindow.AssignProperties_To_MaintenanceWindow(&maintenanceWindow)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MaintenanceWindow() to populate field MaintenanceWindow")
		}
		destination.MaintenanceWindow = &maintenanceWindow
	} else {
		destination.MaintenanceWindow = nil
	}

	// Network
	if server.Network != nil {
		var network storage.Network
		err := server.Network.AssignProperties_To_Network(&network)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Network() to populate field Network")
		}
		destination.Network = &network
	} else {
		destination.Network = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = server.OriginalVersion()

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

	// ReplicationRole
	if server.ReplicationRole != nil {
		replicationRole := string(*server.ReplicationRole)
		destination.ReplicationRole = &replicationRole
	} else {
		destination.ReplicationRole = nil
	}

	// RestorePointInTime
	destination.RestorePointInTime = genruntime.ClonePointerToString(server.RestorePointInTime)

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

	// SourceServerResourceReference
	if server.SourceServerResourceReference != nil {
		sourceServerResourceReference := server.SourceServerResourceReference.Copy()
		destination.SourceServerResourceReference = &sourceServerResourceReference
	} else {
		destination.SourceServerResourceReference = nil
	}

	// Storage
	if server.Storage != nil {
		var storage storage.Storage
		err := server.Storage.AssignProperties_To_Storage(&storage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Storage() to populate field Storage")
		}
		destination.Storage = &storage
	} else {
		destination.Storage = nil
	}

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

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

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

type FlexibleServer_STATUS struct {
	// AdministratorLogin: The administrator's login name of a server. Can only be specified when the server is being created
	// (and is required for creation).
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// AvailabilityZone: availability Zone information of the server.
	AvailabilityZone *string `json:"availabilityZone,omitempty"`

	// Backup: Backup related properties of a server.
	Backup *Backup_STATUS `json:"backup,omitempty"`

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

	// CreateMode: The mode to create a new MySQL server.
	CreateMode *ServerProperties_CreateMode_STATUS `json:"createMode,omitempty"`

	// DataEncryption: The Data Encryption for CMK.
	DataEncryption *DataEncryption_STATUS `json:"dataEncryption,omitempty"`

	// FullyQualifiedDomainName: The fully qualified domain name of a server.
	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`

	// HighAvailability: High availability related properties of a server.
	HighAvailability *HighAvailability_STATUS `json:"highAvailability,omitempty"`

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

	// Identity: The cmk identity for the server.
	Identity *MySQLServerIdentity_STATUS `json:"identity,omitempty"`

	// ImportSourceProperties: Source properties for import from storage.
	ImportSourceProperties *ImportSourceProperties_STATUS `json:"importSourceProperties,omitempty"`

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

	// MaintenanceWindow: Maintenance window of a server.
	MaintenanceWindow *MaintenanceWindow_STATUS `json:"maintenanceWindow,omitempty"`

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

	// Network: Network related properties of a server.
	Network *Network_STATUS `json:"network,omitempty"`

	// PrivateEndpointConnections: PrivateEndpointConnections related properties of a server.
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"`

	// ReplicaCapacity: The maximum number of replicas that a primary server can have.
	ReplicaCapacity *int `json:"replicaCapacity,omitempty"`

	// ReplicationRole: The replication role.
	ReplicationRole *ReplicationRole_STATUS `json:"replicationRole,omitempty"`

	// RestorePointInTime: Restore point creation time (ISO8601 format), specifying the time to restore from.
	RestorePointInTime *string `json:"restorePointInTime,omitempty"`

	// Sku: The SKU (pricing tier) of the server.
	Sku *MySQLServerSku_STATUS `json:"sku,omitempty"`

	// SourceServerResourceId: The source MySQL server id.
	SourceServerResourceId *string `json:"sourceServerResourceId,omitempty"`

	// State: The state of a server.
	State *ServerProperties_State_STATUS `json:"state,omitempty"`

	// Storage: Storage related properties of a server.
	Storage *Storage_STATUS `json:"storage,omitempty"`

	// SystemData: Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

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

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

	// Version: Server version.
	Version *ServerVersion_STATUS `json:"version,omitempty"`
}

var _ genruntime.ConvertibleStatus = &FlexibleServer_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.FlexibleServer_STATUS{}
	err := server.AssignProperties_To_FlexibleServer_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 = &FlexibleServer_STATUS{}

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

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

	// Set property "AdministratorLogin":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AdministratorLogin != nil {
			administratorLogin := *typedInput.Properties.AdministratorLogin
			server.AdministratorLogin = &administratorLogin
		}
	}

	// Set property "AvailabilityZone":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AvailabilityZone != nil {
			availabilityZone := *typedInput.Properties.AvailabilityZone
			server.AvailabilityZone = &availabilityZone
		}
	}

	// Set property "Backup":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Backup != nil {
			var backup1 Backup_STATUS
			err := backup1.PopulateFromARM(owner, *typedInput.Properties.Backup)
			if err != nil {
				return err
			}
			backup := backup1
			server.Backup = &backup
		}
	}

	// no assignment for property "Conditions"

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

	// Set property "DataEncryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DataEncryption != nil {
			var dataEncryption1 DataEncryption_STATUS
			err := dataEncryption1.PopulateFromARM(owner, *typedInput.Properties.DataEncryption)
			if err != nil {
				return err
			}
			dataEncryption := dataEncryption1
			server.DataEncryption = &dataEncryption
		}
	}

	// Set property "FullyQualifiedDomainName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FullyQualifiedDomainName != nil {
			fullyQualifiedDomainName := *typedInput.Properties.FullyQualifiedDomainName
			server.FullyQualifiedDomainName = &fullyQualifiedDomainName
		}
	}

	// Set property "HighAvailability":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.HighAvailability != nil {
			var highAvailability1 HighAvailability_STATUS
			err := highAvailability1.PopulateFromARM(owner, *typedInput.Properties.HighAvailability)
			if err != nil {
				return err
			}
			highAvailability := highAvailability1
			server.HighAvailability = &highAvailability
		}
	}

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

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

	// Set property "ImportSourceProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImportSourceProperties != nil {
			var importSourceProperties1 ImportSourceProperties_STATUS
			err := importSourceProperties1.PopulateFromARM(owner, *typedInput.Properties.ImportSourceProperties)
			if err != nil {
				return err
			}
			importSourceProperties := importSourceProperties1
			server.ImportSourceProperties = &importSourceProperties
		}
	}

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

	// Set property "MaintenanceWindow":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MaintenanceWindow != nil {
			var maintenanceWindow1 MaintenanceWindow_STATUS
			err := maintenanceWindow1.PopulateFromARM(owner, *typedInput.Properties.MaintenanceWindow)
			if err != nil {
				return err
			}
			maintenanceWindow := maintenanceWindow1
			server.MaintenanceWindow = &maintenanceWindow
		}
	}

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

	// Set property "Network":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Network != nil {
			var network1 Network_STATUS
			err := network1.PopulateFromARM(owner, *typedInput.Properties.Network)
			if err != nil {
				return err
			}
			network := network1
			server.Network = &network
		}
	}

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

	// Set property "ReplicaCapacity":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReplicaCapacity != nil {
			replicaCapacity := *typedInput.Properties.ReplicaCapacity
			server.ReplicaCapacity = &replicaCapacity
		}
	}

	// Set property "ReplicationRole":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReplicationRole != nil {
			var temp string
			temp = string(*typedInput.Properties.ReplicationRole)
			replicationRole := ReplicationRole_STATUS(temp)
			server.ReplicationRole = &replicationRole
		}
	}

	// Set property "RestorePointInTime":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RestorePointInTime != nil {
			restorePointInTime := *typedInput.Properties.RestorePointInTime
			server.RestorePointInTime = &restorePointInTime
		}
	}

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

	// Set property "SourceServerResourceId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SourceServerResourceId != nil {
			sourceServerResourceId := *typedInput.Properties.SourceServerResourceId
			server.SourceServerResourceId = &sourceServerResourceId
		}
	}

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

	// Set property "Storage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Storage != nil {
			var storage1 Storage_STATUS
			err := storage1.PopulateFromARM(owner, *typedInput.Properties.Storage)
			if err != nil {
				return err
			}
			storage := storage1
			server.Storage = &storage
		}
	}

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

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

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

	// Set property "Version":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Version != nil {
			var temp string
			temp = string(*typedInput.Properties.Version)
			version := ServerVersion_STATUS(temp)
			server.Version = &version
		}
	}

	// No error
	return nil
}

// AssignProperties_From_FlexibleServer_STATUS populates our FlexibleServer_STATUS from the provided source FlexibleServer_STATUS
func (server *FlexibleServer_STATUS) AssignProperties_From_FlexibleServer_STATUS(source *storage.FlexibleServer_STATUS) error {

	// AdministratorLogin
	server.AdministratorLogin = genruntime.ClonePointerToString(source.AdministratorLogin)

	// AvailabilityZone
	server.AvailabilityZone = genruntime.ClonePointerToString(source.AvailabilityZone)

	// Backup
	if source.Backup != nil {
		var backup Backup_STATUS
		err := backup.AssignProperties_From_Backup_STATUS(source.Backup)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Backup_STATUS() to populate field Backup")
		}
		server.Backup = &backup
	} else {
		server.Backup = nil
	}

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

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

	// DataEncryption
	if source.DataEncryption != nil {
		var dataEncryption DataEncryption_STATUS
		err := dataEncryption.AssignProperties_From_DataEncryption_STATUS(source.DataEncryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DataEncryption_STATUS() to populate field DataEncryption")
		}
		server.DataEncryption = &dataEncryption
	} else {
		server.DataEncryption = nil
	}

	// FullyQualifiedDomainName
	server.FullyQualifiedDomainName = genruntime.ClonePointerToString(source.FullyQualifiedDomainName)

	// HighAvailability
	if source.HighAvailability != nil {
		var highAvailability HighAvailability_STATUS
		err := highAvailability.AssignProperties_From_HighAvailability_STATUS(source.HighAvailability)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_HighAvailability_STATUS() to populate field HighAvailability")
		}
		server.HighAvailability = &highAvailability
	} else {
		server.HighAvailability = nil
	}

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

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

	// ImportSourceProperties
	if source.ImportSourceProperties != nil {
		var importSourceProperty ImportSourceProperties_STATUS
		err := importSourceProperty.AssignProperties_From_ImportSourceProperties_STATUS(source.ImportSourceProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ImportSourceProperties_STATUS() to populate field ImportSourceProperties")
		}
		server.ImportSourceProperties = &importSourceProperty
	} else {
		server.ImportSourceProperties = nil
	}

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

	// MaintenanceWindow
	if source.MaintenanceWindow != nil {
		var maintenanceWindow MaintenanceWindow_STATUS
		err := maintenanceWindow.AssignProperties_From_MaintenanceWindow_STATUS(source.MaintenanceWindow)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MaintenanceWindow_STATUS() to populate field MaintenanceWindow")
		}
		server.MaintenanceWindow = &maintenanceWindow
	} else {
		server.MaintenanceWindow = nil
	}

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

	// Network
	if source.Network != nil {
		var network Network_STATUS
		err := network.AssignProperties_From_Network_STATUS(source.Network)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Network_STATUS() to populate field Network")
		}
		server.Network = &network
	} else {
		server.Network = nil
	}

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

	// ReplicaCapacity
	server.ReplicaCapacity = genruntime.ClonePointerToInt(source.ReplicaCapacity)

	// ReplicationRole
	if source.ReplicationRole != nil {
		replicationRole := *source.ReplicationRole
		replicationRoleTemp := genruntime.ToEnum(replicationRole, replicationRole_STATUS_Values)
		server.ReplicationRole = &replicationRoleTemp
	} else {
		server.ReplicationRole = nil
	}

	// RestorePointInTime
	server.RestorePointInTime = genruntime.ClonePointerToString(source.RestorePointInTime)

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

	// SourceServerResourceId
	server.SourceServerResourceId = genruntime.ClonePointerToString(source.SourceServerResourceId)

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

	// Storage
	if source.Storage != nil {
		var storage Storage_STATUS
		err := storage.AssignProperties_From_Storage_STATUS(source.Storage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Storage_STATUS() to populate field Storage")
		}
		server.Storage = &storage
	} else {
		server.Storage = 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")
		}
		server.SystemData = &systemDatum
	} else {
		server.SystemData = nil
	}

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

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

	// Version
	if source.Version != nil {
		version := *source.Version
		versionTemp := genruntime.ToEnum(version, serverVersion_STATUS_Values)
		server.Version = &versionTemp
	} else {
		server.Version = nil
	}

	// No error
	return nil
}

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

	// AdministratorLogin
	destination.AdministratorLogin = genruntime.ClonePointerToString(server.AdministratorLogin)

	// AvailabilityZone
	destination.AvailabilityZone = genruntime.ClonePointerToString(server.AvailabilityZone)

	// Backup
	if server.Backup != nil {
		var backup storage.Backup_STATUS
		err := server.Backup.AssignProperties_To_Backup_STATUS(&backup)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Backup_STATUS() to populate field Backup")
		}
		destination.Backup = &backup
	} else {
		destination.Backup = nil
	}

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

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

	// DataEncryption
	if server.DataEncryption != nil {
		var dataEncryption storage.DataEncryption_STATUS
		err := server.DataEncryption.AssignProperties_To_DataEncryption_STATUS(&dataEncryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DataEncryption_STATUS() to populate field DataEncryption")
		}
		destination.DataEncryption = &dataEncryption
	} else {
		destination.DataEncryption = nil
	}

	// FullyQualifiedDomainName
	destination.FullyQualifiedDomainName = genruntime.ClonePointerToString(server.FullyQualifiedDomainName)

	// HighAvailability
	if server.HighAvailability != nil {
		var highAvailability storage.HighAvailability_STATUS
		err := server.HighAvailability.AssignProperties_To_HighAvailability_STATUS(&highAvailability)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_HighAvailability_STATUS() to populate field HighAvailability")
		}
		destination.HighAvailability = &highAvailability
	} else {
		destination.HighAvailability = nil
	}

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

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

	// ImportSourceProperties
	if server.ImportSourceProperties != nil {
		var importSourceProperty storage.ImportSourceProperties_STATUS
		err := server.ImportSourceProperties.AssignProperties_To_ImportSourceProperties_STATUS(&importSourceProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ImportSourceProperties_STATUS() to populate field ImportSourceProperties")
		}
		destination.ImportSourceProperties = &importSourceProperty
	} else {
		destination.ImportSourceProperties = nil
	}

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

	// MaintenanceWindow
	if server.MaintenanceWindow != nil {
		var maintenanceWindow storage.MaintenanceWindow_STATUS
		err := server.MaintenanceWindow.AssignProperties_To_MaintenanceWindow_STATUS(&maintenanceWindow)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MaintenanceWindow_STATUS() to populate field MaintenanceWindow")
		}
		destination.MaintenanceWindow = &maintenanceWindow
	} else {
		destination.MaintenanceWindow = nil
	}

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

	// Network
	if server.Network != nil {
		var network storage.Network_STATUS
		err := server.Network.AssignProperties_To_Network_STATUS(&network)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Network_STATUS() to populate field Network")
		}
		destination.Network = &network
	} else {
		destination.Network = nil
	}

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

	// ReplicaCapacity
	destination.ReplicaCapacity = genruntime.ClonePointerToInt(server.ReplicaCapacity)

	// ReplicationRole
	if server.ReplicationRole != nil {
		replicationRole := string(*server.ReplicationRole)
		destination.ReplicationRole = &replicationRole
	} else {
		destination.ReplicationRole = nil
	}

	// RestorePointInTime
	destination.RestorePointInTime = genruntime.ClonePointerToString(server.RestorePointInTime)

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

	// SourceServerResourceId
	destination.SourceServerResourceId = genruntime.ClonePointerToString(server.SourceServerResourceId)

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

	// Storage
	if server.Storage != nil {
		var storage storage.Storage_STATUS
		err := server.Storage.AssignProperties_To_Storage_STATUS(&storage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Storage_STATUS() to populate field Storage")
		}
		destination.Storage = &storage
	} else {
		destination.Storage = nil
	}

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

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

	// Version
	if server.Version != nil {
		version := string(*server.Version)
		destination.Version = &version
	} else {
		destination.Version = nil
	}

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

	// No error
	return nil
}

// Storage Profile properties of a server
type Backup struct {
	// BackupRetentionDays: Backup retention days for the server.
	BackupRetentionDays *int `json:"backupRetentionDays,omitempty"`

	// GeoRedundantBackup: Whether or not geo redundant backup is enabled.
	GeoRedundantBackup *EnableStatusEnum `json:"geoRedundantBackup,omitempty"`
}

var _ genruntime.ARMTransformer = &Backup{}

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

	// Set property "BackupRetentionDays":
	if backup.BackupRetentionDays != nil {
		backupRetentionDays := *backup.BackupRetentionDays
		result.BackupRetentionDays = &backupRetentionDays
	}

	// Set property "GeoRedundantBackup":
	if backup.GeoRedundantBackup != nil {
		var temp string
		temp = string(*backup.GeoRedundantBackup)
		geoRedundantBackup := arm.EnableStatusEnum(temp)
		result.GeoRedundantBackup = &geoRedundantBackup
	}
	return result, nil
}

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

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

	// Set property "BackupRetentionDays":
	if typedInput.BackupRetentionDays != nil {
		backupRetentionDays := *typedInput.BackupRetentionDays
		backup.BackupRetentionDays = &backupRetentionDays
	}

	// Set property "GeoRedundantBackup":
	if typedInput.GeoRedundantBackup != nil {
		var temp string
		temp = string(*typedInput.GeoRedundantBackup)
		geoRedundantBackup := EnableStatusEnum(temp)
		backup.GeoRedundantBackup = &geoRedundantBackup
	}

	// No error
	return nil
}

// AssignProperties_From_Backup populates our Backup from the provided source Backup
func (backup *Backup) AssignProperties_From_Backup(source *storage.Backup) error {

	// BackupRetentionDays
	backup.BackupRetentionDays = genruntime.ClonePointerToInt(source.BackupRetentionDays)

	// GeoRedundantBackup
	if source.GeoRedundantBackup != nil {
		geoRedundantBackup := *source.GeoRedundantBackup
		geoRedundantBackupTemp := genruntime.ToEnum(geoRedundantBackup, enableStatusEnum_Values)
		backup.GeoRedundantBackup = &geoRedundantBackupTemp
	} else {
		backup.GeoRedundantBackup = nil
	}

	// No error
	return nil
}

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

	// BackupRetentionDays
	destination.BackupRetentionDays = genruntime.ClonePointerToInt(backup.BackupRetentionDays)

	// GeoRedundantBackup
	if backup.GeoRedundantBackup != nil {
		geoRedundantBackup := string(*backup.GeoRedundantBackup)
		destination.GeoRedundantBackup = &geoRedundantBackup
	} else {
		destination.GeoRedundantBackup = nil
	}

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

	// No error
	return nil
}

// Storage Profile properties of a server
type Backup_STATUS struct {
	// BackupRetentionDays: Backup retention days for the server.
	BackupRetentionDays *int `json:"backupRetentionDays,omitempty"`

	// EarliestRestoreDate: Earliest restore point creation time (ISO8601 format)
	EarliestRestoreDate *string `json:"earliestRestoreDate,omitempty"`

	// GeoRedundantBackup: Whether or not geo redundant backup is enabled.
	GeoRedundantBackup *EnableStatusEnum_STATUS `json:"geoRedundantBackup,omitempty"`
}

var _ genruntime.FromARMConverter = &Backup_STATUS{}

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

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

	// Set property "BackupRetentionDays":
	if typedInput.BackupRetentionDays != nil {
		backupRetentionDays := *typedInput.BackupRetentionDays
		backup.BackupRetentionDays = &backupRetentionDays
	}

	// Set property "EarliestRestoreDate":
	if typedInput.EarliestRestoreDate != nil {
		earliestRestoreDate := *typedInput.EarliestRestoreDate
		backup.EarliestRestoreDate = &earliestRestoreDate
	}

	// Set property "GeoRedundantBackup":
	if typedInput.GeoRedundantBackup != nil {
		var temp string
		temp = string(*typedInput.GeoRedundantBackup)
		geoRedundantBackup := EnableStatusEnum_STATUS(temp)
		backup.GeoRedundantBackup = &geoRedundantBackup
	}

	// No error
	return nil
}

// AssignProperties_From_Backup_STATUS populates our Backup_STATUS from the provided source Backup_STATUS
func (backup *Backup_STATUS) AssignProperties_From_Backup_STATUS(source *storage.Backup_STATUS) error {

	// BackupRetentionDays
	backup.BackupRetentionDays = genruntime.ClonePointerToInt(source.BackupRetentionDays)

	// EarliestRestoreDate
	backup.EarliestRestoreDate = genruntime.ClonePointerToString(source.EarliestRestoreDate)

	// GeoRedundantBackup
	if source.GeoRedundantBackup != nil {
		geoRedundantBackup := *source.GeoRedundantBackup
		geoRedundantBackupTemp := genruntime.ToEnum(geoRedundantBackup, enableStatusEnum_STATUS_Values)
		backup.GeoRedundantBackup = &geoRedundantBackupTemp
	} else {
		backup.GeoRedundantBackup = nil
	}

	// No error
	return nil
}

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

	// BackupRetentionDays
	destination.BackupRetentionDays = genruntime.ClonePointerToInt(backup.BackupRetentionDays)

	// EarliestRestoreDate
	destination.EarliestRestoreDate = genruntime.ClonePointerToString(backup.EarliestRestoreDate)

	// GeoRedundantBackup
	if backup.GeoRedundantBackup != nil {
		geoRedundantBackup := string(*backup.GeoRedundantBackup)
		destination.GeoRedundantBackup = &geoRedundantBackup
	} else {
		destination.GeoRedundantBackup = nil
	}

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

	// No error
	return nil
}

// The date encryption for cmk.
type DataEncryption struct {
	// GeoBackupKeyURI: Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup
	GeoBackupKeyURI *string `json:"geoBackupKeyURI,omitempty"`

	// GeoBackupUserAssignedIdentityReference: Geo backup user identity resource id as identity can't cross region, need
	// identity in same region as geo backup
	GeoBackupUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"GeoBackupUserAssignedIdentityId" json:"geoBackupUserAssignedIdentityReference,omitempty"`

	// PrimaryKeyURI: Primary key uri
	PrimaryKeyURI *string `json:"primaryKeyURI,omitempty"`

	// PrimaryUserAssignedIdentityReference: Primary user identity resource id
	PrimaryUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"PrimaryUserAssignedIdentityId" json:"primaryUserAssignedIdentityReference,omitempty"`

	// Type: The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk.
	Type *DataEncryption_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &DataEncryption{}

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

	// Set property "GeoBackupKeyURI":
	if encryption.GeoBackupKeyURI != nil {
		geoBackupKeyURI := *encryption.GeoBackupKeyURI
		result.GeoBackupKeyURI = &geoBackupKeyURI
	}

	// Set property "GeoBackupUserAssignedIdentityId":
	if encryption.GeoBackupUserAssignedIdentityReference != nil {
		geoBackupUserAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*encryption.GeoBackupUserAssignedIdentityReference)
		if err != nil {
			return nil, err
		}
		geoBackupUserAssignedIdentityReference := geoBackupUserAssignedIdentityReferenceARMID
		result.GeoBackupUserAssignedIdentityId = &geoBackupUserAssignedIdentityReference
	}

	// Set property "PrimaryKeyURI":
	if encryption.PrimaryKeyURI != nil {
		primaryKeyURI := *encryption.PrimaryKeyURI
		result.PrimaryKeyURI = &primaryKeyURI
	}

	// Set property "PrimaryUserAssignedIdentityId":
	if encryption.PrimaryUserAssignedIdentityReference != nil {
		primaryUserAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*encryption.PrimaryUserAssignedIdentityReference)
		if err != nil {
			return nil, err
		}
		primaryUserAssignedIdentityReference := primaryUserAssignedIdentityReferenceARMID
		result.PrimaryUserAssignedIdentityId = &primaryUserAssignedIdentityReference
	}

	// Set property "Type":
	if encryption.Type != nil {
		var temp string
		temp = string(*encryption.Type)
		typeVar := arm.DataEncryption_Type(temp)
		result.Type = &typeVar
	}
	return result, nil
}

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

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

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

	// no assignment for property "GeoBackupUserAssignedIdentityReference"

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

	// no assignment for property "PrimaryUserAssignedIdentityReference"

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

	// No error
	return nil
}

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

	// GeoBackupKeyURI
	encryption.GeoBackupKeyURI = genruntime.ClonePointerToString(source.GeoBackupKeyURI)

	// GeoBackupUserAssignedIdentityReference
	if source.GeoBackupUserAssignedIdentityReference != nil {
		geoBackupUserAssignedIdentityReference := source.GeoBackupUserAssignedIdentityReference.Copy()
		encryption.GeoBackupUserAssignedIdentityReference = &geoBackupUserAssignedIdentityReference
	} else {
		encryption.GeoBackupUserAssignedIdentityReference = nil
	}

	// PrimaryKeyURI
	encryption.PrimaryKeyURI = genruntime.ClonePointerToString(source.PrimaryKeyURI)

	// PrimaryUserAssignedIdentityReference
	if source.PrimaryUserAssignedIdentityReference != nil {
		primaryUserAssignedIdentityReference := source.PrimaryUserAssignedIdentityReference.Copy()
		encryption.PrimaryUserAssignedIdentityReference = &primaryUserAssignedIdentityReference
	} else {
		encryption.PrimaryUserAssignedIdentityReference = nil
	}

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

	// No error
	return nil
}

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

	// GeoBackupKeyURI
	destination.GeoBackupKeyURI = genruntime.ClonePointerToString(encryption.GeoBackupKeyURI)

	// GeoBackupUserAssignedIdentityReference
	if encryption.GeoBackupUserAssignedIdentityReference != nil {
		geoBackupUserAssignedIdentityReference := encryption.GeoBackupUserAssignedIdentityReference.Copy()
		destination.GeoBackupUserAssignedIdentityReference = &geoBackupUserAssignedIdentityReference
	} else {
		destination.GeoBackupUserAssignedIdentityReference = nil
	}

	// PrimaryKeyURI
	destination.PrimaryKeyURI = genruntime.ClonePointerToString(encryption.PrimaryKeyURI)

	// PrimaryUserAssignedIdentityReference
	if encryption.PrimaryUserAssignedIdentityReference != nil {
		primaryUserAssignedIdentityReference := encryption.PrimaryUserAssignedIdentityReference.Copy()
		destination.PrimaryUserAssignedIdentityReference = &primaryUserAssignedIdentityReference
	} else {
		destination.PrimaryUserAssignedIdentityReference = nil
	}

	// Type
	if encryption.Type != nil {
		typeVar := string(*encryption.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
}

// The date encryption for cmk.
type DataEncryption_STATUS struct {
	// GeoBackupKeyURI: Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup
	GeoBackupKeyURI *string `json:"geoBackupKeyURI,omitempty"`

	// GeoBackupUserAssignedIdentityId: Geo backup user identity resource id as identity can't cross region, need identity in
	// same region as geo backup
	GeoBackupUserAssignedIdentityId *string `json:"geoBackupUserAssignedIdentityId,omitempty"`

	// PrimaryKeyURI: Primary key uri
	PrimaryKeyURI *string `json:"primaryKeyURI,omitempty"`

	// PrimaryUserAssignedIdentityId: Primary user identity resource id
	PrimaryUserAssignedIdentityId *string `json:"primaryUserAssignedIdentityId,omitempty"`

	// Type: The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk.
	Type *DataEncryption_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &DataEncryption_STATUS{}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

	// GeoBackupKeyURI
	encryption.GeoBackupKeyURI = genruntime.ClonePointerToString(source.GeoBackupKeyURI)

	// GeoBackupUserAssignedIdentityId
	encryption.GeoBackupUserAssignedIdentityId = genruntime.ClonePointerToString(source.GeoBackupUserAssignedIdentityId)

	// PrimaryKeyURI
	encryption.PrimaryKeyURI = genruntime.ClonePointerToString(source.PrimaryKeyURI)

	// PrimaryUserAssignedIdentityId
	encryption.PrimaryUserAssignedIdentityId = genruntime.ClonePointerToString(source.PrimaryUserAssignedIdentityId)

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

	// No error
	return nil
}

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

	// GeoBackupKeyURI
	destination.GeoBackupKeyURI = genruntime.ClonePointerToString(encryption.GeoBackupKeyURI)

	// GeoBackupUserAssignedIdentityId
	destination.GeoBackupUserAssignedIdentityId = genruntime.ClonePointerToString(encryption.GeoBackupUserAssignedIdentityId)

	// PrimaryKeyURI
	destination.PrimaryKeyURI = genruntime.ClonePointerToString(encryption.PrimaryKeyURI)

	// PrimaryUserAssignedIdentityId
	destination.PrimaryUserAssignedIdentityId = genruntime.ClonePointerToString(encryption.PrimaryUserAssignedIdentityId)

	// Type
	if encryption.Type != nil {
		typeVar := string(*encryption.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
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type FlexibleServerOperatorSpec struct {
	// ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

	// ConfigMaps: configures where to place operator written ConfigMaps.
	ConfigMaps *FlexibleServerOperatorConfigMaps `json:"configMaps,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 *FlexibleServerOperatorSecrets `json:"secrets,omitempty"`
}

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

	// ConfigMaps
	if source.ConfigMaps != nil {
		var configMap FlexibleServerOperatorConfigMaps
		err := configMap.AssignProperties_From_FlexibleServerOperatorConfigMaps(source.ConfigMaps)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FlexibleServerOperatorConfigMaps() to populate field ConfigMaps")
		}
		operator.ConfigMaps = &configMap
	} else {
		operator.ConfigMaps = 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 FlexibleServerOperatorSecrets
		err := secret.AssignProperties_From_FlexibleServerOperatorSecrets(source.Secrets)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FlexibleServerOperatorSecrets() to populate field Secrets")
		}
		operator.Secrets = &secret
	} else {
		operator.Secrets = nil
	}

	// No error
	return nil
}

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

	// ConfigMaps
	if operator.ConfigMaps != nil {
		var configMap storage.FlexibleServerOperatorConfigMaps
		err := operator.ConfigMaps.AssignProperties_To_FlexibleServerOperatorConfigMaps(&configMap)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FlexibleServerOperatorConfigMaps() to populate field ConfigMaps")
		}
		destination.ConfigMaps = &configMap
	} else {
		destination.ConfigMaps = 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.FlexibleServerOperatorSecrets
		err := operator.Secrets.AssignProperties_To_FlexibleServerOperatorSecrets(&secret)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FlexibleServerOperatorSecrets() 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
}

// Network related properties of a server
type HighAvailability struct {
	// Mode: High availability mode for a server.
	Mode *HighAvailability_Mode `json:"mode,omitempty"`

	// StandbyAvailabilityZone: Availability zone of the standby server.
	StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"`
}

var _ genruntime.ARMTransformer = &HighAvailability{}

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

	// Set property "Mode":
	if availability.Mode != nil {
		var temp string
		temp = string(*availability.Mode)
		mode := arm.HighAvailability_Mode(temp)
		result.Mode = &mode
	}

	// Set property "StandbyAvailabilityZone":
	if availability.StandbyAvailabilityZone != nil {
		standbyAvailabilityZone := *availability.StandbyAvailabilityZone
		result.StandbyAvailabilityZone = &standbyAvailabilityZone
	}
	return result, nil
}

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

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

	// Set property "Mode":
	if typedInput.Mode != nil {
		var temp string
		temp = string(*typedInput.Mode)
		mode := HighAvailability_Mode(temp)
		availability.Mode = &mode
	}

	// Set property "StandbyAvailabilityZone":
	if typedInput.StandbyAvailabilityZone != nil {
		standbyAvailabilityZone := *typedInput.StandbyAvailabilityZone
		availability.StandbyAvailabilityZone = &standbyAvailabilityZone
	}

	// No error
	return nil
}

// AssignProperties_From_HighAvailability populates our HighAvailability from the provided source HighAvailability
func (availability *HighAvailability) AssignProperties_From_HighAvailability(source *storage.HighAvailability) error {

	// Mode
	if source.Mode != nil {
		mode := *source.Mode
		modeTemp := genruntime.ToEnum(mode, highAvailability_Mode_Values)
		availability.Mode = &modeTemp
	} else {
		availability.Mode = nil
	}

	// StandbyAvailabilityZone
	availability.StandbyAvailabilityZone = genruntime.ClonePointerToString(source.StandbyAvailabilityZone)

	// No error
	return nil
}

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

	// Mode
	if availability.Mode != nil {
		mode := string(*availability.Mode)
		destination.Mode = &mode
	} else {
		destination.Mode = nil
	}

	// StandbyAvailabilityZone
	destination.StandbyAvailabilityZone = genruntime.ClonePointerToString(availability.StandbyAvailabilityZone)

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

	// No error
	return nil
}

// Network related properties of a server
type HighAvailability_STATUS struct {
	// Mode: High availability mode for a server.
	Mode *HighAvailability_Mode_STATUS `json:"mode,omitempty"`

	// StandbyAvailabilityZone: Availability zone of the standby server.
	StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"`

	// State: The state of server high availability.
	State *HighAvailability_State_STATUS `json:"state,omitempty"`
}

var _ genruntime.FromARMConverter = &HighAvailability_STATUS{}

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

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

	// Set property "Mode":
	if typedInput.Mode != nil {
		var temp string
		temp = string(*typedInput.Mode)
		mode := HighAvailability_Mode_STATUS(temp)
		availability.Mode = &mode
	}

	// Set property "StandbyAvailabilityZone":
	if typedInput.StandbyAvailabilityZone != nil {
		standbyAvailabilityZone := *typedInput.StandbyAvailabilityZone
		availability.StandbyAvailabilityZone = &standbyAvailabilityZone
	}

	// Set property "State":
	if typedInput.State != nil {
		var temp string
		temp = string(*typedInput.State)
		state := HighAvailability_State_STATUS(temp)
		availability.State = &state
	}

	// No error
	return nil
}

// AssignProperties_From_HighAvailability_STATUS populates our HighAvailability_STATUS from the provided source HighAvailability_STATUS
func (availability *HighAvailability_STATUS) AssignProperties_From_HighAvailability_STATUS(source *storage.HighAvailability_STATUS) error {

	// Mode
	if source.Mode != nil {
		mode := *source.Mode
		modeTemp := genruntime.ToEnum(mode, highAvailability_Mode_STATUS_Values)
		availability.Mode = &modeTemp
	} else {
		availability.Mode = nil
	}

	// StandbyAvailabilityZone
	availability.StandbyAvailabilityZone = genruntime.ClonePointerToString(source.StandbyAvailabilityZone)

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

	// No error
	return nil
}

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

	// Mode
	if availability.Mode != nil {
		mode := string(*availability.Mode)
		destination.Mode = &mode
	} else {
		destination.Mode = nil
	}

	// StandbyAvailabilityZone
	destination.StandbyAvailabilityZone = genruntime.ClonePointerToString(availability.StandbyAvailabilityZone)

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

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

	// No error
	return nil
}

// Import source related properties.
type ImportSourceProperties struct {
	// DataDirPath: Relative path of data directory in storage.
	DataDirPath *string `json:"dataDirPath,omitempty"`

	// SasToken: Sas token for accessing source storage. Read and list permissions are required for sas token.
	SasToken *genruntime.SecretReference `json:"sasToken,omitempty"`

	// StorageType: Storage type of import source.
	StorageType *ImportSourceProperties_StorageType `json:"storageType,omitempty"`

	// StorageUrl: Uri of the import source storage.
	StorageUrl *string `json:"storageUrl,omitempty"`
}

var _ genruntime.ARMTransformer = &ImportSourceProperties{}

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

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

	// Set property "SasToken":
	if properties.SasToken != nil {
		sasTokenSecret, err := resolved.ResolvedSecrets.Lookup(*properties.SasToken)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property SasToken")
		}
		sasToken := sasTokenSecret
		result.SasToken = &sasToken
	}

	// Set property "StorageType":
	if properties.StorageType != nil {
		var temp string
		temp = string(*properties.StorageType)
		storageType := arm.ImportSourceProperties_StorageType(temp)
		result.StorageType = &storageType
	}

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

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

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

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

	// no assignment for property "SasToken"

	// Set property "StorageType":
	if typedInput.StorageType != nil {
		var temp string
		temp = string(*typedInput.StorageType)
		storageType := ImportSourceProperties_StorageType(temp)
		properties.StorageType = &storageType
	}

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

	// No error
	return nil
}

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

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

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

	// StorageType
	if source.StorageType != nil {
		storageType := *source.StorageType
		storageTypeTemp := genruntime.ToEnum(storageType, importSourceProperties_StorageType_Values)
		properties.StorageType = &storageTypeTemp
	} else {
		properties.StorageType = nil
	}

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

	// No error
	return nil
}

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

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

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

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

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

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

	// No error
	return nil
}

// Import source related properties.
type ImportSourceProperties_STATUS struct {
	// DataDirPath: Relative path of data directory in storage.
	DataDirPath *string `json:"dataDirPath,omitempty"`

	// StorageType: Storage type of import source.
	StorageType *ImportSourceProperties_StorageType_STATUS `json:"storageType,omitempty"`

	// StorageUrl: Uri of the import source storage.
	StorageUrl *string `json:"storageUrl,omitempty"`
}

var _ genruntime.FromARMConverter = &ImportSourceProperties_STATUS{}

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

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

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

	// Set property "StorageType":
	if typedInput.StorageType != nil {
		var temp string
		temp = string(*typedInput.StorageType)
		storageType := ImportSourceProperties_StorageType_STATUS(temp)
		properties.StorageType = &storageType
	}

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

	// No error
	return nil
}

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

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

	// StorageType
	if source.StorageType != nil {
		storageType := *source.StorageType
		storageTypeTemp := genruntime.ToEnum(storageType, importSourceProperties_StorageType_STATUS_Values)
		properties.StorageType = &storageTypeTemp
	} else {
		properties.StorageType = nil
	}

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// Maintenance window of a server.
type MaintenanceWindow struct {
	// CustomWindow: indicates whether custom window is enabled or disabled
	CustomWindow *string `json:"customWindow,omitempty"`

	// DayOfWeek: day of week for maintenance window
	DayOfWeek *int `json:"dayOfWeek,omitempty"`

	// StartHour: start hour for maintenance window
	StartHour *int `json:"startHour,omitempty"`

	// StartMinute: start minute for maintenance window
	StartMinute *int `json:"startMinute,omitempty"`
}

var _ genruntime.ARMTransformer = &MaintenanceWindow{}

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

	// Set property "CustomWindow":
	if window.CustomWindow != nil {
		customWindow := *window.CustomWindow
		result.CustomWindow = &customWindow
	}

	// Set property "DayOfWeek":
	if window.DayOfWeek != nil {
		dayOfWeek := *window.DayOfWeek
		result.DayOfWeek = &dayOfWeek
	}

	// Set property "StartHour":
	if window.StartHour != nil {
		startHour := *window.StartHour
		result.StartHour = &startHour
	}

	// Set property "StartMinute":
	if window.StartMinute != nil {
		startMinute := *window.StartMinute
		result.StartMinute = &startMinute
	}
	return result, nil
}

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

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

	// Set property "CustomWindow":
	if typedInput.CustomWindow != nil {
		customWindow := *typedInput.CustomWindow
		window.CustomWindow = &customWindow
	}

	// Set property "DayOfWeek":
	if typedInput.DayOfWeek != nil {
		dayOfWeek := *typedInput.DayOfWeek
		window.DayOfWeek = &dayOfWeek
	}

	// Set property "StartHour":
	if typedInput.StartHour != nil {
		startHour := *typedInput.StartHour
		window.StartHour = &startHour
	}

	// Set property "StartMinute":
	if typedInput.StartMinute != nil {
		startMinute := *typedInput.StartMinute
		window.StartMinute = &startMinute
	}

	// No error
	return nil
}

// AssignProperties_From_MaintenanceWindow populates our MaintenanceWindow from the provided source MaintenanceWindow
func (window *MaintenanceWindow) AssignProperties_From_MaintenanceWindow(source *storage.MaintenanceWindow) error {

	// CustomWindow
	window.CustomWindow = genruntime.ClonePointerToString(source.CustomWindow)

	// DayOfWeek
	window.DayOfWeek = genruntime.ClonePointerToInt(source.DayOfWeek)

	// StartHour
	window.StartHour = genruntime.ClonePointerToInt(source.StartHour)

	// StartMinute
	window.StartMinute = genruntime.ClonePointerToInt(source.StartMinute)

	// No error
	return nil
}

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

	// CustomWindow
	destination.CustomWindow = genruntime.ClonePointerToString(window.CustomWindow)

	// DayOfWeek
	destination.DayOfWeek = genruntime.ClonePointerToInt(window.DayOfWeek)

	// StartHour
	destination.StartHour = genruntime.ClonePointerToInt(window.StartHour)

	// StartMinute
	destination.StartMinute = genruntime.ClonePointerToInt(window.StartMinute)

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

	// No error
	return nil
}

// Maintenance window of a server.
type MaintenanceWindow_STATUS struct {
	// CustomWindow: indicates whether custom window is enabled or disabled
	CustomWindow *string `json:"customWindow,omitempty"`

	// DayOfWeek: day of week for maintenance window
	DayOfWeek *int `json:"dayOfWeek,omitempty"`

	// StartHour: start hour for maintenance window
	StartHour *int `json:"startHour,omitempty"`

	// StartMinute: start minute for maintenance window
	StartMinute *int `json:"startMinute,omitempty"`
}

var _ genruntime.FromARMConverter = &MaintenanceWindow_STATUS{}

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

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

	// Set property "CustomWindow":
	if typedInput.CustomWindow != nil {
		customWindow := *typedInput.CustomWindow
		window.CustomWindow = &customWindow
	}

	// Set property "DayOfWeek":
	if typedInput.DayOfWeek != nil {
		dayOfWeek := *typedInput.DayOfWeek
		window.DayOfWeek = &dayOfWeek
	}

	// Set property "StartHour":
	if typedInput.StartHour != nil {
		startHour := *typedInput.StartHour
		window.StartHour = &startHour
	}

	// Set property "StartMinute":
	if typedInput.StartMinute != nil {
		startMinute := *typedInput.StartMinute
		window.StartMinute = &startMinute
	}

	// No error
	return nil
}

// AssignProperties_From_MaintenanceWindow_STATUS populates our MaintenanceWindow_STATUS from the provided source MaintenanceWindow_STATUS
func (window *MaintenanceWindow_STATUS) AssignProperties_From_MaintenanceWindow_STATUS(source *storage.MaintenanceWindow_STATUS) error {

	// CustomWindow
	window.CustomWindow = genruntime.ClonePointerToString(source.CustomWindow)

	// DayOfWeek
	window.DayOfWeek = genruntime.ClonePointerToInt(source.DayOfWeek)

	// StartHour
	window.StartHour = genruntime.ClonePointerToInt(source.StartHour)

	// StartMinute
	window.StartMinute = genruntime.ClonePointerToInt(source.StartMinute)

	// No error
	return nil
}

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

	// CustomWindow
	destination.CustomWindow = genruntime.ClonePointerToString(window.CustomWindow)

	// DayOfWeek
	destination.DayOfWeek = genruntime.ClonePointerToInt(window.DayOfWeek)

	// StartHour
	destination.StartHour = genruntime.ClonePointerToInt(window.StartHour)

	// StartMinute
	destination.StartMinute = genruntime.ClonePointerToInt(window.StartMinute)

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

	// No error
	return nil
}

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

	// UserAssignedIdentities: Metadata of user assigned identity.
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.ARMTransformer = &MySQLServerIdentity{}

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

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

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

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

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

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

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

	// UserAssignedIdentities: Metadata of user assigned identity.
	UserAssignedIdentities map[string]v1.JSON `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &MySQLServerIdentity_STATUS{}

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

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

	// Set property "UserAssignedIdentities":
	if typedInput.UserAssignedIdentities != nil {
		identity.UserAssignedIdentities = make(map[string]v1.JSON, len(typedInput.UserAssignedIdentities))
		for key, value := range typedInput.UserAssignedIdentities {
			identity.UserAssignedIdentities[key] = *value.DeepCopy()
		}
	}

	// No error
	return nil
}

// AssignProperties_From_MySQLServerIdentity_STATUS populates our MySQLServerIdentity_STATUS from the provided source MySQLServerIdentity_STATUS
func (identity *MySQLServerIdentity_STATUS) AssignProperties_From_MySQLServerIdentity_STATUS(source *storage.MySQLServerIdentity_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, mySQLServerIdentity_Type_STATUS_Values)
		identity.Type = &typeTemp
	} else {
		identity.Type = nil
	}

	// UserAssignedIdentities
	if source.UserAssignedIdentities != nil {
		userAssignedIdentityMap := make(map[string]v1.JSON, len(source.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range source.UserAssignedIdentities {
			userAssignedIdentityMap[userAssignedIdentityKey] = *userAssignedIdentityValue.DeepCopy()
		}
		identity.UserAssignedIdentities = userAssignedIdentityMap
	} else {
		identity.UserAssignedIdentities = nil
	}

	// No error
	return nil
}

// AssignProperties_To_MySQLServerIdentity_STATUS populates the provided destination MySQLServerIdentity_STATUS from our MySQLServerIdentity_STATUS
func (identity *MySQLServerIdentity_STATUS) AssignProperties_To_MySQLServerIdentity_STATUS(destination *storage.MySQLServerIdentity_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]v1.JSON, len(identity.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities {
			userAssignedIdentityMap[userAssignedIdentityKey] = *userAssignedIdentityValue.DeepCopy()
		}
		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
}

// Billing information related properties of a server.
type MySQLServerSku struct {
	// +kubebuilder:validation:Required
	// Name: The name of the sku, e.g. Standard_D32s_v3.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// Tier: The tier of the particular SKU, e.g. GeneralPurpose.
	Tier *MySQLServerSku_Tier `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &MySQLServerSku{}

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

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

	// Set property "Tier":
	if serverSku.Tier != nil {
		var temp string
		temp = string(*serverSku.Tier)
		tier := arm.MySQLServerSku_Tier(temp)
		result.Tier = &tier
	}
	return result, nil
}

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_MySQLServerSku populates our MySQLServerSku from the provided source MySQLServerSku
func (serverSku *MySQLServerSku) AssignProperties_From_MySQLServerSku(source *storage.MySQLServerSku) error {

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

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

	// No error
	return nil
}

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

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

	// Tier
	if serverSku.Tier != nil {
		tier := string(*serverSku.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
}

// Billing information related properties of a server.
type MySQLServerSku_STATUS struct {
	// Name: The name of the sku, e.g. Standard_D32s_v3.
	Name *string `json:"name,omitempty"`

	// Tier: The tier of the particular SKU, e.g. GeneralPurpose.
	Tier *MySQLServerSku_Tier_STATUS `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &MySQLServerSku_STATUS{}

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_MySQLServerSku_STATUS populates our MySQLServerSku_STATUS from the provided source MySQLServerSku_STATUS
func (serverSku *MySQLServerSku_STATUS) AssignProperties_From_MySQLServerSku_STATUS(source *storage.MySQLServerSku_STATUS) error {

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

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

	// No error
	return nil
}

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

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

	// Tier
	if serverSku.Tier != nil {
		tier := string(*serverSku.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
}

// Network related properties of a server
type Network struct {
	// DelegatedSubnetResourceReference: Delegated subnet resource id used to setup vnet for a server.
	DelegatedSubnetResourceReference *genruntime.ResourceReference `armReference:"DelegatedSubnetResourceId" json:"delegatedSubnetResourceReference,omitempty"`

	// PrivateDnsZoneResourceReference: Private DNS zone resource id.
	PrivateDnsZoneResourceReference *genruntime.ResourceReference `armReference:"PrivateDnsZoneResourceId" json:"privateDnsZoneResourceReference,omitempty"`

	// PublicNetworkAccess: Whether or not public network access is allowed for this server. Value is 'Disabled' when server
	// has VNet integration.
	PublicNetworkAccess *EnableStatusEnum `json:"publicNetworkAccess,omitempty"`
}

var _ genruntime.ARMTransformer = &Network{}

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

	// Set property "DelegatedSubnetResourceId":
	if network.DelegatedSubnetResourceReference != nil {
		delegatedSubnetResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*network.DelegatedSubnetResourceReference)
		if err != nil {
			return nil, err
		}
		delegatedSubnetResourceReference := delegatedSubnetResourceReferenceARMID
		result.DelegatedSubnetResourceId = &delegatedSubnetResourceReference
	}

	// Set property "PrivateDnsZoneResourceId":
	if network.PrivateDnsZoneResourceReference != nil {
		privateDnsZoneResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*network.PrivateDnsZoneResourceReference)
		if err != nil {
			return nil, err
		}
		privateDnsZoneResourceReference := privateDnsZoneResourceReferenceARMID
		result.PrivateDnsZoneResourceId = &privateDnsZoneResourceReference
	}

	// Set property "PublicNetworkAccess":
	if network.PublicNetworkAccess != nil {
		var temp string
		temp = string(*network.PublicNetworkAccess)
		publicNetworkAccess := arm.EnableStatusEnum(temp)
		result.PublicNetworkAccess = &publicNetworkAccess
	}
	return result, nil
}

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

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

	// no assignment for property "DelegatedSubnetResourceReference"

	// no assignment for property "PrivateDnsZoneResourceReference"

	// Set property "PublicNetworkAccess":
	if typedInput.PublicNetworkAccess != nil {
		var temp string
		temp = string(*typedInput.PublicNetworkAccess)
		publicNetworkAccess := EnableStatusEnum(temp)
		network.PublicNetworkAccess = &publicNetworkAccess
	}

	// No error
	return nil
}

// AssignProperties_From_Network populates our Network from the provided source Network
func (network *Network) AssignProperties_From_Network(source *storage.Network) error {

	// DelegatedSubnetResourceReference
	if source.DelegatedSubnetResourceReference != nil {
		delegatedSubnetResourceReference := source.DelegatedSubnetResourceReference.Copy()
		network.DelegatedSubnetResourceReference = &delegatedSubnetResourceReference
	} else {
		network.DelegatedSubnetResourceReference = nil
	}

	// PrivateDnsZoneResourceReference
	if source.PrivateDnsZoneResourceReference != nil {
		privateDnsZoneResourceReference := source.PrivateDnsZoneResourceReference.Copy()
		network.PrivateDnsZoneResourceReference = &privateDnsZoneResourceReference
	} else {
		network.PrivateDnsZoneResourceReference = nil
	}

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

	// No error
	return nil
}

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

	// DelegatedSubnetResourceReference
	if network.DelegatedSubnetResourceReference != nil {
		delegatedSubnetResourceReference := network.DelegatedSubnetResourceReference.Copy()
		destination.DelegatedSubnetResourceReference = &delegatedSubnetResourceReference
	} else {
		destination.DelegatedSubnetResourceReference = nil
	}

	// PrivateDnsZoneResourceReference
	if network.PrivateDnsZoneResourceReference != nil {
		privateDnsZoneResourceReference := network.PrivateDnsZoneResourceReference.Copy()
		destination.PrivateDnsZoneResourceReference = &privateDnsZoneResourceReference
	} else {
		destination.PrivateDnsZoneResourceReference = nil
	}

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

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

	// No error
	return nil
}

// Network related properties of a server
type Network_STATUS struct {
	// DelegatedSubnetResourceId: Delegated subnet resource id used to setup vnet for a server.
	DelegatedSubnetResourceId *string `json:"delegatedSubnetResourceId,omitempty"`

	// PrivateDnsZoneResourceId: Private DNS zone resource id.
	PrivateDnsZoneResourceId *string `json:"privateDnsZoneResourceId,omitempty"`

	// PublicNetworkAccess: Whether or not public network access is allowed for this server. Value is 'Disabled' when server
	// has VNet integration.
	PublicNetworkAccess *EnableStatusEnum_STATUS `json:"publicNetworkAccess,omitempty"`
}

var _ genruntime.FromARMConverter = &Network_STATUS{}

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

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

	// Set property "DelegatedSubnetResourceId":
	if typedInput.DelegatedSubnetResourceId != nil {
		delegatedSubnetResourceId := *typedInput.DelegatedSubnetResourceId
		network.DelegatedSubnetResourceId = &delegatedSubnetResourceId
	}

	// Set property "PrivateDnsZoneResourceId":
	if typedInput.PrivateDnsZoneResourceId != nil {
		privateDnsZoneResourceId := *typedInput.PrivateDnsZoneResourceId
		network.PrivateDnsZoneResourceId = &privateDnsZoneResourceId
	}

	// Set property "PublicNetworkAccess":
	if typedInput.PublicNetworkAccess != nil {
		var temp string
		temp = string(*typedInput.PublicNetworkAccess)
		publicNetworkAccess := EnableStatusEnum_STATUS(temp)
		network.PublicNetworkAccess = &publicNetworkAccess
	}

	// No error
	return nil
}

// AssignProperties_From_Network_STATUS populates our Network_STATUS from the provided source Network_STATUS
func (network *Network_STATUS) AssignProperties_From_Network_STATUS(source *storage.Network_STATUS) error {

	// DelegatedSubnetResourceId
	network.DelegatedSubnetResourceId = genruntime.ClonePointerToString(source.DelegatedSubnetResourceId)

	// PrivateDnsZoneResourceId
	network.PrivateDnsZoneResourceId = genruntime.ClonePointerToString(source.PrivateDnsZoneResourceId)

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

	// No error
	return nil
}

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

	// DelegatedSubnetResourceId
	destination.DelegatedSubnetResourceId = genruntime.ClonePointerToString(network.DelegatedSubnetResourceId)

	// PrivateDnsZoneResourceId
	destination.PrivateDnsZoneResourceId = genruntime.ClonePointerToString(network.PrivateDnsZoneResourceId)

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

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

	// No error
	return nil
}

// The private endpoint connection resource.
type PrivateEndpointConnection_STATUS struct {
	// Id: Fully qualified resource ID for the resource. E.g.
	// "/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
}

// The replication role.
// +kubebuilder:validation:Enum={"None","Replica","Source"}
type ReplicationRole string

const (
	ReplicationRole_None    = ReplicationRole("None")
	ReplicationRole_Replica = ReplicationRole("Replica")
	ReplicationRole_Source  = ReplicationRole("Source")
)

// Mapping from string to ReplicationRole
var replicationRole_Values = map[string]ReplicationRole{
	"none":    ReplicationRole_None,
	"replica": ReplicationRole_Replica,
	"source":  ReplicationRole_Source,
}

// The replication role.
type ReplicationRole_STATUS string

const (
	ReplicationRole_STATUS_None    = ReplicationRole_STATUS("None")
	ReplicationRole_STATUS_Replica = ReplicationRole_STATUS("Replica")
	ReplicationRole_STATUS_Source  = ReplicationRole_STATUS("Source")
)

// Mapping from string to ReplicationRole_STATUS
var replicationRole_STATUS_Values = map[string]ReplicationRole_STATUS{
	"none":    ReplicationRole_STATUS_None,
	"replica": ReplicationRole_STATUS_Replica,
	"source":  ReplicationRole_STATUS_Source,
}

// +kubebuilder:validation:Enum={"Default","GeoRestore","PointInTimeRestore","Replica"}
type ServerProperties_CreateMode string

const (
	ServerProperties_CreateMode_Default            = ServerProperties_CreateMode("Default")
	ServerProperties_CreateMode_GeoRestore         = ServerProperties_CreateMode("GeoRestore")
	ServerProperties_CreateMode_PointInTimeRestore = ServerProperties_CreateMode("PointInTimeRestore")
	ServerProperties_CreateMode_Replica            = ServerProperties_CreateMode("Replica")
)

// Mapping from string to ServerProperties_CreateMode
var serverProperties_CreateMode_Values = map[string]ServerProperties_CreateMode{
	"default":            ServerProperties_CreateMode_Default,
	"georestore":         ServerProperties_CreateMode_GeoRestore,
	"pointintimerestore": ServerProperties_CreateMode_PointInTimeRestore,
	"replica":            ServerProperties_CreateMode_Replica,
}

type ServerProperties_CreateMode_STATUS string

const (
	ServerProperties_CreateMode_STATUS_Default            = ServerProperties_CreateMode_STATUS("Default")
	ServerProperties_CreateMode_STATUS_GeoRestore         = ServerProperties_CreateMode_STATUS("GeoRestore")
	ServerProperties_CreateMode_STATUS_PointInTimeRestore = ServerProperties_CreateMode_STATUS("PointInTimeRestore")
	ServerProperties_CreateMode_STATUS_Replica            = ServerProperties_CreateMode_STATUS("Replica")
)

// Mapping from string to ServerProperties_CreateMode_STATUS
var serverProperties_CreateMode_STATUS_Values = map[string]ServerProperties_CreateMode_STATUS{
	"default":            ServerProperties_CreateMode_STATUS_Default,
	"georestore":         ServerProperties_CreateMode_STATUS_GeoRestore,
	"pointintimerestore": ServerProperties_CreateMode_STATUS_PointInTimeRestore,
	"replica":            ServerProperties_CreateMode_STATUS_Replica,
}

type ServerProperties_State_STATUS string

const (
	ServerProperties_State_STATUS_Disabled = ServerProperties_State_STATUS("Disabled")
	ServerProperties_State_STATUS_Dropping = ServerProperties_State_STATUS("Dropping")
	ServerProperties_State_STATUS_Ready    = ServerProperties_State_STATUS("Ready")
	ServerProperties_State_STATUS_Starting = ServerProperties_State_STATUS("Starting")
	ServerProperties_State_STATUS_Stopped  = ServerProperties_State_STATUS("Stopped")
	ServerProperties_State_STATUS_Stopping = ServerProperties_State_STATUS("Stopping")
	ServerProperties_State_STATUS_Updating = ServerProperties_State_STATUS("Updating")
)

// Mapping from string to ServerProperties_State_STATUS
var serverProperties_State_STATUS_Values = map[string]ServerProperties_State_STATUS{
	"disabled": ServerProperties_State_STATUS_Disabled,
	"dropping": ServerProperties_State_STATUS_Dropping,
	"ready":    ServerProperties_State_STATUS_Ready,
	"starting": ServerProperties_State_STATUS_Starting,
	"stopped":  ServerProperties_State_STATUS_Stopped,
	"stopping": ServerProperties_State_STATUS_Stopping,
	"updating": ServerProperties_State_STATUS_Updating,
}

// The version of a server.
// +kubebuilder:validation:Enum={"5.7","8.0.21"}
type ServerVersion string

const (
	ServerVersion_57   = ServerVersion("5.7")
	ServerVersion_8021 = ServerVersion("8.0.21")
)

// Mapping from string to ServerVersion
var serverVersion_Values = map[string]ServerVersion{
	"5.7":    ServerVersion_57,
	"8.0.21": ServerVersion_8021,
}

// The version of a server.
type ServerVersion_STATUS string

const (
	ServerVersion_STATUS_57   = ServerVersion_STATUS("5.7")
	ServerVersion_STATUS_8021 = ServerVersion_STATUS("8.0.21")
)

// Mapping from string to ServerVersion_STATUS
var serverVersion_STATUS_Values = map[string]ServerVersion_STATUS{
	"5.7":    ServerVersion_STATUS_57,
	"8.0.21": ServerVersion_STATUS_8021,
}

// Storage Profile properties of a server
type Storage struct {
	// AutoGrow: Enable Storage Auto Grow or not.
	AutoGrow *EnableStatusEnum `json:"autoGrow,omitempty"`

	// AutoIoScaling: Enable IO Auto Scaling or not.
	AutoIoScaling *EnableStatusEnum `json:"autoIoScaling,omitempty"`

	// Iops: Storage IOPS for a server.
	Iops *int `json:"iops,omitempty"`

	// LogOnDisk: Enable Log On Disk or not.
	LogOnDisk *EnableStatusEnum `json:"logOnDisk,omitempty"`

	// StorageSizeGB: Max storage size allowed for a server.
	StorageSizeGB *int `json:"storageSizeGB,omitempty"`
}

var _ genruntime.ARMTransformer = &Storage{}

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

	// Set property "AutoGrow":
	if storage.AutoGrow != nil {
		var temp string
		temp = string(*storage.AutoGrow)
		autoGrow := arm.EnableStatusEnum(temp)
		result.AutoGrow = &autoGrow
	}

	// Set property "AutoIoScaling":
	if storage.AutoIoScaling != nil {
		var temp string
		temp = string(*storage.AutoIoScaling)
		autoIoScaling := arm.EnableStatusEnum(temp)
		result.AutoIoScaling = &autoIoScaling
	}

	// Set property "Iops":
	if storage.Iops != nil {
		iops := *storage.Iops
		result.Iops = &iops
	}

	// Set property "LogOnDisk":
	if storage.LogOnDisk != nil {
		var temp string
		temp = string(*storage.LogOnDisk)
		logOnDisk := arm.EnableStatusEnum(temp)
		result.LogOnDisk = &logOnDisk
	}

	// Set property "StorageSizeGB":
	if storage.StorageSizeGB != nil {
		storageSizeGB := *storage.StorageSizeGB
		result.StorageSizeGB = &storageSizeGB
	}
	return result, nil
}

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

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

	// Set property "AutoGrow":
	if typedInput.AutoGrow != nil {
		var temp string
		temp = string(*typedInput.AutoGrow)
		autoGrow := EnableStatusEnum(temp)
		storage.AutoGrow = &autoGrow
	}

	// Set property "AutoIoScaling":
	if typedInput.AutoIoScaling != nil {
		var temp string
		temp = string(*typedInput.AutoIoScaling)
		autoIoScaling := EnableStatusEnum(temp)
		storage.AutoIoScaling = &autoIoScaling
	}

	// Set property "Iops":
	if typedInput.Iops != nil {
		iops := *typedInput.Iops
		storage.Iops = &iops
	}

	// Set property "LogOnDisk":
	if typedInput.LogOnDisk != nil {
		var temp string
		temp = string(*typedInput.LogOnDisk)
		logOnDisk := EnableStatusEnum(temp)
		storage.LogOnDisk = &logOnDisk
	}

	// Set property "StorageSizeGB":
	if typedInput.StorageSizeGB != nil {
		storageSizeGB := *typedInput.StorageSizeGB
		storage.StorageSizeGB = &storageSizeGB
	}

	// No error
	return nil
}

// AssignProperties_From_Storage populates our Storage from the provided source Storage
func (storage *Storage) AssignProperties_From_Storage(source *storage.Storage) error {

	// AutoGrow
	if source.AutoGrow != nil {
		autoGrow := *source.AutoGrow
		autoGrowTemp := genruntime.ToEnum(autoGrow, enableStatusEnum_Values)
		storage.AutoGrow = &autoGrowTemp
	} else {
		storage.AutoGrow = nil
	}

	// AutoIoScaling
	if source.AutoIoScaling != nil {
		autoIoScaling := *source.AutoIoScaling
		autoIoScalingTemp := genruntime.ToEnum(autoIoScaling, enableStatusEnum_Values)
		storage.AutoIoScaling = &autoIoScalingTemp
	} else {
		storage.AutoIoScaling = nil
	}

	// Iops
	storage.Iops = genruntime.ClonePointerToInt(source.Iops)

	// LogOnDisk
	if source.LogOnDisk != nil {
		logOnDisk := *source.LogOnDisk
		logOnDiskTemp := genruntime.ToEnum(logOnDisk, enableStatusEnum_Values)
		storage.LogOnDisk = &logOnDiskTemp
	} else {
		storage.LogOnDisk = nil
	}

	// StorageSizeGB
	storage.StorageSizeGB = genruntime.ClonePointerToInt(source.StorageSizeGB)

	// No error
	return nil
}

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

	// AutoGrow
	if storage.AutoGrow != nil {
		autoGrow := string(*storage.AutoGrow)
		destination.AutoGrow = &autoGrow
	} else {
		destination.AutoGrow = nil
	}

	// AutoIoScaling
	if storage.AutoIoScaling != nil {
		autoIoScaling := string(*storage.AutoIoScaling)
		destination.AutoIoScaling = &autoIoScaling
	} else {
		destination.AutoIoScaling = nil
	}

	// Iops
	destination.Iops = genruntime.ClonePointerToInt(storage.Iops)

	// LogOnDisk
	if storage.LogOnDisk != nil {
		logOnDisk := string(*storage.LogOnDisk)
		destination.LogOnDisk = &logOnDisk
	} else {
		destination.LogOnDisk = nil
	}

	// StorageSizeGB
	destination.StorageSizeGB = genruntime.ClonePointerToInt(storage.StorageSizeGB)

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

	// No error
	return nil
}

// Storage Profile properties of a server
type Storage_STATUS struct {
	// AutoGrow: Enable Storage Auto Grow or not.
	AutoGrow *EnableStatusEnum_STATUS `json:"autoGrow,omitempty"`

	// AutoIoScaling: Enable IO Auto Scaling or not.
	AutoIoScaling *EnableStatusEnum_STATUS `json:"autoIoScaling,omitempty"`

	// Iops: Storage IOPS for a server.
	Iops *int `json:"iops,omitempty"`

	// LogOnDisk: Enable Log On Disk or not.
	LogOnDisk *EnableStatusEnum_STATUS `json:"logOnDisk,omitempty"`

	// StorageSizeGB: Max storage size allowed for a server.
	StorageSizeGB *int `json:"storageSizeGB,omitempty"`

	// StorageSku: The sku name of the server storage.
	StorageSku *string `json:"storageSku,omitempty"`
}

var _ genruntime.FromARMConverter = &Storage_STATUS{}

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

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

	// Set property "AutoGrow":
	if typedInput.AutoGrow != nil {
		var temp string
		temp = string(*typedInput.AutoGrow)
		autoGrow := EnableStatusEnum_STATUS(temp)
		storage.AutoGrow = &autoGrow
	}

	// Set property "AutoIoScaling":
	if typedInput.AutoIoScaling != nil {
		var temp string
		temp = string(*typedInput.AutoIoScaling)
		autoIoScaling := EnableStatusEnum_STATUS(temp)
		storage.AutoIoScaling = &autoIoScaling
	}

	// Set property "Iops":
	if typedInput.Iops != nil {
		iops := *typedInput.Iops
		storage.Iops = &iops
	}

	// Set property "LogOnDisk":
	if typedInput.LogOnDisk != nil {
		var temp string
		temp = string(*typedInput.LogOnDisk)
		logOnDisk := EnableStatusEnum_STATUS(temp)
		storage.LogOnDisk = &logOnDisk
	}

	// Set property "StorageSizeGB":
	if typedInput.StorageSizeGB != nil {
		storageSizeGB := *typedInput.StorageSizeGB
		storage.StorageSizeGB = &storageSizeGB
	}

	// Set property "StorageSku":
	if typedInput.StorageSku != nil {
		storageSku := *typedInput.StorageSku
		storage.StorageSku = &storageSku
	}

	// No error
	return nil
}

// AssignProperties_From_Storage_STATUS populates our Storage_STATUS from the provided source Storage_STATUS
func (storage *Storage_STATUS) AssignProperties_From_Storage_STATUS(source *storage.Storage_STATUS) error {

	// AutoGrow
	if source.AutoGrow != nil {
		autoGrow := *source.AutoGrow
		autoGrowTemp := genruntime.ToEnum(autoGrow, enableStatusEnum_STATUS_Values)
		storage.AutoGrow = &autoGrowTemp
	} else {
		storage.AutoGrow = nil
	}

	// AutoIoScaling
	if source.AutoIoScaling != nil {
		autoIoScaling := *source.AutoIoScaling
		autoIoScalingTemp := genruntime.ToEnum(autoIoScaling, enableStatusEnum_STATUS_Values)
		storage.AutoIoScaling = &autoIoScalingTemp
	} else {
		storage.AutoIoScaling = nil
	}

	// Iops
	storage.Iops = genruntime.ClonePointerToInt(source.Iops)

	// LogOnDisk
	if source.LogOnDisk != nil {
		logOnDisk := *source.LogOnDisk
		logOnDiskTemp := genruntime.ToEnum(logOnDisk, enableStatusEnum_STATUS_Values)
		storage.LogOnDisk = &logOnDiskTemp
	} else {
		storage.LogOnDisk = nil
	}

	// StorageSizeGB
	storage.StorageSizeGB = genruntime.ClonePointerToInt(source.StorageSizeGB)

	// StorageSku
	storage.StorageSku = genruntime.ClonePointerToString(source.StorageSku)

	// No error
	return nil
}

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

	// AutoGrow
	if storage.AutoGrow != nil {
		autoGrow := string(*storage.AutoGrow)
		destination.AutoGrow = &autoGrow
	} else {
		destination.AutoGrow = nil
	}

	// AutoIoScaling
	if storage.AutoIoScaling != nil {
		autoIoScaling := string(*storage.AutoIoScaling)
		destination.AutoIoScaling = &autoIoScaling
	} else {
		destination.AutoIoScaling = nil
	}

	// Iops
	destination.Iops = genruntime.ClonePointerToInt(storage.Iops)

	// LogOnDisk
	if storage.LogOnDisk != nil {
		logOnDisk := string(*storage.LogOnDisk)
		destination.LogOnDisk = &logOnDisk
	} else {
		destination.LogOnDisk = nil
	}

	// StorageSizeGB
	destination.StorageSizeGB = genruntime.ClonePointerToInt(storage.StorageSizeGB)

	// StorageSku
	destination.StorageSku = genruntime.ClonePointerToString(storage.StorageSku)

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

// +kubebuilder:validation:Enum={"AzureKeyVault","SystemManaged"}
type DataEncryption_Type string

const (
	DataEncryption_Type_AzureKeyVault = DataEncryption_Type("AzureKeyVault")
	DataEncryption_Type_SystemManaged = DataEncryption_Type("SystemManaged")
)

// Mapping from string to DataEncryption_Type
var dataEncryption_Type_Values = map[string]DataEncryption_Type{
	"azurekeyvault": DataEncryption_Type_AzureKeyVault,
	"systemmanaged": DataEncryption_Type_SystemManaged,
}

type DataEncryption_Type_STATUS string

const (
	DataEncryption_Type_STATUS_AzureKeyVault = DataEncryption_Type_STATUS("AzureKeyVault")
	DataEncryption_Type_STATUS_SystemManaged = DataEncryption_Type_STATUS("SystemManaged")
)

// Mapping from string to DataEncryption_Type_STATUS
var dataEncryption_Type_STATUS_Values = map[string]DataEncryption_Type_STATUS{
	"azurekeyvault": DataEncryption_Type_STATUS_AzureKeyVault,
	"systemmanaged": DataEncryption_Type_STATUS_SystemManaged,
}

// Enum to indicate whether value is 'Enabled' or 'Disabled'
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type EnableStatusEnum string

const (
	EnableStatusEnum_Disabled = EnableStatusEnum("Disabled")
	EnableStatusEnum_Enabled  = EnableStatusEnum("Enabled")
)

// Mapping from string to EnableStatusEnum
var enableStatusEnum_Values = map[string]EnableStatusEnum{
	"disabled": EnableStatusEnum_Disabled,
	"enabled":  EnableStatusEnum_Enabled,
}

// Enum to indicate whether value is 'Enabled' or 'Disabled'
type EnableStatusEnum_STATUS string

const (
	EnableStatusEnum_STATUS_Disabled = EnableStatusEnum_STATUS("Disabled")
	EnableStatusEnum_STATUS_Enabled  = EnableStatusEnum_STATUS("Enabled")
)

// Mapping from string to EnableStatusEnum_STATUS
var enableStatusEnum_STATUS_Values = map[string]EnableStatusEnum_STATUS{
	"disabled": EnableStatusEnum_STATUS_Disabled,
	"enabled":  EnableStatusEnum_STATUS_Enabled,
}

type FlexibleServerOperatorConfigMaps struct {
	// AdministratorLogin: indicates where the AdministratorLogin config map should be placed. If omitted, no config map will
	// be created.
	AdministratorLogin *genruntime.ConfigMapDestination `json:"administratorLogin,omitempty"`

	// FullyQualifiedDomainName: indicates where the FullyQualifiedDomainName config map should be placed. If omitted, no
	// config map will be created.
	FullyQualifiedDomainName *genruntime.ConfigMapDestination `json:"fullyQualifiedDomainName,omitempty"`
}

// AssignProperties_From_FlexibleServerOperatorConfigMaps populates our FlexibleServerOperatorConfigMaps from the provided source FlexibleServerOperatorConfigMaps
func (maps *FlexibleServerOperatorConfigMaps) AssignProperties_From_FlexibleServerOperatorConfigMaps(source *storage.FlexibleServerOperatorConfigMaps) error {

	// AdministratorLogin
	if source.AdministratorLogin != nil {
		administratorLogin := source.AdministratorLogin.Copy()
		maps.AdministratorLogin = &administratorLogin
	} else {
		maps.AdministratorLogin = nil
	}

	// FullyQualifiedDomainName
	if source.FullyQualifiedDomainName != nil {
		fullyQualifiedDomainName := source.FullyQualifiedDomainName.Copy()
		maps.FullyQualifiedDomainName = &fullyQualifiedDomainName
	} else {
		maps.FullyQualifiedDomainName = nil
	}

	// No error
	return nil
}

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

	// AdministratorLogin
	if maps.AdministratorLogin != nil {
		administratorLogin := maps.AdministratorLogin.Copy()
		destination.AdministratorLogin = &administratorLogin
	} else {
		destination.AdministratorLogin = nil
	}

	// FullyQualifiedDomainName
	if maps.FullyQualifiedDomainName != nil {
		fullyQualifiedDomainName := maps.FullyQualifiedDomainName.Copy()
		destination.FullyQualifiedDomainName = &fullyQualifiedDomainName
	} else {
		destination.FullyQualifiedDomainName = nil
	}

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Disabled","SameZone","ZoneRedundant"}
type HighAvailability_Mode string

const (
	HighAvailability_Mode_Disabled      = HighAvailability_Mode("Disabled")
	HighAvailability_Mode_SameZone      = HighAvailability_Mode("SameZone")
	HighAvailability_Mode_ZoneRedundant = HighAvailability_Mode("ZoneRedundant")
)

// Mapping from string to HighAvailability_Mode
var highAvailability_Mode_Values = map[string]HighAvailability_Mode{
	"disabled":      HighAvailability_Mode_Disabled,
	"samezone":      HighAvailability_Mode_SameZone,
	"zoneredundant": HighAvailability_Mode_ZoneRedundant,
}

type HighAvailability_Mode_STATUS string

const (
	HighAvailability_Mode_STATUS_Disabled      = HighAvailability_Mode_STATUS("Disabled")
	HighAvailability_Mode_STATUS_SameZone      = HighAvailability_Mode_STATUS("SameZone")
	HighAvailability_Mode_STATUS_ZoneRedundant = HighAvailability_Mode_STATUS("ZoneRedundant")
)

// Mapping from string to HighAvailability_Mode_STATUS
var highAvailability_Mode_STATUS_Values = map[string]HighAvailability_Mode_STATUS{
	"disabled":      HighAvailability_Mode_STATUS_Disabled,
	"samezone":      HighAvailability_Mode_STATUS_SameZone,
	"zoneredundant": HighAvailability_Mode_STATUS_ZoneRedundant,
}

type HighAvailability_State_STATUS string

const (
	HighAvailability_State_STATUS_CreatingStandby = HighAvailability_State_STATUS("CreatingStandby")
	HighAvailability_State_STATUS_FailingOver     = HighAvailability_State_STATUS("FailingOver")
	HighAvailability_State_STATUS_Healthy         = HighAvailability_State_STATUS("Healthy")
	HighAvailability_State_STATUS_NotEnabled      = HighAvailability_State_STATUS("NotEnabled")
	HighAvailability_State_STATUS_RemovingStandby = HighAvailability_State_STATUS("RemovingStandby")
)

// Mapping from string to HighAvailability_State_STATUS
var highAvailability_State_STATUS_Values = map[string]HighAvailability_State_STATUS{
	"creatingstandby": HighAvailability_State_STATUS_CreatingStandby,
	"failingover":     HighAvailability_State_STATUS_FailingOver,
	"healthy":         HighAvailability_State_STATUS_Healthy,
	"notenabled":      HighAvailability_State_STATUS_NotEnabled,
	"removingstandby": HighAvailability_State_STATUS_RemovingStandby,
}

// +kubebuilder:validation:Enum={"AzureBlob"}
type ImportSourceProperties_StorageType string

const ImportSourceProperties_StorageType_AzureBlob = ImportSourceProperties_StorageType("AzureBlob")

// Mapping from string to ImportSourceProperties_StorageType
var importSourceProperties_StorageType_Values = map[string]ImportSourceProperties_StorageType{
	"azureblob": ImportSourceProperties_StorageType_AzureBlob,
}

type ImportSourceProperties_StorageType_STATUS string

const ImportSourceProperties_StorageType_STATUS_AzureBlob = ImportSourceProperties_StorageType_STATUS("AzureBlob")

// Mapping from string to ImportSourceProperties_StorageType_STATUS
var importSourceProperties_StorageType_STATUS_Values = map[string]ImportSourceProperties_StorageType_STATUS{
	"azureblob": ImportSourceProperties_StorageType_STATUS_AzureBlob,
}

// +kubebuilder:validation:Enum={"UserAssigned"}
type MySQLServerIdentity_Type string

const MySQLServerIdentity_Type_UserAssigned = MySQLServerIdentity_Type("UserAssigned")

// Mapping from string to MySQLServerIdentity_Type
var mySQLServerIdentity_Type_Values = map[string]MySQLServerIdentity_Type{
	"userassigned": MySQLServerIdentity_Type_UserAssigned,
}

type MySQLServerIdentity_Type_STATUS string

const MySQLServerIdentity_Type_STATUS_UserAssigned = MySQLServerIdentity_Type_STATUS("UserAssigned")

// Mapping from string to MySQLServerIdentity_Type_STATUS
var mySQLServerIdentity_Type_STATUS_Values = map[string]MySQLServerIdentity_Type_STATUS{
	"userassigned": MySQLServerIdentity_Type_STATUS_UserAssigned,
}

// +kubebuilder:validation:Enum={"Burstable","GeneralPurpose","MemoryOptimized"}
type MySQLServerSku_Tier string

const (
	MySQLServerSku_Tier_Burstable       = MySQLServerSku_Tier("Burstable")
	MySQLServerSku_Tier_GeneralPurpose  = MySQLServerSku_Tier("GeneralPurpose")
	MySQLServerSku_Tier_MemoryOptimized = MySQLServerSku_Tier("MemoryOptimized")
)

// Mapping from string to MySQLServerSku_Tier
var mySQLServerSku_Tier_Values = map[string]MySQLServerSku_Tier{
	"burstable":       MySQLServerSku_Tier_Burstable,
	"generalpurpose":  MySQLServerSku_Tier_GeneralPurpose,
	"memoryoptimized": MySQLServerSku_Tier_MemoryOptimized,
}

type MySQLServerSku_Tier_STATUS string

const (
	MySQLServerSku_Tier_STATUS_Burstable       = MySQLServerSku_Tier_STATUS("Burstable")
	MySQLServerSku_Tier_STATUS_GeneralPurpose  = MySQLServerSku_Tier_STATUS("GeneralPurpose")
	MySQLServerSku_Tier_STATUS_MemoryOptimized = MySQLServerSku_Tier_STATUS("MemoryOptimized")
)

// Mapping from string to MySQLServerSku_Tier_STATUS
var mySQLServerSku_Tier_STATUS_Values = map[string]MySQLServerSku_Tier_STATUS{
	"burstable":       MySQLServerSku_Tier_STATUS_Burstable,
	"generalpurpose":  MySQLServerSku_Tier_STATUS_GeneralPurpose,
	"memoryoptimized": MySQLServerSku_Tier_STATUS_MemoryOptimized,
}

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
}

func init() {
	SchemeBuilder.Register(&FlexibleServer{}, &FlexibleServerList{})
}
