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

import (
	"context"
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/dbforpostgresql/v1api20240801/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/dbforpostgresql/v1api20240801/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"
	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,dbforpostgresql}
// +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: /postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/FlexibleServers.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/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 {
	source, ok := hub.(*storage.FlexibleServer)
	if !ok {
		return fmt.Errorf("expected dbforpostgresql/v1api20240801/storage/FlexibleServer but received %T instead", hub)
	}

	return server.AssignProperties_From_FlexibleServer(source)
}

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

	return server.AssignProperties_To_FlexibleServer(destination)
}

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.ImportableResource = &FlexibleServer{}

// InitializeSpec initializes the spec for this resource from the given status
func (server *FlexibleServer) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*FlexibleServer_STATUS); ok {
		return server.Spec.Initialize_From_FlexibleServer_STATUS(s)
	}

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

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.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 "2024-08-01"
func (server FlexibleServer) GetAPIVersion() string {
	return "2024-08-01"
}

// 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.DBforPostgreSQL/flexibleServers"
func (server *FlexibleServer) GetType() string {
	return "Microsoft.DBforPostgreSQL/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: /postgresql/resource-manager/Microsoft.DBforPostgreSQL/stable/2024-08-01/FlexibleServers.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}
type FlexibleServerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []FlexibleServer `json:"items"`
}

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

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

type FlexibleServer_Spec struct {
	// AdministratorLogin: Name of the login designated as the first password based administrator assigned to your instance of
	// PostgreSQL. Must be specified the first time that you enable password based authentication on a server. Once set to a
	// given value, it cannot be changed for the rest of the life of a server. If you disable password based authentication on
	// a server which had it enabled, this password based role isn't deleted.
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// AdministratorLoginPassword: Password assigned to the administrator login. As long as password authentication is enabled,
	// this password can be changed at any time.
	AdministratorLoginPassword *genruntime.SecretReference `json:"administratorLoginPassword,omitempty"`

	// AuthConfig: Authentication configuration properties of a flexible server.
	AuthConfig *AuthConfig `json:"authConfig,omitempty"`

	// AvailabilityZone: Availability zone of a flexible server.
	AvailabilityZone *string `json:"availabilityZone,omitempty"`

	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:MinLength=3
	// +kubebuilder:validation:Pattern="^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*"
	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName string `json:"azureName,omitempty"`

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

	// CreateMode: Creation mode of a new flexible server.
	CreateMode *ServerProperties_CreateMode `json:"createMode,omitempty"`

	// DataEncryption: Data encryption properties of a flexible server.
	DataEncryption *DataEncryption `json:"dataEncryption,omitempty"`

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

	// Identity: User assigned managed identities assigned to the flexible server.
	Identity *UserAssignedIdentity `json:"identity,omitempty"`

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

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

	// Network: Network properties of a flexible server. Only required if you want your server to be integrated into a virtual
	// network provided by customer.
	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"`

	// PointInTimeUTC: Creation time (in ISO8601 format) of the backup which you want to restore in the new flexible server.
	// It's required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', or 'ReviveDropped'.
	PointInTimeUTC *string `json:"pointInTimeUTC,omitempty"`

	// Replica: Read replica properties of a flexible server. Required only in case that you want to promote a server.
	Replica *Replica `json:"replica,omitempty"`

	// ReplicationRole: Role of the server in a replication set.
	ReplicationRole *ReplicationRole `json:"replicationRole,omitempty"`

	// Sku: Compute tier and size of a flexible server.
	Sku *Sku `json:"sku,omitempty"`

	// SourceServerResourceReference: Identifier of the flexible server to be used as the source of the new flexible server.
	// Required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', 'Replica', or 'ReviveDropped'. This property is
	// returned only when the target flexible server is a read replica.
	SourceServerResourceReference *genruntime.ResourceReference `armReference:"SourceServerResourceId" json:"sourceServerResourceReference,omitempty"`

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

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

	// Version: Major version of PostgreSQL database engine.
	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.UserAssignedIdentity)
		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.AuthConfig != nil ||
		server.AvailabilityZone != nil ||
		server.Backup != nil ||
		server.CreateMode != nil ||
		server.DataEncryption != nil ||
		server.HighAvailability != nil ||
		server.MaintenanceWindow != nil ||
		server.Network != nil ||
		server.PointInTimeUTC != nil ||
		server.Replica != nil ||
		server.ReplicationRole != 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.AuthConfig != nil {
		authConfig_ARM, err := server.AuthConfig.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		authConfig := *authConfig_ARM.(*arm.AuthConfig)
		result.Properties.AuthConfig = &authConfig
	}
	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.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.PointInTimeUTC != nil {
		pointInTimeUTC := *server.PointInTimeUTC
		result.Properties.PointInTimeUTC = &pointInTimeUTC
	}
	if server.Replica != nil {
		replica_ARM, err := server.Replica.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		replica := *replica_ARM.(*arm.Replica)
		result.Properties.Replica = &replica
	}
	if server.ReplicationRole != nil {
		var temp string
		temp = string(*server.ReplicationRole)
		replicationRole := arm.ReplicationRole(temp)
		result.Properties.ReplicationRole = &replicationRole
	}
	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.Sku)
		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 "AuthConfig":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AuthConfig != nil {
			var authConfig1 AuthConfig
			err := authConfig1.PopulateFromARM(owner, *typedInput.Properties.AuthConfig)
			if err != nil {
				return err
			}
			authConfig := authConfig1
			server.AuthConfig = &authConfig
		}
	}

	// 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 UserAssignedIdentity
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		server.Identity = &identity
	}

	// 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 "PointInTimeUTC":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PointInTimeUTC != nil {
			pointInTimeUTC := *typedInput.Properties.PointInTimeUTC
			server.PointInTimeUTC = &pointInTimeUTC
		}
	}

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

	// 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 "Sku":
	if typedInput.Sku != nil {
		var sku1 Sku
		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
	}

	// AuthConfig
	if source.AuthConfig != nil {
		var authConfig AuthConfig
		err := authConfig.AssignProperties_From_AuthConfig(source.AuthConfig)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AuthConfig() to populate field AuthConfig")
		}
		server.AuthConfig = &authConfig
	} else {
		server.AuthConfig = 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 UserAssignedIdentity
		err := identity.AssignProperties_From_UserAssignedIdentity(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UserAssignedIdentity() to populate field Identity")
		}
		server.Identity = &identity
	} else {
		server.Identity = 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
	}

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

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

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

	// Sku
	if source.Sku != nil {
		var sku Sku
		err := sku.AssignProperties_From_Sku(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku")
		}
		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
	}

	// AuthConfig
	if server.AuthConfig != nil {
		var authConfig storage.AuthConfig
		err := server.AuthConfig.AssignProperties_To_AuthConfig(&authConfig)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AuthConfig() to populate field AuthConfig")
		}
		destination.AuthConfig = &authConfig
	} else {
		destination.AuthConfig = 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.UserAssignedIdentity
		err := server.Identity.AssignProperties_To_UserAssignedIdentity(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = 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
	}

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

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

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

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

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

// Initialize_From_FlexibleServer_STATUS populates our FlexibleServer_Spec from the provided source FlexibleServer_STATUS
func (server *FlexibleServer_Spec) Initialize_From_FlexibleServer_STATUS(source *FlexibleServer_STATUS) error {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	// SourceServerResourceReference
	if source.SourceServerResourceId != nil {
		sourceServerResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.SourceServerResourceId)
		server.SourceServerResourceReference = &sourceServerResourceReference
	} else {
		server.SourceServerResourceReference = nil
	}

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

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

	// Version
	if source.Version != nil {
		version := genruntime.ToEnum(string(*source.Version), serverVersion_Values)
		server.Version = &version
	} else {
		server.Version = 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: Name of the login designated as the first password based administrator assigned to your instance of
	// PostgreSQL. Must be specified the first time that you enable password based authentication on a server. Once set to a
	// given value, it cannot be changed for the rest of the life of a server. If you disable password based authentication on
	// a server which had it enabled, this password based role isn't deleted.
	AdministratorLogin *string `json:"administratorLogin,omitempty"`

	// AuthConfig: Authentication configuration properties of a flexible server.
	AuthConfig *AuthConfig_STATUS `json:"authConfig,omitempty"`

	// AvailabilityZone: Availability zone of a flexible server.
	AvailabilityZone *string `json:"availabilityZone,omitempty"`

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

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

	// CreateMode: Creation mode of a new flexible server.
	CreateMode *ServerProperties_CreateMode_STATUS `json:"createMode,omitempty"`

	// DataEncryption: Data encryption properties of a flexible server.
	DataEncryption *DataEncryption_STATUS `json:"dataEncryption,omitempty"`

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

	// HighAvailability: High availability properties of a flexible 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: User assigned managed identities assigned to the flexible server.
	Identity *UserAssignedIdentity_STATUS `json:"identity,omitempty"`

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

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

	// MinorVersion: Minor version of PostgreSQL database engine.
	MinorVersion *string `json:"minorVersion,omitempty"`

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

	// Network: Network properties of a flexible server. Only required if you want your server to be integrated into a virtual
	// network provided by customer.
	Network *Network_STATUS `json:"network,omitempty"`

	// PointInTimeUTC: Creation time (in ISO8601 format) of the backup which you want to restore in the new flexible server.
	// It's required when 'createMode' is 'PointInTimeRestore', 'GeoRestore', or 'ReviveDropped'.
	PointInTimeUTC *string `json:"pointInTimeUTC,omitempty"`

	// PrivateEndpointConnections: List of private endpoint connections associated with the specified flexible server.
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"`

	// Replica: Read replica properties of a flexible server. Required only in case that you want to promote a server.
	Replica *Replica_STATUS `json:"replica,omitempty"`

	// ReplicaCapacity: Maximum number of read replicas allowed for a flexible server.
	ReplicaCapacity *int `json:"replicaCapacity,omitempty"`

	// ReplicationRole: Role of the server in a replication set.
	ReplicationRole *ReplicationRole_STATUS `json:"replicationRole,omitempty"`

	// Sku: Compute tier and size of a flexible server.
	Sku *Sku_STATUS `json:"sku,omitempty"`

	// SourceServerResourceId: Identifier of the flexible server to be used as the source of the new flexible server. Required
	// when 'createMode' is 'PointInTimeRestore', 'GeoRestore', 'Replica', or 'ReviveDropped'. This property is returned only
	// when the target flexible server is a read replica.
	SourceServerResourceId *string `json:"sourceServerResourceId,omitempty"`

	// State: Possible states of a flexible server.
	State *ServerProperties_State_STATUS `json:"state,omitempty"`

	// Storage: Storage properties of a flexible 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: Major version of PostgreSQL database engine.
	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 "AuthConfig":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AuthConfig != nil {
			var authConfig1 AuthConfig_STATUS
			err := authConfig1.PopulateFromARM(owner, *typedInput.Properties.AuthConfig)
			if err != nil {
				return err
			}
			authConfig := authConfig1
			server.AuthConfig = &authConfig
		}
	}

	// 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 UserAssignedIdentity_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		server.Identity = &identity
	}

	// 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 "MinorVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MinorVersion != nil {
			minorVersion := *typedInput.Properties.MinorVersion
			server.MinorVersion = &minorVersion
		}
	}

	// 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 "PointInTimeUTC":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PointInTimeUTC != nil {
			pointInTimeUTC := *typedInput.Properties.PointInTimeUTC
			server.PointInTimeUTC = &pointInTimeUTC
		}
	}

	// 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 "Replica":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Replica != nil {
			var replica1 Replica_STATUS
			err := replica1.PopulateFromARM(owner, *typedInput.Properties.Replica)
			if err != nil {
				return err
			}
			replica := replica1
			server.Replica = &replica
		}
	}

	// 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 "Sku":
	if typedInput.Sku != nil {
		var sku1 Sku_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)

	// AuthConfig
	if source.AuthConfig != nil {
		var authConfig AuthConfig_STATUS
		err := authConfig.AssignProperties_From_AuthConfig_STATUS(source.AuthConfig)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AuthConfig_STATUS() to populate field AuthConfig")
		}
		server.AuthConfig = &authConfig
	} else {
		server.AuthConfig = nil
	}

	// 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 UserAssignedIdentity_STATUS
		err := identity.AssignProperties_From_UserAssignedIdentity_STATUS(source.Identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UserAssignedIdentity_STATUS() to populate field Identity")
		}
		server.Identity = &identity
	} else {
		server.Identity = 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
	}

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

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

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

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

	// Replica
	if source.Replica != nil {
		var replica Replica_STATUS
		err := replica.AssignProperties_From_Replica_STATUS(source.Replica)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Replica_STATUS() to populate field Replica")
		}
		server.Replica = &replica
	} else {
		server.Replica = 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
	}

	// Sku
	if source.Sku != nil {
		var sku Sku_STATUS
		err := sku.AssignProperties_From_Sku_STATUS(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku")
		}
		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)

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

	// 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.UserAssignedIdentity_STATUS
		err := server.Identity.AssignProperties_To_UserAssignedIdentity_STATUS(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_STATUS() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = 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
	}

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

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

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

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

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

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

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

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

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

// Authentication configuration properties of a flexible server.
type AuthConfig struct {
	// ActiveDirectoryAuth: Indicates if the server supports Microsoft Entra authentication.
	ActiveDirectoryAuth *AuthConfig_ActiveDirectoryAuth `json:"activeDirectoryAuth,omitempty"`

	// PasswordAuth: Indicates if the server supports password based authentication.
	PasswordAuth *AuthConfig_PasswordAuth `json:"passwordAuth,omitempty"`

	// TenantId: Identifier of the tenant of the delegated resource.
	TenantId *string `json:"tenantId,omitempty"`
}

var _ genruntime.ARMTransformer = &AuthConfig{}

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

	// Set property "ActiveDirectoryAuth":
	if config.ActiveDirectoryAuth != nil {
		var temp string
		temp = string(*config.ActiveDirectoryAuth)
		activeDirectoryAuth := arm.AuthConfig_ActiveDirectoryAuth(temp)
		result.ActiveDirectoryAuth = &activeDirectoryAuth
	}

	// Set property "PasswordAuth":
	if config.PasswordAuth != nil {
		var temp string
		temp = string(*config.PasswordAuth)
		passwordAuth := arm.AuthConfig_PasswordAuth(temp)
		result.PasswordAuth = &passwordAuth
	}

	// Set property "TenantId":
	if config.TenantId != nil {
		tenantId := *config.TenantId
		result.TenantId = &tenantId
	}
	return result, nil
}

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

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

	// Set property "ActiveDirectoryAuth":
	if typedInput.ActiveDirectoryAuth != nil {
		var temp string
		temp = string(*typedInput.ActiveDirectoryAuth)
		activeDirectoryAuth := AuthConfig_ActiveDirectoryAuth(temp)
		config.ActiveDirectoryAuth = &activeDirectoryAuth
	}

	// Set property "PasswordAuth":
	if typedInput.PasswordAuth != nil {
		var temp string
		temp = string(*typedInput.PasswordAuth)
		passwordAuth := AuthConfig_PasswordAuth(temp)
		config.PasswordAuth = &passwordAuth
	}

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

	// No error
	return nil
}

// AssignProperties_From_AuthConfig populates our AuthConfig from the provided source AuthConfig
func (config *AuthConfig) AssignProperties_From_AuthConfig(source *storage.AuthConfig) error {

	// ActiveDirectoryAuth
	if source.ActiveDirectoryAuth != nil {
		activeDirectoryAuth := *source.ActiveDirectoryAuth
		activeDirectoryAuthTemp := genruntime.ToEnum(activeDirectoryAuth, authConfig_ActiveDirectoryAuth_Values)
		config.ActiveDirectoryAuth = &activeDirectoryAuthTemp
	} else {
		config.ActiveDirectoryAuth = nil
	}

	// PasswordAuth
	if source.PasswordAuth != nil {
		passwordAuth := *source.PasswordAuth
		passwordAuthTemp := genruntime.ToEnum(passwordAuth, authConfig_PasswordAuth_Values)
		config.PasswordAuth = &passwordAuthTemp
	} else {
		config.PasswordAuth = nil
	}

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

	// No error
	return nil
}

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

	// ActiveDirectoryAuth
	if config.ActiveDirectoryAuth != nil {
		activeDirectoryAuth := string(*config.ActiveDirectoryAuth)
		destination.ActiveDirectoryAuth = &activeDirectoryAuth
	} else {
		destination.ActiveDirectoryAuth = nil
	}

	// PasswordAuth
	if config.PasswordAuth != nil {
		passwordAuth := string(*config.PasswordAuth)
		destination.PasswordAuth = &passwordAuth
	} else {
		destination.PasswordAuth = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_AuthConfig_STATUS populates our AuthConfig from the provided source AuthConfig_STATUS
func (config *AuthConfig) Initialize_From_AuthConfig_STATUS(source *AuthConfig_STATUS) error {

	// ActiveDirectoryAuth
	if source.ActiveDirectoryAuth != nil {
		activeDirectoryAuth := genruntime.ToEnum(string(*source.ActiveDirectoryAuth), authConfig_ActiveDirectoryAuth_Values)
		config.ActiveDirectoryAuth = &activeDirectoryAuth
	} else {
		config.ActiveDirectoryAuth = nil
	}

	// PasswordAuth
	if source.PasswordAuth != nil {
		passwordAuth := genruntime.ToEnum(string(*source.PasswordAuth), authConfig_PasswordAuth_Values)
		config.PasswordAuth = &passwordAuth
	} else {
		config.PasswordAuth = nil
	}

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

	// No error
	return nil
}

// Authentication configuration properties of a flexible server.
type AuthConfig_STATUS struct {
	// ActiveDirectoryAuth: Indicates if the server supports Microsoft Entra authentication.
	ActiveDirectoryAuth *AuthConfig_ActiveDirectoryAuth_STATUS `json:"activeDirectoryAuth,omitempty"`

	// PasswordAuth: Indicates if the server supports password based authentication.
	PasswordAuth *AuthConfig_PasswordAuth_STATUS `json:"passwordAuth,omitempty"`

	// TenantId: Identifier of the tenant of the delegated resource.
	TenantId *string `json:"tenantId,omitempty"`
}

var _ genruntime.FromARMConverter = &AuthConfig_STATUS{}

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

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

	// Set property "ActiveDirectoryAuth":
	if typedInput.ActiveDirectoryAuth != nil {
		var temp string
		temp = string(*typedInput.ActiveDirectoryAuth)
		activeDirectoryAuth := AuthConfig_ActiveDirectoryAuth_STATUS(temp)
		config.ActiveDirectoryAuth = &activeDirectoryAuth
	}

	// Set property "PasswordAuth":
	if typedInput.PasswordAuth != nil {
		var temp string
		temp = string(*typedInput.PasswordAuth)
		passwordAuth := AuthConfig_PasswordAuth_STATUS(temp)
		config.PasswordAuth = &passwordAuth
	}

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

	// No error
	return nil
}

// AssignProperties_From_AuthConfig_STATUS populates our AuthConfig_STATUS from the provided source AuthConfig_STATUS
func (config *AuthConfig_STATUS) AssignProperties_From_AuthConfig_STATUS(source *storage.AuthConfig_STATUS) error {

	// ActiveDirectoryAuth
	if source.ActiveDirectoryAuth != nil {
		activeDirectoryAuth := *source.ActiveDirectoryAuth
		activeDirectoryAuthTemp := genruntime.ToEnum(activeDirectoryAuth, authConfig_ActiveDirectoryAuth_STATUS_Values)
		config.ActiveDirectoryAuth = &activeDirectoryAuthTemp
	} else {
		config.ActiveDirectoryAuth = nil
	}

	// PasswordAuth
	if source.PasswordAuth != nil {
		passwordAuth := *source.PasswordAuth
		passwordAuthTemp := genruntime.ToEnum(passwordAuth, authConfig_PasswordAuth_STATUS_Values)
		config.PasswordAuth = &passwordAuthTemp
	} else {
		config.PasswordAuth = nil
	}

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

	// No error
	return nil
}

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

	// ActiveDirectoryAuth
	if config.ActiveDirectoryAuth != nil {
		activeDirectoryAuth := string(*config.ActiveDirectoryAuth)
		destination.ActiveDirectoryAuth = &activeDirectoryAuth
	} else {
		destination.ActiveDirectoryAuth = nil
	}

	// PasswordAuth
	if config.PasswordAuth != nil {
		passwordAuth := string(*config.PasswordAuth)
		destination.PasswordAuth = &passwordAuth
	} else {
		destination.PasswordAuth = nil
	}

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

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

	// No error
	return nil
}

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

	// GeoRedundantBackup: Indicates if the server is configured to create geographically redundant backups.
	GeoRedundantBackup *Backup_GeoRedundantBackup `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.Backup_GeoRedundantBackup(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 := Backup_GeoRedundantBackup(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, backup_GeoRedundantBackup_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
}

// Initialize_From_Backup_STATUS populates our Backup from the provided source Backup_STATUS
func (backup *Backup) Initialize_From_Backup_STATUS(source *Backup_STATUS) error {

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

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

	// No error
	return nil
}

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

	// EarliestRestoreDate: Earliest restore point time (ISO8601 format) for a flexible server.
	EarliestRestoreDate *string `json:"earliestRestoreDate,omitempty"`

	// GeoRedundantBackup: Indicates if the server is configured to create geographically redundant backups.
	GeoRedundantBackup *Backup_GeoRedundantBackup_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 := Backup_GeoRedundantBackup_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, backup_GeoRedundantBackup_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
}

// Data encryption properties of a flexible server.
type DataEncryption struct {
	// GeoBackupEncryptionKeyStatus: Status of key used by a flexible server configured with data encryption based on customer
	// managed key, to encrypt the geographically redundant storage associated to the server when it is configured to support
	// geographically redundant backups.
	GeoBackupEncryptionKeyStatus *DataEncryption_GeoBackupEncryptionKeyStatus `json:"geoBackupEncryptionKeyStatus,omitempty"`

	// GeoBackupKeyURI: Identifier of the user assigned managed identity used to access the key in Azure Key Vault for data
	// encryption of the geographically redundant storage associated to a flexible server that is configured to support
	// geographically redundant backups.
	GeoBackupKeyURI *string `json:"geoBackupKeyURI,omitempty" optionalConfigMapPair:"GeoBackupKeyURI"`

	// GeoBackupKeyURIFromConfig: Identifier of the user assigned managed identity used to access the key in Azure Key Vault
	// for data encryption of the geographically redundant storage associated to a flexible server that is configured to
	// support geographically redundant backups.
	GeoBackupKeyURIFromConfig *genruntime.ConfigMapReference `json:"geoBackupKeyURIFromConfig,omitempty" optionalConfigMapPair:"GeoBackupKeyURI"`

	// GeoBackupUserAssignedIdentityReference: Identifier of the user assigned managed identity used to access the key in Azure
	// Key Vault for data encryption of the geographically redundant storage associated to a flexible server that is configured
	// to support geographically redundant backups.
	GeoBackupUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"GeoBackupUserAssignedIdentityId" json:"geoBackupUserAssignedIdentityReference,omitempty"`

	// PrimaryEncryptionKeyStatus: Status of key used by a flexible server configured with data encryption based on customer
	// managed key, to encrypt the primary storage associated to the server.
	PrimaryEncryptionKeyStatus *DataEncryption_PrimaryEncryptionKeyStatus `json:"primaryEncryptionKeyStatus,omitempty"`

	// PrimaryKeyURI: URI of the key in Azure Key Vault used for data encryption of the primary storage associated to a
	// flexible server.
	PrimaryKeyURI *string `json:"primaryKeyURI,omitempty" optionalConfigMapPair:"PrimaryKeyURI"`

	// PrimaryKeyURIFromConfig: URI of the key in Azure Key Vault used for data encryption of the primary storage associated to
	// a flexible server.
	PrimaryKeyURIFromConfig *genruntime.ConfigMapReference `json:"primaryKeyURIFromConfig,omitempty" optionalConfigMapPair:"PrimaryKeyURI"`

	// PrimaryUserAssignedIdentityReference: Identifier of the user assigned managed identity used to access the key in Azure
	// Key Vault for data encryption of the primary storage associated to a flexible server.
	PrimaryUserAssignedIdentityReference *genruntime.ResourceReference `armReference:"PrimaryUserAssignedIdentityId" json:"primaryUserAssignedIdentityReference,omitempty"`

	// Type: Data encryption type used by a flexible server.
	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 "GeoBackupEncryptionKeyStatus":
	if encryption.GeoBackupEncryptionKeyStatus != nil {
		var temp string
		temp = string(*encryption.GeoBackupEncryptionKeyStatus)
		geoBackupEncryptionKeyStatus := arm.DataEncryption_GeoBackupEncryptionKeyStatus(temp)
		result.GeoBackupEncryptionKeyStatus = &geoBackupEncryptionKeyStatus
	}

	// Set property "GeoBackupKeyURI":
	if encryption.GeoBackupKeyURI != nil {
		geoBackupKeyURI := *encryption.GeoBackupKeyURI
		result.GeoBackupKeyURI = &geoBackupKeyURI
	}
	if encryption.GeoBackupKeyURIFromConfig != nil {
		geoBackupKeyURIValue, err := resolved.ResolvedConfigMaps.Lookup(*encryption.GeoBackupKeyURIFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property GeoBackupKeyURI")
		}
		geoBackupKeyURI := geoBackupKeyURIValue
		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 "PrimaryEncryptionKeyStatus":
	if encryption.PrimaryEncryptionKeyStatus != nil {
		var temp string
		temp = string(*encryption.PrimaryEncryptionKeyStatus)
		primaryEncryptionKeyStatus := arm.DataEncryption_PrimaryEncryptionKeyStatus(temp)
		result.PrimaryEncryptionKeyStatus = &primaryEncryptionKeyStatus
	}

	// Set property "PrimaryKeyURI":
	if encryption.PrimaryKeyURI != nil {
		primaryKeyURI := *encryption.PrimaryKeyURI
		result.PrimaryKeyURI = &primaryKeyURI
	}
	if encryption.PrimaryKeyURIFromConfig != nil {
		primaryKeyURIValue, err := resolved.ResolvedConfigMaps.Lookup(*encryption.PrimaryKeyURIFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property PrimaryKeyURI")
		}
		primaryKeyURI := primaryKeyURIValue
		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 "GeoBackupEncryptionKeyStatus":
	if typedInput.GeoBackupEncryptionKeyStatus != nil {
		var temp string
		temp = string(*typedInput.GeoBackupEncryptionKeyStatus)
		geoBackupEncryptionKeyStatus := DataEncryption_GeoBackupEncryptionKeyStatus(temp)
		encryption.GeoBackupEncryptionKeyStatus = &geoBackupEncryptionKeyStatus
	}

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

	// no assignment for property "GeoBackupKeyURIFromConfig"

	// no assignment for property "GeoBackupUserAssignedIdentityReference"

	// Set property "PrimaryEncryptionKeyStatus":
	if typedInput.PrimaryEncryptionKeyStatus != nil {
		var temp string
		temp = string(*typedInput.PrimaryEncryptionKeyStatus)
		primaryEncryptionKeyStatus := DataEncryption_PrimaryEncryptionKeyStatus(temp)
		encryption.PrimaryEncryptionKeyStatus = &primaryEncryptionKeyStatus
	}

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

	// no assignment for property "PrimaryKeyURIFromConfig"

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

	// GeoBackupEncryptionKeyStatus
	if source.GeoBackupEncryptionKeyStatus != nil {
		geoBackupEncryptionKeyStatus := *source.GeoBackupEncryptionKeyStatus
		geoBackupEncryptionKeyStatusTemp := genruntime.ToEnum(geoBackupEncryptionKeyStatus, dataEncryption_GeoBackupEncryptionKeyStatus_Values)
		encryption.GeoBackupEncryptionKeyStatus = &geoBackupEncryptionKeyStatusTemp
	} else {
		encryption.GeoBackupEncryptionKeyStatus = nil
	}

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

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

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

	// PrimaryEncryptionKeyStatus
	if source.PrimaryEncryptionKeyStatus != nil {
		primaryEncryptionKeyStatus := *source.PrimaryEncryptionKeyStatus
		primaryEncryptionKeyStatusTemp := genruntime.ToEnum(primaryEncryptionKeyStatus, dataEncryption_PrimaryEncryptionKeyStatus_Values)
		encryption.PrimaryEncryptionKeyStatus = &primaryEncryptionKeyStatusTemp
	} else {
		encryption.PrimaryEncryptionKeyStatus = nil
	}

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

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

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

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

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

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

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

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

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

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

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

// Initialize_From_DataEncryption_STATUS populates our DataEncryption from the provided source DataEncryption_STATUS
func (encryption *DataEncryption) Initialize_From_DataEncryption_STATUS(source *DataEncryption_STATUS) error {

	// GeoBackupEncryptionKeyStatus
	if source.GeoBackupEncryptionKeyStatus != nil {
		geoBackupEncryptionKeyStatus := genruntime.ToEnum(string(*source.GeoBackupEncryptionKeyStatus), dataEncryption_GeoBackupEncryptionKeyStatus_Values)
		encryption.GeoBackupEncryptionKeyStatus = &geoBackupEncryptionKeyStatus
	} else {
		encryption.GeoBackupEncryptionKeyStatus = nil
	}

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

	// GeoBackupUserAssignedIdentityReference
	if source.GeoBackupUserAssignedIdentityId != nil {
		geoBackupUserAssignedIdentityReference := genruntime.CreateResourceReferenceFromARMID(*source.GeoBackupUserAssignedIdentityId)
		encryption.GeoBackupUserAssignedIdentityReference = &geoBackupUserAssignedIdentityReference
	} else {
		encryption.GeoBackupUserAssignedIdentityReference = nil
	}

	// PrimaryEncryptionKeyStatus
	if source.PrimaryEncryptionKeyStatus != nil {
		primaryEncryptionKeyStatus := genruntime.ToEnum(string(*source.PrimaryEncryptionKeyStatus), dataEncryption_PrimaryEncryptionKeyStatus_Values)
		encryption.PrimaryEncryptionKeyStatus = &primaryEncryptionKeyStatus
	} else {
		encryption.PrimaryEncryptionKeyStatus = nil
	}

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

	// PrimaryUserAssignedIdentityReference
	if source.PrimaryUserAssignedIdentityId != nil {
		primaryUserAssignedIdentityReference := genruntime.CreateResourceReferenceFromARMID(*source.PrimaryUserAssignedIdentityId)
		encryption.PrimaryUserAssignedIdentityReference = &primaryUserAssignedIdentityReference
	} else {
		encryption.PrimaryUserAssignedIdentityReference = nil
	}

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

	// No error
	return nil
}

// Data encryption properties of a flexible server.
type DataEncryption_STATUS struct {
	// GeoBackupEncryptionKeyStatus: Status of key used by a flexible server configured with data encryption based on customer
	// managed key, to encrypt the geographically redundant storage associated to the server when it is configured to support
	// geographically redundant backups.
	GeoBackupEncryptionKeyStatus *DataEncryption_GeoBackupEncryptionKeyStatus_STATUS `json:"geoBackupEncryptionKeyStatus,omitempty"`

	// GeoBackupKeyURI: Identifier of the user assigned managed identity used to access the key in Azure Key Vault for data
	// encryption of the geographically redundant storage associated to a flexible server that is configured to support
	// geographically redundant backups.
	GeoBackupKeyURI *string `json:"geoBackupKeyURI,omitempty"`

	// GeoBackupUserAssignedIdentityId: Identifier of the user assigned managed identity used to access the key in Azure Key
	// Vault for data encryption of the geographically redundant storage associated to a flexible server that is configured to
	// support geographically redundant backups.
	GeoBackupUserAssignedIdentityId *string `json:"geoBackupUserAssignedIdentityId,omitempty"`

	// PrimaryEncryptionKeyStatus: Status of key used by a flexible server configured with data encryption based on customer
	// managed key, to encrypt the primary storage associated to the server.
	PrimaryEncryptionKeyStatus *DataEncryption_PrimaryEncryptionKeyStatus_STATUS `json:"primaryEncryptionKeyStatus,omitempty"`

	// PrimaryKeyURI: URI of the key in Azure Key Vault used for data encryption of the primary storage associated to a
	// flexible server.
	PrimaryKeyURI *string `json:"primaryKeyURI,omitempty"`

	// PrimaryUserAssignedIdentityId: Identifier of the user assigned managed identity used to access the key in Azure Key
	// Vault for data encryption of the primary storage associated to a flexible server.
	PrimaryUserAssignedIdentityId *string `json:"primaryUserAssignedIdentityId,omitempty"`

	// Type: Data encryption type used by a flexible server.
	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 "GeoBackupEncryptionKeyStatus":
	if typedInput.GeoBackupEncryptionKeyStatus != nil {
		var temp string
		temp = string(*typedInput.GeoBackupEncryptionKeyStatus)
		geoBackupEncryptionKeyStatus := DataEncryption_GeoBackupEncryptionKeyStatus_STATUS(temp)
		encryption.GeoBackupEncryptionKeyStatus = &geoBackupEncryptionKeyStatus
	}

	// 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 "PrimaryEncryptionKeyStatus":
	if typedInput.PrimaryEncryptionKeyStatus != nil {
		var temp string
		temp = string(*typedInput.PrimaryEncryptionKeyStatus)
		primaryEncryptionKeyStatus := DataEncryption_PrimaryEncryptionKeyStatus_STATUS(temp)
		encryption.PrimaryEncryptionKeyStatus = &primaryEncryptionKeyStatus
	}

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

	// GeoBackupEncryptionKeyStatus
	if source.GeoBackupEncryptionKeyStatus != nil {
		geoBackupEncryptionKeyStatus := *source.GeoBackupEncryptionKeyStatus
		geoBackupEncryptionKeyStatusTemp := genruntime.ToEnum(geoBackupEncryptionKeyStatus, dataEncryption_GeoBackupEncryptionKeyStatus_STATUS_Values)
		encryption.GeoBackupEncryptionKeyStatus = &geoBackupEncryptionKeyStatusTemp
	} else {
		encryption.GeoBackupEncryptionKeyStatus = nil
	}

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

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

	// PrimaryEncryptionKeyStatus
	if source.PrimaryEncryptionKeyStatus != nil {
		primaryEncryptionKeyStatus := *source.PrimaryEncryptionKeyStatus
		primaryEncryptionKeyStatusTemp := genruntime.ToEnum(primaryEncryptionKeyStatus, dataEncryption_PrimaryEncryptionKeyStatus_STATUS_Values)
		encryption.PrimaryEncryptionKeyStatus = &primaryEncryptionKeyStatusTemp
	} else {
		encryption.PrimaryEncryptionKeyStatus = nil
	}

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

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

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

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

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

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

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

	// StandbyAvailabilityZone: Availability zone associated to the standby server created when high availability is set to
	// SameZone or ZoneRedundant.
	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
}

// Initialize_From_HighAvailability_STATUS populates our HighAvailability from the provided source HighAvailability_STATUS
func (availability *HighAvailability) Initialize_From_HighAvailability_STATUS(source *HighAvailability_STATUS) error {

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

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

	// No error
	return nil
}

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

	// StandbyAvailabilityZone: Availability zone associated to the standby server created when high availability is set to
	// SameZone or ZoneRedundant.
	StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"`

	// State: Possible states of the standby server created when high availability is set to SameZone or ZoneRedundant.
	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
}

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

	// DayOfWeek: Day of the week to be used for maintenance window.
	DayOfWeek *int `json:"dayOfWeek,omitempty"`

	// StartHour: Start hour to be used for maintenance window.
	StartHour *int `json:"startHour,omitempty"`

	// StartMinute: Start minute to be used 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
}

// Initialize_From_MaintenanceWindow_STATUS populates our MaintenanceWindow from the provided source MaintenanceWindow_STATUS
func (window *MaintenanceWindow) Initialize_From_MaintenanceWindow_STATUS(source *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
}

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

	// DayOfWeek: Day of the week to be used for maintenance window.
	DayOfWeek *int `json:"dayOfWeek,omitempty"`

	// StartHour: Start hour to be used for maintenance window.
	StartHour *int `json:"startHour,omitempty"`

	// StartMinute: Start minute to be used 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
}

// Network properties of a flexible server.
type Network struct {
	// DelegatedSubnetResourceReference: Resource identifier of the delegated subnet. Required during creation of a new server,
	// in case you want the server to be integrated into your own virtual network. For an update operation, you only have to
	// provide this property if you want to change the value assigned for the private DNS zone.
	DelegatedSubnetResourceReference *genruntime.ResourceReference `armReference:"DelegatedSubnetResourceId" json:"delegatedSubnetResourceReference,omitempty"`

	// PrivateDnsZoneArmResourceReference: Identifier of the private DNS zone. Required during creation of a new server, in
	// case you want the server to be integrated into your own virtual network. For an update operation, you only have to
	// provide this property if you want to change the value assigned for the private DNS zone.
	PrivateDnsZoneArmResourceReference *genruntime.ResourceReference `armReference:"PrivateDnsZoneArmResourceId" json:"privateDnsZoneArmResourceReference,omitempty"`

	// PublicNetworkAccess: Indicates if public network access is enabled or not.
	PublicNetworkAccess *Network_PublicNetworkAccess `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 "PrivateDnsZoneArmResourceId":
	if network.PrivateDnsZoneArmResourceReference != nil {
		privateDnsZoneArmResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*network.PrivateDnsZoneArmResourceReference)
		if err != nil {
			return nil, err
		}
		privateDnsZoneArmResourceReference := privateDnsZoneArmResourceReferenceARMID
		result.PrivateDnsZoneArmResourceId = &privateDnsZoneArmResourceReference
	}

	// Set property "PublicNetworkAccess":
	if network.PublicNetworkAccess != nil {
		var temp string
		temp = string(*network.PublicNetworkAccess)
		publicNetworkAccess := arm.Network_PublicNetworkAccess(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 "PrivateDnsZoneArmResourceReference"

	// Set property "PublicNetworkAccess":
	if typedInput.PublicNetworkAccess != nil {
		var temp string
		temp = string(*typedInput.PublicNetworkAccess)
		publicNetworkAccess := Network_PublicNetworkAccess(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
	}

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, network_PublicNetworkAccess_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
	}

	// PrivateDnsZoneArmResourceReference
	if network.PrivateDnsZoneArmResourceReference != nil {
		privateDnsZoneArmResourceReference := network.PrivateDnsZoneArmResourceReference.Copy()
		destination.PrivateDnsZoneArmResourceReference = &privateDnsZoneArmResourceReference
	} else {
		destination.PrivateDnsZoneArmResourceReference = 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
}

// Initialize_From_Network_STATUS populates our Network from the provided source Network_STATUS
func (network *Network) Initialize_From_Network_STATUS(source *Network_STATUS) error {

	// DelegatedSubnetResourceReference
	if source.DelegatedSubnetResourceId != nil {
		delegatedSubnetResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.DelegatedSubnetResourceId)
		network.DelegatedSubnetResourceReference = &delegatedSubnetResourceReference
	} else {
		network.DelegatedSubnetResourceReference = nil
	}

	// PrivateDnsZoneArmResourceReference
	if source.PrivateDnsZoneArmResourceId != nil {
		privateDnsZoneArmResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.PrivateDnsZoneArmResourceId)
		network.PrivateDnsZoneArmResourceReference = &privateDnsZoneArmResourceReference
	} else {
		network.PrivateDnsZoneArmResourceReference = nil
	}

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

	// No error
	return nil
}

// Network properties of a flexible server.
type Network_STATUS struct {
	// DelegatedSubnetResourceId: Resource identifier of the delegated subnet. Required during creation of a new server, in
	// case you want the server to be integrated into your own virtual network. For an update operation, you only have to
	// provide this property if you want to change the value assigned for the private DNS zone.
	DelegatedSubnetResourceId *string `json:"delegatedSubnetResourceId,omitempty"`

	// PrivateDnsZoneArmResourceId: Identifier of the private DNS zone. Required during creation of a new server, in case you
	// want the server to be integrated into your own virtual network. For an update operation, you only have to provide this
	// property if you want to change the value assigned for the private DNS zone.
	PrivateDnsZoneArmResourceId *string `json:"privateDnsZoneArmResourceId,omitempty"`

	// PublicNetworkAccess: Indicates if public network access is enabled or not.
	PublicNetworkAccess *Network_PublicNetworkAccess_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 "PrivateDnsZoneArmResourceId":
	if typedInput.PrivateDnsZoneArmResourceId != nil {
		privateDnsZoneArmResourceId := *typedInput.PrivateDnsZoneArmResourceId
		network.PrivateDnsZoneArmResourceId = &privateDnsZoneArmResourceId
	}

	// Set property "PublicNetworkAccess":
	if typedInput.PublicNetworkAccess != nil {
		var temp string
		temp = string(*typedInput.PublicNetworkAccess)
		publicNetworkAccess := Network_PublicNetworkAccess_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)

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

	// PublicNetworkAccess
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, network_PublicNetworkAccess_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)

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

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

// Replica properties of a flexible server.
type Replica struct {
	// PromoteMode: Type of operation to apply on the read replica. This property is write only. Standalone means that the read
	// replica will be promoted to a standalone server, and will become a completely independent entity from the replication
	// set. Switchover means that the read replica will roles with the primary server.
	PromoteMode *Replica_PromoteMode `json:"promoteMode,omitempty"`

	// PromoteOption: Data synchronization option to use when processing the operation specified in the promoteMode property
	// This property is write only. Planned means that the operation will wait for data in the read replica to be fully
	// synchronized with its source server before it initiates the operation. Forced means that the operation will not wait for
	// data in the read replica to be synchronized with its source server before it initiates the operation.
	PromoteOption *Replica_PromoteOption `json:"promoteOption,omitempty"`

	// Role: Role of the server in a replication set.
	Role *ReplicationRole `json:"role,omitempty"`
}

var _ genruntime.ARMTransformer = &Replica{}

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

	// Set property "PromoteMode":
	if replica.PromoteMode != nil {
		var temp string
		temp = string(*replica.PromoteMode)
		promoteMode := arm.Replica_PromoteMode(temp)
		result.PromoteMode = &promoteMode
	}

	// Set property "PromoteOption":
	if replica.PromoteOption != nil {
		var temp string
		temp = string(*replica.PromoteOption)
		promoteOption := arm.Replica_PromoteOption(temp)
		result.PromoteOption = &promoteOption
	}

	// Set property "Role":
	if replica.Role != nil {
		var temp string
		temp = string(*replica.Role)
		role := arm.ReplicationRole(temp)
		result.Role = &role
	}
	return result, nil
}

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

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

	// Set property "PromoteMode":
	if typedInput.PromoteMode != nil {
		var temp string
		temp = string(*typedInput.PromoteMode)
		promoteMode := Replica_PromoteMode(temp)
		replica.PromoteMode = &promoteMode
	}

	// Set property "PromoteOption":
	if typedInput.PromoteOption != nil {
		var temp string
		temp = string(*typedInput.PromoteOption)
		promoteOption := Replica_PromoteOption(temp)
		replica.PromoteOption = &promoteOption
	}

	// Set property "Role":
	if typedInput.Role != nil {
		var temp string
		temp = string(*typedInput.Role)
		role := ReplicationRole(temp)
		replica.Role = &role
	}

	// No error
	return nil
}

// AssignProperties_From_Replica populates our Replica from the provided source Replica
func (replica *Replica) AssignProperties_From_Replica(source *storage.Replica) error {

	// PromoteMode
	if source.PromoteMode != nil {
		promoteMode := *source.PromoteMode
		promoteModeTemp := genruntime.ToEnum(promoteMode, replica_PromoteMode_Values)
		replica.PromoteMode = &promoteModeTemp
	} else {
		replica.PromoteMode = nil
	}

	// PromoteOption
	if source.PromoteOption != nil {
		promoteOption := *source.PromoteOption
		promoteOptionTemp := genruntime.ToEnum(promoteOption, replica_PromoteOption_Values)
		replica.PromoteOption = &promoteOptionTemp
	} else {
		replica.PromoteOption = nil
	}

	// Role
	if source.Role != nil {
		role := *source.Role
		roleTemp := genruntime.ToEnum(role, replicationRole_Values)
		replica.Role = &roleTemp
	} else {
		replica.Role = nil
	}

	// No error
	return nil
}

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

	// PromoteMode
	if replica.PromoteMode != nil {
		promoteMode := string(*replica.PromoteMode)
		destination.PromoteMode = &promoteMode
	} else {
		destination.PromoteMode = nil
	}

	// PromoteOption
	if replica.PromoteOption != nil {
		promoteOption := string(*replica.PromoteOption)
		destination.PromoteOption = &promoteOption
	} else {
		destination.PromoteOption = nil
	}

	// Role
	if replica.Role != nil {
		role := string(*replica.Role)
		destination.Role = &role
	} else {
		destination.Role = nil
	}

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

	// No error
	return nil
}

// Initialize_From_Replica_STATUS populates our Replica from the provided source Replica_STATUS
func (replica *Replica) Initialize_From_Replica_STATUS(source *Replica_STATUS) error {

	// PromoteMode
	if source.PromoteMode != nil {
		promoteMode := genruntime.ToEnum(string(*source.PromoteMode), replica_PromoteMode_Values)
		replica.PromoteMode = &promoteMode
	} else {
		replica.PromoteMode = nil
	}

	// PromoteOption
	if source.PromoteOption != nil {
		promoteOption := genruntime.ToEnum(string(*source.PromoteOption), replica_PromoteOption_Values)
		replica.PromoteOption = &promoteOption
	} else {
		replica.PromoteOption = nil
	}

	// Role
	if source.Role != nil {
		role := genruntime.ToEnum(string(*source.Role), replicationRole_Values)
		replica.Role = &role
	} else {
		replica.Role = nil
	}

	// No error
	return nil
}

// Replica properties of a flexible server.
type Replica_STATUS struct {
	// Capacity: Maximum number of read replicas allowed for a flexible server.
	Capacity *int `json:"capacity,omitempty"`

	// PromoteMode: Type of operation to apply on the read replica. This property is write only. Standalone means that the read
	// replica will be promoted to a standalone server, and will become a completely independent entity from the replication
	// set. Switchover means that the read replica will roles with the primary server.
	PromoteMode *Replica_PromoteMode_STATUS `json:"promoteMode,omitempty"`

	// PromoteOption: Data synchronization option to use when processing the operation specified in the promoteMode property
	// This property is write only. Planned means that the operation will wait for data in the read replica to be fully
	// synchronized with its source server before it initiates the operation. Forced means that the operation will not wait for
	// data in the read replica to be synchronized with its source server before it initiates the operation.
	PromoteOption *Replica_PromoteOption_STATUS `json:"promoteOption,omitempty"`

	// ReplicationState: Indicates the replication state of a read replica. This property is returned only when the target
	// flexible server is a read replica. Possible  values are Active, Broken, Catchup, Provisioning, Reconfiguring, and
	// Updating
	ReplicationState *Replica_ReplicationState_STATUS `json:"replicationState,omitempty"`

	// Role: Role of the server in a replication set.
	Role *ReplicationRole_STATUS `json:"role,omitempty"`
}

var _ genruntime.FromARMConverter = &Replica_STATUS{}

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

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

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

	// Set property "PromoteMode":
	if typedInput.PromoteMode != nil {
		var temp string
		temp = string(*typedInput.PromoteMode)
		promoteMode := Replica_PromoteMode_STATUS(temp)
		replica.PromoteMode = &promoteMode
	}

	// Set property "PromoteOption":
	if typedInput.PromoteOption != nil {
		var temp string
		temp = string(*typedInput.PromoteOption)
		promoteOption := Replica_PromoteOption_STATUS(temp)
		replica.PromoteOption = &promoteOption
	}

	// Set property "ReplicationState":
	if typedInput.ReplicationState != nil {
		var temp string
		temp = string(*typedInput.ReplicationState)
		replicationState := Replica_ReplicationState_STATUS(temp)
		replica.ReplicationState = &replicationState
	}

	// Set property "Role":
	if typedInput.Role != nil {
		var temp string
		temp = string(*typedInput.Role)
		role := ReplicationRole_STATUS(temp)
		replica.Role = &role
	}

	// No error
	return nil
}

// AssignProperties_From_Replica_STATUS populates our Replica_STATUS from the provided source Replica_STATUS
func (replica *Replica_STATUS) AssignProperties_From_Replica_STATUS(source *storage.Replica_STATUS) error {

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

	// PromoteMode
	if source.PromoteMode != nil {
		promoteMode := *source.PromoteMode
		promoteModeTemp := genruntime.ToEnum(promoteMode, replica_PromoteMode_STATUS_Values)
		replica.PromoteMode = &promoteModeTemp
	} else {
		replica.PromoteMode = nil
	}

	// PromoteOption
	if source.PromoteOption != nil {
		promoteOption := *source.PromoteOption
		promoteOptionTemp := genruntime.ToEnum(promoteOption, replica_PromoteOption_STATUS_Values)
		replica.PromoteOption = &promoteOptionTemp
	} else {
		replica.PromoteOption = nil
	}

	// ReplicationState
	if source.ReplicationState != nil {
		replicationState := *source.ReplicationState
		replicationStateTemp := genruntime.ToEnum(replicationState, replica_ReplicationState_STATUS_Values)
		replica.ReplicationState = &replicationStateTemp
	} else {
		replica.ReplicationState = nil
	}

	// Role
	if source.Role != nil {
		role := *source.Role
		roleTemp := genruntime.ToEnum(role, replicationRole_STATUS_Values)
		replica.Role = &roleTemp
	} else {
		replica.Role = nil
	}

	// No error
	return nil
}

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

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

	// PromoteMode
	if replica.PromoteMode != nil {
		promoteMode := string(*replica.PromoteMode)
		destination.PromoteMode = &promoteMode
	} else {
		destination.PromoteMode = nil
	}

	// PromoteOption
	if replica.PromoteOption != nil {
		promoteOption := string(*replica.PromoteOption)
		destination.PromoteOption = &promoteOption
	} else {
		destination.PromoteOption = nil
	}

	// ReplicationState
	if replica.ReplicationState != nil {
		replicationState := string(*replica.ReplicationState)
		destination.ReplicationState = &replicationState
	} else {
		destination.ReplicationState = nil
	}

	// Role
	if replica.Role != nil {
		role := string(*replica.Role)
		destination.Role = &role
	} else {
		destination.Role = nil
	}

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

	// No error
	return nil
}

// Role of the flexible server in a replication set.
// +kubebuilder:validation:Enum={"AsyncReplica","GeoAsyncReplica","None","Primary"}
type ReplicationRole string

const (
	ReplicationRole_AsyncReplica    = ReplicationRole("AsyncReplica")
	ReplicationRole_GeoAsyncReplica = ReplicationRole("GeoAsyncReplica")
	ReplicationRole_None            = ReplicationRole("None")
	ReplicationRole_Primary         = ReplicationRole("Primary")
)

// Mapping from string to ReplicationRole
var replicationRole_Values = map[string]ReplicationRole{
	"asyncreplica":    ReplicationRole_AsyncReplica,
	"geoasyncreplica": ReplicationRole_GeoAsyncReplica,
	"none":            ReplicationRole_None,
	"primary":         ReplicationRole_Primary,
}

// Role of the flexible server in a replication set.
type ReplicationRole_STATUS string

const (
	ReplicationRole_STATUS_AsyncReplica    = ReplicationRole_STATUS("AsyncReplica")
	ReplicationRole_STATUS_GeoAsyncReplica = ReplicationRole_STATUS("GeoAsyncReplica")
	ReplicationRole_STATUS_None            = ReplicationRole_STATUS("None")
	ReplicationRole_STATUS_Primary         = ReplicationRole_STATUS("Primary")
)

// Mapping from string to ReplicationRole_STATUS
var replicationRole_STATUS_Values = map[string]ReplicationRole_STATUS{
	"asyncreplica":    ReplicationRole_STATUS_AsyncReplica,
	"geoasyncreplica": ReplicationRole_STATUS_GeoAsyncReplica,
	"none":            ReplicationRole_STATUS_None,
	"primary":         ReplicationRole_STATUS_Primary,
}

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

const (
	ServerProperties_CreateMode_Create             = ServerProperties_CreateMode("Create")
	ServerProperties_CreateMode_Default            = ServerProperties_CreateMode("Default")
	ServerProperties_CreateMode_GeoRestore         = ServerProperties_CreateMode("GeoRestore")
	ServerProperties_CreateMode_PointInTimeRestore = ServerProperties_CreateMode("PointInTimeRestore")
	ServerProperties_CreateMode_Replica            = ServerProperties_CreateMode("Replica")
	ServerProperties_CreateMode_ReviveDropped      = ServerProperties_CreateMode("ReviveDropped")
	ServerProperties_CreateMode_Update             = ServerProperties_CreateMode("Update")
)

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

type ServerProperties_CreateMode_STATUS string

const (
	ServerProperties_CreateMode_STATUS_Create             = ServerProperties_CreateMode_STATUS("Create")
	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")
	ServerProperties_CreateMode_STATUS_ReviveDropped      = ServerProperties_CreateMode_STATUS("ReviveDropped")
	ServerProperties_CreateMode_STATUS_Update             = ServerProperties_CreateMode_STATUS("Update")
)

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

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

// Major version of PostgreSQL database engine.
// +kubebuilder:validation:Enum={"11","12","13","14","15","16"}
type ServerVersion string

const (
	ServerVersion_11 = ServerVersion("11")
	ServerVersion_12 = ServerVersion("12")
	ServerVersion_13 = ServerVersion("13")
	ServerVersion_14 = ServerVersion("14")
	ServerVersion_15 = ServerVersion("15")
	ServerVersion_16 = ServerVersion("16")
)

// Mapping from string to ServerVersion
var serverVersion_Values = map[string]ServerVersion{
	"11": ServerVersion_11,
	"12": ServerVersion_12,
	"13": ServerVersion_13,
	"14": ServerVersion_14,
	"15": ServerVersion_15,
	"16": ServerVersion_16,
}

// Major version of PostgreSQL database engine.
type ServerVersion_STATUS string

const (
	ServerVersion_STATUS_11 = ServerVersion_STATUS("11")
	ServerVersion_STATUS_12 = ServerVersion_STATUS("12")
	ServerVersion_STATUS_13 = ServerVersion_STATUS("13")
	ServerVersion_STATUS_14 = ServerVersion_STATUS("14")
	ServerVersion_STATUS_15 = ServerVersion_STATUS("15")
	ServerVersion_STATUS_16 = ServerVersion_STATUS("16")
)

// Mapping from string to ServerVersion_STATUS
var serverVersion_STATUS_Values = map[string]ServerVersion_STATUS{
	"11": ServerVersion_STATUS_11,
	"12": ServerVersion_STATUS_12,
	"13": ServerVersion_STATUS_13,
	"14": ServerVersion_STATUS_14,
	"15": ServerVersion_STATUS_15,
	"16": ServerVersion_STATUS_16,
}

// Compute information of a flexible server.
type Sku struct {
	// +kubebuilder:validation:Required
	// Name: Name by which is known a given compute size assigned to a flexible server.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// Tier: Tier of the compute assigned to a flexible server.
	Tier *Sku_Tier `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &Sku{}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Compute information of a flexible server.
type Sku_STATUS struct {
	// Name: Name by which is known a given compute size assigned to a flexible server.
	Name *string `json:"name,omitempty"`

	// Tier: Tier of the compute assigned to a flexible server.
	Tier *Sku_Tier_STATUS `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &Sku_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Storage properties of a flexible server.
type Storage struct {
	// AutoGrow: Flag to enable or disable the automatic growth of storage size of a flexible server when available space is
	// nearing zero and conditions allow for automatically growing storage size.
	AutoGrow *Storage_AutoGrow `json:"autoGrow,omitempty"`

	// Iops: Maximum IOPS supported for storage. Required when type of storage is PremiumV2_LRS.
	Iops *int `json:"iops,omitempty"`

	// StorageSizeGB: Size of storage assigned to a flexible server.
	StorageSizeGB *int `json:"storageSizeGB,omitempty"`

	// Throughput: Maximum throughput supported for storage. Required when type of storage is PremiumV2_LRS.
	Throughput *int `json:"throughput,omitempty"`

	// Tier: Storage tier of a flexible server.
	Tier *Storage_Tier `json:"tier,omitempty"`

	// Type: Type of storage assigned to a flexible server. Allowed values are Premium_LRS or PremiumV2_LRS. If not specified,
	// it defaults to Premium_LRS.
	Type *Storage_Type `json:"type,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.Storage_AutoGrow(temp)
		result.AutoGrow = &autoGrow
	}

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

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

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

	// Set property "Tier":
	if storage.Tier != nil {
		var temp string
		temp = string(*storage.Tier)
		tier := arm.Storage_Tier(temp)
		result.Tier = &tier
	}

	// Set property "Type":
	if storage.Type != nil {
		var temp string
		temp = string(*storage.Type)
		typeVar := arm.Storage_Type(temp)
		result.Type = &typeVar
	}
	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 := Storage_AutoGrow(temp)
		storage.AutoGrow = &autoGrow
	}

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

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

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

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

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

	// 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, storage_AutoGrow_Values)
		storage.AutoGrow = &autoGrowTemp
	} else {
		storage.AutoGrow = nil
	}

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

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

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

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

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

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

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

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

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

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

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

// Initialize_From_Storage_STATUS populates our Storage from the provided source Storage_STATUS
func (storage *Storage) Initialize_From_Storage_STATUS(source *Storage_STATUS) error {

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

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

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

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

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

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

	// No error
	return nil
}

// Storage properties of a flexible server.
type Storage_STATUS struct {
	// AutoGrow: Flag to enable or disable the automatic growth of storage size of a flexible server when available space is
	// nearing zero and conditions allow for automatically growing storage size.
	AutoGrow *Storage_AutoGrow_STATUS `json:"autoGrow,omitempty"`

	// Iops: Maximum IOPS supported for storage. Required when type of storage is PremiumV2_LRS.
	Iops *int `json:"iops,omitempty"`

	// StorageSizeGB: Size of storage assigned to a flexible server.
	StorageSizeGB *int `json:"storageSizeGB,omitempty"`

	// Throughput: Maximum throughput supported for storage. Required when type of storage is PremiumV2_LRS.
	Throughput *int `json:"throughput,omitempty"`

	// Tier: Storage tier of a flexible server.
	Tier *Storage_Tier_STATUS `json:"tier,omitempty"`

	// Type: Type of storage assigned to a flexible server. Allowed values are Premium_LRS or PremiumV2_LRS. If not specified,
	// it defaults to Premium_LRS.
	Type *Storage_Type_STATUS `json:"type,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 := Storage_AutoGrow_STATUS(temp)
		storage.AutoGrow = &autoGrow
	}

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

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

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

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

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

	// 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, storage_AutoGrow_STATUS_Values)
		storage.AutoGrow = &autoGrowTemp
	} else {
		storage.AutoGrow = nil
	}

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

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

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

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

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

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

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

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

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

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

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

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

// Identities associated with a flexible server.
type UserAssignedIdentity struct {
	// PrincipalId: Identifier of the object of the service principal associated to the user assigned managed identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// +kubebuilder:validation:Required
	// Type: Types of identities associated with a flexible server.
	Type *UserAssignedIdentity_Type `json:"type,omitempty"`

	// UserAssignedIdentities: Map of user assigned managed identities.
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.ARMTransformer = &UserAssignedIdentity{}

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

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

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

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

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

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

	// Type
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, userAssignedIdentity_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_UserAssignedIdentity populates the provided destination UserAssignedIdentity from our UserAssignedIdentity
func (identity *UserAssignedIdentity) AssignProperties_To_UserAssignedIdentity(destination *storage.UserAssignedIdentity) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

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

	// No error
	return nil
}

// Initialize_From_UserAssignedIdentity_STATUS populates our UserAssignedIdentity from the provided source UserAssignedIdentity_STATUS
func (identity *UserAssignedIdentity) Initialize_From_UserAssignedIdentity_STATUS(source *UserAssignedIdentity_STATUS) error {

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

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

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

	// No error
	return nil
}

// Identities associated with a flexible server.
type UserAssignedIdentity_STATUS struct {
	// PrincipalId: Identifier of the object of the service principal associated to the user assigned managed identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: Identifier of the tenant of a flexible server.
	TenantId *string `json:"tenantId,omitempty"`

	// Type: Types of identities associated with a flexible server.
	Type *UserAssignedIdentity_Type_STATUS `json:"type,omitempty"`

	// UserAssignedIdentities: Map of user assigned managed identities.
	UserAssignedIdentities map[string]UserIdentity_STATUS `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &UserAssignedIdentity_STATUS{}

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

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

	// Set property "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 := UserAssignedIdentity_Type_STATUS(temp)
		identity.Type = &typeVar
	}

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

	// No error
	return nil
}

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

	// 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, userAssignedIdentity_Type_STATUS_Values)
		identity.Type = &typeTemp
	} else {
		identity.Type = nil
	}

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

	// No error
	return nil
}

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

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

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

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

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

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

	// No error
	return nil
}

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

const (
	AuthConfig_ActiveDirectoryAuth_Disabled = AuthConfig_ActiveDirectoryAuth("Disabled")
	AuthConfig_ActiveDirectoryAuth_Enabled  = AuthConfig_ActiveDirectoryAuth("Enabled")
)

// Mapping from string to AuthConfig_ActiveDirectoryAuth
var authConfig_ActiveDirectoryAuth_Values = map[string]AuthConfig_ActiveDirectoryAuth{
	"disabled": AuthConfig_ActiveDirectoryAuth_Disabled,
	"enabled":  AuthConfig_ActiveDirectoryAuth_Enabled,
}

type AuthConfig_ActiveDirectoryAuth_STATUS string

const (
	AuthConfig_ActiveDirectoryAuth_STATUS_Disabled = AuthConfig_ActiveDirectoryAuth_STATUS("Disabled")
	AuthConfig_ActiveDirectoryAuth_STATUS_Enabled  = AuthConfig_ActiveDirectoryAuth_STATUS("Enabled")
)

// Mapping from string to AuthConfig_ActiveDirectoryAuth_STATUS
var authConfig_ActiveDirectoryAuth_STATUS_Values = map[string]AuthConfig_ActiveDirectoryAuth_STATUS{
	"disabled": AuthConfig_ActiveDirectoryAuth_STATUS_Disabled,
	"enabled":  AuthConfig_ActiveDirectoryAuth_STATUS_Enabled,
}

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

const (
	AuthConfig_PasswordAuth_Disabled = AuthConfig_PasswordAuth("Disabled")
	AuthConfig_PasswordAuth_Enabled  = AuthConfig_PasswordAuth("Enabled")
)

// Mapping from string to AuthConfig_PasswordAuth
var authConfig_PasswordAuth_Values = map[string]AuthConfig_PasswordAuth{
	"disabled": AuthConfig_PasswordAuth_Disabled,
	"enabled":  AuthConfig_PasswordAuth_Enabled,
}

type AuthConfig_PasswordAuth_STATUS string

const (
	AuthConfig_PasswordAuth_STATUS_Disabled = AuthConfig_PasswordAuth_STATUS("Disabled")
	AuthConfig_PasswordAuth_STATUS_Enabled  = AuthConfig_PasswordAuth_STATUS("Enabled")
)

// Mapping from string to AuthConfig_PasswordAuth_STATUS
var authConfig_PasswordAuth_STATUS_Values = map[string]AuthConfig_PasswordAuth_STATUS{
	"disabled": AuthConfig_PasswordAuth_STATUS_Disabled,
	"enabled":  AuthConfig_PasswordAuth_STATUS_Enabled,
}

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

const (
	Backup_GeoRedundantBackup_Disabled = Backup_GeoRedundantBackup("Disabled")
	Backup_GeoRedundantBackup_Enabled  = Backup_GeoRedundantBackup("Enabled")
)

// Mapping from string to Backup_GeoRedundantBackup
var backup_GeoRedundantBackup_Values = map[string]Backup_GeoRedundantBackup{
	"disabled": Backup_GeoRedundantBackup_Disabled,
	"enabled":  Backup_GeoRedundantBackup_Enabled,
}

type Backup_GeoRedundantBackup_STATUS string

const (
	Backup_GeoRedundantBackup_STATUS_Disabled = Backup_GeoRedundantBackup_STATUS("Disabled")
	Backup_GeoRedundantBackup_STATUS_Enabled  = Backup_GeoRedundantBackup_STATUS("Enabled")
)

// Mapping from string to Backup_GeoRedundantBackup_STATUS
var backup_GeoRedundantBackup_STATUS_Values = map[string]Backup_GeoRedundantBackup_STATUS{
	"disabled": Backup_GeoRedundantBackup_STATUS_Disabled,
	"enabled":  Backup_GeoRedundantBackup_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"Invalid","Valid"}
type DataEncryption_GeoBackupEncryptionKeyStatus string

const (
	DataEncryption_GeoBackupEncryptionKeyStatus_Invalid = DataEncryption_GeoBackupEncryptionKeyStatus("Invalid")
	DataEncryption_GeoBackupEncryptionKeyStatus_Valid   = DataEncryption_GeoBackupEncryptionKeyStatus("Valid")
)

// Mapping from string to DataEncryption_GeoBackupEncryptionKeyStatus
var dataEncryption_GeoBackupEncryptionKeyStatus_Values = map[string]DataEncryption_GeoBackupEncryptionKeyStatus{
	"invalid": DataEncryption_GeoBackupEncryptionKeyStatus_Invalid,
	"valid":   DataEncryption_GeoBackupEncryptionKeyStatus_Valid,
}

type DataEncryption_GeoBackupEncryptionKeyStatus_STATUS string

const (
	DataEncryption_GeoBackupEncryptionKeyStatus_STATUS_Invalid = DataEncryption_GeoBackupEncryptionKeyStatus_STATUS("Invalid")
	DataEncryption_GeoBackupEncryptionKeyStatus_STATUS_Valid   = DataEncryption_GeoBackupEncryptionKeyStatus_STATUS("Valid")
)

// Mapping from string to DataEncryption_GeoBackupEncryptionKeyStatus_STATUS
var dataEncryption_GeoBackupEncryptionKeyStatus_STATUS_Values = map[string]DataEncryption_GeoBackupEncryptionKeyStatus_STATUS{
	"invalid": DataEncryption_GeoBackupEncryptionKeyStatus_STATUS_Invalid,
	"valid":   DataEncryption_GeoBackupEncryptionKeyStatus_STATUS_Valid,
}

// +kubebuilder:validation:Enum={"Invalid","Valid"}
type DataEncryption_PrimaryEncryptionKeyStatus string

const (
	DataEncryption_PrimaryEncryptionKeyStatus_Invalid = DataEncryption_PrimaryEncryptionKeyStatus("Invalid")
	DataEncryption_PrimaryEncryptionKeyStatus_Valid   = DataEncryption_PrimaryEncryptionKeyStatus("Valid")
)

// Mapping from string to DataEncryption_PrimaryEncryptionKeyStatus
var dataEncryption_PrimaryEncryptionKeyStatus_Values = map[string]DataEncryption_PrimaryEncryptionKeyStatus{
	"invalid": DataEncryption_PrimaryEncryptionKeyStatus_Invalid,
	"valid":   DataEncryption_PrimaryEncryptionKeyStatus_Valid,
}

type DataEncryption_PrimaryEncryptionKeyStatus_STATUS string

const (
	DataEncryption_PrimaryEncryptionKeyStatus_STATUS_Invalid = DataEncryption_PrimaryEncryptionKeyStatus_STATUS("Invalid")
	DataEncryption_PrimaryEncryptionKeyStatus_STATUS_Valid   = DataEncryption_PrimaryEncryptionKeyStatus_STATUS("Valid")
)

// Mapping from string to DataEncryption_PrimaryEncryptionKeyStatus_STATUS
var dataEncryption_PrimaryEncryptionKeyStatus_STATUS_Values = map[string]DataEncryption_PrimaryEncryptionKeyStatus_STATUS{
	"invalid": DataEncryption_PrimaryEncryptionKeyStatus_STATUS_Invalid,
	"valid":   DataEncryption_PrimaryEncryptionKeyStatus_STATUS_Valid,
}

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

type FlexibleServerOperatorConfigMaps struct {
	// 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 {

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

	// 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")
	HighAvailability_State_STATUS_ReplicatingData = HighAvailability_State_STATUS("ReplicatingData")
)

// 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,
	"replicatingdata": HighAvailability_State_STATUS_ReplicatingData,
}

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

const (
	Network_PublicNetworkAccess_Disabled = Network_PublicNetworkAccess("Disabled")
	Network_PublicNetworkAccess_Enabled  = Network_PublicNetworkAccess("Enabled")
)

// Mapping from string to Network_PublicNetworkAccess
var network_PublicNetworkAccess_Values = map[string]Network_PublicNetworkAccess{
	"disabled": Network_PublicNetworkAccess_Disabled,
	"enabled":  Network_PublicNetworkAccess_Enabled,
}

type Network_PublicNetworkAccess_STATUS string

const (
	Network_PublicNetworkAccess_STATUS_Disabled = Network_PublicNetworkAccess_STATUS("Disabled")
	Network_PublicNetworkAccess_STATUS_Enabled  = Network_PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to Network_PublicNetworkAccess_STATUS
var network_PublicNetworkAccess_STATUS_Values = map[string]Network_PublicNetworkAccess_STATUS{
	"disabled": Network_PublicNetworkAccess_STATUS_Disabled,
	"enabled":  Network_PublicNetworkAccess_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"standalone","switchover"}
type Replica_PromoteMode string

const (
	Replica_PromoteMode_Standalone = Replica_PromoteMode("standalone")
	Replica_PromoteMode_Switchover = Replica_PromoteMode("switchover")
)

// Mapping from string to Replica_PromoteMode
var replica_PromoteMode_Values = map[string]Replica_PromoteMode{
	"standalone": Replica_PromoteMode_Standalone,
	"switchover": Replica_PromoteMode_Switchover,
}

type Replica_PromoteMode_STATUS string

const (
	Replica_PromoteMode_STATUS_Standalone = Replica_PromoteMode_STATUS("standalone")
	Replica_PromoteMode_STATUS_Switchover = Replica_PromoteMode_STATUS("switchover")
)

// Mapping from string to Replica_PromoteMode_STATUS
var replica_PromoteMode_STATUS_Values = map[string]Replica_PromoteMode_STATUS{
	"standalone": Replica_PromoteMode_STATUS_Standalone,
	"switchover": Replica_PromoteMode_STATUS_Switchover,
}

// +kubebuilder:validation:Enum={"forced","planned"}
type Replica_PromoteOption string

const (
	Replica_PromoteOption_Forced  = Replica_PromoteOption("forced")
	Replica_PromoteOption_Planned = Replica_PromoteOption("planned")
)

// Mapping from string to Replica_PromoteOption
var replica_PromoteOption_Values = map[string]Replica_PromoteOption{
	"forced":  Replica_PromoteOption_Forced,
	"planned": Replica_PromoteOption_Planned,
}

type Replica_PromoteOption_STATUS string

const (
	Replica_PromoteOption_STATUS_Forced  = Replica_PromoteOption_STATUS("forced")
	Replica_PromoteOption_STATUS_Planned = Replica_PromoteOption_STATUS("planned")
)

// Mapping from string to Replica_PromoteOption_STATUS
var replica_PromoteOption_STATUS_Values = map[string]Replica_PromoteOption_STATUS{
	"forced":  Replica_PromoteOption_STATUS_Forced,
	"planned": Replica_PromoteOption_STATUS_Planned,
}

type Replica_ReplicationState_STATUS string

const (
	Replica_ReplicationState_STATUS_Active        = Replica_ReplicationState_STATUS("Active")
	Replica_ReplicationState_STATUS_Broken        = Replica_ReplicationState_STATUS("Broken")
	Replica_ReplicationState_STATUS_Catchup       = Replica_ReplicationState_STATUS("Catchup")
	Replica_ReplicationState_STATUS_Provisioning  = Replica_ReplicationState_STATUS("Provisioning")
	Replica_ReplicationState_STATUS_Reconfiguring = Replica_ReplicationState_STATUS("Reconfiguring")
	Replica_ReplicationState_STATUS_Updating      = Replica_ReplicationState_STATUS("Updating")
)

// Mapping from string to Replica_ReplicationState_STATUS
var replica_ReplicationState_STATUS_Values = map[string]Replica_ReplicationState_STATUS{
	"active":        Replica_ReplicationState_STATUS_Active,
	"broken":        Replica_ReplicationState_STATUS_Broken,
	"catchup":       Replica_ReplicationState_STATUS_Catchup,
	"provisioning":  Replica_ReplicationState_STATUS_Provisioning,
	"reconfiguring": Replica_ReplicationState_STATUS_Reconfiguring,
	"updating":      Replica_ReplicationState_STATUS_Updating,
}

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

const (
	Sku_Tier_Burstable       = Sku_Tier("Burstable")
	Sku_Tier_GeneralPurpose  = Sku_Tier("GeneralPurpose")
	Sku_Tier_MemoryOptimized = Sku_Tier("MemoryOptimized")
)

// Mapping from string to Sku_Tier
var sku_Tier_Values = map[string]Sku_Tier{
	"burstable":       Sku_Tier_Burstable,
	"generalpurpose":  Sku_Tier_GeneralPurpose,
	"memoryoptimized": Sku_Tier_MemoryOptimized,
}

type Sku_Tier_STATUS string

const (
	Sku_Tier_STATUS_Burstable       = Sku_Tier_STATUS("Burstable")
	Sku_Tier_STATUS_GeneralPurpose  = Sku_Tier_STATUS("GeneralPurpose")
	Sku_Tier_STATUS_MemoryOptimized = Sku_Tier_STATUS("MemoryOptimized")
)

// Mapping from string to Sku_Tier_STATUS
var sku_Tier_STATUS_Values = map[string]Sku_Tier_STATUS{
	"burstable":       Sku_Tier_STATUS_Burstable,
	"generalpurpose":  Sku_Tier_STATUS_GeneralPurpose,
	"memoryoptimized": Sku_Tier_STATUS_MemoryOptimized,
}

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

const (
	Storage_AutoGrow_Disabled = Storage_AutoGrow("Disabled")
	Storage_AutoGrow_Enabled  = Storage_AutoGrow("Enabled")
)

// Mapping from string to Storage_AutoGrow
var storage_AutoGrow_Values = map[string]Storage_AutoGrow{
	"disabled": Storage_AutoGrow_Disabled,
	"enabled":  Storage_AutoGrow_Enabled,
}

type Storage_AutoGrow_STATUS string

const (
	Storage_AutoGrow_STATUS_Disabled = Storage_AutoGrow_STATUS("Disabled")
	Storage_AutoGrow_STATUS_Enabled  = Storage_AutoGrow_STATUS("Enabled")
)

// Mapping from string to Storage_AutoGrow_STATUS
var storage_AutoGrow_STATUS_Values = map[string]Storage_AutoGrow_STATUS{
	"disabled": Storage_AutoGrow_STATUS_Disabled,
	"enabled":  Storage_AutoGrow_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"P1","P10","P15","P2","P20","P3","P30","P4","P40","P50","P6","P60","P70","P80"}
type Storage_Tier string

const (
	Storage_Tier_P1  = Storage_Tier("P1")
	Storage_Tier_P10 = Storage_Tier("P10")
	Storage_Tier_P15 = Storage_Tier("P15")
	Storage_Tier_P2  = Storage_Tier("P2")
	Storage_Tier_P20 = Storage_Tier("P20")
	Storage_Tier_P3  = Storage_Tier("P3")
	Storage_Tier_P30 = Storage_Tier("P30")
	Storage_Tier_P4  = Storage_Tier("P4")
	Storage_Tier_P40 = Storage_Tier("P40")
	Storage_Tier_P50 = Storage_Tier("P50")
	Storage_Tier_P6  = Storage_Tier("P6")
	Storage_Tier_P60 = Storage_Tier("P60")
	Storage_Tier_P70 = Storage_Tier("P70")
	Storage_Tier_P80 = Storage_Tier("P80")
)

// Mapping from string to Storage_Tier
var storage_Tier_Values = map[string]Storage_Tier{
	"p1":  Storage_Tier_P1,
	"p10": Storage_Tier_P10,
	"p15": Storage_Tier_P15,
	"p2":  Storage_Tier_P2,
	"p20": Storage_Tier_P20,
	"p3":  Storage_Tier_P3,
	"p30": Storage_Tier_P30,
	"p4":  Storage_Tier_P4,
	"p40": Storage_Tier_P40,
	"p50": Storage_Tier_P50,
	"p6":  Storage_Tier_P6,
	"p60": Storage_Tier_P60,
	"p70": Storage_Tier_P70,
	"p80": Storage_Tier_P80,
}

type Storage_Tier_STATUS string

const (
	Storage_Tier_STATUS_P1  = Storage_Tier_STATUS("P1")
	Storage_Tier_STATUS_P10 = Storage_Tier_STATUS("P10")
	Storage_Tier_STATUS_P15 = Storage_Tier_STATUS("P15")
	Storage_Tier_STATUS_P2  = Storage_Tier_STATUS("P2")
	Storage_Tier_STATUS_P20 = Storage_Tier_STATUS("P20")
	Storage_Tier_STATUS_P3  = Storage_Tier_STATUS("P3")
	Storage_Tier_STATUS_P30 = Storage_Tier_STATUS("P30")
	Storage_Tier_STATUS_P4  = Storage_Tier_STATUS("P4")
	Storage_Tier_STATUS_P40 = Storage_Tier_STATUS("P40")
	Storage_Tier_STATUS_P50 = Storage_Tier_STATUS("P50")
	Storage_Tier_STATUS_P6  = Storage_Tier_STATUS("P6")
	Storage_Tier_STATUS_P60 = Storage_Tier_STATUS("P60")
	Storage_Tier_STATUS_P70 = Storage_Tier_STATUS("P70")
	Storage_Tier_STATUS_P80 = Storage_Tier_STATUS("P80")
)

// Mapping from string to Storage_Tier_STATUS
var storage_Tier_STATUS_Values = map[string]Storage_Tier_STATUS{
	"p1":  Storage_Tier_STATUS_P1,
	"p10": Storage_Tier_STATUS_P10,
	"p15": Storage_Tier_STATUS_P15,
	"p2":  Storage_Tier_STATUS_P2,
	"p20": Storage_Tier_STATUS_P20,
	"p3":  Storage_Tier_STATUS_P3,
	"p30": Storage_Tier_STATUS_P30,
	"p4":  Storage_Tier_STATUS_P4,
	"p40": Storage_Tier_STATUS_P40,
	"p50": Storage_Tier_STATUS_P50,
	"p6":  Storage_Tier_STATUS_P6,
	"p60": Storage_Tier_STATUS_P60,
	"p70": Storage_Tier_STATUS_P70,
	"p80": Storage_Tier_STATUS_P80,
}

// +kubebuilder:validation:Enum={"PremiumV2_LRS","Premium_LRS"}
type Storage_Type string

const (
	Storage_Type_PremiumV2_LRS = Storage_Type("PremiumV2_LRS")
	Storage_Type_Premium_LRS   = Storage_Type("Premium_LRS")
)

// Mapping from string to Storage_Type
var storage_Type_Values = map[string]Storage_Type{
	"premiumv2_lrs": Storage_Type_PremiumV2_LRS,
	"premium_lrs":   Storage_Type_Premium_LRS,
}

type Storage_Type_STATUS string

const (
	Storage_Type_STATUS_PremiumV2_LRS = Storage_Type_STATUS("PremiumV2_LRS")
	Storage_Type_STATUS_Premium_LRS   = Storage_Type_STATUS("Premium_LRS")
)

// Mapping from string to Storage_Type_STATUS
var storage_Type_STATUS_Values = map[string]Storage_Type_STATUS{
	"premiumv2_lrs": Storage_Type_STATUS_PremiumV2_LRS,
	"premium_lrs":   Storage_Type_STATUS_Premium_LRS,
}

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

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

const (
	UserAssignedIdentity_Type_None                       = UserAssignedIdentity_Type("None")
	UserAssignedIdentity_Type_SystemAssigned             = UserAssignedIdentity_Type("SystemAssigned")
	UserAssignedIdentity_Type_SystemAssignedUserAssigned = UserAssignedIdentity_Type("SystemAssigned,UserAssigned")
	UserAssignedIdentity_Type_UserAssigned               = UserAssignedIdentity_Type("UserAssigned")
)

// Mapping from string to UserAssignedIdentity_Type
var userAssignedIdentity_Type_Values = map[string]UserAssignedIdentity_Type{
	"none":                        UserAssignedIdentity_Type_None,
	"systemassigned":              UserAssignedIdentity_Type_SystemAssigned,
	"systemassigned,userassigned": UserAssignedIdentity_Type_SystemAssignedUserAssigned,
	"userassigned":                UserAssignedIdentity_Type_UserAssigned,
}

type UserAssignedIdentity_Type_STATUS string

const (
	UserAssignedIdentity_Type_STATUS_None                       = UserAssignedIdentity_Type_STATUS("None")
	UserAssignedIdentity_Type_STATUS_SystemAssigned             = UserAssignedIdentity_Type_STATUS("SystemAssigned")
	UserAssignedIdentity_Type_STATUS_SystemAssignedUserAssigned = UserAssignedIdentity_Type_STATUS("SystemAssigned,UserAssigned")
	UserAssignedIdentity_Type_STATUS_UserAssigned               = UserAssignedIdentity_Type_STATUS("UserAssigned")
)

// Mapping from string to UserAssignedIdentity_Type_STATUS
var userAssignedIdentity_Type_STATUS_Values = map[string]UserAssignedIdentity_Type_STATUS{
	"none":                        UserAssignedIdentity_Type_STATUS_None,
	"systemassigned":              UserAssignedIdentity_Type_STATUS_SystemAssigned,
	"systemassigned,userassigned": UserAssignedIdentity_Type_STATUS_SystemAssignedUserAssigned,
	"userassigned":                UserAssignedIdentity_Type_STATUS_UserAssigned,
}

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

// User assigned managed identity associated with a flexible server.
type UserIdentity_STATUS struct {
	// ClientId: Identifier of the client of the service principal associated to the user assigned managed identity.
	ClientId *string `json:"clientId,omitempty"`

	// PrincipalId: Identifier of the object of the service principal associated to the user assigned managed identity.
	PrincipalId *string `json:"principalId,omitempty"`
}

var _ genruntime.FromARMConverter = &UserIdentity_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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