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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/sql/v1api20211101/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/sql/v1api20211101/storage"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/core"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets"
	"github.com/rotisserie/eris"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,sql}
// +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: /sql/resource-manager/Microsoft.Sql/stable/2021-11-01/FailoverGroups.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}
type ServersFailoverGroup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ServersFailoverGroup_Spec   `json:"spec,omitempty"`
	Status            ServersFailoverGroup_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &ServersFailoverGroup{}

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

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

var _ conversion.Convertible = &ServersFailoverGroup{}

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

	return group.AssignProperties_From_ServersFailoverGroup(source)
}

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

	return group.AssignProperties_To_ServersFailoverGroup(destination)
}

var _ configmaps.Exporter = &ServersFailoverGroup{}

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

var _ secrets.Exporter = &ServersFailoverGroup{}

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

var _ genruntime.ImportableResource = &ServersFailoverGroup{}

// InitializeSpec initializes the spec for this resource from the given status
func (group *ServersFailoverGroup) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*ServersFailoverGroup_STATUS); ok {
		return group.Spec.Initialize_From_ServersFailoverGroup_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &ServersFailoverGroup{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01"
func (group ServersFailoverGroup) GetAPIVersion() string {
	return "2021-11-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Sql/servers/failoverGroups"
func (group *ServersFailoverGroup) GetType() string {
	return "Microsoft.Sql/servers/failoverGroups"
}

// NewEmptyStatus returns a new empty (blank) status
func (group *ServersFailoverGroup) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &ServersFailoverGroup_STATUS{}
}

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

	ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec)
	return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind)
}

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

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

	group.Status = st
	return nil
}

// AssignProperties_From_ServersFailoverGroup populates our ServersFailoverGroup from the provided source ServersFailoverGroup
func (group *ServersFailoverGroup) AssignProperties_From_ServersFailoverGroup(source *storage.ServersFailoverGroup) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ServersFailoverGroup populates the provided destination ServersFailoverGroup from our ServersFailoverGroup
func (group *ServersFailoverGroup) AssignProperties_To_ServersFailoverGroup(destination *storage.ServersFailoverGroup) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /sql/resource-manager/Microsoft.Sql/stable/2021-11-01/FailoverGroups.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}
type ServersFailoverGroupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ServersFailoverGroup `json:"items"`
}

type ServersFailoverGroup_Spec struct {
	// 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"`

	// DatabasesReferences: List of databases in the failover group.
	DatabasesReferences []genruntime.ResourceReference `armReference:"Databases" json:"databasesReferences,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *ServersFailoverGroupOperatorSpec `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 sql.azure.com/Server resource
	Owner *genruntime.KnownResourceReference `group:"sql.azure.com" json:"owner,omitempty" kind:"Server"`

	// +kubebuilder:validation:Required
	// PartnerServers: List of partner server information for the failover group.
	PartnerServers []PartnerInfo `json:"partnerServers,omitempty"`

	// ReadOnlyEndpoint: Read-only endpoint of the failover group instance.
	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`

	// +kubebuilder:validation:Required
	// ReadWriteEndpoint: Read-write endpoint of the failover group instance.
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`

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

var _ genruntime.ARMTransformer = &ServersFailoverGroup_Spec{}

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

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

	// Set property "Properties":
	if group.DatabasesReferences != nil ||
		group.PartnerServers != nil ||
		group.ReadOnlyEndpoint != nil ||
		group.ReadWriteEndpoint != nil {
		result.Properties = &arm.FailoverGroupProperties{}
	}
	for _, item := range group.DatabasesReferences {
		itemARMID, err := resolved.ResolvedReferences.Lookup(item)
		if err != nil {
			return nil, err
		}
		result.Properties.Databases = append(result.Properties.Databases, itemARMID)
	}
	for _, item := range group.PartnerServers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.PartnerServers = append(result.Properties.PartnerServers, *item_ARM.(*arm.PartnerInfo))
	}
	if group.ReadOnlyEndpoint != nil {
		readOnlyEndpoint_ARM, err := group.ReadOnlyEndpoint.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		readOnlyEndpoint := *readOnlyEndpoint_ARM.(*arm.FailoverGroupReadOnlyEndpoint)
		result.Properties.ReadOnlyEndpoint = &readOnlyEndpoint
	}
	if group.ReadWriteEndpoint != nil {
		readWriteEndpoint_ARM, err := group.ReadWriteEndpoint.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		readWriteEndpoint := *readWriteEndpoint_ARM.(*arm.FailoverGroupReadWriteEndpoint)
		result.Properties.ReadWriteEndpoint = &readWriteEndpoint
	}

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

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

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

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

	// no assignment for property "DatabasesReferences"

	// no assignment for property "OperatorSpec"

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

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

	// Set property "ReadOnlyEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReadOnlyEndpoint != nil {
			var readOnlyEndpoint1 FailoverGroupReadOnlyEndpoint
			err := readOnlyEndpoint1.PopulateFromARM(owner, *typedInput.Properties.ReadOnlyEndpoint)
			if err != nil {
				return err
			}
			readOnlyEndpoint := readOnlyEndpoint1
			group.ReadOnlyEndpoint = &readOnlyEndpoint
		}
	}

	// Set property "ReadWriteEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReadWriteEndpoint != nil {
			var readWriteEndpoint1 FailoverGroupReadWriteEndpoint
			err := readWriteEndpoint1.PopulateFromARM(owner, *typedInput.Properties.ReadWriteEndpoint)
			if err != nil {
				return err
			}
			readWriteEndpoint := readWriteEndpoint1
			group.ReadWriteEndpoint = &readWriteEndpoint
		}
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &ServersFailoverGroup_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.ServersFailoverGroup_Spec{}
	err := group.AssignProperties_To_ServersFailoverGroup_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_ServersFailoverGroup_Spec populates our ServersFailoverGroup_Spec from the provided source ServersFailoverGroup_Spec
func (group *ServersFailoverGroup_Spec) AssignProperties_From_ServersFailoverGroup_Spec(source *storage.ServersFailoverGroup_Spec) error {

	// AzureName
	group.AzureName = source.AzureName

	// DatabasesReferences
	if source.DatabasesReferences != nil {
		databasesReferenceList := make([]genruntime.ResourceReference, len(source.DatabasesReferences))
		for databasesReferenceIndex, databasesReferenceItem := range source.DatabasesReferences {
			databasesReferenceList[databasesReferenceIndex] = databasesReferenceItem.Copy()
		}
		group.DatabasesReferences = databasesReferenceList
	} else {
		group.DatabasesReferences = nil
	}

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

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

	// PartnerServers
	if source.PartnerServers != nil {
		partnerServerList := make([]PartnerInfo, len(source.PartnerServers))
		for partnerServerIndex, partnerServerItem := range source.PartnerServers {
			var partnerServer PartnerInfo
			err := partnerServer.AssignProperties_From_PartnerInfo(&partnerServerItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PartnerInfo() to populate field PartnerServers")
			}
			partnerServerList[partnerServerIndex] = partnerServer
		}
		group.PartnerServers = partnerServerList
	} else {
		group.PartnerServers = nil
	}

	// ReadOnlyEndpoint
	if source.ReadOnlyEndpoint != nil {
		var readOnlyEndpoint FailoverGroupReadOnlyEndpoint
		err := readOnlyEndpoint.AssignProperties_From_FailoverGroupReadOnlyEndpoint(source.ReadOnlyEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FailoverGroupReadOnlyEndpoint() to populate field ReadOnlyEndpoint")
		}
		group.ReadOnlyEndpoint = &readOnlyEndpoint
	} else {
		group.ReadOnlyEndpoint = nil
	}

	// ReadWriteEndpoint
	if source.ReadWriteEndpoint != nil {
		var readWriteEndpoint FailoverGroupReadWriteEndpoint
		err := readWriteEndpoint.AssignProperties_From_FailoverGroupReadWriteEndpoint(source.ReadWriteEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FailoverGroupReadWriteEndpoint() to populate field ReadWriteEndpoint")
		}
		group.ReadWriteEndpoint = &readWriteEndpoint
	} else {
		group.ReadWriteEndpoint = nil
	}

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = group.AzureName

	// DatabasesReferences
	if group.DatabasesReferences != nil {
		databasesReferenceList := make([]genruntime.ResourceReference, len(group.DatabasesReferences))
		for databasesReferenceIndex, databasesReferenceItem := range group.DatabasesReferences {
			databasesReferenceList[databasesReferenceIndex] = databasesReferenceItem.Copy()
		}
		destination.DatabasesReferences = databasesReferenceList
	} else {
		destination.DatabasesReferences = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = group.OriginalVersion()

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

	// PartnerServers
	if group.PartnerServers != nil {
		partnerServerList := make([]storage.PartnerInfo, len(group.PartnerServers))
		for partnerServerIndex, partnerServerItem := range group.PartnerServers {
			var partnerServer storage.PartnerInfo
			err := partnerServerItem.AssignProperties_To_PartnerInfo(&partnerServer)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PartnerInfo() to populate field PartnerServers")
			}
			partnerServerList[partnerServerIndex] = partnerServer
		}
		destination.PartnerServers = partnerServerList
	} else {
		destination.PartnerServers = nil
	}

	// ReadOnlyEndpoint
	if group.ReadOnlyEndpoint != nil {
		var readOnlyEndpoint storage.FailoverGroupReadOnlyEndpoint
		err := group.ReadOnlyEndpoint.AssignProperties_To_FailoverGroupReadOnlyEndpoint(&readOnlyEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FailoverGroupReadOnlyEndpoint() to populate field ReadOnlyEndpoint")
		}
		destination.ReadOnlyEndpoint = &readOnlyEndpoint
	} else {
		destination.ReadOnlyEndpoint = nil
	}

	// ReadWriteEndpoint
	if group.ReadWriteEndpoint != nil {
		var readWriteEndpoint storage.FailoverGroupReadWriteEndpoint
		err := group.ReadWriteEndpoint.AssignProperties_To_FailoverGroupReadWriteEndpoint(&readWriteEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FailoverGroupReadWriteEndpoint() to populate field ReadWriteEndpoint")
		}
		destination.ReadWriteEndpoint = &readWriteEndpoint
	} else {
		destination.ReadWriteEndpoint = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_ServersFailoverGroup_STATUS populates our ServersFailoverGroup_Spec from the provided source ServersFailoverGroup_STATUS
func (group *ServersFailoverGroup_Spec) Initialize_From_ServersFailoverGroup_STATUS(source *ServersFailoverGroup_STATUS) error {

	// PartnerServers
	if source.PartnerServers != nil {
		partnerServerList := make([]PartnerInfo, len(source.PartnerServers))
		for partnerServerIndex, partnerServerItem := range source.PartnerServers {
			var partnerServer PartnerInfo
			err := partnerServer.Initialize_From_PartnerInfo_STATUS(&partnerServerItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_PartnerInfo_STATUS() to populate field PartnerServers")
			}
			partnerServerList[partnerServerIndex] = partnerServer
		}
		group.PartnerServers = partnerServerList
	} else {
		group.PartnerServers = nil
	}

	// ReadOnlyEndpoint
	if source.ReadOnlyEndpoint != nil {
		var readOnlyEndpoint FailoverGroupReadOnlyEndpoint
		err := readOnlyEndpoint.Initialize_From_FailoverGroupReadOnlyEndpoint_STATUS(source.ReadOnlyEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_FailoverGroupReadOnlyEndpoint_STATUS() to populate field ReadOnlyEndpoint")
		}
		group.ReadOnlyEndpoint = &readOnlyEndpoint
	} else {
		group.ReadOnlyEndpoint = nil
	}

	// ReadWriteEndpoint
	if source.ReadWriteEndpoint != nil {
		var readWriteEndpoint FailoverGroupReadWriteEndpoint
		err := readWriteEndpoint.Initialize_From_FailoverGroupReadWriteEndpoint_STATUS(source.ReadWriteEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_FailoverGroupReadWriteEndpoint_STATUS() to populate field ReadWriteEndpoint")
		}
		group.ReadWriteEndpoint = &readWriteEndpoint
	} else {
		group.ReadWriteEndpoint = nil
	}

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

	// No error
	return nil
}

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

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

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

	// Databases: List of databases in the failover group.
	Databases []string `json:"databases,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

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

	// Name: Resource name.
	Name *string `json:"name,omitempty"`

	// PartnerServers: List of partner server information for the failover group.
	PartnerServers []PartnerInfo_STATUS `json:"partnerServers,omitempty"`

	// ReadOnlyEndpoint: Read-only endpoint of the failover group instance.
	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint_STATUS `json:"readOnlyEndpoint,omitempty"`

	// ReadWriteEndpoint: Read-write endpoint of the failover group instance.
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint_STATUS `json:"readWriteEndpoint,omitempty"`

	// ReplicationRole: Local replication role of the failover group instance.
	ReplicationRole *FailoverGroupProperties_ReplicationRole_STATUS `json:"replicationRole,omitempty"`

	// ReplicationState: Replication state of the failover group instance.
	ReplicationState *string `json:"replicationState,omitempty"`

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

	// Type: Resource type.
	Type *string `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &ServersFailoverGroup_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.ServersFailoverGroup_STATUS{}
	err := group.AssignProperties_To_ServersFailoverGroup_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 = &ServersFailoverGroup_STATUS{}

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

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

	// no assignment for property "Conditions"

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

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

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

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

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

	// Set property "ReadOnlyEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReadOnlyEndpoint != nil {
			var readOnlyEndpoint1 FailoverGroupReadOnlyEndpoint_STATUS
			err := readOnlyEndpoint1.PopulateFromARM(owner, *typedInput.Properties.ReadOnlyEndpoint)
			if err != nil {
				return err
			}
			readOnlyEndpoint := readOnlyEndpoint1
			group.ReadOnlyEndpoint = &readOnlyEndpoint
		}
	}

	// Set property "ReadWriteEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReadWriteEndpoint != nil {
			var readWriteEndpoint1 FailoverGroupReadWriteEndpoint_STATUS
			err := readWriteEndpoint1.PopulateFromARM(owner, *typedInput.Properties.ReadWriteEndpoint)
			if err != nil {
				return err
			}
			readWriteEndpoint := readWriteEndpoint1
			group.ReadWriteEndpoint = &readWriteEndpoint
		}
	}

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

	// Set property "ReplicationState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ReplicationState != nil {
			replicationState := *typedInput.Properties.ReplicationState
			group.ReplicationState = &replicationState
		}
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_ServersFailoverGroup_STATUS populates our ServersFailoverGroup_STATUS from the provided source ServersFailoverGroup_STATUS
func (group *ServersFailoverGroup_STATUS) AssignProperties_From_ServersFailoverGroup_STATUS(source *storage.ServersFailoverGroup_STATUS) error {

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

	// Databases
	group.Databases = genruntime.CloneSliceOfString(source.Databases)

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

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

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

	// PartnerServers
	if source.PartnerServers != nil {
		partnerServerList := make([]PartnerInfo_STATUS, len(source.PartnerServers))
		for partnerServerIndex, partnerServerItem := range source.PartnerServers {
			var partnerServer PartnerInfo_STATUS
			err := partnerServer.AssignProperties_From_PartnerInfo_STATUS(&partnerServerItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PartnerInfo_STATUS() to populate field PartnerServers")
			}
			partnerServerList[partnerServerIndex] = partnerServer
		}
		group.PartnerServers = partnerServerList
	} else {
		group.PartnerServers = nil
	}

	// ReadOnlyEndpoint
	if source.ReadOnlyEndpoint != nil {
		var readOnlyEndpoint FailoverGroupReadOnlyEndpoint_STATUS
		err := readOnlyEndpoint.AssignProperties_From_FailoverGroupReadOnlyEndpoint_STATUS(source.ReadOnlyEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FailoverGroupReadOnlyEndpoint_STATUS() to populate field ReadOnlyEndpoint")
		}
		group.ReadOnlyEndpoint = &readOnlyEndpoint
	} else {
		group.ReadOnlyEndpoint = nil
	}

	// ReadWriteEndpoint
	if source.ReadWriteEndpoint != nil {
		var readWriteEndpoint FailoverGroupReadWriteEndpoint_STATUS
		err := readWriteEndpoint.AssignProperties_From_FailoverGroupReadWriteEndpoint_STATUS(source.ReadWriteEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FailoverGroupReadWriteEndpoint_STATUS() to populate field ReadWriteEndpoint")
		}
		group.ReadWriteEndpoint = &readWriteEndpoint
	} else {
		group.ReadWriteEndpoint = nil
	}

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

	// ReplicationState
	group.ReplicationState = genruntime.ClonePointerToString(source.ReplicationState)

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

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

	// No error
	return nil
}

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

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

	// Databases
	destination.Databases = genruntime.CloneSliceOfString(group.Databases)

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

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

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

	// PartnerServers
	if group.PartnerServers != nil {
		partnerServerList := make([]storage.PartnerInfo_STATUS, len(group.PartnerServers))
		for partnerServerIndex, partnerServerItem := range group.PartnerServers {
			var partnerServer storage.PartnerInfo_STATUS
			err := partnerServerItem.AssignProperties_To_PartnerInfo_STATUS(&partnerServer)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PartnerInfo_STATUS() to populate field PartnerServers")
			}
			partnerServerList[partnerServerIndex] = partnerServer
		}
		destination.PartnerServers = partnerServerList
	} else {
		destination.PartnerServers = nil
	}

	// ReadOnlyEndpoint
	if group.ReadOnlyEndpoint != nil {
		var readOnlyEndpoint storage.FailoverGroupReadOnlyEndpoint_STATUS
		err := group.ReadOnlyEndpoint.AssignProperties_To_FailoverGroupReadOnlyEndpoint_STATUS(&readOnlyEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FailoverGroupReadOnlyEndpoint_STATUS() to populate field ReadOnlyEndpoint")
		}
		destination.ReadOnlyEndpoint = &readOnlyEndpoint
	} else {
		destination.ReadOnlyEndpoint = nil
	}

	// ReadWriteEndpoint
	if group.ReadWriteEndpoint != nil {
		var readWriteEndpoint storage.FailoverGroupReadWriteEndpoint_STATUS
		err := group.ReadWriteEndpoint.AssignProperties_To_FailoverGroupReadWriteEndpoint_STATUS(&readWriteEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FailoverGroupReadWriteEndpoint_STATUS() to populate field ReadWriteEndpoint")
		}
		destination.ReadWriteEndpoint = &readWriteEndpoint
	} else {
		destination.ReadWriteEndpoint = nil
	}

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

	// ReplicationState
	destination.ReplicationState = genruntime.ClonePointerToString(group.ReplicationState)

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

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

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

	// No error
	return nil
}

type FailoverGroupProperties_ReplicationRole_STATUS string

const (
	FailoverGroupProperties_ReplicationRole_STATUS_Primary   = FailoverGroupProperties_ReplicationRole_STATUS("Primary")
	FailoverGroupProperties_ReplicationRole_STATUS_Secondary = FailoverGroupProperties_ReplicationRole_STATUS("Secondary")
)

// Mapping from string to FailoverGroupProperties_ReplicationRole_STATUS
var failoverGroupProperties_ReplicationRole_STATUS_Values = map[string]FailoverGroupProperties_ReplicationRole_STATUS{
	"primary":   FailoverGroupProperties_ReplicationRole_STATUS_Primary,
	"secondary": FailoverGroupProperties_ReplicationRole_STATUS_Secondary,
}

// Read-only endpoint of the failover group instance.
type FailoverGroupReadOnlyEndpoint struct {
	// FailoverPolicy: Failover policy of the read-only endpoint for the failover group.
	FailoverPolicy *FailoverGroupReadOnlyEndpoint_FailoverPolicy `json:"failoverPolicy,omitempty"`
}

var _ genruntime.ARMTransformer = &FailoverGroupReadOnlyEndpoint{}

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

	// Set property "FailoverPolicy":
	if endpoint.FailoverPolicy != nil {
		var temp string
		temp = string(*endpoint.FailoverPolicy)
		failoverPolicy := arm.FailoverGroupReadOnlyEndpoint_FailoverPolicy(temp)
		result.FailoverPolicy = &failoverPolicy
	}
	return result, nil
}

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

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

	// Set property "FailoverPolicy":
	if typedInput.FailoverPolicy != nil {
		var temp string
		temp = string(*typedInput.FailoverPolicy)
		failoverPolicy := FailoverGroupReadOnlyEndpoint_FailoverPolicy(temp)
		endpoint.FailoverPolicy = &failoverPolicy
	}

	// No error
	return nil
}

// AssignProperties_From_FailoverGroupReadOnlyEndpoint populates our FailoverGroupReadOnlyEndpoint from the provided source FailoverGroupReadOnlyEndpoint
func (endpoint *FailoverGroupReadOnlyEndpoint) AssignProperties_From_FailoverGroupReadOnlyEndpoint(source *storage.FailoverGroupReadOnlyEndpoint) error {

	// FailoverPolicy
	if source.FailoverPolicy != nil {
		failoverPolicy := *source.FailoverPolicy
		failoverPolicyTemp := genruntime.ToEnum(failoverPolicy, failoverGroupReadOnlyEndpoint_FailoverPolicy_Values)
		endpoint.FailoverPolicy = &failoverPolicyTemp
	} else {
		endpoint.FailoverPolicy = nil
	}

	// No error
	return nil
}

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

	// FailoverPolicy
	if endpoint.FailoverPolicy != nil {
		failoverPolicy := string(*endpoint.FailoverPolicy)
		destination.FailoverPolicy = &failoverPolicy
	} else {
		destination.FailoverPolicy = nil
	}

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

	// No error
	return nil
}

// Initialize_From_FailoverGroupReadOnlyEndpoint_STATUS populates our FailoverGroupReadOnlyEndpoint from the provided source FailoverGroupReadOnlyEndpoint_STATUS
func (endpoint *FailoverGroupReadOnlyEndpoint) Initialize_From_FailoverGroupReadOnlyEndpoint_STATUS(source *FailoverGroupReadOnlyEndpoint_STATUS) error {

	// FailoverPolicy
	if source.FailoverPolicy != nil {
		failoverPolicy := genruntime.ToEnum(string(*source.FailoverPolicy), failoverGroupReadOnlyEndpoint_FailoverPolicy_Values)
		endpoint.FailoverPolicy = &failoverPolicy
	} else {
		endpoint.FailoverPolicy = nil
	}

	// No error
	return nil
}

// Read-only endpoint of the failover group instance.
type FailoverGroupReadOnlyEndpoint_STATUS struct {
	// FailoverPolicy: Failover policy of the read-only endpoint for the failover group.
	FailoverPolicy *FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS `json:"failoverPolicy,omitempty"`
}

var _ genruntime.FromARMConverter = &FailoverGroupReadOnlyEndpoint_STATUS{}

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

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

	// Set property "FailoverPolicy":
	if typedInput.FailoverPolicy != nil {
		var temp string
		temp = string(*typedInput.FailoverPolicy)
		failoverPolicy := FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS(temp)
		endpoint.FailoverPolicy = &failoverPolicy
	}

	// No error
	return nil
}

// AssignProperties_From_FailoverGroupReadOnlyEndpoint_STATUS populates our FailoverGroupReadOnlyEndpoint_STATUS from the provided source FailoverGroupReadOnlyEndpoint_STATUS
func (endpoint *FailoverGroupReadOnlyEndpoint_STATUS) AssignProperties_From_FailoverGroupReadOnlyEndpoint_STATUS(source *storage.FailoverGroupReadOnlyEndpoint_STATUS) error {

	// FailoverPolicy
	if source.FailoverPolicy != nil {
		failoverPolicy := *source.FailoverPolicy
		failoverPolicyTemp := genruntime.ToEnum(failoverPolicy, failoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS_Values)
		endpoint.FailoverPolicy = &failoverPolicyTemp
	} else {
		endpoint.FailoverPolicy = nil
	}

	// No error
	return nil
}

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

	// FailoverPolicy
	if endpoint.FailoverPolicy != nil {
		failoverPolicy := string(*endpoint.FailoverPolicy)
		destination.FailoverPolicy = &failoverPolicy
	} else {
		destination.FailoverPolicy = nil
	}

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

	// No error
	return nil
}

// Read-write endpoint of the failover group instance.
type FailoverGroupReadWriteEndpoint struct {
	// +kubebuilder:validation:Required
	// FailoverPolicy: Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then
	// failoverWithDataLossGracePeriodMinutes is required.
	FailoverPolicy *FailoverGroupReadWriteEndpoint_FailoverPolicy `json:"failoverPolicy,omitempty"`

	// FailoverWithDataLossGracePeriodMinutes: Grace period before failover with data loss is attempted for the read-write
	// endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
	FailoverWithDataLossGracePeriodMinutes *int `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
}

var _ genruntime.ARMTransformer = &FailoverGroupReadWriteEndpoint{}

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

	// Set property "FailoverPolicy":
	if endpoint.FailoverPolicy != nil {
		var temp string
		temp = string(*endpoint.FailoverPolicy)
		failoverPolicy := arm.FailoverGroupReadWriteEndpoint_FailoverPolicy(temp)
		result.FailoverPolicy = &failoverPolicy
	}

	// Set property "FailoverWithDataLossGracePeriodMinutes":
	if endpoint.FailoverWithDataLossGracePeriodMinutes != nil {
		failoverWithDataLossGracePeriodMinutes := *endpoint.FailoverWithDataLossGracePeriodMinutes
		result.FailoverWithDataLossGracePeriodMinutes = &failoverWithDataLossGracePeriodMinutes
	}
	return result, nil
}

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

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

	// Set property "FailoverPolicy":
	if typedInput.FailoverPolicy != nil {
		var temp string
		temp = string(*typedInput.FailoverPolicy)
		failoverPolicy := FailoverGroupReadWriteEndpoint_FailoverPolicy(temp)
		endpoint.FailoverPolicy = &failoverPolicy
	}

	// Set property "FailoverWithDataLossGracePeriodMinutes":
	if typedInput.FailoverWithDataLossGracePeriodMinutes != nil {
		failoverWithDataLossGracePeriodMinutes := *typedInput.FailoverWithDataLossGracePeriodMinutes
		endpoint.FailoverWithDataLossGracePeriodMinutes = &failoverWithDataLossGracePeriodMinutes
	}

	// No error
	return nil
}

// AssignProperties_From_FailoverGroupReadWriteEndpoint populates our FailoverGroupReadWriteEndpoint from the provided source FailoverGroupReadWriteEndpoint
func (endpoint *FailoverGroupReadWriteEndpoint) AssignProperties_From_FailoverGroupReadWriteEndpoint(source *storage.FailoverGroupReadWriteEndpoint) error {

	// FailoverPolicy
	if source.FailoverPolicy != nil {
		failoverPolicy := *source.FailoverPolicy
		failoverPolicyTemp := genruntime.ToEnum(failoverPolicy, failoverGroupReadWriteEndpoint_FailoverPolicy_Values)
		endpoint.FailoverPolicy = &failoverPolicyTemp
	} else {
		endpoint.FailoverPolicy = nil
	}

	// FailoverWithDataLossGracePeriodMinutes
	endpoint.FailoverWithDataLossGracePeriodMinutes = genruntime.ClonePointerToInt(source.FailoverWithDataLossGracePeriodMinutes)

	// No error
	return nil
}

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

	// FailoverPolicy
	if endpoint.FailoverPolicy != nil {
		failoverPolicy := string(*endpoint.FailoverPolicy)
		destination.FailoverPolicy = &failoverPolicy
	} else {
		destination.FailoverPolicy = nil
	}

	// FailoverWithDataLossGracePeriodMinutes
	destination.FailoverWithDataLossGracePeriodMinutes = genruntime.ClonePointerToInt(endpoint.FailoverWithDataLossGracePeriodMinutes)

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

	// No error
	return nil
}

// Initialize_From_FailoverGroupReadWriteEndpoint_STATUS populates our FailoverGroupReadWriteEndpoint from the provided source FailoverGroupReadWriteEndpoint_STATUS
func (endpoint *FailoverGroupReadWriteEndpoint) Initialize_From_FailoverGroupReadWriteEndpoint_STATUS(source *FailoverGroupReadWriteEndpoint_STATUS) error {

	// FailoverPolicy
	if source.FailoverPolicy != nil {
		failoverPolicy := genruntime.ToEnum(string(*source.FailoverPolicy), failoverGroupReadWriteEndpoint_FailoverPolicy_Values)
		endpoint.FailoverPolicy = &failoverPolicy
	} else {
		endpoint.FailoverPolicy = nil
	}

	// FailoverWithDataLossGracePeriodMinutes
	endpoint.FailoverWithDataLossGracePeriodMinutes = genruntime.ClonePointerToInt(source.FailoverWithDataLossGracePeriodMinutes)

	// No error
	return nil
}

// Read-write endpoint of the failover group instance.
type FailoverGroupReadWriteEndpoint_STATUS struct {
	// FailoverPolicy: Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then
	// failoverWithDataLossGracePeriodMinutes is required.
	FailoverPolicy *FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS `json:"failoverPolicy,omitempty"`

	// FailoverWithDataLossGracePeriodMinutes: Grace period before failover with data loss is attempted for the read-write
	// endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
	FailoverWithDataLossGracePeriodMinutes *int `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
}

var _ genruntime.FromARMConverter = &FailoverGroupReadWriteEndpoint_STATUS{}

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

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

	// Set property "FailoverPolicy":
	if typedInput.FailoverPolicy != nil {
		var temp string
		temp = string(*typedInput.FailoverPolicy)
		failoverPolicy := FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS(temp)
		endpoint.FailoverPolicy = &failoverPolicy
	}

	// Set property "FailoverWithDataLossGracePeriodMinutes":
	if typedInput.FailoverWithDataLossGracePeriodMinutes != nil {
		failoverWithDataLossGracePeriodMinutes := *typedInput.FailoverWithDataLossGracePeriodMinutes
		endpoint.FailoverWithDataLossGracePeriodMinutes = &failoverWithDataLossGracePeriodMinutes
	}

	// No error
	return nil
}

// AssignProperties_From_FailoverGroupReadWriteEndpoint_STATUS populates our FailoverGroupReadWriteEndpoint_STATUS from the provided source FailoverGroupReadWriteEndpoint_STATUS
func (endpoint *FailoverGroupReadWriteEndpoint_STATUS) AssignProperties_From_FailoverGroupReadWriteEndpoint_STATUS(source *storage.FailoverGroupReadWriteEndpoint_STATUS) error {

	// FailoverPolicy
	if source.FailoverPolicy != nil {
		failoverPolicy := *source.FailoverPolicy
		failoverPolicyTemp := genruntime.ToEnum(failoverPolicy, failoverGroupReadWriteEndpoint_FailoverPolicy_STATUS_Values)
		endpoint.FailoverPolicy = &failoverPolicyTemp
	} else {
		endpoint.FailoverPolicy = nil
	}

	// FailoverWithDataLossGracePeriodMinutes
	endpoint.FailoverWithDataLossGracePeriodMinutes = genruntime.ClonePointerToInt(source.FailoverWithDataLossGracePeriodMinutes)

	// No error
	return nil
}

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

	// FailoverPolicy
	if endpoint.FailoverPolicy != nil {
		failoverPolicy := string(*endpoint.FailoverPolicy)
		destination.FailoverPolicy = &failoverPolicy
	} else {
		destination.FailoverPolicy = nil
	}

	// FailoverWithDataLossGracePeriodMinutes
	destination.FailoverWithDataLossGracePeriodMinutes = genruntime.ClonePointerToInt(endpoint.FailoverWithDataLossGracePeriodMinutes)

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

	// No error
	return nil
}

// Partner server information for the failover group.
type PartnerInfo struct {
	// +kubebuilder:validation:Required
	// Reference: Resource identifier of the partner server.
	Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}

var _ genruntime.ARMTransformer = &PartnerInfo{}

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

	// Set property "Id":
	if info.Reference != nil {
		referenceARMID, err := resolved.ResolvedReferences.Lookup(*info.Reference)
		if err != nil {
			return nil, err
		}
		reference := referenceARMID
		result.Id = &reference
	}
	return result, nil
}

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

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

	// no assignment for property "Reference"

	// No error
	return nil
}

// AssignProperties_From_PartnerInfo populates our PartnerInfo from the provided source PartnerInfo
func (info *PartnerInfo) AssignProperties_From_PartnerInfo(source *storage.PartnerInfo) error {

	// Reference
	if source.Reference != nil {
		reference := source.Reference.Copy()
		info.Reference = &reference
	} else {
		info.Reference = nil
	}

	// No error
	return nil
}

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

	// Reference
	if info.Reference != nil {
		reference := info.Reference.Copy()
		destination.Reference = &reference
	} else {
		destination.Reference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_PartnerInfo_STATUS populates our PartnerInfo from the provided source PartnerInfo_STATUS
func (info *PartnerInfo) Initialize_From_PartnerInfo_STATUS(source *PartnerInfo_STATUS) error {

	// Reference
	if source.Id != nil {
		reference := genruntime.CreateResourceReferenceFromARMID(*source.Id)
		info.Reference = &reference
	} else {
		info.Reference = nil
	}

	// No error
	return nil
}

// Partner server information for the failover group.
type PartnerInfo_STATUS struct {
	// Id: Resource identifier of the partner server.
	Id *string `json:"id,omitempty"`

	// Location: Geo location of the partner server.
	Location *string `json:"location,omitempty"`

	// ReplicationRole: Replication role of the partner server.
	ReplicationRole *PartnerInfo_ReplicationRole_STATUS `json:"replicationRole,omitempty"`
}

var _ genruntime.FromARMConverter = &PartnerInfo_STATUS{}

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

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

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

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

	// Set property "ReplicationRole":
	if typedInput.ReplicationRole != nil {
		var temp string
		temp = string(*typedInput.ReplicationRole)
		replicationRole := PartnerInfo_ReplicationRole_STATUS(temp)
		info.ReplicationRole = &replicationRole
	}

	// No error
	return nil
}

// AssignProperties_From_PartnerInfo_STATUS populates our PartnerInfo_STATUS from the provided source PartnerInfo_STATUS
func (info *PartnerInfo_STATUS) AssignProperties_From_PartnerInfo_STATUS(source *storage.PartnerInfo_STATUS) error {

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

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

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

	// No error
	return nil
}

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

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

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

	// ReplicationRole
	if info.ReplicationRole != nil {
		replicationRole := string(*info.ReplicationRole)
		destination.ReplicationRole = &replicationRole
	} else {
		destination.ReplicationRole = 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 ServersFailoverGroupOperatorSpec struct {
	// ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

	// SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions).
	SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_ServersFailoverGroupOperatorSpec populates our ServersFailoverGroupOperatorSpec from the provided source ServersFailoverGroupOperatorSpec
func (operator *ServersFailoverGroupOperatorSpec) AssignProperties_From_ServersFailoverGroupOperatorSpec(source *storage.ServersFailoverGroupOperatorSpec) error {

	// ConfigMapExpressions
	if source.ConfigMapExpressions != nil {
		configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions))
		for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions {
			if configMapExpressionItem != nil {
				configMapExpression := *configMapExpressionItem.DeepCopy()
				configMapExpressionList[configMapExpressionIndex] = &configMapExpression
			} else {
				configMapExpressionList[configMapExpressionIndex] = nil
			}
		}
		operator.ConfigMapExpressions = configMapExpressionList
	} else {
		operator.ConfigMapExpressions = nil
	}

	// SecretExpressions
	if source.SecretExpressions != nil {
		secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions))
		for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions {
			if secretExpressionItem != nil {
				secretExpression := *secretExpressionItem.DeepCopy()
				secretExpressionList[secretExpressionIndex] = &secretExpression
			} else {
				secretExpressionList[secretExpressionIndex] = nil
			}
		}
		operator.SecretExpressions = secretExpressionList
	} else {
		operator.SecretExpressions = nil
	}

	// No error
	return nil
}

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

	// ConfigMapExpressions
	if operator.ConfigMapExpressions != nil {
		configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions))
		for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions {
			if configMapExpressionItem != nil {
				configMapExpression := *configMapExpressionItem.DeepCopy()
				configMapExpressionList[configMapExpressionIndex] = &configMapExpression
			} else {
				configMapExpressionList[configMapExpressionIndex] = nil
			}
		}
		destination.ConfigMapExpressions = configMapExpressionList
	} else {
		destination.ConfigMapExpressions = nil
	}

	// SecretExpressions
	if operator.SecretExpressions != nil {
		secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions))
		for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions {
			if secretExpressionItem != nil {
				secretExpression := *secretExpressionItem.DeepCopy()
				secretExpressionList[secretExpressionIndex] = &secretExpression
			} else {
				secretExpressionList[secretExpressionIndex] = nil
			}
		}
		destination.SecretExpressions = secretExpressionList
	} else {
		destination.SecretExpressions = nil
	}

	// 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 FailoverGroupReadOnlyEndpoint_FailoverPolicy string

const (
	FailoverGroupReadOnlyEndpoint_FailoverPolicy_Disabled = FailoverGroupReadOnlyEndpoint_FailoverPolicy("Disabled")
	FailoverGroupReadOnlyEndpoint_FailoverPolicy_Enabled  = FailoverGroupReadOnlyEndpoint_FailoverPolicy("Enabled")
)

// Mapping from string to FailoverGroupReadOnlyEndpoint_FailoverPolicy
var failoverGroupReadOnlyEndpoint_FailoverPolicy_Values = map[string]FailoverGroupReadOnlyEndpoint_FailoverPolicy{
	"disabled": FailoverGroupReadOnlyEndpoint_FailoverPolicy_Disabled,
	"enabled":  FailoverGroupReadOnlyEndpoint_FailoverPolicy_Enabled,
}

type FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS string

const (
	FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS_Disabled = FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS("Disabled")
	FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS_Enabled  = FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS("Enabled")
)

// Mapping from string to FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS
var failoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS_Values = map[string]FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS{
	"disabled": FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS_Disabled,
	"enabled":  FailoverGroupReadOnlyEndpoint_FailoverPolicy_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"Automatic","Manual"}
type FailoverGroupReadWriteEndpoint_FailoverPolicy string

const (
	FailoverGroupReadWriteEndpoint_FailoverPolicy_Automatic = FailoverGroupReadWriteEndpoint_FailoverPolicy("Automatic")
	FailoverGroupReadWriteEndpoint_FailoverPolicy_Manual    = FailoverGroupReadWriteEndpoint_FailoverPolicy("Manual")
)

// Mapping from string to FailoverGroupReadWriteEndpoint_FailoverPolicy
var failoverGroupReadWriteEndpoint_FailoverPolicy_Values = map[string]FailoverGroupReadWriteEndpoint_FailoverPolicy{
	"automatic": FailoverGroupReadWriteEndpoint_FailoverPolicy_Automatic,
	"manual":    FailoverGroupReadWriteEndpoint_FailoverPolicy_Manual,
}

type FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS string

const (
	FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS_Automatic = FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS("Automatic")
	FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS_Manual    = FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS("Manual")
)

// Mapping from string to FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS
var failoverGroupReadWriteEndpoint_FailoverPolicy_STATUS_Values = map[string]FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS{
	"automatic": FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS_Automatic,
	"manual":    FailoverGroupReadWriteEndpoint_FailoverPolicy_STATUS_Manual,
}

type PartnerInfo_ReplicationRole_STATUS string

const (
	PartnerInfo_ReplicationRole_STATUS_Primary   = PartnerInfo_ReplicationRole_STATUS("Primary")
	PartnerInfo_ReplicationRole_STATUS_Secondary = PartnerInfo_ReplicationRole_STATUS("Secondary")
)

// Mapping from string to PartnerInfo_ReplicationRole_STATUS
var partnerInfo_ReplicationRole_STATUS_Values = map[string]PartnerInfo_ReplicationRole_STATUS{
	"primary":   PartnerInfo_ReplicationRole_STATUS_Primary,
	"secondary": PartnerInfo_ReplicationRole_STATUS_Secondary,
}

func init() {
	SchemeBuilder.Register(&ServersFailoverGroup{}, &ServersFailoverGroupList{})
}
