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

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

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,documentdb}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Generator information:
// - Generated from: /mongocluster/resource-manager/Microsoft.DocumentDB/MongoCluster/stable/2024-07-01/mongoCluster.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}
type MongoCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              MongoCluster_Spec   `json:"spec,omitempty"`
	Status            MongoCluster_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &MongoCluster{}

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

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

var _ conversion.Convertible = &MongoCluster{}

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

	return cluster.AssignProperties_From_MongoCluster(source)
}

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

	return cluster.AssignProperties_To_MongoCluster(destination)
}

var _ configmaps.Exporter = &MongoCluster{}

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

var _ secrets.Exporter = &MongoCluster{}

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

var _ genruntime.ImportableResource = &MongoCluster{}

// InitializeSpec initializes the spec for this resource from the given status
func (cluster *MongoCluster) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*MongoCluster_STATUS); ok {
		return cluster.Spec.Initialize_From_MongoCluster_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &MongoCluster{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.DocumentDB/mongoClusters"
func (cluster *MongoCluster) GetType() string {
	return "Microsoft.DocumentDB/mongoClusters"
}

// NewEmptyStatus returns a new empty (blank) status
func (cluster *MongoCluster) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &MongoCluster_STATUS{}
}

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

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

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

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

	cluster.Status = st
	return nil
}

// AssignProperties_From_MongoCluster populates our MongoCluster from the provided source MongoCluster
func (cluster *MongoCluster) AssignProperties_From_MongoCluster(source *storage.MongoCluster) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_MongoCluster populates the provided destination MongoCluster from our MongoCluster
func (cluster *MongoCluster) AssignProperties_To_MongoCluster(destination *storage.MongoCluster) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /mongocluster/resource-manager/Microsoft.DocumentDB/MongoCluster/stable/2024-07-01/mongoCluster.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}
type MongoClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MongoCluster `json:"items"`
}

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

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

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

	// Properties: The resource-specific properties for this resource.
	Properties *MongoClusterProperties `json:"properties,omitempty"`

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

var _ genruntime.ARMTransformer = &MongoCluster_Spec{}

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

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

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

	// Set property "Properties":
	if cluster.Properties != nil {
		properties_ARM, err := cluster.Properties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		properties := *properties_ARM.(*arm.MongoClusterProperties)
		result.Properties = &properties
	}

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

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

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

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

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

	// no assignment for property "OperatorSpec"

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

	// Set property "Properties":
	if typedInput.Properties != nil {
		var properties1 MongoClusterProperties
		err := properties1.PopulateFromARM(owner, *typedInput.Properties)
		if err != nil {
			return err
		}
		properties := properties1
		cluster.Properties = &properties
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &MongoCluster_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.MongoCluster_Spec{}
	err := cluster.AssignProperties_To_MongoCluster_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_MongoCluster_Spec populates our MongoCluster_Spec from the provided source MongoCluster_Spec
func (cluster *MongoCluster_Spec) AssignProperties_From_MongoCluster_Spec(source *storage.MongoCluster_Spec) error {

	// AzureName
	cluster.AzureName = source.AzureName

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

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

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

	// Properties
	if source.Properties != nil {
		var property MongoClusterProperties
		err := property.AssignProperties_From_MongoClusterProperties(source.Properties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MongoClusterProperties() to populate field Properties")
		}
		cluster.Properties = &property
	} else {
		cluster.Properties = nil
	}

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = cluster.AzureName

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

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

	// OriginalVersion
	destination.OriginalVersion = cluster.OriginalVersion()

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

	// Properties
	if cluster.Properties != nil {
		var property storage.MongoClusterProperties
		err := cluster.Properties.AssignProperties_To_MongoClusterProperties(&property)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MongoClusterProperties() to populate field Properties")
		}
		destination.Properties = &property
	} else {
		destination.Properties = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_MongoCluster_STATUS populates our MongoCluster_Spec from the provided source MongoCluster_STATUS
func (cluster *MongoCluster_Spec) Initialize_From_MongoCluster_STATUS(source *MongoCluster_STATUS) error {

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

	// Properties
	if source.Properties != nil {
		var property MongoClusterProperties
		err := property.Initialize_From_MongoClusterProperties_STATUS(source.Properties)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_MongoClusterProperties_STATUS() to populate field Properties")
		}
		cluster.Properties = &property
	} else {
		cluster.Properties = nil
	}

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

	// No error
	return nil
}

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

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

// Represents a mongo cluster resource.
type MongoCluster_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

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

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

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

	// Properties: The resource-specific properties for this resource.
	Properties *MongoClusterProperties_STATUS `json:"properties,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"`
}

var _ genruntime.ConvertibleStatus = &MongoCluster_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.MongoCluster_STATUS{}
	err := cluster.AssignProperties_To_MongoCluster_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 = &MongoCluster_STATUS{}

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

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

	// no assignment for property "Conditions"

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

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

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

	// Set property "Properties":
	if typedInput.Properties != nil {
		var properties1 MongoClusterProperties_STATUS
		err := properties1.PopulateFromARM(owner, *typedInput.Properties)
		if err != nil {
			return err
		}
		properties := properties1
		cluster.Properties = &properties
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_MongoCluster_STATUS populates our MongoCluster_STATUS from the provided source MongoCluster_STATUS
func (cluster *MongoCluster_STATUS) AssignProperties_From_MongoCluster_STATUS(source *storage.MongoCluster_STATUS) error {

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

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

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

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

	// Properties
	if source.Properties != nil {
		var property MongoClusterProperties_STATUS
		err := property.AssignProperties_From_MongoClusterProperties_STATUS(source.Properties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MongoClusterProperties_STATUS() to populate field Properties")
		}
		cluster.Properties = &property
	} else {
		cluster.Properties = 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")
		}
		cluster.SystemData = &systemDatum
	} else {
		cluster.SystemData = nil
	}

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

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

	// No error
	return nil
}

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

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

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

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

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

	// Properties
	if cluster.Properties != nil {
		var property storage.MongoClusterProperties_STATUS
		err := cluster.Properties.AssignProperties_To_MongoClusterProperties_STATUS(&property)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MongoClusterProperties_STATUS() to populate field Properties")
		}
		destination.Properties = &property
	} else {
		destination.Properties = nil
	}

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

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

	// 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 MongoClusterOperatorSpec 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_MongoClusterOperatorSpec populates our MongoClusterOperatorSpec from the provided source MongoClusterOperatorSpec
func (operator *MongoClusterOperatorSpec) AssignProperties_From_MongoClusterOperatorSpec(source *storage.MongoClusterOperatorSpec) 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_MongoClusterOperatorSpec populates the provided destination MongoClusterOperatorSpec from our MongoClusterOperatorSpec
func (operator *MongoClusterOperatorSpec) AssignProperties_To_MongoClusterOperatorSpec(destination *storage.MongoClusterOperatorSpec) 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
}

// The properties of a mongo cluster.
type MongoClusterProperties struct {
	// Administrator: The local administrator properties for the mongo cluster.
	Administrator *AdministratorProperties `json:"administrator,omitempty"`

	// Compute: The compute properties of the mongo cluster.
	Compute *ComputeProperties `json:"compute,omitempty"`

	// CreateMode: The mode to create a mongo cluster.
	CreateMode *CreateMode `json:"createMode,omitempty"`

	// HighAvailability: The high availability properties of the mongo cluster.
	HighAvailability *HighAvailabilityProperties `json:"highAvailability,omitempty"`

	// PreviewFeatures: List of private endpoint connections.
	PreviewFeatures []PreviewFeature `json:"previewFeatures,omitempty"`

	// PublicNetworkAccess: Whether or not public endpoint access is allowed for this mongo cluster.
	PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// ReplicaParameters: The parameters to create a replica mongo cluster.
	ReplicaParameters *MongoClusterReplicaParameters `json:"replicaParameters,omitempty"`

	// RestoreParameters: The parameters to create a point-in-time restore mongo cluster.
	RestoreParameters *MongoClusterRestoreParameters `json:"restoreParameters,omitempty"`

	// ServerVersion: The Mongo DB server version. Defaults to the latest available version if not specified.
	ServerVersion *string `json:"serverVersion,omitempty"`

	// Sharding: The sharding properties of the mongo cluster.
	Sharding *ShardingProperties `json:"sharding,omitempty"`

	// Storage: The storage properties of the mongo cluster.
	Storage *StorageProperties `json:"storage,omitempty"`
}

var _ genruntime.ARMTransformer = &MongoClusterProperties{}

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

	// Set property "Administrator":
	if properties.Administrator != nil {
		administrator_ARM, err := properties.Administrator.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		administrator := *administrator_ARM.(*arm.AdministratorProperties)
		result.Administrator = &administrator
	}

	// Set property "Compute":
	if properties.Compute != nil {
		compute_ARM, err := properties.Compute.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		compute := *compute_ARM.(*arm.ComputeProperties)
		result.Compute = &compute
	}

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

	// Set property "HighAvailability":
	if properties.HighAvailability != nil {
		highAvailability_ARM, err := properties.HighAvailability.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		highAvailability := *highAvailability_ARM.(*arm.HighAvailabilityProperties)
		result.HighAvailability = &highAvailability
	}

	// Set property "PreviewFeatures":
	for _, item := range properties.PreviewFeatures {
		var temp string
		temp = string(item)
		result.PreviewFeatures = append(result.PreviewFeatures, arm.PreviewFeature(temp))
	}

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

	// Set property "ReplicaParameters":
	if properties.ReplicaParameters != nil {
		replicaParameters_ARM, err := properties.ReplicaParameters.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		replicaParameters := *replicaParameters_ARM.(*arm.MongoClusterReplicaParameters)
		result.ReplicaParameters = &replicaParameters
	}

	// Set property "RestoreParameters":
	if properties.RestoreParameters != nil {
		restoreParameters_ARM, err := properties.RestoreParameters.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		restoreParameters := *restoreParameters_ARM.(*arm.MongoClusterRestoreParameters)
		result.RestoreParameters = &restoreParameters
	}

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

	// Set property "Sharding":
	if properties.Sharding != nil {
		sharding_ARM, err := properties.Sharding.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sharding := *sharding_ARM.(*arm.ShardingProperties)
		result.Sharding = &sharding
	}

	// Set property "Storage":
	if properties.Storage != nil {
		storage_ARM, err := properties.Storage.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		storage := *storage_ARM.(*arm.StorageProperties)
		result.Storage = &storage
	}
	return result, nil
}

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

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

	// Set property "Administrator":
	if typedInput.Administrator != nil {
		var administrator1 AdministratorProperties
		err := administrator1.PopulateFromARM(owner, *typedInput.Administrator)
		if err != nil {
			return err
		}
		administrator := administrator1
		properties.Administrator = &administrator
	}

	// Set property "Compute":
	if typedInput.Compute != nil {
		var compute1 ComputeProperties
		err := compute1.PopulateFromARM(owner, *typedInput.Compute)
		if err != nil {
			return err
		}
		compute := compute1
		properties.Compute = &compute
	}

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

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

	// Set property "PreviewFeatures":
	for _, item := range typedInput.PreviewFeatures {
		var temp string
		temp = string(item)
		properties.PreviewFeatures = append(properties.PreviewFeatures, PreviewFeature(temp))
	}

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

	// Set property "ReplicaParameters":
	if typedInput.ReplicaParameters != nil {
		var replicaParameters1 MongoClusterReplicaParameters
		err := replicaParameters1.PopulateFromARM(owner, *typedInput.ReplicaParameters)
		if err != nil {
			return err
		}
		replicaParameters := replicaParameters1
		properties.ReplicaParameters = &replicaParameters
	}

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

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

	// Set property "Sharding":
	if typedInput.Sharding != nil {
		var sharding1 ShardingProperties
		err := sharding1.PopulateFromARM(owner, *typedInput.Sharding)
		if err != nil {
			return err
		}
		sharding := sharding1
		properties.Sharding = &sharding
	}

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

	// No error
	return nil
}

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

	// Administrator
	if source.Administrator != nil {
		var administrator AdministratorProperties
		err := administrator.AssignProperties_From_AdministratorProperties(source.Administrator)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AdministratorProperties() to populate field Administrator")
		}
		properties.Administrator = &administrator
	} else {
		properties.Administrator = nil
	}

	// Compute
	if source.Compute != nil {
		var compute ComputeProperties
		err := compute.AssignProperties_From_ComputeProperties(source.Compute)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ComputeProperties() to populate field Compute")
		}
		properties.Compute = &compute
	} else {
		properties.Compute = nil
	}

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

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

	// PreviewFeatures
	if source.PreviewFeatures != nil {
		previewFeatureList := make([]PreviewFeature, len(source.PreviewFeatures))
		for previewFeatureIndex, previewFeatureItem := range source.PreviewFeatures {
			previewFeatureList[previewFeatureIndex] = genruntime.ToEnum(previewFeatureItem, previewFeature_Values)
		}
		properties.PreviewFeatures = previewFeatureList
	} else {
		properties.PreviewFeatures = nil
	}

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

	// ReplicaParameters
	if source.ReplicaParameters != nil {
		var replicaParameter MongoClusterReplicaParameters
		err := replicaParameter.AssignProperties_From_MongoClusterReplicaParameters(source.ReplicaParameters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MongoClusterReplicaParameters() to populate field ReplicaParameters")
		}
		properties.ReplicaParameters = &replicaParameter
	} else {
		properties.ReplicaParameters = nil
	}

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

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

	// Sharding
	if source.Sharding != nil {
		var sharding ShardingProperties
		err := sharding.AssignProperties_From_ShardingProperties(source.Sharding)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ShardingProperties() to populate field Sharding")
		}
		properties.Sharding = &sharding
	} else {
		properties.Sharding = nil
	}

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

	// No error
	return nil
}

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

	// Administrator
	if properties.Administrator != nil {
		var administrator storage.AdministratorProperties
		err := properties.Administrator.AssignProperties_To_AdministratorProperties(&administrator)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AdministratorProperties() to populate field Administrator")
		}
		destination.Administrator = &administrator
	} else {
		destination.Administrator = nil
	}

	// Compute
	if properties.Compute != nil {
		var compute storage.ComputeProperties
		err := properties.Compute.AssignProperties_To_ComputeProperties(&compute)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ComputeProperties() to populate field Compute")
		}
		destination.Compute = &compute
	} else {
		destination.Compute = nil
	}

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

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

	// PreviewFeatures
	if properties.PreviewFeatures != nil {
		previewFeatureList := make([]string, len(properties.PreviewFeatures))
		for previewFeatureIndex, previewFeatureItem := range properties.PreviewFeatures {
			previewFeatureList[previewFeatureIndex] = string(previewFeatureItem)
		}
		destination.PreviewFeatures = previewFeatureList
	} else {
		destination.PreviewFeatures = nil
	}

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

	// ReplicaParameters
	if properties.ReplicaParameters != nil {
		var replicaParameter storage.MongoClusterReplicaParameters
		err := properties.ReplicaParameters.AssignProperties_To_MongoClusterReplicaParameters(&replicaParameter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MongoClusterReplicaParameters() to populate field ReplicaParameters")
		}
		destination.ReplicaParameters = &replicaParameter
	} else {
		destination.ReplicaParameters = nil
	}

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

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

	// Sharding
	if properties.Sharding != nil {
		var sharding storage.ShardingProperties
		err := properties.Sharding.AssignProperties_To_ShardingProperties(&sharding)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ShardingProperties() to populate field Sharding")
		}
		destination.Sharding = &sharding
	} else {
		destination.Sharding = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_MongoClusterProperties_STATUS populates our MongoClusterProperties from the provided source MongoClusterProperties_STATUS
func (properties *MongoClusterProperties) Initialize_From_MongoClusterProperties_STATUS(source *MongoClusterProperties_STATUS) error {

	// Administrator
	if source.Administrator != nil {
		var administrator AdministratorProperties
		err := administrator.Initialize_From_AdministratorProperties_STATUS(source.Administrator)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_AdministratorProperties_STATUS() to populate field Administrator")
		}
		properties.Administrator = &administrator
	} else {
		properties.Administrator = nil
	}

	// Compute
	if source.Compute != nil {
		var compute ComputeProperties
		err := compute.Initialize_From_ComputeProperties_STATUS(source.Compute)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ComputeProperties_STATUS() to populate field Compute")
		}
		properties.Compute = &compute
	} else {
		properties.Compute = nil
	}

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

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

	// PreviewFeatures
	if source.PreviewFeatures != nil {
		previewFeatureList := make([]PreviewFeature, len(source.PreviewFeatures))
		for previewFeatureIndex, previewFeatureItem := range source.PreviewFeatures {
			previewFeature := genruntime.ToEnum(string(previewFeatureItem), previewFeature_Values)
			previewFeatureList[previewFeatureIndex] = previewFeature
		}
		properties.PreviewFeatures = previewFeatureList
	} else {
		properties.PreviewFeatures = nil
	}

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

	// ReplicaParameters
	if source.ReplicaParameters != nil {
		var replicaParameter MongoClusterReplicaParameters
		err := replicaParameter.Initialize_From_MongoClusterReplicaParameters_STATUS(source.ReplicaParameters)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_MongoClusterReplicaParameters_STATUS() to populate field ReplicaParameters")
		}
		properties.ReplicaParameters = &replicaParameter
	} else {
		properties.ReplicaParameters = nil
	}

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

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

	// Sharding
	if source.Sharding != nil {
		var sharding ShardingProperties
		err := sharding.Initialize_From_ShardingProperties_STATUS(source.Sharding)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ShardingProperties_STATUS() to populate field Sharding")
		}
		properties.Sharding = &sharding
	} else {
		properties.Sharding = nil
	}

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

	// No error
	return nil
}

// The properties of a mongo cluster.
type MongoClusterProperties_STATUS struct {
	// Administrator: The local administrator properties for the mongo cluster.
	Administrator *AdministratorProperties_STATUS `json:"administrator,omitempty"`

	// Backup: The backup properties of the mongo cluster.
	Backup *BackupProperties_STATUS `json:"backup,omitempty"`

	// ClusterStatus: The status of the mongo cluster.
	ClusterStatus *MongoClusterStatus_STATUS `json:"clusterStatus,omitempty"`

	// Compute: The compute properties of the mongo cluster.
	Compute *ComputeProperties_STATUS `json:"compute,omitempty"`

	// ConnectionString: The default mongo connection string for the cluster.
	ConnectionString *string `json:"connectionString,omitempty"`

	// CreateMode: The mode to create a mongo cluster.
	CreateMode *CreateMode_STATUS `json:"createMode,omitempty"`

	// HighAvailability: The high availability properties of the mongo cluster.
	HighAvailability *HighAvailabilityProperties_STATUS `json:"highAvailability,omitempty"`

	// InfrastructureVersion: The infrastructure version the cluster is provisioned on.
	InfrastructureVersion *string `json:"infrastructureVersion,omitempty"`

	// PreviewFeatures: List of private endpoint connections.
	PreviewFeatures []PreviewFeature_STATUS `json:"previewFeatures,omitempty"`

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

	// ProvisioningState: The provisioning state of the mongo cluster.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Whether or not public endpoint access is allowed for this mongo cluster.
	PublicNetworkAccess *PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// Replica: The replication properties for the mongo cluster
	Replica *ReplicationProperties_STATUS `json:"replica,omitempty"`

	// ReplicaParameters: The parameters to create a replica mongo cluster.
	ReplicaParameters *MongoClusterReplicaParameters_STATUS `json:"replicaParameters,omitempty"`

	// RestoreParameters: The parameters to create a point-in-time restore mongo cluster.
	RestoreParameters *MongoClusterRestoreParameters_STATUS `json:"restoreParameters,omitempty"`

	// ServerVersion: The Mongo DB server version. Defaults to the latest available version if not specified.
	ServerVersion *string `json:"serverVersion,omitempty"`

	// Sharding: The sharding properties of the mongo cluster.
	Sharding *ShardingProperties_STATUS `json:"sharding,omitempty"`

	// Storage: The storage properties of the mongo cluster.
	Storage *StorageProperties_STATUS `json:"storage,omitempty"`
}

var _ genruntime.FromARMConverter = &MongoClusterProperties_STATUS{}

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

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

	// Set property "Administrator":
	if typedInput.Administrator != nil {
		var administrator1 AdministratorProperties_STATUS
		err := administrator1.PopulateFromARM(owner, *typedInput.Administrator)
		if err != nil {
			return err
		}
		administrator := administrator1
		properties.Administrator = &administrator
	}

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

	// Set property "ClusterStatus":
	if typedInput.ClusterStatus != nil {
		var temp string
		temp = string(*typedInput.ClusterStatus)
		clusterStatus := MongoClusterStatus_STATUS(temp)
		properties.ClusterStatus = &clusterStatus
	}

	// Set property "Compute":
	if typedInput.Compute != nil {
		var compute1 ComputeProperties_STATUS
		err := compute1.PopulateFromARM(owner, *typedInput.Compute)
		if err != nil {
			return err
		}
		compute := compute1
		properties.Compute = &compute
	}

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

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

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

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

	// Set property "PreviewFeatures":
	for _, item := range typedInput.PreviewFeatures {
		var temp string
		temp = string(item)
		properties.PreviewFeatures = append(properties.PreviewFeatures, PreviewFeature_STATUS(temp))
	}

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

	// Set property "ProvisioningState":
	if typedInput.ProvisioningState != nil {
		var temp string
		temp = string(*typedInput.ProvisioningState)
		provisioningState := ProvisioningState_STATUS(temp)
		properties.ProvisioningState = &provisioningState
	}

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

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

	// Set property "ReplicaParameters":
	if typedInput.ReplicaParameters != nil {
		var replicaParameters1 MongoClusterReplicaParameters_STATUS
		err := replicaParameters1.PopulateFromARM(owner, *typedInput.ReplicaParameters)
		if err != nil {
			return err
		}
		replicaParameters := replicaParameters1
		properties.ReplicaParameters = &replicaParameters
	}

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

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

	// Set property "Sharding":
	if typedInput.Sharding != nil {
		var sharding1 ShardingProperties_STATUS
		err := sharding1.PopulateFromARM(owner, *typedInput.Sharding)
		if err != nil {
			return err
		}
		sharding := sharding1
		properties.Sharding = &sharding
	}

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

	// No error
	return nil
}

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

	// Administrator
	if source.Administrator != nil {
		var administrator AdministratorProperties_STATUS
		err := administrator.AssignProperties_From_AdministratorProperties_STATUS(source.Administrator)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AdministratorProperties_STATUS() to populate field Administrator")
		}
		properties.Administrator = &administrator
	} else {
		properties.Administrator = nil
	}

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

	// ClusterStatus
	if source.ClusterStatus != nil {
		clusterStatus := *source.ClusterStatus
		clusterStatusTemp := genruntime.ToEnum(clusterStatus, mongoClusterStatus_STATUS_Values)
		properties.ClusterStatus = &clusterStatusTemp
	} else {
		properties.ClusterStatus = nil
	}

	// Compute
	if source.Compute != nil {
		var compute ComputeProperties_STATUS
		err := compute.AssignProperties_From_ComputeProperties_STATUS(source.Compute)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ComputeProperties_STATUS() to populate field Compute")
		}
		properties.Compute = &compute
	} else {
		properties.Compute = nil
	}

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

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

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

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

	// PreviewFeatures
	if source.PreviewFeatures != nil {
		previewFeatureList := make([]PreviewFeature_STATUS, len(source.PreviewFeatures))
		for previewFeatureIndex, previewFeatureItem := range source.PreviewFeatures {
			previewFeatureList[previewFeatureIndex] = genruntime.ToEnum(previewFeatureItem, previewFeature_STATUS_Values)
		}
		properties.PreviewFeatures = previewFeatureList
	} else {
		properties.PreviewFeatures = nil
	}

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

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, provisioningState_STATUS_Values)
		properties.ProvisioningState = &provisioningStateTemp
	} else {
		properties.ProvisioningState = nil
	}

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

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

	// ReplicaParameters
	if source.ReplicaParameters != nil {
		var replicaParameter MongoClusterReplicaParameters_STATUS
		err := replicaParameter.AssignProperties_From_MongoClusterReplicaParameters_STATUS(source.ReplicaParameters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MongoClusterReplicaParameters_STATUS() to populate field ReplicaParameters")
		}
		properties.ReplicaParameters = &replicaParameter
	} else {
		properties.ReplicaParameters = nil
	}

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

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

	// Sharding
	if source.Sharding != nil {
		var sharding ShardingProperties_STATUS
		err := sharding.AssignProperties_From_ShardingProperties_STATUS(source.Sharding)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ShardingProperties_STATUS() to populate field Sharding")
		}
		properties.Sharding = &sharding
	} else {
		properties.Sharding = nil
	}

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

	// No error
	return nil
}

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

	// Administrator
	if properties.Administrator != nil {
		var administrator storage.AdministratorProperties_STATUS
		err := properties.Administrator.AssignProperties_To_AdministratorProperties_STATUS(&administrator)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AdministratorProperties_STATUS() to populate field Administrator")
		}
		destination.Administrator = &administrator
	} else {
		destination.Administrator = nil
	}

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

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

	// Compute
	if properties.Compute != nil {
		var compute storage.ComputeProperties_STATUS
		err := properties.Compute.AssignProperties_To_ComputeProperties_STATUS(&compute)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ComputeProperties_STATUS() to populate field Compute")
		}
		destination.Compute = &compute
	} else {
		destination.Compute = nil
	}

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

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

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

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

	// PreviewFeatures
	if properties.PreviewFeatures != nil {
		previewFeatureList := make([]string, len(properties.PreviewFeatures))
		for previewFeatureIndex, previewFeatureItem := range properties.PreviewFeatures {
			previewFeatureList[previewFeatureIndex] = string(previewFeatureItem)
		}
		destination.PreviewFeatures = previewFeatureList
	} else {
		destination.PreviewFeatures = nil
	}

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

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

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

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

	// ReplicaParameters
	if properties.ReplicaParameters != nil {
		var replicaParameter storage.MongoClusterReplicaParameters_STATUS
		err := properties.ReplicaParameters.AssignProperties_To_MongoClusterReplicaParameters_STATUS(&replicaParameter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MongoClusterReplicaParameters_STATUS() to populate field ReplicaParameters")
		}
		destination.ReplicaParameters = &replicaParameter
	} else {
		destination.ReplicaParameters = nil
	}

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

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

	// Sharding
	if properties.Sharding != nil {
		var sharding storage.ShardingProperties_STATUS
		err := properties.Sharding.AssignProperties_To_ShardingProperties_STATUS(&sharding)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ShardingProperties_STATUS() to populate field Sharding")
		}
		destination.Sharding = &sharding
	} else {
		destination.Sharding = nil
	}

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

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

	// No error
	return nil
}

// The local administrator login properties.
type AdministratorProperties struct {
	// Password: The administrator password.
	Password *genruntime.SecretReference `json:"password,omitempty"`

	// UserName: The administrator user name.
	UserName *string `json:"userName,omitempty"`
}

var _ genruntime.ARMTransformer = &AdministratorProperties{}

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

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

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

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

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

	// no assignment for property "Password"

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Initialize_From_AdministratorProperties_STATUS populates our AdministratorProperties from the provided source AdministratorProperties_STATUS
func (properties *AdministratorProperties) Initialize_From_AdministratorProperties_STATUS(source *AdministratorProperties_STATUS) error {

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

	// No error
	return nil
}

// The local administrator login properties.
type AdministratorProperties_STATUS struct {
	// UserName: The administrator user name.
	UserName *string `json:"userName,omitempty"`
}

var _ genruntime.FromARMConverter = &AdministratorProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// The backup properties of the cluster. This includes the earliest restore time and retention settings.
type BackupProperties_STATUS struct {
	// EarliestRestoreTime: Earliest restore timestamp in UTC ISO8601 format.
	EarliestRestoreTime *string `json:"earliestRestoreTime,omitempty"`
}

var _ genruntime.FromARMConverter = &BackupProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// The compute properties of the cluster. This includes the virtual-cores/memory and scaling options applied to servers in
// the cluster.
type ComputeProperties struct {
	// Tier: The compute tier to assign to the cluster, where each tier maps to a virtual-core and memory size. Example values:
	// 'M30', 'M40'.
	Tier *string `json:"tier,omitempty"`
}

var _ genruntime.ARMTransformer = &ComputeProperties{}

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

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

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_ComputeProperties_STATUS populates our ComputeProperties from the provided source ComputeProperties_STATUS
func (properties *ComputeProperties) Initialize_From_ComputeProperties_STATUS(source *ComputeProperties_STATUS) error {

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

	// No error
	return nil
}

// The compute properties of the cluster. This includes the virtual-cores/memory and scaling options applied to servers in
// the cluster.
type ComputeProperties_STATUS struct {
	// Tier: The compute tier to assign to the cluster, where each tier maps to a virtual-core and memory size. Example values:
	// 'M30', 'M40'.
	Tier *string `json:"tier,omitempty"`
}

var _ genruntime.FromARMConverter = &ComputeProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// The mode that the Mongo Cluster is created with.
// +kubebuilder:validation:Enum={"Default","GeoReplica","PointInTimeRestore","Replica"}
type CreateMode string

const (
	CreateMode_Default            = CreateMode("Default")
	CreateMode_GeoReplica         = CreateMode("GeoReplica")
	CreateMode_PointInTimeRestore = CreateMode("PointInTimeRestore")
	CreateMode_Replica            = CreateMode("Replica")
)

// Mapping from string to CreateMode
var createMode_Values = map[string]CreateMode{
	"default":            CreateMode_Default,
	"georeplica":         CreateMode_GeoReplica,
	"pointintimerestore": CreateMode_PointInTimeRestore,
	"replica":            CreateMode_Replica,
}

// The mode that the Mongo Cluster is created with.
type CreateMode_STATUS string

const (
	CreateMode_STATUS_Default            = CreateMode_STATUS("Default")
	CreateMode_STATUS_GeoReplica         = CreateMode_STATUS("GeoReplica")
	CreateMode_STATUS_PointInTimeRestore = CreateMode_STATUS("PointInTimeRestore")
	CreateMode_STATUS_Replica            = CreateMode_STATUS("Replica")
)

// Mapping from string to CreateMode_STATUS
var createMode_STATUS_Values = map[string]CreateMode_STATUS{
	"default":            CreateMode_STATUS_Default,
	"georeplica":         CreateMode_STATUS_GeoReplica,
	"pointintimerestore": CreateMode_STATUS_PointInTimeRestore,
	"replica":            CreateMode_STATUS_Replica,
}

// The high availability properties of the cluster.
type HighAvailabilityProperties struct {
	// TargetMode: The target high availability mode requested for the cluster.
	TargetMode *HighAvailabilityMode `json:"targetMode,omitempty"`
}

var _ genruntime.ARMTransformer = &HighAvailabilityProperties{}

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

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

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

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

	// Set property "TargetMode":
	if typedInput.TargetMode != nil {
		var temp string
		temp = string(*typedInput.TargetMode)
		targetMode := HighAvailabilityMode(temp)
		properties.TargetMode = &targetMode
	}

	// No error
	return nil
}

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

	// TargetMode
	if source.TargetMode != nil {
		targetMode := *source.TargetMode
		targetModeTemp := genruntime.ToEnum(targetMode, highAvailabilityMode_Values)
		properties.TargetMode = &targetModeTemp
	} else {
		properties.TargetMode = nil
	}

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_HighAvailabilityProperties_STATUS populates our HighAvailabilityProperties from the provided source HighAvailabilityProperties_STATUS
func (properties *HighAvailabilityProperties) Initialize_From_HighAvailabilityProperties_STATUS(source *HighAvailabilityProperties_STATUS) error {

	// TargetMode
	if source.TargetMode != nil {
		targetMode := genruntime.ToEnum(string(*source.TargetMode), highAvailabilityMode_Values)
		properties.TargetMode = &targetMode
	} else {
		properties.TargetMode = nil
	}

	// No error
	return nil
}

// The high availability properties of the cluster.
type HighAvailabilityProperties_STATUS struct {
	// TargetMode: The target high availability mode requested for the cluster.
	TargetMode *HighAvailabilityMode_STATUS `json:"targetMode,omitempty"`
}

var _ genruntime.FromARMConverter = &HighAvailabilityProperties_STATUS{}

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

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

	// Set property "TargetMode":
	if typedInput.TargetMode != nil {
		var temp string
		temp = string(*typedInput.TargetMode)
		targetMode := HighAvailabilityMode_STATUS(temp)
		properties.TargetMode = &targetMode
	}

	// No error
	return nil
}

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

	// TargetMode
	if source.TargetMode != nil {
		targetMode := *source.TargetMode
		targetModeTemp := genruntime.ToEnum(targetMode, highAvailabilityMode_STATUS_Values)
		properties.TargetMode = &targetModeTemp
	} else {
		properties.TargetMode = nil
	}

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Parameters used for replica operations.
type MongoClusterReplicaParameters struct {
	// +kubebuilder:validation:Required
	// SourceLocation: The location of the source cluster
	SourceLocation *string `json:"sourceLocation,omitempty"`

	// +kubebuilder:validation:Required
	// SourceResourceReference: The id of the replication source cluster.
	SourceResourceReference *genruntime.ResourceReference `armReference:"SourceResourceId" json:"sourceResourceReference,omitempty"`
}

var _ genruntime.ARMTransformer = &MongoClusterReplicaParameters{}

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

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

	// Set property "SourceResourceId":
	if parameters.SourceResourceReference != nil {
		sourceResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*parameters.SourceResourceReference)
		if err != nil {
			return nil, err
		}
		sourceResourceReference := sourceResourceReferenceARMID
		result.SourceResourceId = &sourceResourceReference
	}
	return result, nil
}

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

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

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

	// no assignment for property "SourceResourceReference"

	// No error
	return nil
}

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

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

	// SourceResourceReference
	if source.SourceResourceReference != nil {
		sourceResourceReference := source.SourceResourceReference.Copy()
		parameters.SourceResourceReference = &sourceResourceReference
	} else {
		parameters.SourceResourceReference = nil
	}

	// No error
	return nil
}

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

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

	// SourceResourceReference
	if parameters.SourceResourceReference != nil {
		sourceResourceReference := parameters.SourceResourceReference.Copy()
		destination.SourceResourceReference = &sourceResourceReference
	} else {
		destination.SourceResourceReference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_MongoClusterReplicaParameters_STATUS populates our MongoClusterReplicaParameters from the provided source MongoClusterReplicaParameters_STATUS
func (parameters *MongoClusterReplicaParameters) Initialize_From_MongoClusterReplicaParameters_STATUS(source *MongoClusterReplicaParameters_STATUS) error {

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

	// SourceResourceReference
	if source.SourceResourceId != nil {
		sourceResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.SourceResourceId)
		parameters.SourceResourceReference = &sourceResourceReference
	} else {
		parameters.SourceResourceReference = nil
	}

	// No error
	return nil
}

// Parameters used for replica operations.
type MongoClusterReplicaParameters_STATUS struct {
	// SourceLocation: The location of the source cluster
	SourceLocation *string `json:"sourceLocation,omitempty"`

	// SourceResourceId: The id of the replication source cluster.
	SourceResourceId *string `json:"sourceResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &MongoClusterReplicaParameters_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Parameters used for restore operations
type MongoClusterRestoreParameters struct {
	// PointInTimeUTC: UTC point in time to restore a mongo cluster
	PointInTimeUTC *string `json:"pointInTimeUTC,omitempty"`

	// SourceResourceReference: Resource ID to locate the source cluster to restore
	SourceResourceReference *genruntime.ResourceReference `armReference:"SourceResourceId" json:"sourceResourceReference,omitempty"`
}

var _ genruntime.ARMTransformer = &MongoClusterRestoreParameters{}

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

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

	// Set property "SourceResourceId":
	if parameters.SourceResourceReference != nil {
		sourceResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*parameters.SourceResourceReference)
		if err != nil {
			return nil, err
		}
		sourceResourceReference := sourceResourceReferenceARMID
		result.SourceResourceId = &sourceResourceReference
	}
	return result, nil
}

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

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

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

	// no assignment for property "SourceResourceReference"

	// No error
	return nil
}

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

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

	// SourceResourceReference
	if source.SourceResourceReference != nil {
		sourceResourceReference := source.SourceResourceReference.Copy()
		parameters.SourceResourceReference = &sourceResourceReference
	} else {
		parameters.SourceResourceReference = nil
	}

	// No error
	return nil
}

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

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

	// SourceResourceReference
	if parameters.SourceResourceReference != nil {
		sourceResourceReference := parameters.SourceResourceReference.Copy()
		destination.SourceResourceReference = &sourceResourceReference
	} else {
		destination.SourceResourceReference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_MongoClusterRestoreParameters_STATUS populates our MongoClusterRestoreParameters from the provided source MongoClusterRestoreParameters_STATUS
func (parameters *MongoClusterRestoreParameters) Initialize_From_MongoClusterRestoreParameters_STATUS(source *MongoClusterRestoreParameters_STATUS) error {

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

	// SourceResourceReference
	if source.SourceResourceId != nil {
		sourceResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.SourceResourceId)
		parameters.SourceResourceReference = &sourceResourceReference
	} else {
		parameters.SourceResourceReference = nil
	}

	// No error
	return nil
}

// Parameters used for restore operations
type MongoClusterRestoreParameters_STATUS struct {
	// PointInTimeUTC: UTC point in time to restore a mongo cluster
	PointInTimeUTC *string `json:"pointInTimeUTC,omitempty"`

	// SourceResourceId: Resource ID to locate the source cluster to restore
	SourceResourceId *string `json:"sourceResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &MongoClusterRestoreParameters_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// The status of the Mongo cluster resource.
type MongoClusterStatus_STATUS string

const (
	MongoClusterStatus_STATUS_Dropping     = MongoClusterStatus_STATUS("Dropping")
	MongoClusterStatus_STATUS_Provisioning = MongoClusterStatus_STATUS("Provisioning")
	MongoClusterStatus_STATUS_Ready        = MongoClusterStatus_STATUS("Ready")
	MongoClusterStatus_STATUS_Starting     = MongoClusterStatus_STATUS("Starting")
	MongoClusterStatus_STATUS_Stopped      = MongoClusterStatus_STATUS("Stopped")
	MongoClusterStatus_STATUS_Stopping     = MongoClusterStatus_STATUS("Stopping")
	MongoClusterStatus_STATUS_Updating     = MongoClusterStatus_STATUS("Updating")
)

// Mapping from string to MongoClusterStatus_STATUS
var mongoClusterStatus_STATUS_Values = map[string]MongoClusterStatus_STATUS{
	"dropping":     MongoClusterStatus_STATUS_Dropping,
	"provisioning": MongoClusterStatus_STATUS_Provisioning,
	"ready":        MongoClusterStatus_STATUS_Ready,
	"starting":     MongoClusterStatus_STATUS_Starting,
	"stopped":      MongoClusterStatus_STATUS_Stopped,
	"stopping":     MongoClusterStatus_STATUS_Stopping,
	"updating":     MongoClusterStatus_STATUS_Updating,
}

// Preview features that can be enabled on a mongo cluster.
// +kubebuilder:validation:Enum={"GeoReplicas"}
type PreviewFeature string

const PreviewFeature_GeoReplicas = PreviewFeature("GeoReplicas")

// Mapping from string to PreviewFeature
var previewFeature_Values = map[string]PreviewFeature{
	"georeplicas": PreviewFeature_GeoReplicas,
}

// Preview features that can be enabled on a mongo cluster.
type PreviewFeature_STATUS string

const PreviewFeature_STATUS_GeoReplicas = PreviewFeature_STATUS("GeoReplicas")

// Mapping from string to PreviewFeature_STATUS
var previewFeature_STATUS_Values = map[string]PreviewFeature_STATUS{
	"georeplicas": PreviewFeature_STATUS_GeoReplicas,
}

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

// Whether or not public endpoint access is allowed for this Mongo cluster.  Value is optional and default value is
// 'Enabled'
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type PublicNetworkAccess string

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

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

// Whether or not public endpoint access is allowed for this Mongo cluster.  Value is optional and default value is
// 'Enabled'
type PublicNetworkAccess_STATUS string

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

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

// Replica properties of the mongo cluster.
type ReplicationProperties_STATUS struct {
	// ReplicationState: The replication link state of the replica cluster.
	ReplicationState *ReplicationState_STATUS `json:"replicationState,omitempty"`

	// Role: The replication role of the cluster
	Role *ReplicationRole_STATUS `json:"role,omitempty"`

	// SourceResourceId: The resource id the source cluster for the replica cluster.
	SourceResourceId *string `json:"sourceResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &ReplicationProperties_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// The sharding properties of the cluster. This includes the shard count and scaling options for the cluster.
type ShardingProperties struct {
	// ShardCount: Number of shards to provision on the cluster.
	ShardCount *int `json:"shardCount,omitempty"`
}

var _ genruntime.ARMTransformer = &ShardingProperties{}

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

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

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

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

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

	// No error
	return nil
}

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

	// ShardCount
	properties.ShardCount = genruntime.ClonePointerToInt(source.ShardCount)

	// No error
	return nil
}

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

	// ShardCount
	destination.ShardCount = genruntime.ClonePointerToInt(properties.ShardCount)

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

	// No error
	return nil
}

// Initialize_From_ShardingProperties_STATUS populates our ShardingProperties from the provided source ShardingProperties_STATUS
func (properties *ShardingProperties) Initialize_From_ShardingProperties_STATUS(source *ShardingProperties_STATUS) error {

	// ShardCount
	properties.ShardCount = genruntime.ClonePointerToInt(source.ShardCount)

	// No error
	return nil
}

// The sharding properties of the cluster. This includes the shard count and scaling options for the cluster.
type ShardingProperties_STATUS struct {
	// ShardCount: Number of shards to provision on the cluster.
	ShardCount *int `json:"shardCount,omitempty"`
}

var _ genruntime.FromARMConverter = &ShardingProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

	// ShardCount
	properties.ShardCount = genruntime.ClonePointerToInt(source.ShardCount)

	// No error
	return nil
}

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

	// ShardCount
	destination.ShardCount = genruntime.ClonePointerToInt(properties.ShardCount)

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

	// No error
	return nil
}

// The storage properties of the cluster. This includes the data storage size and scaling applied to servers in the cluster.
type StorageProperties struct {
	// SizeGb: The size of the data disk assigned to each server.
	SizeGb *int `json:"sizeGb,omitempty"`
}

var _ genruntime.ARMTransformer = &StorageProperties{}

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

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

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

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

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

	// No error
	return nil
}

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

	// SizeGb
	properties.SizeGb = genruntime.ClonePointerToInt(source.SizeGb)

	// No error
	return nil
}

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

	// SizeGb
	destination.SizeGb = genruntime.ClonePointerToInt(properties.SizeGb)

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

	// No error
	return nil
}

// Initialize_From_StorageProperties_STATUS populates our StorageProperties from the provided source StorageProperties_STATUS
func (properties *StorageProperties) Initialize_From_StorageProperties_STATUS(source *StorageProperties_STATUS) error {

	// SizeGb
	properties.SizeGb = genruntime.ClonePointerToInt(source.SizeGb)

	// No error
	return nil
}

// The storage properties of the cluster. This includes the data storage size and scaling applied to servers in the cluster.
type StorageProperties_STATUS struct {
	// SizeGb: The size of the data disk assigned to each server.
	SizeGb *int `json:"sizeGb,omitempty"`
}

var _ genruntime.FromARMConverter = &StorageProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

	// SizeGb
	properties.SizeGb = genruntime.ClonePointerToInt(source.SizeGb)

	// No error
	return nil
}

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

	// SizeGb
	destination.SizeGb = genruntime.ClonePointerToInt(properties.SizeGb)

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

	// No error
	return nil
}

// The high availability modes for a cluster.
// +kubebuilder:validation:Enum={"Disabled","SameZone","ZoneRedundantPreferred"}
type HighAvailabilityMode string

const (
	HighAvailabilityMode_Disabled               = HighAvailabilityMode("Disabled")
	HighAvailabilityMode_SameZone               = HighAvailabilityMode("SameZone")
	HighAvailabilityMode_ZoneRedundantPreferred = HighAvailabilityMode("ZoneRedundantPreferred")
)

// Mapping from string to HighAvailabilityMode
var highAvailabilityMode_Values = map[string]HighAvailabilityMode{
	"disabled":               HighAvailabilityMode_Disabled,
	"samezone":               HighAvailabilityMode_SameZone,
	"zoneredundantpreferred": HighAvailabilityMode_ZoneRedundantPreferred,
}

// The high availability modes for a cluster.
type HighAvailabilityMode_STATUS string

const (
	HighAvailabilityMode_STATUS_Disabled               = HighAvailabilityMode_STATUS("Disabled")
	HighAvailabilityMode_STATUS_SameZone               = HighAvailabilityMode_STATUS("SameZone")
	HighAvailabilityMode_STATUS_ZoneRedundantPreferred = HighAvailabilityMode_STATUS("ZoneRedundantPreferred")
)

// Mapping from string to HighAvailabilityMode_STATUS
var highAvailabilityMode_STATUS_Values = map[string]HighAvailabilityMode_STATUS{
	"disabled":               HighAvailabilityMode_STATUS_Disabled,
	"samezone":               HighAvailabilityMode_STATUS_SameZone,
	"zoneredundantpreferred": HighAvailabilityMode_STATUS_ZoneRedundantPreferred,
}

// Replication role of the mongo cluster.
type ReplicationRole_STATUS string

const (
	ReplicationRole_STATUS_AsyncReplica    = ReplicationRole_STATUS("AsyncReplica")
	ReplicationRole_STATUS_GeoAsyncReplica = ReplicationRole_STATUS("GeoAsyncReplica")
	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,
	"primary":         ReplicationRole_STATUS_Primary,
}

// The state of the replication link between the replica and source cluster.
type ReplicationState_STATUS string

const (
	ReplicationState_STATUS_Active        = ReplicationState_STATUS("Active")
	ReplicationState_STATUS_Broken        = ReplicationState_STATUS("Broken")
	ReplicationState_STATUS_Catchup       = ReplicationState_STATUS("Catchup")
	ReplicationState_STATUS_Provisioning  = ReplicationState_STATUS("Provisioning")
	ReplicationState_STATUS_Reconfiguring = ReplicationState_STATUS("Reconfiguring")
	ReplicationState_STATUS_Updating      = ReplicationState_STATUS("Updating")
)

// Mapping from string to ReplicationState_STATUS
var replicationState_STATUS_Values = map[string]ReplicationState_STATUS{
	"active":        ReplicationState_STATUS_Active,
	"broken":        ReplicationState_STATUS_Broken,
	"catchup":       ReplicationState_STATUS_Catchup,
	"provisioning":  ReplicationState_STATUS_Provisioning,
	"reconfiguring": ReplicationState_STATUS_Reconfiguring,
	"updating":      ReplicationState_STATUS_Updating,
}

func init() {
	SchemeBuilder.Register(&MongoCluster{}, &MongoClusterList{})
}
