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

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

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,documentdb}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Generator information:
// - Generated from: /cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-08-15/cosmos-db.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}
type SqlDatabaseContainer struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              SqlDatabaseContainer_Spec   `json:"spec,omitempty"`
	Status            SqlDatabaseContainer_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &SqlDatabaseContainer{}

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

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

var _ conversion.Convertible = &SqlDatabaseContainer{}

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

	return container.AssignProperties_From_SqlDatabaseContainer(source)
}

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

	return container.AssignProperties_To_SqlDatabaseContainer(destination)
}

var _ configmaps.Exporter = &SqlDatabaseContainer{}

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

var _ secrets.Exporter = &SqlDatabaseContainer{}

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

var _ genruntime.ImportableResource = &SqlDatabaseContainer{}

// InitializeSpec initializes the spec for this resource from the given status
func (container *SqlDatabaseContainer) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*SqlDatabaseContainer_STATUS); ok {
		return container.Spec.Initialize_From_SqlDatabaseContainer_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &SqlDatabaseContainer{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-08-15"
func (container SqlDatabaseContainer) GetAPIVersion() string {
	return "2024-08-15"
}

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

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

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

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

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

// NewEmptyStatus returns a new empty (blank) status
func (container *SqlDatabaseContainer) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &SqlDatabaseContainer_STATUS{}
}

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

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

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

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

	container.Status = st
	return nil
}

// AssignProperties_From_SqlDatabaseContainer populates our SqlDatabaseContainer from the provided source SqlDatabaseContainer
func (container *SqlDatabaseContainer) AssignProperties_From_SqlDatabaseContainer(source *storage.SqlDatabaseContainer) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_SqlDatabaseContainer populates the provided destination SqlDatabaseContainer from our SqlDatabaseContainer
func (container *SqlDatabaseContainer) AssignProperties_To_SqlDatabaseContainer(destination *storage.SqlDatabaseContainer) error {

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

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

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

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

type SqlDatabaseContainer_Spec struct {
	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName string `json:"azureName,omitempty"`

	// Location: The location of the resource group to which the resource belongs.
	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 *SqlDatabaseContainerOperatorSpec `json:"operatorSpec,omitempty"`

	// Options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the
	// request.
	Options *CreateUpdateOptions `json:"options,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 documentdb.azure.com/SqlDatabase resource
	Owner *genruntime.KnownResourceReference `group:"documentdb.azure.com" json:"owner,omitempty" kind:"SqlDatabase"`

	// +kubebuilder:validation:Required
	// Resource: The standard JSON format of a container
	Resource *SqlContainerResource `json:"resource,omitempty"`
	Tags     map[string]string     `json:"tags,omitempty"`
}

var _ genruntime.ARMTransformer = &SqlDatabaseContainer_Spec{}

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

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

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

	// Set property "Properties":
	if container.Options != nil || container.Resource != nil {
		result.Properties = &arm.SqlContainerCreateUpdateProperties{}
	}
	if container.Options != nil {
		options_ARM, err := container.Options.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		options := *options_ARM.(*arm.CreateUpdateOptions)
		result.Properties.Options = &options
	}
	if container.Resource != nil {
		resource_ARM, err := container.Resource.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		resource := *resource_ARM.(*arm.SqlContainerResource)
		result.Properties.Resource = &resource
	}

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

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

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

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

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

	// no assignment for property "OperatorSpec"

	// Set property "Options":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Options != nil {
			var options1 CreateUpdateOptions
			err := options1.PopulateFromARM(owner, *typedInput.Properties.Options)
			if err != nil {
				return err
			}
			options := options1
			container.Options = &options
		}
	}

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

	// Set property "Resource":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Resource != nil {
			var resource1 SqlContainerResource
			err := resource1.PopulateFromARM(owner, *typedInput.Properties.Resource)
			if err != nil {
				return err
			}
			resource := resource1
			container.Resource = &resource
		}
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &SqlDatabaseContainer_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.SqlDatabaseContainer_Spec{}
	err := container.AssignProperties_To_SqlDatabaseContainer_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_SqlDatabaseContainer_Spec populates our SqlDatabaseContainer_Spec from the provided source SqlDatabaseContainer_Spec
func (container *SqlDatabaseContainer_Spec) AssignProperties_From_SqlDatabaseContainer_Spec(source *storage.SqlDatabaseContainer_Spec) error {

	// AzureName
	container.AzureName = source.AzureName

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

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

	// Options
	if source.Options != nil {
		var option CreateUpdateOptions
		err := option.AssignProperties_From_CreateUpdateOptions(source.Options)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CreateUpdateOptions() to populate field Options")
		}
		container.Options = &option
	} else {
		container.Options = nil
	}

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

	// Resource
	if source.Resource != nil {
		var resource SqlContainerResource
		err := resource.AssignProperties_From_SqlContainerResource(source.Resource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SqlContainerResource() to populate field Resource")
		}
		container.Resource = &resource
	} else {
		container.Resource = nil
	}

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = container.AzureName

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

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

	// Options
	if container.Options != nil {
		var option storage.CreateUpdateOptions
		err := container.Options.AssignProperties_To_CreateUpdateOptions(&option)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CreateUpdateOptions() to populate field Options")
		}
		destination.Options = &option
	} else {
		destination.Options = nil
	}

	// OriginalVersion
	destination.OriginalVersion = container.OriginalVersion()

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

	// Resource
	if container.Resource != nil {
		var resource storage.SqlContainerResource
		err := container.Resource.AssignProperties_To_SqlContainerResource(&resource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SqlContainerResource() to populate field Resource")
		}
		destination.Resource = &resource
	} else {
		destination.Resource = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_SqlDatabaseContainer_STATUS populates our SqlDatabaseContainer_Spec from the provided source SqlDatabaseContainer_STATUS
func (container *SqlDatabaseContainer_Spec) Initialize_From_SqlDatabaseContainer_STATUS(source *SqlDatabaseContainer_STATUS) error {

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

	// Options
	if source.Options != nil {
		var option CreateUpdateOptions
		err := option.Initialize_From_OptionsResource_STATUS(source.Options)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_OptionsResource_STATUS() to populate field Options")
		}
		container.Options = &option
	} else {
		container.Options = nil
	}

	// Resource
	if source.Resource != nil {
		var resource SqlContainerResource
		err := resource.Initialize_From_SqlContainerGetProperties_Resource_STATUS(source.Resource)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SqlContainerGetProperties_Resource_STATUS() to populate field Resource")
		}
		container.Resource = &resource
	} else {
		container.Resource = nil
	}

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

	// No error
	return nil
}

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

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

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

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

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

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

	// Options: Cosmos DB options resource object
	Options  *OptionsResource_STATUS                    `json:"options,omitempty"`
	Resource *SqlContainerGetProperties_Resource_STATUS `json:"resource,omitempty"`
	Tags     map[string]string                          `json:"tags,omitempty"`

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

var _ genruntime.ConvertibleStatus = &SqlDatabaseContainer_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.SqlDatabaseContainer_STATUS{}
	err := container.AssignProperties_To_SqlDatabaseContainer_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 = &SqlDatabaseContainer_STATUS{}

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

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

	// no assignment for property "Conditions"

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

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

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

	// Set property "Options":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Options != nil {
			var options1 OptionsResource_STATUS
			err := options1.PopulateFromARM(owner, *typedInput.Properties.Options)
			if err != nil {
				return err
			}
			options := options1
			container.Options = &options
		}
	}

	// Set property "Resource":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Resource != nil {
			var resource1 SqlContainerGetProperties_Resource_STATUS
			err := resource1.PopulateFromARM(owner, *typedInput.Properties.Resource)
			if err != nil {
				return err
			}
			resource := resource1
			container.Resource = &resource
		}
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_SqlDatabaseContainer_STATUS populates our SqlDatabaseContainer_STATUS from the provided source SqlDatabaseContainer_STATUS
func (container *SqlDatabaseContainer_STATUS) AssignProperties_From_SqlDatabaseContainer_STATUS(source *storage.SqlDatabaseContainer_STATUS) error {

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

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

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

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

	// Options
	if source.Options != nil {
		var option OptionsResource_STATUS
		err := option.AssignProperties_From_OptionsResource_STATUS(source.Options)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_OptionsResource_STATUS() to populate field Options")
		}
		container.Options = &option
	} else {
		container.Options = nil
	}

	// Resource
	if source.Resource != nil {
		var resource SqlContainerGetProperties_Resource_STATUS
		err := resource.AssignProperties_From_SqlContainerGetProperties_Resource_STATUS(source.Resource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SqlContainerGetProperties_Resource_STATUS() to populate field Resource")
		}
		container.Resource = &resource
	} else {
		container.Resource = nil
	}

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

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

	// No error
	return nil
}

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

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

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

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

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

	// Options
	if container.Options != nil {
		var option storage.OptionsResource_STATUS
		err := container.Options.AssignProperties_To_OptionsResource_STATUS(&option)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_OptionsResource_STATUS() to populate field Options")
		}
		destination.Options = &option
	} else {
		destination.Options = nil
	}

	// Resource
	if container.Resource != nil {
		var resource storage.SqlContainerGetProperties_Resource_STATUS
		err := container.Resource.AssignProperties_To_SqlContainerGetProperties_Resource_STATUS(&resource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SqlContainerGetProperties_Resource_STATUS() to populate field Resource")
		}
		destination.Resource = &resource
	} else {
		destination.Resource = nil
	}

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

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

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

	// No error
	return nil
}

type SqlContainerGetProperties_Resource_STATUS struct {
	// AnalyticalStorageTtl: Analytical TTL.
	AnalyticalStorageTtl *int `json:"analyticalStorageTtl,omitempty"`

	// ClientEncryptionPolicy: The client encryption policy for the container.
	ClientEncryptionPolicy *ClientEncryptionPolicy_STATUS `json:"clientEncryptionPolicy,omitempty"`

	// ComputedProperties: List of computed properties
	ComputedProperties []ComputedProperty_STATUS `json:"computedProperties,omitempty"`

	// ConflictResolutionPolicy: The conflict resolution policy for the container.
	ConflictResolutionPolicy *ConflictResolutionPolicy_STATUS `json:"conflictResolutionPolicy,omitempty"`

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

	// DefaultTtl: Default time to live
	DefaultTtl *int `json:"defaultTtl,omitempty"`

	// Etag: A system generated property representing the resource etag required for optimistic concurrency control.
	Etag *string `json:"_etag,omitempty"`

	// Id: Name of the Cosmos DB SQL container
	Id *string `json:"id,omitempty"`

	// IndexingPolicy: The configuration of the indexing policy. By default, the indexing is automatic for all document paths
	// within the container
	IndexingPolicy *IndexingPolicy_STATUS `json:"indexingPolicy,omitempty"`

	// PartitionKey: The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey_STATUS `json:"partitionKey,omitempty"`

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

	// Rid: A system generated property. A unique identifier.
	Rid *string `json:"_rid,omitempty"`

	// Ts: A system generated property that denotes the last updated timestamp of the resource.
	Ts *float64 `json:"_ts,omitempty"`

	// UniqueKeyPolicy: The unique key policy configuration for specifying uniqueness constraints on documents in the
	// collection in the Azure Cosmos DB service.
	UniqueKeyPolicy *UniqueKeyPolicy_STATUS `json:"uniqueKeyPolicy,omitempty"`
}

var _ genruntime.FromARMConverter = &SqlContainerGetProperties_Resource_STATUS{}

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

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

	// Set property "AnalyticalStorageTtl":
	if typedInput.AnalyticalStorageTtl != nil {
		analyticalStorageTtl := *typedInput.AnalyticalStorageTtl
		resource.AnalyticalStorageTtl = &analyticalStorageTtl
	}

	// Set property "ClientEncryptionPolicy":
	if typedInput.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy1 ClientEncryptionPolicy_STATUS
		err := clientEncryptionPolicy1.PopulateFromARM(owner, *typedInput.ClientEncryptionPolicy)
		if err != nil {
			return err
		}
		clientEncryptionPolicy := clientEncryptionPolicy1
		resource.ClientEncryptionPolicy = &clientEncryptionPolicy
	}

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

	// Set property "ConflictResolutionPolicy":
	if typedInput.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy1 ConflictResolutionPolicy_STATUS
		err := conflictResolutionPolicy1.PopulateFromARM(owner, *typedInput.ConflictResolutionPolicy)
		if err != nil {
			return err
		}
		conflictResolutionPolicy := conflictResolutionPolicy1
		resource.ConflictResolutionPolicy = &conflictResolutionPolicy
	}

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

	// Set property "DefaultTtl":
	if typedInput.DefaultTtl != nil {
		defaultTtl := *typedInput.DefaultTtl
		resource.DefaultTtl = &defaultTtl
	}

	// Set property "Etag":
	if typedInput.Etag != nil {
		etag := *typedInput.Etag
		resource.Etag = &etag
	}

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

	// Set property "IndexingPolicy":
	if typedInput.IndexingPolicy != nil {
		var indexingPolicy1 IndexingPolicy_STATUS
		err := indexingPolicy1.PopulateFromARM(owner, *typedInput.IndexingPolicy)
		if err != nil {
			return err
		}
		indexingPolicy := indexingPolicy1
		resource.IndexingPolicy = &indexingPolicy
	}

	// Set property "PartitionKey":
	if typedInput.PartitionKey != nil {
		var partitionKey1 ContainerPartitionKey_STATUS
		err := partitionKey1.PopulateFromARM(owner, *typedInput.PartitionKey)
		if err != nil {
			return err
		}
		partitionKey := partitionKey1
		resource.PartitionKey = &partitionKey
	}

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

	// Set property "Rid":
	if typedInput.Rid != nil {
		rid := *typedInput.Rid
		resource.Rid = &rid
	}

	// Set property "Ts":
	if typedInput.Ts != nil {
		ts := *typedInput.Ts
		resource.Ts = &ts
	}

	// Set property "UniqueKeyPolicy":
	if typedInput.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy1 UniqueKeyPolicy_STATUS
		err := uniqueKeyPolicy1.PopulateFromARM(owner, *typedInput.UniqueKeyPolicy)
		if err != nil {
			return err
		}
		uniqueKeyPolicy := uniqueKeyPolicy1
		resource.UniqueKeyPolicy = &uniqueKeyPolicy
	}

	// No error
	return nil
}

// AssignProperties_From_SqlContainerGetProperties_Resource_STATUS populates our SqlContainerGetProperties_Resource_STATUS from the provided source SqlContainerGetProperties_Resource_STATUS
func (resource *SqlContainerGetProperties_Resource_STATUS) AssignProperties_From_SqlContainerGetProperties_Resource_STATUS(source *storage.SqlContainerGetProperties_Resource_STATUS) error {

	// AnalyticalStorageTtl
	resource.AnalyticalStorageTtl = genruntime.ClonePointerToInt(source.AnalyticalStorageTtl)

	// ClientEncryptionPolicy
	if source.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy ClientEncryptionPolicy_STATUS
		err := clientEncryptionPolicy.AssignProperties_From_ClientEncryptionPolicy_STATUS(source.ClientEncryptionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ClientEncryptionPolicy_STATUS() to populate field ClientEncryptionPolicy")
		}
		resource.ClientEncryptionPolicy = &clientEncryptionPolicy
	} else {
		resource.ClientEncryptionPolicy = nil
	}

	// ComputedProperties
	if source.ComputedProperties != nil {
		computedPropertyList := make([]ComputedProperty_STATUS, len(source.ComputedProperties))
		for computedPropertyIndex, computedPropertyItem := range source.ComputedProperties {
			var computedProperty ComputedProperty_STATUS
			err := computedProperty.AssignProperties_From_ComputedProperty_STATUS(&computedPropertyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ComputedProperty_STATUS() to populate field ComputedProperties")
			}
			computedPropertyList[computedPropertyIndex] = computedProperty
		}
		resource.ComputedProperties = computedPropertyList
	} else {
		resource.ComputedProperties = nil
	}

	// ConflictResolutionPolicy
	if source.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy ConflictResolutionPolicy_STATUS
		err := conflictResolutionPolicy.AssignProperties_From_ConflictResolutionPolicy_STATUS(source.ConflictResolutionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConflictResolutionPolicy_STATUS() to populate field ConflictResolutionPolicy")
		}
		resource.ConflictResolutionPolicy = &conflictResolutionPolicy
	} else {
		resource.ConflictResolutionPolicy = nil
	}

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

	// DefaultTtl
	resource.DefaultTtl = genruntime.ClonePointerToInt(source.DefaultTtl)

	// Etag
	resource.Etag = genruntime.ClonePointerToString(source.Etag)

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

	// IndexingPolicy
	if source.IndexingPolicy != nil {
		var indexingPolicy IndexingPolicy_STATUS
		err := indexingPolicy.AssignProperties_From_IndexingPolicy_STATUS(source.IndexingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_IndexingPolicy_STATUS() to populate field IndexingPolicy")
		}
		resource.IndexingPolicy = &indexingPolicy
	} else {
		resource.IndexingPolicy = nil
	}

	// PartitionKey
	if source.PartitionKey != nil {
		var partitionKey ContainerPartitionKey_STATUS
		err := partitionKey.AssignProperties_From_ContainerPartitionKey_STATUS(source.PartitionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ContainerPartitionKey_STATUS() to populate field PartitionKey")
		}
		resource.PartitionKey = &partitionKey
	} else {
		resource.PartitionKey = nil
	}

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

	// Rid
	resource.Rid = genruntime.ClonePointerToString(source.Rid)

	// Ts
	if source.Ts != nil {
		t := *source.Ts
		resource.Ts = &t
	} else {
		resource.Ts = nil
	}

	// UniqueKeyPolicy
	if source.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy UniqueKeyPolicy_STATUS
		err := uniqueKeyPolicy.AssignProperties_From_UniqueKeyPolicy_STATUS(source.UniqueKeyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UniqueKeyPolicy_STATUS() to populate field UniqueKeyPolicy")
		}
		resource.UniqueKeyPolicy = &uniqueKeyPolicy
	} else {
		resource.UniqueKeyPolicy = nil
	}

	// No error
	return nil
}

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

	// AnalyticalStorageTtl
	destination.AnalyticalStorageTtl = genruntime.ClonePointerToInt(resource.AnalyticalStorageTtl)

	// ClientEncryptionPolicy
	if resource.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy storage.ClientEncryptionPolicy_STATUS
		err := resource.ClientEncryptionPolicy.AssignProperties_To_ClientEncryptionPolicy_STATUS(&clientEncryptionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ClientEncryptionPolicy_STATUS() to populate field ClientEncryptionPolicy")
		}
		destination.ClientEncryptionPolicy = &clientEncryptionPolicy
	} else {
		destination.ClientEncryptionPolicy = nil
	}

	// ComputedProperties
	if resource.ComputedProperties != nil {
		computedPropertyList := make([]storage.ComputedProperty_STATUS, len(resource.ComputedProperties))
		for computedPropertyIndex, computedPropertyItem := range resource.ComputedProperties {
			var computedProperty storage.ComputedProperty_STATUS
			err := computedPropertyItem.AssignProperties_To_ComputedProperty_STATUS(&computedProperty)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ComputedProperty_STATUS() to populate field ComputedProperties")
			}
			computedPropertyList[computedPropertyIndex] = computedProperty
		}
		destination.ComputedProperties = computedPropertyList
	} else {
		destination.ComputedProperties = nil
	}

	// ConflictResolutionPolicy
	if resource.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy storage.ConflictResolutionPolicy_STATUS
		err := resource.ConflictResolutionPolicy.AssignProperties_To_ConflictResolutionPolicy_STATUS(&conflictResolutionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConflictResolutionPolicy_STATUS() to populate field ConflictResolutionPolicy")
		}
		destination.ConflictResolutionPolicy = &conflictResolutionPolicy
	} else {
		destination.ConflictResolutionPolicy = nil
	}

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

	// DefaultTtl
	destination.DefaultTtl = genruntime.ClonePointerToInt(resource.DefaultTtl)

	// Etag
	destination.Etag = genruntime.ClonePointerToString(resource.Etag)

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

	// IndexingPolicy
	if resource.IndexingPolicy != nil {
		var indexingPolicy storage.IndexingPolicy_STATUS
		err := resource.IndexingPolicy.AssignProperties_To_IndexingPolicy_STATUS(&indexingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_IndexingPolicy_STATUS() to populate field IndexingPolicy")
		}
		destination.IndexingPolicy = &indexingPolicy
	} else {
		destination.IndexingPolicy = nil
	}

	// PartitionKey
	if resource.PartitionKey != nil {
		var partitionKey storage.ContainerPartitionKey_STATUS
		err := resource.PartitionKey.AssignProperties_To_ContainerPartitionKey_STATUS(&partitionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ContainerPartitionKey_STATUS() to populate field PartitionKey")
		}
		destination.PartitionKey = &partitionKey
	} else {
		destination.PartitionKey = nil
	}

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

	// Rid
	destination.Rid = genruntime.ClonePointerToString(resource.Rid)

	// Ts
	if resource.Ts != nil {
		t := *resource.Ts
		destination.Ts = &t
	} else {
		destination.Ts = nil
	}

	// UniqueKeyPolicy
	if resource.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy storage.UniqueKeyPolicy_STATUS
		err := resource.UniqueKeyPolicy.AssignProperties_To_UniqueKeyPolicy_STATUS(&uniqueKeyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UniqueKeyPolicy_STATUS() to populate field UniqueKeyPolicy")
		}
		destination.UniqueKeyPolicy = &uniqueKeyPolicy
	} else {
		destination.UniqueKeyPolicy = nil
	}

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

	// No error
	return nil
}

// Cosmos DB SQL container resource object
type SqlContainerResource struct {
	// AnalyticalStorageTtl: Analytical TTL.
	AnalyticalStorageTtl *int `json:"analyticalStorageTtl,omitempty"`

	// ClientEncryptionPolicy: The client encryption policy for the container.
	ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"`

	// ComputedProperties: List of computed properties
	ComputedProperties []ComputedProperty `json:"computedProperties,omitempty"`

	// ConflictResolutionPolicy: The conflict resolution policy for the container.
	ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`

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

	// DefaultTtl: Default time to live
	DefaultTtl *int `json:"defaultTtl,omitempty"`

	// +kubebuilder:validation:Required
	// Id: Name of the Cosmos DB SQL container
	Id *string `json:"id,omitempty"`

	// IndexingPolicy: The configuration of the indexing policy. By default, the indexing is automatic for all document paths
	// within the container
	IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"`

	// PartitionKey: The configuration of the partition key to be used for partitioning data into multiple partitions
	PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"`

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

	// UniqueKeyPolicy: The unique key policy configuration for specifying uniqueness constraints on documents in the
	// collection in the Azure Cosmos DB service.
	UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"`
}

var _ genruntime.ARMTransformer = &SqlContainerResource{}

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

	// Set property "AnalyticalStorageTtl":
	if resource.AnalyticalStorageTtl != nil {
		analyticalStorageTtl := *resource.AnalyticalStorageTtl
		result.AnalyticalStorageTtl = &analyticalStorageTtl
	}

	// Set property "ClientEncryptionPolicy":
	if resource.ClientEncryptionPolicy != nil {
		clientEncryptionPolicy_ARM, err := resource.ClientEncryptionPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		clientEncryptionPolicy := *clientEncryptionPolicy_ARM.(*arm.ClientEncryptionPolicy)
		result.ClientEncryptionPolicy = &clientEncryptionPolicy
	}

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

	// Set property "ConflictResolutionPolicy":
	if resource.ConflictResolutionPolicy != nil {
		conflictResolutionPolicy_ARM, err := resource.ConflictResolutionPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		conflictResolutionPolicy := *conflictResolutionPolicy_ARM.(*arm.ConflictResolutionPolicy)
		result.ConflictResolutionPolicy = &conflictResolutionPolicy
	}

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

	// Set property "DefaultTtl":
	if resource.DefaultTtl != nil {
		defaultTtl := *resource.DefaultTtl
		result.DefaultTtl = &defaultTtl
	}

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

	// Set property "IndexingPolicy":
	if resource.IndexingPolicy != nil {
		indexingPolicy_ARM, err := resource.IndexingPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		indexingPolicy := *indexingPolicy_ARM.(*arm.IndexingPolicy)
		result.IndexingPolicy = &indexingPolicy
	}

	// Set property "PartitionKey":
	if resource.PartitionKey != nil {
		partitionKey_ARM, err := resource.PartitionKey.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		partitionKey := *partitionKey_ARM.(*arm.ContainerPartitionKey)
		result.PartitionKey = &partitionKey
	}

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

	// Set property "UniqueKeyPolicy":
	if resource.UniqueKeyPolicy != nil {
		uniqueKeyPolicy_ARM, err := resource.UniqueKeyPolicy.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		uniqueKeyPolicy := *uniqueKeyPolicy_ARM.(*arm.UniqueKeyPolicy)
		result.UniqueKeyPolicy = &uniqueKeyPolicy
	}
	return result, nil
}

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

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

	// Set property "AnalyticalStorageTtl":
	if typedInput.AnalyticalStorageTtl != nil {
		analyticalStorageTtl := *typedInput.AnalyticalStorageTtl
		resource.AnalyticalStorageTtl = &analyticalStorageTtl
	}

	// Set property "ClientEncryptionPolicy":
	if typedInput.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy1 ClientEncryptionPolicy
		err := clientEncryptionPolicy1.PopulateFromARM(owner, *typedInput.ClientEncryptionPolicy)
		if err != nil {
			return err
		}
		clientEncryptionPolicy := clientEncryptionPolicy1
		resource.ClientEncryptionPolicy = &clientEncryptionPolicy
	}

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

	// Set property "ConflictResolutionPolicy":
	if typedInput.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy1 ConflictResolutionPolicy
		err := conflictResolutionPolicy1.PopulateFromARM(owner, *typedInput.ConflictResolutionPolicy)
		if err != nil {
			return err
		}
		conflictResolutionPolicy := conflictResolutionPolicy1
		resource.ConflictResolutionPolicy = &conflictResolutionPolicy
	}

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

	// Set property "DefaultTtl":
	if typedInput.DefaultTtl != nil {
		defaultTtl := *typedInput.DefaultTtl
		resource.DefaultTtl = &defaultTtl
	}

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

	// Set property "IndexingPolicy":
	if typedInput.IndexingPolicy != nil {
		var indexingPolicy1 IndexingPolicy
		err := indexingPolicy1.PopulateFromARM(owner, *typedInput.IndexingPolicy)
		if err != nil {
			return err
		}
		indexingPolicy := indexingPolicy1
		resource.IndexingPolicy = &indexingPolicy
	}

	// Set property "PartitionKey":
	if typedInput.PartitionKey != nil {
		var partitionKey1 ContainerPartitionKey
		err := partitionKey1.PopulateFromARM(owner, *typedInput.PartitionKey)
		if err != nil {
			return err
		}
		partitionKey := partitionKey1
		resource.PartitionKey = &partitionKey
	}

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

	// Set property "UniqueKeyPolicy":
	if typedInput.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy1 UniqueKeyPolicy
		err := uniqueKeyPolicy1.PopulateFromARM(owner, *typedInput.UniqueKeyPolicy)
		if err != nil {
			return err
		}
		uniqueKeyPolicy := uniqueKeyPolicy1
		resource.UniqueKeyPolicy = &uniqueKeyPolicy
	}

	// No error
	return nil
}

// AssignProperties_From_SqlContainerResource populates our SqlContainerResource from the provided source SqlContainerResource
func (resource *SqlContainerResource) AssignProperties_From_SqlContainerResource(source *storage.SqlContainerResource) error {

	// AnalyticalStorageTtl
	resource.AnalyticalStorageTtl = genruntime.ClonePointerToInt(source.AnalyticalStorageTtl)

	// ClientEncryptionPolicy
	if source.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy ClientEncryptionPolicy
		err := clientEncryptionPolicy.AssignProperties_From_ClientEncryptionPolicy(source.ClientEncryptionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ClientEncryptionPolicy() to populate field ClientEncryptionPolicy")
		}
		resource.ClientEncryptionPolicy = &clientEncryptionPolicy
	} else {
		resource.ClientEncryptionPolicy = nil
	}

	// ComputedProperties
	if source.ComputedProperties != nil {
		computedPropertyList := make([]ComputedProperty, len(source.ComputedProperties))
		for computedPropertyIndex, computedPropertyItem := range source.ComputedProperties {
			var computedProperty ComputedProperty
			err := computedProperty.AssignProperties_From_ComputedProperty(&computedPropertyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ComputedProperty() to populate field ComputedProperties")
			}
			computedPropertyList[computedPropertyIndex] = computedProperty
		}
		resource.ComputedProperties = computedPropertyList
	} else {
		resource.ComputedProperties = nil
	}

	// ConflictResolutionPolicy
	if source.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy ConflictResolutionPolicy
		err := conflictResolutionPolicy.AssignProperties_From_ConflictResolutionPolicy(source.ConflictResolutionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConflictResolutionPolicy() to populate field ConflictResolutionPolicy")
		}
		resource.ConflictResolutionPolicy = &conflictResolutionPolicy
	} else {
		resource.ConflictResolutionPolicy = nil
	}

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

	// DefaultTtl
	resource.DefaultTtl = genruntime.ClonePointerToInt(source.DefaultTtl)

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

	// IndexingPolicy
	if source.IndexingPolicy != nil {
		var indexingPolicy IndexingPolicy
		err := indexingPolicy.AssignProperties_From_IndexingPolicy(source.IndexingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_IndexingPolicy() to populate field IndexingPolicy")
		}
		resource.IndexingPolicy = &indexingPolicy
	} else {
		resource.IndexingPolicy = nil
	}

	// PartitionKey
	if source.PartitionKey != nil {
		var partitionKey ContainerPartitionKey
		err := partitionKey.AssignProperties_From_ContainerPartitionKey(source.PartitionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ContainerPartitionKey() to populate field PartitionKey")
		}
		resource.PartitionKey = &partitionKey
	} else {
		resource.PartitionKey = nil
	}

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

	// UniqueKeyPolicy
	if source.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy UniqueKeyPolicy
		err := uniqueKeyPolicy.AssignProperties_From_UniqueKeyPolicy(source.UniqueKeyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UniqueKeyPolicy() to populate field UniqueKeyPolicy")
		}
		resource.UniqueKeyPolicy = &uniqueKeyPolicy
	} else {
		resource.UniqueKeyPolicy = nil
	}

	// No error
	return nil
}

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

	// AnalyticalStorageTtl
	destination.AnalyticalStorageTtl = genruntime.ClonePointerToInt(resource.AnalyticalStorageTtl)

	// ClientEncryptionPolicy
	if resource.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy storage.ClientEncryptionPolicy
		err := resource.ClientEncryptionPolicy.AssignProperties_To_ClientEncryptionPolicy(&clientEncryptionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ClientEncryptionPolicy() to populate field ClientEncryptionPolicy")
		}
		destination.ClientEncryptionPolicy = &clientEncryptionPolicy
	} else {
		destination.ClientEncryptionPolicy = nil
	}

	// ComputedProperties
	if resource.ComputedProperties != nil {
		computedPropertyList := make([]storage.ComputedProperty, len(resource.ComputedProperties))
		for computedPropertyIndex, computedPropertyItem := range resource.ComputedProperties {
			var computedProperty storage.ComputedProperty
			err := computedPropertyItem.AssignProperties_To_ComputedProperty(&computedProperty)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ComputedProperty() to populate field ComputedProperties")
			}
			computedPropertyList[computedPropertyIndex] = computedProperty
		}
		destination.ComputedProperties = computedPropertyList
	} else {
		destination.ComputedProperties = nil
	}

	// ConflictResolutionPolicy
	if resource.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy storage.ConflictResolutionPolicy
		err := resource.ConflictResolutionPolicy.AssignProperties_To_ConflictResolutionPolicy(&conflictResolutionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConflictResolutionPolicy() to populate field ConflictResolutionPolicy")
		}
		destination.ConflictResolutionPolicy = &conflictResolutionPolicy
	} else {
		destination.ConflictResolutionPolicy = nil
	}

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

	// DefaultTtl
	destination.DefaultTtl = genruntime.ClonePointerToInt(resource.DefaultTtl)

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

	// IndexingPolicy
	if resource.IndexingPolicy != nil {
		var indexingPolicy storage.IndexingPolicy
		err := resource.IndexingPolicy.AssignProperties_To_IndexingPolicy(&indexingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_IndexingPolicy() to populate field IndexingPolicy")
		}
		destination.IndexingPolicy = &indexingPolicy
	} else {
		destination.IndexingPolicy = nil
	}

	// PartitionKey
	if resource.PartitionKey != nil {
		var partitionKey storage.ContainerPartitionKey
		err := resource.PartitionKey.AssignProperties_To_ContainerPartitionKey(&partitionKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ContainerPartitionKey() to populate field PartitionKey")
		}
		destination.PartitionKey = &partitionKey
	} else {
		destination.PartitionKey = nil
	}

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

	// UniqueKeyPolicy
	if resource.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy storage.UniqueKeyPolicy
		err := resource.UniqueKeyPolicy.AssignProperties_To_UniqueKeyPolicy(&uniqueKeyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UniqueKeyPolicy() to populate field UniqueKeyPolicy")
		}
		destination.UniqueKeyPolicy = &uniqueKeyPolicy
	} else {
		destination.UniqueKeyPolicy = nil
	}

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

	// No error
	return nil
}

// Initialize_From_SqlContainerGetProperties_Resource_STATUS populates our SqlContainerResource from the provided source SqlContainerGetProperties_Resource_STATUS
func (resource *SqlContainerResource) Initialize_From_SqlContainerGetProperties_Resource_STATUS(source *SqlContainerGetProperties_Resource_STATUS) error {

	// AnalyticalStorageTtl
	resource.AnalyticalStorageTtl = genruntime.ClonePointerToInt(source.AnalyticalStorageTtl)

	// ClientEncryptionPolicy
	if source.ClientEncryptionPolicy != nil {
		var clientEncryptionPolicy ClientEncryptionPolicy
		err := clientEncryptionPolicy.Initialize_From_ClientEncryptionPolicy_STATUS(source.ClientEncryptionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ClientEncryptionPolicy_STATUS() to populate field ClientEncryptionPolicy")
		}
		resource.ClientEncryptionPolicy = &clientEncryptionPolicy
	} else {
		resource.ClientEncryptionPolicy = nil
	}

	// ComputedProperties
	if source.ComputedProperties != nil {
		computedPropertyList := make([]ComputedProperty, len(source.ComputedProperties))
		for computedPropertyIndex, computedPropertyItem := range source.ComputedProperties {
			var computedProperty ComputedProperty
			err := computedProperty.Initialize_From_ComputedProperty_STATUS(&computedPropertyItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ComputedProperty_STATUS() to populate field ComputedProperties")
			}
			computedPropertyList[computedPropertyIndex] = computedProperty
		}
		resource.ComputedProperties = computedPropertyList
	} else {
		resource.ComputedProperties = nil
	}

	// ConflictResolutionPolicy
	if source.ConflictResolutionPolicy != nil {
		var conflictResolutionPolicy ConflictResolutionPolicy
		err := conflictResolutionPolicy.Initialize_From_ConflictResolutionPolicy_STATUS(source.ConflictResolutionPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ConflictResolutionPolicy_STATUS() to populate field ConflictResolutionPolicy")
		}
		resource.ConflictResolutionPolicy = &conflictResolutionPolicy
	} else {
		resource.ConflictResolutionPolicy = nil
	}

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

	// DefaultTtl
	resource.DefaultTtl = genruntime.ClonePointerToInt(source.DefaultTtl)

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

	// IndexingPolicy
	if source.IndexingPolicy != nil {
		var indexingPolicy IndexingPolicy
		err := indexingPolicy.Initialize_From_IndexingPolicy_STATUS(source.IndexingPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_IndexingPolicy_STATUS() to populate field IndexingPolicy")
		}
		resource.IndexingPolicy = &indexingPolicy
	} else {
		resource.IndexingPolicy = nil
	}

	// PartitionKey
	if source.PartitionKey != nil {
		var partitionKey ContainerPartitionKey
		err := partitionKey.Initialize_From_ContainerPartitionKey_STATUS(source.PartitionKey)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ContainerPartitionKey_STATUS() to populate field PartitionKey")
		}
		resource.PartitionKey = &partitionKey
	} else {
		resource.PartitionKey = nil
	}

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

	// UniqueKeyPolicy
	if source.UniqueKeyPolicy != nil {
		var uniqueKeyPolicy UniqueKeyPolicy
		err := uniqueKeyPolicy.Initialize_From_UniqueKeyPolicy_STATUS(source.UniqueKeyPolicy)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_UniqueKeyPolicy_STATUS() to populate field UniqueKeyPolicy")
		}
		resource.UniqueKeyPolicy = &uniqueKeyPolicy
	} else {
		resource.UniqueKeyPolicy = 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 SqlDatabaseContainerOperatorSpec 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_SqlDatabaseContainerOperatorSpec populates our SqlDatabaseContainerOperatorSpec from the provided source SqlDatabaseContainerOperatorSpec
func (operator *SqlDatabaseContainerOperatorSpec) AssignProperties_From_SqlDatabaseContainerOperatorSpec(source *storage.SqlDatabaseContainerOperatorSpec) 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_SqlDatabaseContainerOperatorSpec populates the provided destination SqlDatabaseContainerOperatorSpec from our SqlDatabaseContainerOperatorSpec
func (operator *SqlDatabaseContainerOperatorSpec) AssignProperties_To_SqlDatabaseContainerOperatorSpec(destination *storage.SqlDatabaseContainerOperatorSpec) 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
}

// Cosmos DB client encryption policy.
type ClientEncryptionPolicy struct {
	// +kubebuilder:validation:Required
	// IncludedPaths: Paths of the item that need encryption along with path-specific settings.
	IncludedPaths []ClientEncryptionIncludedPath `json:"includedPaths,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Maximum=2
	// +kubebuilder:validation:Minimum=1
	// PolicyFormatVersion: Version of the client encryption policy definition. Supported versions are 1 and 2. Version 2
	// supports id and partition key path encryption.
	PolicyFormatVersion *int `json:"policyFormatVersion,omitempty"`
}

var _ genruntime.ARMTransformer = &ClientEncryptionPolicy{}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

	// IncludedPaths
	if source.IncludedPaths != nil {
		includedPathList := make([]ClientEncryptionIncludedPath, len(source.IncludedPaths))
		for includedPathIndex, includedPathItem := range source.IncludedPaths {
			var includedPath ClientEncryptionIncludedPath
			err := includedPath.AssignProperties_From_ClientEncryptionIncludedPath(&includedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ClientEncryptionIncludedPath() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		policy.IncludedPaths = includedPathList
	} else {
		policy.IncludedPaths = nil
	}

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

	// No error
	return nil
}

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

	// IncludedPaths
	if policy.IncludedPaths != nil {
		includedPathList := make([]storage.ClientEncryptionIncludedPath, len(policy.IncludedPaths))
		for includedPathIndex, includedPathItem := range policy.IncludedPaths {
			var includedPath storage.ClientEncryptionIncludedPath
			err := includedPathItem.AssignProperties_To_ClientEncryptionIncludedPath(&includedPath)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ClientEncryptionIncludedPath() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		destination.IncludedPaths = includedPathList
	} else {
		destination.IncludedPaths = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_ClientEncryptionPolicy_STATUS populates our ClientEncryptionPolicy from the provided source ClientEncryptionPolicy_STATUS
func (policy *ClientEncryptionPolicy) Initialize_From_ClientEncryptionPolicy_STATUS(source *ClientEncryptionPolicy_STATUS) error {

	// IncludedPaths
	if source.IncludedPaths != nil {
		includedPathList := make([]ClientEncryptionIncludedPath, len(source.IncludedPaths))
		for includedPathIndex, includedPathItem := range source.IncludedPaths {
			var includedPath ClientEncryptionIncludedPath
			err := includedPath.Initialize_From_ClientEncryptionIncludedPath_STATUS(&includedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ClientEncryptionIncludedPath_STATUS() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		policy.IncludedPaths = includedPathList
	} else {
		policy.IncludedPaths = nil
	}

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

	// No error
	return nil
}

// Cosmos DB client encryption policy.
type ClientEncryptionPolicy_STATUS struct {
	// IncludedPaths: Paths of the item that need encryption along with path-specific settings.
	IncludedPaths []ClientEncryptionIncludedPath_STATUS `json:"includedPaths,omitempty"`

	// PolicyFormatVersion: Version of the client encryption policy definition. Supported versions are 1 and 2. Version 2
	// supports id and partition key path encryption.
	PolicyFormatVersion *int `json:"policyFormatVersion,omitempty"`
}

var _ genruntime.FromARMConverter = &ClientEncryptionPolicy_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

	// IncludedPaths
	if source.IncludedPaths != nil {
		includedPathList := make([]ClientEncryptionIncludedPath_STATUS, len(source.IncludedPaths))
		for includedPathIndex, includedPathItem := range source.IncludedPaths {
			var includedPath ClientEncryptionIncludedPath_STATUS
			err := includedPath.AssignProperties_From_ClientEncryptionIncludedPath_STATUS(&includedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ClientEncryptionIncludedPath_STATUS() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		policy.IncludedPaths = includedPathList
	} else {
		policy.IncludedPaths = nil
	}

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

	// No error
	return nil
}

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

	// IncludedPaths
	if policy.IncludedPaths != nil {
		includedPathList := make([]storage.ClientEncryptionIncludedPath_STATUS, len(policy.IncludedPaths))
		for includedPathIndex, includedPathItem := range policy.IncludedPaths {
			var includedPath storage.ClientEncryptionIncludedPath_STATUS
			err := includedPathItem.AssignProperties_To_ClientEncryptionIncludedPath_STATUS(&includedPath)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ClientEncryptionIncludedPath_STATUS() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		destination.IncludedPaths = includedPathList
	} else {
		destination.IncludedPaths = nil
	}

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

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

	// No error
	return nil
}

// The definition of a computed property
type ComputedProperty struct {
	// Name: The name of a computed property, for example - "cp_lowerName"
	Name *string `json:"name,omitempty"`

	// Query: The query that evaluates the value for computed property, for example - "SELECT VALUE LOWER(c.name) FROM c"
	Query *string `json:"query,omitempty"`
}

var _ genruntime.ARMTransformer = &ComputedProperty{}

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

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

	// Set property "Query":
	if property.Query != nil {
		query := *property.Query
		result.Query = &query
	}
	return result, nil
}

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

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

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

	// Set property "Query":
	if typedInput.Query != nil {
		query := *typedInput.Query
		property.Query = &query
	}

	// No error
	return nil
}

// AssignProperties_From_ComputedProperty populates our ComputedProperty from the provided source ComputedProperty
func (property *ComputedProperty) AssignProperties_From_ComputedProperty(source *storage.ComputedProperty) error {

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

	// Query
	property.Query = genruntime.ClonePointerToString(source.Query)

	// No error
	return nil
}

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

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

	// Query
	destination.Query = genruntime.ClonePointerToString(property.Query)

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

	// No error
	return nil
}

// Initialize_From_ComputedProperty_STATUS populates our ComputedProperty from the provided source ComputedProperty_STATUS
func (property *ComputedProperty) Initialize_From_ComputedProperty_STATUS(source *ComputedProperty_STATUS) error {

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

	// Query
	property.Query = genruntime.ClonePointerToString(source.Query)

	// No error
	return nil
}

// The definition of a computed property
type ComputedProperty_STATUS struct {
	// Name: The name of a computed property, for example - "cp_lowerName"
	Name *string `json:"name,omitempty"`

	// Query: The query that evaluates the value for computed property, for example - "SELECT VALUE LOWER(c.name) FROM c"
	Query *string `json:"query,omitempty"`
}

var _ genruntime.FromARMConverter = &ComputedProperty_STATUS{}

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

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

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

	// Set property "Query":
	if typedInput.Query != nil {
		query := *typedInput.Query
		property.Query = &query
	}

	// No error
	return nil
}

// AssignProperties_From_ComputedProperty_STATUS populates our ComputedProperty_STATUS from the provided source ComputedProperty_STATUS
func (property *ComputedProperty_STATUS) AssignProperties_From_ComputedProperty_STATUS(source *storage.ComputedProperty_STATUS) error {

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

	// Query
	property.Query = genruntime.ClonePointerToString(source.Query)

	// No error
	return nil
}

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

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

	// Query
	destination.Query = genruntime.ClonePointerToString(property.Query)

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

	// No error
	return nil
}

// The conflict resolution policy for the container.
type ConflictResolutionPolicy struct {
	// ConflictResolutionPath: The conflict resolution path in the case of LastWriterWins mode.
	ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"`

	// ConflictResolutionProcedure: The procedure to resolve conflicts in the case of custom mode.
	ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"`

	// Mode: Indicates the conflict resolution mode.
	Mode *ConflictResolutionPolicy_Mode `json:"mode,omitempty"`
}

var _ genruntime.ARMTransformer = &ConflictResolutionPolicy{}

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

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

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

	// Set property "Mode":
	if policy.Mode != nil {
		var temp string
		temp = string(*policy.Mode)
		mode := arm.ConflictResolutionPolicy_Mode(temp)
		result.Mode = &mode
	}
	return result, nil
}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// Initialize_From_ConflictResolutionPolicy_STATUS populates our ConflictResolutionPolicy from the provided source ConflictResolutionPolicy_STATUS
func (policy *ConflictResolutionPolicy) Initialize_From_ConflictResolutionPolicy_STATUS(source *ConflictResolutionPolicy_STATUS) error {

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

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

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

	// No error
	return nil
}

// The conflict resolution policy for the container.
type ConflictResolutionPolicy_STATUS struct {
	// ConflictResolutionPath: The conflict resolution path in the case of LastWriterWins mode.
	ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"`

	// ConflictResolutionProcedure: The procedure to resolve conflicts in the case of custom mode.
	ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"`

	// Mode: Indicates the conflict resolution mode.
	Mode *ConflictResolutionPolicy_Mode_STATUS `json:"mode,omitempty"`
}

var _ genruntime.FromARMConverter = &ConflictResolutionPolicy_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

// The configuration of the partition key to be used for partitioning data into multiple partitions
type ContainerPartitionKey struct {
	// Kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum)
	// are supported for container create
	Kind *ContainerPartitionKey_Kind `json:"kind,omitempty"`

	// Paths: List of paths using which data within the container can be partitioned
	Paths []string `json:"paths,omitempty"`

	// +kubebuilder:validation:Maximum=2
	// +kubebuilder:validation:Minimum=1
	// Version: Indicates the version of the partition key definition
	Version *int `json:"version,omitempty"`
}

var _ genruntime.ARMTransformer = &ContainerPartitionKey{}

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

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

	// Set property "Paths":
	for _, item := range partitionKey.Paths {
		result.Paths = append(result.Paths, item)
	}

	// Set property "Version":
	if partitionKey.Version != nil {
		version := *partitionKey.Version
		result.Version = &version
	}
	return result, nil
}

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

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

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

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

	// Set property "Version":
	if typedInput.Version != nil {
		version := *typedInput.Version
		partitionKey.Version = &version
	}

	// No error
	return nil
}

// AssignProperties_From_ContainerPartitionKey populates our ContainerPartitionKey from the provided source ContainerPartitionKey
func (partitionKey *ContainerPartitionKey) AssignProperties_From_ContainerPartitionKey(source *storage.ContainerPartitionKey) error {

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

	// Paths
	partitionKey.Paths = genruntime.CloneSliceOfString(source.Paths)

	// Version
	partitionKey.Version = genruntime.ClonePointerToInt(source.Version)

	// No error
	return nil
}

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

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

	// Paths
	destination.Paths = genruntime.CloneSliceOfString(partitionKey.Paths)

	// Version
	destination.Version = genruntime.ClonePointerToInt(partitionKey.Version)

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

	// No error
	return nil
}

// Initialize_From_ContainerPartitionKey_STATUS populates our ContainerPartitionKey from the provided source ContainerPartitionKey_STATUS
func (partitionKey *ContainerPartitionKey) Initialize_From_ContainerPartitionKey_STATUS(source *ContainerPartitionKey_STATUS) error {

	// Kind
	if source.Kind != nil {
		kind := genruntime.ToEnum(string(*source.Kind), containerPartitionKey_Kind_Values)
		partitionKey.Kind = &kind
	} else {
		partitionKey.Kind = nil
	}

	// Paths
	partitionKey.Paths = genruntime.CloneSliceOfString(source.Paths)

	// Version
	partitionKey.Version = genruntime.ClonePointerToInt(source.Version)

	// No error
	return nil
}

// The configuration of the partition key to be used for partitioning data into multiple partitions
type ContainerPartitionKey_STATUS struct {
	// Kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum)
	// are supported for container create
	Kind *ContainerPartitionKey_Kind_STATUS `json:"kind,omitempty"`

	// Paths: List of paths using which data within the container can be partitioned
	Paths []string `json:"paths,omitempty"`

	// SystemKey: Indicates if the container is using a system generated partition key
	SystemKey *bool `json:"systemKey,omitempty"`

	// Version: Indicates the version of the partition key definition
	Version *int `json:"version,omitempty"`
}

var _ genruntime.FromARMConverter = &ContainerPartitionKey_STATUS{}

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

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

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

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

	// Set property "SystemKey":
	if typedInput.SystemKey != nil {
		systemKey := *typedInput.SystemKey
		partitionKey.SystemKey = &systemKey
	}

	// Set property "Version":
	if typedInput.Version != nil {
		version := *typedInput.Version
		partitionKey.Version = &version
	}

	// No error
	return nil
}

// AssignProperties_From_ContainerPartitionKey_STATUS populates our ContainerPartitionKey_STATUS from the provided source ContainerPartitionKey_STATUS
func (partitionKey *ContainerPartitionKey_STATUS) AssignProperties_From_ContainerPartitionKey_STATUS(source *storage.ContainerPartitionKey_STATUS) error {

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

	// Paths
	partitionKey.Paths = genruntime.CloneSliceOfString(source.Paths)

	// SystemKey
	if source.SystemKey != nil {
		systemKey := *source.SystemKey
		partitionKey.SystemKey = &systemKey
	} else {
		partitionKey.SystemKey = nil
	}

	// Version
	partitionKey.Version = genruntime.ClonePointerToInt(source.Version)

	// No error
	return nil
}

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

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

	// Paths
	destination.Paths = genruntime.CloneSliceOfString(partitionKey.Paths)

	// SystemKey
	if partitionKey.SystemKey != nil {
		systemKey := *partitionKey.SystemKey
		destination.SystemKey = &systemKey
	} else {
		destination.SystemKey = nil
	}

	// Version
	destination.Version = genruntime.ClonePointerToInt(partitionKey.Version)

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

	// No error
	return nil
}

// Cosmos DB indexing policy
type IndexingPolicy struct {
	// Automatic: Indicates if the indexing policy is automatic
	Automatic *bool `json:"automatic,omitempty"`

	// CompositeIndexes: List of composite path list
	CompositeIndexes [][]CompositePath `json:"compositeIndexes,omitempty"`

	// ExcludedPaths: List of paths to exclude from indexing
	ExcludedPaths []ExcludedPath `json:"excludedPaths,omitempty"`

	// IncludedPaths: List of paths to include in the indexing
	IncludedPaths []IncludedPath `json:"includedPaths,omitempty"`

	// IndexingMode: Indicates the indexing mode.
	IndexingMode *IndexingPolicy_IndexingMode `json:"indexingMode,omitempty"`

	// SpatialIndexes: List of spatial specifics
	SpatialIndexes []SpatialSpec `json:"spatialIndexes,omitempty"`
}

var _ genruntime.ARMTransformer = &IndexingPolicy{}

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

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

	// Set property "CompositeIndexes":
	for _, item := range policy.CompositeIndexes {
		var itemTemp []arm.CompositePath
		for _, item1 := range item {
			item1_ARM, err := item1.ConvertToARM(resolved)
			if err != nil {
				return nil, err
			}
			itemTemp = append(itemTemp, *item1_ARM.(*arm.CompositePath))
		}
		result.CompositeIndexes = append(result.CompositeIndexes, itemTemp)
	}

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

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

	// Set property "IndexingMode":
	if policy.IndexingMode != nil {
		var temp string
		temp = string(*policy.IndexingMode)
		indexingMode := arm.IndexingPolicy_IndexingMode(temp)
		result.IndexingMode = &indexingMode
	}

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

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

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

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

	// Set property "CompositeIndexes":
	for _, item := range typedInput.CompositeIndexes {
		var itemTemp []CompositePath
		for _, item1 := range item {
			var item2 CompositePath
			err := item2.PopulateFromARM(owner, item1)
			if err != nil {
				return err
			}
			itemTemp = append(itemTemp, item2)
		}
		policy.CompositeIndexes = append(policy.CompositeIndexes, itemTemp)
	}

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

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

	// Set property "IndexingMode":
	if typedInput.IndexingMode != nil {
		var temp string
		temp = string(*typedInput.IndexingMode)
		indexingMode := IndexingPolicy_IndexingMode(temp)
		policy.IndexingMode = &indexingMode
	}

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

	// No error
	return nil
}

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

	// Automatic
	if source.Automatic != nil {
		automatic := *source.Automatic
		policy.Automatic = &automatic
	} else {
		policy.Automatic = nil
	}

	// CompositeIndexes
	if source.CompositeIndexes != nil {
		compositeIndexList := make([][]CompositePath, len(source.CompositeIndexes))
		for compositeIndex, compositeIndexItem := range source.CompositeIndexes {
			if compositeIndexItem != nil {
				compositeIndexList1 := make([]CompositePath, len(compositeIndexItem))
				for compositeIndex1, compositeIndexItem1 := range compositeIndexItem {
					var compositeIndexLocal CompositePath
					err := compositeIndexLocal.AssignProperties_From_CompositePath(&compositeIndexItem1)
					if err != nil {
						return eris.Wrap(err, "calling AssignProperties_From_CompositePath() to populate field CompositeIndexes")
					}
					compositeIndexList1[compositeIndex1] = compositeIndexLocal
				}
				compositeIndexList[compositeIndex] = compositeIndexList1
			} else {
				compositeIndexList[compositeIndex] = nil
			}
		}
		policy.CompositeIndexes = compositeIndexList
	} else {
		policy.CompositeIndexes = nil
	}

	// ExcludedPaths
	if source.ExcludedPaths != nil {
		excludedPathList := make([]ExcludedPath, len(source.ExcludedPaths))
		for excludedPathIndex, excludedPathItem := range source.ExcludedPaths {
			var excludedPath ExcludedPath
			err := excludedPath.AssignProperties_From_ExcludedPath(&excludedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ExcludedPath() to populate field ExcludedPaths")
			}
			excludedPathList[excludedPathIndex] = excludedPath
		}
		policy.ExcludedPaths = excludedPathList
	} else {
		policy.ExcludedPaths = nil
	}

	// IncludedPaths
	if source.IncludedPaths != nil {
		includedPathList := make([]IncludedPath, len(source.IncludedPaths))
		for includedPathIndex, includedPathItem := range source.IncludedPaths {
			var includedPath IncludedPath
			err := includedPath.AssignProperties_From_IncludedPath(&includedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IncludedPath() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		policy.IncludedPaths = includedPathList
	} else {
		policy.IncludedPaths = nil
	}

	// IndexingMode
	if source.IndexingMode != nil {
		indexingMode := *source.IndexingMode
		indexingModeTemp := genruntime.ToEnum(indexingMode, indexingPolicy_IndexingMode_Values)
		policy.IndexingMode = &indexingModeTemp
	} else {
		policy.IndexingMode = nil
	}

	// SpatialIndexes
	if source.SpatialIndexes != nil {
		spatialIndexList := make([]SpatialSpec, len(source.SpatialIndexes))
		for spatialIndex, spatialIndexItem := range source.SpatialIndexes {
			var spatialIndexLocal SpatialSpec
			err := spatialIndexLocal.AssignProperties_From_SpatialSpec(&spatialIndexItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SpatialSpec() to populate field SpatialIndexes")
			}
			spatialIndexList[spatialIndex] = spatialIndexLocal
		}
		policy.SpatialIndexes = spatialIndexList
	} else {
		policy.SpatialIndexes = nil
	}

	// No error
	return nil
}

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

	// Automatic
	if policy.Automatic != nil {
		automatic := *policy.Automatic
		destination.Automatic = &automatic
	} else {
		destination.Automatic = nil
	}

	// CompositeIndexes
	if policy.CompositeIndexes != nil {
		compositeIndexList := make([][]storage.CompositePath, len(policy.CompositeIndexes))
		for compositeIndex, compositeIndexItem := range policy.CompositeIndexes {
			if compositeIndexItem != nil {
				compositeIndexList1 := make([]storage.CompositePath, len(compositeIndexItem))
				for compositeIndex1, compositeIndexItem1 := range compositeIndexItem {
					var compositeIndexLocal storage.CompositePath
					err := compositeIndexItem1.AssignProperties_To_CompositePath(&compositeIndexLocal)
					if err != nil {
						return eris.Wrap(err, "calling AssignProperties_To_CompositePath() to populate field CompositeIndexes")
					}
					compositeIndexList1[compositeIndex1] = compositeIndexLocal
				}
				compositeIndexList[compositeIndex] = compositeIndexList1
			} else {
				compositeIndexList[compositeIndex] = nil
			}
		}
		destination.CompositeIndexes = compositeIndexList
	} else {
		destination.CompositeIndexes = nil
	}

	// ExcludedPaths
	if policy.ExcludedPaths != nil {
		excludedPathList := make([]storage.ExcludedPath, len(policy.ExcludedPaths))
		for excludedPathIndex, excludedPathItem := range policy.ExcludedPaths {
			var excludedPath storage.ExcludedPath
			err := excludedPathItem.AssignProperties_To_ExcludedPath(&excludedPath)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ExcludedPath() to populate field ExcludedPaths")
			}
			excludedPathList[excludedPathIndex] = excludedPath
		}
		destination.ExcludedPaths = excludedPathList
	} else {
		destination.ExcludedPaths = nil
	}

	// IncludedPaths
	if policy.IncludedPaths != nil {
		includedPathList := make([]storage.IncludedPath, len(policy.IncludedPaths))
		for includedPathIndex, includedPathItem := range policy.IncludedPaths {
			var includedPath storage.IncludedPath
			err := includedPathItem.AssignProperties_To_IncludedPath(&includedPath)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IncludedPath() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		destination.IncludedPaths = includedPathList
	} else {
		destination.IncludedPaths = nil
	}

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

	// SpatialIndexes
	if policy.SpatialIndexes != nil {
		spatialIndexList := make([]storage.SpatialSpec, len(policy.SpatialIndexes))
		for spatialIndex, spatialIndexItem := range policy.SpatialIndexes {
			var spatialIndexLocal storage.SpatialSpec
			err := spatialIndexItem.AssignProperties_To_SpatialSpec(&spatialIndexLocal)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SpatialSpec() to populate field SpatialIndexes")
			}
			spatialIndexList[spatialIndex] = spatialIndexLocal
		}
		destination.SpatialIndexes = spatialIndexList
	} else {
		destination.SpatialIndexes = nil
	}

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

	// No error
	return nil
}

// Initialize_From_IndexingPolicy_STATUS populates our IndexingPolicy from the provided source IndexingPolicy_STATUS
func (policy *IndexingPolicy) Initialize_From_IndexingPolicy_STATUS(source *IndexingPolicy_STATUS) error {

	// Automatic
	if source.Automatic != nil {
		automatic := *source.Automatic
		policy.Automatic = &automatic
	} else {
		policy.Automatic = nil
	}

	// CompositeIndexes
	if source.CompositeIndexes != nil {
		compositeIndexList := make([][]CompositePath, len(source.CompositeIndexes))
		for compositeIndex, compositeIndexItem := range source.CompositeIndexes {
			if compositeIndexItem != nil {
				compositeIndexList1 := make([]CompositePath, len(compositeIndexItem))
				for compositeIndex1, compositeIndexItem1 := range compositeIndexItem {
					var compositeIndexLocal CompositePath
					err := compositeIndexLocal.Initialize_From_CompositePath_STATUS(&compositeIndexItem1)
					if err != nil {
						return eris.Wrap(err, "calling Initialize_From_CompositePath_STATUS() to populate field CompositeIndexes")
					}
					compositeIndexList1[compositeIndex1] = compositeIndexLocal
				}
				compositeIndexList[compositeIndex] = compositeIndexList1
			} else {
				compositeIndexList[compositeIndex] = nil
			}
		}
		policy.CompositeIndexes = compositeIndexList
	} else {
		policy.CompositeIndexes = nil
	}

	// ExcludedPaths
	if source.ExcludedPaths != nil {
		excludedPathList := make([]ExcludedPath, len(source.ExcludedPaths))
		for excludedPathIndex, excludedPathItem := range source.ExcludedPaths {
			var excludedPath ExcludedPath
			err := excludedPath.Initialize_From_ExcludedPath_STATUS(&excludedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ExcludedPath_STATUS() to populate field ExcludedPaths")
			}
			excludedPathList[excludedPathIndex] = excludedPath
		}
		policy.ExcludedPaths = excludedPathList
	} else {
		policy.ExcludedPaths = nil
	}

	// IncludedPaths
	if source.IncludedPaths != nil {
		includedPathList := make([]IncludedPath, len(source.IncludedPaths))
		for includedPathIndex, includedPathItem := range source.IncludedPaths {
			var includedPath IncludedPath
			err := includedPath.Initialize_From_IncludedPath_STATUS(&includedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_IncludedPath_STATUS() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		policy.IncludedPaths = includedPathList
	} else {
		policy.IncludedPaths = nil
	}

	// IndexingMode
	if source.IndexingMode != nil {
		indexingMode := genruntime.ToEnum(string(*source.IndexingMode), indexingPolicy_IndexingMode_Values)
		policy.IndexingMode = &indexingMode
	} else {
		policy.IndexingMode = nil
	}

	// SpatialIndexes
	if source.SpatialIndexes != nil {
		spatialIndexList := make([]SpatialSpec, len(source.SpatialIndexes))
		for spatialIndex, spatialIndexItem := range source.SpatialIndexes {
			var spatialIndexLocal SpatialSpec
			err := spatialIndexLocal.Initialize_From_SpatialSpec_STATUS(&spatialIndexItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_SpatialSpec_STATUS() to populate field SpatialIndexes")
			}
			spatialIndexList[spatialIndex] = spatialIndexLocal
		}
		policy.SpatialIndexes = spatialIndexList
	} else {
		policy.SpatialIndexes = nil
	}

	// No error
	return nil
}

// Cosmos DB indexing policy
type IndexingPolicy_STATUS struct {
	// Automatic: Indicates if the indexing policy is automatic
	Automatic *bool `json:"automatic,omitempty"`

	// CompositeIndexes: List of composite path list
	CompositeIndexes [][]CompositePath_STATUS `json:"compositeIndexes,omitempty"`

	// ExcludedPaths: List of paths to exclude from indexing
	ExcludedPaths []ExcludedPath_STATUS `json:"excludedPaths,omitempty"`

	// IncludedPaths: List of paths to include in the indexing
	IncludedPaths []IncludedPath_STATUS `json:"includedPaths,omitempty"`

	// IndexingMode: Indicates the indexing mode.
	IndexingMode *IndexingPolicy_IndexingMode_STATUS `json:"indexingMode,omitempty"`

	// SpatialIndexes: List of spatial specifics
	SpatialIndexes []SpatialSpec_STATUS `json:"spatialIndexes,omitempty"`
}

var _ genruntime.FromARMConverter = &IndexingPolicy_STATUS{}

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

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

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

	// Set property "CompositeIndexes":
	for _, item := range typedInput.CompositeIndexes {
		var itemTemp []CompositePath_STATUS
		for _, item1 := range item {
			var item2 CompositePath_STATUS
			err := item2.PopulateFromARM(owner, item1)
			if err != nil {
				return err
			}
			itemTemp = append(itemTemp, item2)
		}
		policy.CompositeIndexes = append(policy.CompositeIndexes, itemTemp)
	}

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

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

	// Set property "IndexingMode":
	if typedInput.IndexingMode != nil {
		var temp string
		temp = string(*typedInput.IndexingMode)
		indexingMode := IndexingPolicy_IndexingMode_STATUS(temp)
		policy.IndexingMode = &indexingMode
	}

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

	// No error
	return nil
}

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

	// Automatic
	if source.Automatic != nil {
		automatic := *source.Automatic
		policy.Automatic = &automatic
	} else {
		policy.Automatic = nil
	}

	// CompositeIndexes
	if source.CompositeIndexes != nil {
		compositeIndexList := make([][]CompositePath_STATUS, len(source.CompositeIndexes))
		for compositeIndex, compositeIndexItem := range source.CompositeIndexes {
			if compositeIndexItem != nil {
				compositeIndexList1 := make([]CompositePath_STATUS, len(compositeIndexItem))
				for compositeIndex1, compositeIndexItem1 := range compositeIndexItem {
					var compositeIndexLocal CompositePath_STATUS
					err := compositeIndexLocal.AssignProperties_From_CompositePath_STATUS(&compositeIndexItem1)
					if err != nil {
						return eris.Wrap(err, "calling AssignProperties_From_CompositePath_STATUS() to populate field CompositeIndexes")
					}
					compositeIndexList1[compositeIndex1] = compositeIndexLocal
				}
				compositeIndexList[compositeIndex] = compositeIndexList1
			} else {
				compositeIndexList[compositeIndex] = nil
			}
		}
		policy.CompositeIndexes = compositeIndexList
	} else {
		policy.CompositeIndexes = nil
	}

	// ExcludedPaths
	if source.ExcludedPaths != nil {
		excludedPathList := make([]ExcludedPath_STATUS, len(source.ExcludedPaths))
		for excludedPathIndex, excludedPathItem := range source.ExcludedPaths {
			var excludedPath ExcludedPath_STATUS
			err := excludedPath.AssignProperties_From_ExcludedPath_STATUS(&excludedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ExcludedPath_STATUS() to populate field ExcludedPaths")
			}
			excludedPathList[excludedPathIndex] = excludedPath
		}
		policy.ExcludedPaths = excludedPathList
	} else {
		policy.ExcludedPaths = nil
	}

	// IncludedPaths
	if source.IncludedPaths != nil {
		includedPathList := make([]IncludedPath_STATUS, len(source.IncludedPaths))
		for includedPathIndex, includedPathItem := range source.IncludedPaths {
			var includedPath IncludedPath_STATUS
			err := includedPath.AssignProperties_From_IncludedPath_STATUS(&includedPathItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IncludedPath_STATUS() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		policy.IncludedPaths = includedPathList
	} else {
		policy.IncludedPaths = nil
	}

	// IndexingMode
	if source.IndexingMode != nil {
		indexingMode := *source.IndexingMode
		indexingModeTemp := genruntime.ToEnum(indexingMode, indexingPolicy_IndexingMode_STATUS_Values)
		policy.IndexingMode = &indexingModeTemp
	} else {
		policy.IndexingMode = nil
	}

	// SpatialIndexes
	if source.SpatialIndexes != nil {
		spatialIndexList := make([]SpatialSpec_STATUS, len(source.SpatialIndexes))
		for spatialIndex, spatialIndexItem := range source.SpatialIndexes {
			var spatialIndexLocal SpatialSpec_STATUS
			err := spatialIndexLocal.AssignProperties_From_SpatialSpec_STATUS(&spatialIndexItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SpatialSpec_STATUS() to populate field SpatialIndexes")
			}
			spatialIndexList[spatialIndex] = spatialIndexLocal
		}
		policy.SpatialIndexes = spatialIndexList
	} else {
		policy.SpatialIndexes = nil
	}

	// No error
	return nil
}

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

	// Automatic
	if policy.Automatic != nil {
		automatic := *policy.Automatic
		destination.Automatic = &automatic
	} else {
		destination.Automatic = nil
	}

	// CompositeIndexes
	if policy.CompositeIndexes != nil {
		compositeIndexList := make([][]storage.CompositePath_STATUS, len(policy.CompositeIndexes))
		for compositeIndex, compositeIndexItem := range policy.CompositeIndexes {
			if compositeIndexItem != nil {
				compositeIndexList1 := make([]storage.CompositePath_STATUS, len(compositeIndexItem))
				for compositeIndex1, compositeIndexItem1 := range compositeIndexItem {
					var compositeIndexLocal storage.CompositePath_STATUS
					err := compositeIndexItem1.AssignProperties_To_CompositePath_STATUS(&compositeIndexLocal)
					if err != nil {
						return eris.Wrap(err, "calling AssignProperties_To_CompositePath_STATUS() to populate field CompositeIndexes")
					}
					compositeIndexList1[compositeIndex1] = compositeIndexLocal
				}
				compositeIndexList[compositeIndex] = compositeIndexList1
			} else {
				compositeIndexList[compositeIndex] = nil
			}
		}
		destination.CompositeIndexes = compositeIndexList
	} else {
		destination.CompositeIndexes = nil
	}

	// ExcludedPaths
	if policy.ExcludedPaths != nil {
		excludedPathList := make([]storage.ExcludedPath_STATUS, len(policy.ExcludedPaths))
		for excludedPathIndex, excludedPathItem := range policy.ExcludedPaths {
			var excludedPath storage.ExcludedPath_STATUS
			err := excludedPathItem.AssignProperties_To_ExcludedPath_STATUS(&excludedPath)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ExcludedPath_STATUS() to populate field ExcludedPaths")
			}
			excludedPathList[excludedPathIndex] = excludedPath
		}
		destination.ExcludedPaths = excludedPathList
	} else {
		destination.ExcludedPaths = nil
	}

	// IncludedPaths
	if policy.IncludedPaths != nil {
		includedPathList := make([]storage.IncludedPath_STATUS, len(policy.IncludedPaths))
		for includedPathIndex, includedPathItem := range policy.IncludedPaths {
			var includedPath storage.IncludedPath_STATUS
			err := includedPathItem.AssignProperties_To_IncludedPath_STATUS(&includedPath)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IncludedPath_STATUS() to populate field IncludedPaths")
			}
			includedPathList[includedPathIndex] = includedPath
		}
		destination.IncludedPaths = includedPathList
	} else {
		destination.IncludedPaths = nil
	}

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

	// SpatialIndexes
	if policy.SpatialIndexes != nil {
		spatialIndexList := make([]storage.SpatialSpec_STATUS, len(policy.SpatialIndexes))
		for spatialIndex, spatialIndexItem := range policy.SpatialIndexes {
			var spatialIndexLocal storage.SpatialSpec_STATUS
			err := spatialIndexItem.AssignProperties_To_SpatialSpec_STATUS(&spatialIndexLocal)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SpatialSpec_STATUS() to populate field SpatialIndexes")
			}
			spatialIndexList[spatialIndex] = spatialIndexLocal
		}
		destination.SpatialIndexes = spatialIndexList
	} else {
		destination.SpatialIndexes = nil
	}

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

	// No error
	return nil
}

// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure
// Cosmos DB service.
type UniqueKeyPolicy struct {
	// UniqueKeys: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure
	// Cosmos DB service.
	UniqueKeys []UniqueKey `json:"uniqueKeys,omitempty"`
}

var _ genruntime.ARMTransformer = &UniqueKeyPolicy{}

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

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

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

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

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

	// No error
	return nil
}

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

	// UniqueKeys
	if source.UniqueKeys != nil {
		uniqueKeyList := make([]UniqueKey, len(source.UniqueKeys))
		for uniqueKeyIndex, uniqueKeyItem := range source.UniqueKeys {
			var uniqueKey UniqueKey
			err := uniqueKey.AssignProperties_From_UniqueKey(&uniqueKeyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_UniqueKey() to populate field UniqueKeys")
			}
			uniqueKeyList[uniqueKeyIndex] = uniqueKey
		}
		policy.UniqueKeys = uniqueKeyList
	} else {
		policy.UniqueKeys = nil
	}

	// No error
	return nil
}

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

	// UniqueKeys
	if policy.UniqueKeys != nil {
		uniqueKeyList := make([]storage.UniqueKey, len(policy.UniqueKeys))
		for uniqueKeyIndex, uniqueKeyItem := range policy.UniqueKeys {
			var uniqueKey storage.UniqueKey
			err := uniqueKeyItem.AssignProperties_To_UniqueKey(&uniqueKey)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UniqueKey() to populate field UniqueKeys")
			}
			uniqueKeyList[uniqueKeyIndex] = uniqueKey
		}
		destination.UniqueKeys = uniqueKeyList
	} else {
		destination.UniqueKeys = nil
	}

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

	// No error
	return nil
}

// Initialize_From_UniqueKeyPolicy_STATUS populates our UniqueKeyPolicy from the provided source UniqueKeyPolicy_STATUS
func (policy *UniqueKeyPolicy) Initialize_From_UniqueKeyPolicy_STATUS(source *UniqueKeyPolicy_STATUS) error {

	// UniqueKeys
	if source.UniqueKeys != nil {
		uniqueKeyList := make([]UniqueKey, len(source.UniqueKeys))
		for uniqueKeyIndex, uniqueKeyItem := range source.UniqueKeys {
			var uniqueKey UniqueKey
			err := uniqueKey.Initialize_From_UniqueKey_STATUS(&uniqueKeyItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_UniqueKey_STATUS() to populate field UniqueKeys")
			}
			uniqueKeyList[uniqueKeyIndex] = uniqueKey
		}
		policy.UniqueKeys = uniqueKeyList
	} else {
		policy.UniqueKeys = nil
	}

	// No error
	return nil
}

// The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure
// Cosmos DB service.
type UniqueKeyPolicy_STATUS struct {
	// UniqueKeys: List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure
	// Cosmos DB service.
	UniqueKeys []UniqueKey_STATUS `json:"uniqueKeys,omitempty"`
}

var _ genruntime.FromARMConverter = &UniqueKeyPolicy_STATUS{}

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

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

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

	// No error
	return nil
}

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

	// UniqueKeys
	if source.UniqueKeys != nil {
		uniqueKeyList := make([]UniqueKey_STATUS, len(source.UniqueKeys))
		for uniqueKeyIndex, uniqueKeyItem := range source.UniqueKeys {
			var uniqueKey UniqueKey_STATUS
			err := uniqueKey.AssignProperties_From_UniqueKey_STATUS(&uniqueKeyItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_UniqueKey_STATUS() to populate field UniqueKeys")
			}
			uniqueKeyList[uniqueKeyIndex] = uniqueKey
		}
		policy.UniqueKeys = uniqueKeyList
	} else {
		policy.UniqueKeys = nil
	}

	// No error
	return nil
}

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

	// UniqueKeys
	if policy.UniqueKeys != nil {
		uniqueKeyList := make([]storage.UniqueKey_STATUS, len(policy.UniqueKeys))
		for uniqueKeyIndex, uniqueKeyItem := range policy.UniqueKeys {
			var uniqueKey storage.UniqueKey_STATUS
			err := uniqueKeyItem.AssignProperties_To_UniqueKey_STATUS(&uniqueKey)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UniqueKey_STATUS() to populate field UniqueKeys")
			}
			uniqueKeyList[uniqueKeyIndex] = uniqueKey
		}
		destination.UniqueKeys = uniqueKeyList
	} else {
		destination.UniqueKeys = nil
	}

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

	// No error
	return nil
}

// .
type ClientEncryptionIncludedPath struct {
	// +kubebuilder:validation:Required
	// ClientEncryptionKeyId: The identifier of the Client Encryption Key to be used to encrypt the path.
	ClientEncryptionKeyId *string `json:"clientEncryptionKeyId,omitempty"`

	// +kubebuilder:validation:Required
	// EncryptionAlgorithm: The encryption algorithm which will be used. Eg - AEAD_AES_256_CBC_HMAC_SHA256.
	EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"`

	// +kubebuilder:validation:Required
	// EncryptionType: The type of encryption to be performed. Eg - Deterministic, Randomized.
	EncryptionType *string `json:"encryptionType,omitempty"`

	// +kubebuilder:validation:Required
	// Path: Path that needs to be encrypted.
	Path *string `json:"path,omitempty"`
}

var _ genruntime.ARMTransformer = &ClientEncryptionIncludedPath{}

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

	// Set property "ClientEncryptionKeyId":
	if path.ClientEncryptionKeyId != nil {
		clientEncryptionKeyId := *path.ClientEncryptionKeyId
		result.ClientEncryptionKeyId = &clientEncryptionKeyId
	}

	// Set property "EncryptionAlgorithm":
	if path.EncryptionAlgorithm != nil {
		encryptionAlgorithm := *path.EncryptionAlgorithm
		result.EncryptionAlgorithm = &encryptionAlgorithm
	}

	// Set property "EncryptionType":
	if path.EncryptionType != nil {
		encryptionType := *path.EncryptionType
		result.EncryptionType = &encryptionType
	}

	// Set property "Path":
	if path.Path != nil {
		path1 := *path.Path
		result.Path = &path1
	}
	return result, nil
}

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

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

	// Set property "ClientEncryptionKeyId":
	if typedInput.ClientEncryptionKeyId != nil {
		clientEncryptionKeyId := *typedInput.ClientEncryptionKeyId
		path.ClientEncryptionKeyId = &clientEncryptionKeyId
	}

	// Set property "EncryptionAlgorithm":
	if typedInput.EncryptionAlgorithm != nil {
		encryptionAlgorithm := *typedInput.EncryptionAlgorithm
		path.EncryptionAlgorithm = &encryptionAlgorithm
	}

	// Set property "EncryptionType":
	if typedInput.EncryptionType != nil {
		encryptionType := *typedInput.EncryptionType
		path.EncryptionType = &encryptionType
	}

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_ClientEncryptionIncludedPath populates our ClientEncryptionIncludedPath from the provided source ClientEncryptionIncludedPath
func (path *ClientEncryptionIncludedPath) AssignProperties_From_ClientEncryptionIncludedPath(source *storage.ClientEncryptionIncludedPath) error {

	// ClientEncryptionKeyId
	path.ClientEncryptionKeyId = genruntime.ClonePointerToString(source.ClientEncryptionKeyId)

	// EncryptionAlgorithm
	path.EncryptionAlgorithm = genruntime.ClonePointerToString(source.EncryptionAlgorithm)

	// EncryptionType
	path.EncryptionType = genruntime.ClonePointerToString(source.EncryptionType)

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// ClientEncryptionKeyId
	destination.ClientEncryptionKeyId = genruntime.ClonePointerToString(path.ClientEncryptionKeyId)

	// EncryptionAlgorithm
	destination.EncryptionAlgorithm = genruntime.ClonePointerToString(path.EncryptionAlgorithm)

	// EncryptionType
	destination.EncryptionType = genruntime.ClonePointerToString(path.EncryptionType)

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// Initialize_From_ClientEncryptionIncludedPath_STATUS populates our ClientEncryptionIncludedPath from the provided source ClientEncryptionIncludedPath_STATUS
func (path *ClientEncryptionIncludedPath) Initialize_From_ClientEncryptionIncludedPath_STATUS(source *ClientEncryptionIncludedPath_STATUS) error {

	// ClientEncryptionKeyId
	path.ClientEncryptionKeyId = genruntime.ClonePointerToString(source.ClientEncryptionKeyId)

	// EncryptionAlgorithm
	path.EncryptionAlgorithm = genruntime.ClonePointerToString(source.EncryptionAlgorithm)

	// EncryptionType
	path.EncryptionType = genruntime.ClonePointerToString(source.EncryptionType)

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

// .
type ClientEncryptionIncludedPath_STATUS struct {
	// ClientEncryptionKeyId: The identifier of the Client Encryption Key to be used to encrypt the path.
	ClientEncryptionKeyId *string `json:"clientEncryptionKeyId,omitempty"`

	// EncryptionAlgorithm: The encryption algorithm which will be used. Eg - AEAD_AES_256_CBC_HMAC_SHA256.
	EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"`

	// EncryptionType: The type of encryption to be performed. Eg - Deterministic, Randomized.
	EncryptionType *string `json:"encryptionType,omitempty"`

	// Path: Path that needs to be encrypted.
	Path *string `json:"path,omitempty"`
}

var _ genruntime.FromARMConverter = &ClientEncryptionIncludedPath_STATUS{}

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

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

	// Set property "ClientEncryptionKeyId":
	if typedInput.ClientEncryptionKeyId != nil {
		clientEncryptionKeyId := *typedInput.ClientEncryptionKeyId
		path.ClientEncryptionKeyId = &clientEncryptionKeyId
	}

	// Set property "EncryptionAlgorithm":
	if typedInput.EncryptionAlgorithm != nil {
		encryptionAlgorithm := *typedInput.EncryptionAlgorithm
		path.EncryptionAlgorithm = &encryptionAlgorithm
	}

	// Set property "EncryptionType":
	if typedInput.EncryptionType != nil {
		encryptionType := *typedInput.EncryptionType
		path.EncryptionType = &encryptionType
	}

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_ClientEncryptionIncludedPath_STATUS populates our ClientEncryptionIncludedPath_STATUS from the provided source ClientEncryptionIncludedPath_STATUS
func (path *ClientEncryptionIncludedPath_STATUS) AssignProperties_From_ClientEncryptionIncludedPath_STATUS(source *storage.ClientEncryptionIncludedPath_STATUS) error {

	// ClientEncryptionKeyId
	path.ClientEncryptionKeyId = genruntime.ClonePointerToString(source.ClientEncryptionKeyId)

	// EncryptionAlgorithm
	path.EncryptionAlgorithm = genruntime.ClonePointerToString(source.EncryptionAlgorithm)

	// EncryptionType
	path.EncryptionType = genruntime.ClonePointerToString(source.EncryptionType)

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// ClientEncryptionKeyId
	destination.ClientEncryptionKeyId = genruntime.ClonePointerToString(path.ClientEncryptionKeyId)

	// EncryptionAlgorithm
	destination.EncryptionAlgorithm = genruntime.ClonePointerToString(path.EncryptionAlgorithm)

	// EncryptionType
	destination.EncryptionType = genruntime.ClonePointerToString(path.EncryptionType)

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

type CompositePath struct {
	// Order: Sort order for composite paths.
	Order *CompositePath_Order `json:"order,omitempty"`

	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`
}

var _ genruntime.ARMTransformer = &CompositePath{}

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

	// Set property "Order":
	if path.Order != nil {
		var temp string
		temp = string(*path.Order)
		order := arm.CompositePath_Order(temp)
		result.Order = &order
	}

	// Set property "Path":
	if path.Path != nil {
		path1 := *path.Path
		result.Path = &path1
	}
	return result, nil
}

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

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

	// Set property "Order":
	if typedInput.Order != nil {
		var temp string
		temp = string(*typedInput.Order)
		order := CompositePath_Order(temp)
		path.Order = &order
	}

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_CompositePath populates our CompositePath from the provided source CompositePath
func (path *CompositePath) AssignProperties_From_CompositePath(source *storage.CompositePath) error {

	// Order
	if source.Order != nil {
		order := *source.Order
		orderTemp := genruntime.ToEnum(order, compositePath_Order_Values)
		path.Order = &orderTemp
	} else {
		path.Order = nil
	}

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// Order
	if path.Order != nil {
		order := string(*path.Order)
		destination.Order = &order
	} else {
		destination.Order = nil
	}

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// Initialize_From_CompositePath_STATUS populates our CompositePath from the provided source CompositePath_STATUS
func (path *CompositePath) Initialize_From_CompositePath_STATUS(source *CompositePath_STATUS) error {

	// Order
	if source.Order != nil {
		order := genruntime.ToEnum(string(*source.Order), compositePath_Order_Values)
		path.Order = &order
	} else {
		path.Order = nil
	}

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

type CompositePath_STATUS struct {
	// Order: Sort order for composite paths.
	Order *CompositePath_Order_STATUS `json:"order,omitempty"`

	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`
}

var _ genruntime.FromARMConverter = &CompositePath_STATUS{}

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

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

	// Set property "Order":
	if typedInput.Order != nil {
		var temp string
		temp = string(*typedInput.Order)
		order := CompositePath_Order_STATUS(temp)
		path.Order = &order
	}

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_CompositePath_STATUS populates our CompositePath_STATUS from the provided source CompositePath_STATUS
func (path *CompositePath_STATUS) AssignProperties_From_CompositePath_STATUS(source *storage.CompositePath_STATUS) error {

	// Order
	if source.Order != nil {
		order := *source.Order
		orderTemp := genruntime.ToEnum(order, compositePath_Order_STATUS_Values)
		path.Order = &orderTemp
	} else {
		path.Order = nil
	}

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// Order
	if path.Order != nil {
		order := string(*path.Order)
		destination.Order = &order
	} else {
		destination.Order = nil
	}

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Custom","LastWriterWins"}
type ConflictResolutionPolicy_Mode string

const (
	ConflictResolutionPolicy_Mode_Custom         = ConflictResolutionPolicy_Mode("Custom")
	ConflictResolutionPolicy_Mode_LastWriterWins = ConflictResolutionPolicy_Mode("LastWriterWins")
)

// Mapping from string to ConflictResolutionPolicy_Mode
var conflictResolutionPolicy_Mode_Values = map[string]ConflictResolutionPolicy_Mode{
	"custom":         ConflictResolutionPolicy_Mode_Custom,
	"lastwriterwins": ConflictResolutionPolicy_Mode_LastWriterWins,
}

type ConflictResolutionPolicy_Mode_STATUS string

const (
	ConflictResolutionPolicy_Mode_STATUS_Custom         = ConflictResolutionPolicy_Mode_STATUS("Custom")
	ConflictResolutionPolicy_Mode_STATUS_LastWriterWins = ConflictResolutionPolicy_Mode_STATUS("LastWriterWins")
)

// Mapping from string to ConflictResolutionPolicy_Mode_STATUS
var conflictResolutionPolicy_Mode_STATUS_Values = map[string]ConflictResolutionPolicy_Mode_STATUS{
	"custom":         ConflictResolutionPolicy_Mode_STATUS_Custom,
	"lastwriterwins": ConflictResolutionPolicy_Mode_STATUS_LastWriterWins,
}

// +kubebuilder:validation:Enum={"Hash","MultiHash","Range"}
type ContainerPartitionKey_Kind string

const (
	ContainerPartitionKey_Kind_Hash      = ContainerPartitionKey_Kind("Hash")
	ContainerPartitionKey_Kind_MultiHash = ContainerPartitionKey_Kind("MultiHash")
	ContainerPartitionKey_Kind_Range     = ContainerPartitionKey_Kind("Range")
)

// Mapping from string to ContainerPartitionKey_Kind
var containerPartitionKey_Kind_Values = map[string]ContainerPartitionKey_Kind{
	"hash":      ContainerPartitionKey_Kind_Hash,
	"multihash": ContainerPartitionKey_Kind_MultiHash,
	"range":     ContainerPartitionKey_Kind_Range,
}

type ContainerPartitionKey_Kind_STATUS string

const (
	ContainerPartitionKey_Kind_STATUS_Hash      = ContainerPartitionKey_Kind_STATUS("Hash")
	ContainerPartitionKey_Kind_STATUS_MultiHash = ContainerPartitionKey_Kind_STATUS("MultiHash")
	ContainerPartitionKey_Kind_STATUS_Range     = ContainerPartitionKey_Kind_STATUS("Range")
)

// Mapping from string to ContainerPartitionKey_Kind_STATUS
var containerPartitionKey_Kind_STATUS_Values = map[string]ContainerPartitionKey_Kind_STATUS{
	"hash":      ContainerPartitionKey_Kind_STATUS_Hash,
	"multihash": ContainerPartitionKey_Kind_STATUS_MultiHash,
	"range":     ContainerPartitionKey_Kind_STATUS_Range,
}

type ExcludedPath struct {
	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`
}

var _ genruntime.ARMTransformer = &ExcludedPath{}

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

	// Set property "Path":
	if path.Path != nil {
		path1 := *path.Path
		result.Path = &path1
	}
	return result, nil
}

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

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

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_ExcludedPath populates our ExcludedPath from the provided source ExcludedPath
func (path *ExcludedPath) AssignProperties_From_ExcludedPath(source *storage.ExcludedPath) error {

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// Initialize_From_ExcludedPath_STATUS populates our ExcludedPath from the provided source ExcludedPath_STATUS
func (path *ExcludedPath) Initialize_From_ExcludedPath_STATUS(source *ExcludedPath_STATUS) error {

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

type ExcludedPath_STATUS struct {
	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`
}

var _ genruntime.FromARMConverter = &ExcludedPath_STATUS{}

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

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

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_ExcludedPath_STATUS populates our ExcludedPath_STATUS from the provided source ExcludedPath_STATUS
func (path *ExcludedPath_STATUS) AssignProperties_From_ExcludedPath_STATUS(source *storage.ExcludedPath_STATUS) error {

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// The paths that are included in indexing
type IncludedPath struct {
	// Indexes: List of indexes for this path
	Indexes []Indexes `json:"indexes,omitempty"`

	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`
}

var _ genruntime.ARMTransformer = &IncludedPath{}

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

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

	// Set property "Path":
	if path.Path != nil {
		path1 := *path.Path
		result.Path = &path1
	}
	return result, nil
}

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

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

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

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_IncludedPath populates our IncludedPath from the provided source IncludedPath
func (path *IncludedPath) AssignProperties_From_IncludedPath(source *storage.IncludedPath) error {

	// Indexes
	if source.Indexes != nil {
		indexList := make([]Indexes, len(source.Indexes))
		for index, indexItem := range source.Indexes {
			var indexLocal Indexes
			err := indexLocal.AssignProperties_From_Indexes(&indexItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Indexes() to populate field Indexes")
			}
			indexList[index] = indexLocal
		}
		path.Indexes = indexList
	} else {
		path.Indexes = nil
	}

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// Indexes
	if path.Indexes != nil {
		indexList := make([]storage.Indexes, len(path.Indexes))
		for index, indexItem := range path.Indexes {
			var indexLocal storage.Indexes
			err := indexItem.AssignProperties_To_Indexes(&indexLocal)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Indexes() to populate field Indexes")
			}
			indexList[index] = indexLocal
		}
		destination.Indexes = indexList
	} else {
		destination.Indexes = nil
	}

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// Initialize_From_IncludedPath_STATUS populates our IncludedPath from the provided source IncludedPath_STATUS
func (path *IncludedPath) Initialize_From_IncludedPath_STATUS(source *IncludedPath_STATUS) error {

	// Indexes
	if source.Indexes != nil {
		indexList := make([]Indexes, len(source.Indexes))
		for index, indexItem := range source.Indexes {
			var indexLocal Indexes
			err := indexLocal.Initialize_From_Indexes_STATUS(&indexItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_Indexes_STATUS() to populate field Indexes")
			}
			indexList[index] = indexLocal
		}
		path.Indexes = indexList
	} else {
		path.Indexes = nil
	}

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

// The paths that are included in indexing
type IncludedPath_STATUS struct {
	// Indexes: List of indexes for this path
	Indexes []Indexes_STATUS `json:"indexes,omitempty"`

	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`
}

var _ genruntime.FromARMConverter = &IncludedPath_STATUS{}

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

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

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

	// Set property "Path":
	if typedInput.Path != nil {
		path1 := *typedInput.Path
		path.Path = &path1
	}

	// No error
	return nil
}

// AssignProperties_From_IncludedPath_STATUS populates our IncludedPath_STATUS from the provided source IncludedPath_STATUS
func (path *IncludedPath_STATUS) AssignProperties_From_IncludedPath_STATUS(source *storage.IncludedPath_STATUS) error {

	// Indexes
	if source.Indexes != nil {
		indexList := make([]Indexes_STATUS, len(source.Indexes))
		for index, indexItem := range source.Indexes {
			var indexLocal Indexes_STATUS
			err := indexLocal.AssignProperties_From_Indexes_STATUS(&indexItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Indexes_STATUS() to populate field Indexes")
			}
			indexList[index] = indexLocal
		}
		path.Indexes = indexList
	} else {
		path.Indexes = nil
	}

	// Path
	path.Path = genruntime.ClonePointerToString(source.Path)

	// No error
	return nil
}

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

	// Indexes
	if path.Indexes != nil {
		indexList := make([]storage.Indexes_STATUS, len(path.Indexes))
		for index, indexItem := range path.Indexes {
			var indexLocal storage.Indexes_STATUS
			err := indexItem.AssignProperties_To_Indexes_STATUS(&indexLocal)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Indexes_STATUS() to populate field Indexes")
			}
			indexList[index] = indexLocal
		}
		destination.Indexes = indexList
	} else {
		destination.Indexes = nil
	}

	// Path
	destination.Path = genruntime.ClonePointerToString(path.Path)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"consistent","lazy","none"}
type IndexingPolicy_IndexingMode string

const (
	IndexingPolicy_IndexingMode_Consistent = IndexingPolicy_IndexingMode("consistent")
	IndexingPolicy_IndexingMode_Lazy       = IndexingPolicy_IndexingMode("lazy")
	IndexingPolicy_IndexingMode_None       = IndexingPolicy_IndexingMode("none")
)

// Mapping from string to IndexingPolicy_IndexingMode
var indexingPolicy_IndexingMode_Values = map[string]IndexingPolicy_IndexingMode{
	"consistent": IndexingPolicy_IndexingMode_Consistent,
	"lazy":       IndexingPolicy_IndexingMode_Lazy,
	"none":       IndexingPolicy_IndexingMode_None,
}

type IndexingPolicy_IndexingMode_STATUS string

const (
	IndexingPolicy_IndexingMode_STATUS_Consistent = IndexingPolicy_IndexingMode_STATUS("consistent")
	IndexingPolicy_IndexingMode_STATUS_Lazy       = IndexingPolicy_IndexingMode_STATUS("lazy")
	IndexingPolicy_IndexingMode_STATUS_None       = IndexingPolicy_IndexingMode_STATUS("none")
)

// Mapping from string to IndexingPolicy_IndexingMode_STATUS
var indexingPolicy_IndexingMode_STATUS_Values = map[string]IndexingPolicy_IndexingMode_STATUS{
	"consistent": IndexingPolicy_IndexingMode_STATUS_Consistent,
	"lazy":       IndexingPolicy_IndexingMode_STATUS_Lazy,
	"none":       IndexingPolicy_IndexingMode_STATUS_None,
}

type SpatialSpec struct {
	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`

	// Types: List of path's spatial type
	Types []SpatialType `json:"types,omitempty"`
}

var _ genruntime.ARMTransformer = &SpatialSpec{}

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

	// Set property "Path":
	if spatial.Path != nil {
		path := *spatial.Path
		result.Path = &path
	}

	// Set property "Types":
	for _, item := range spatial.Types {
		var temp string
		temp = string(item)
		result.Types = append(result.Types, arm.SpatialType(temp))
	}
	return result, nil
}

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

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

	// Set property "Path":
	if typedInput.Path != nil {
		path := *typedInput.Path
		spatial.Path = &path
	}

	// Set property "Types":
	for _, item := range typedInput.Types {
		var temp string
		temp = string(item)
		spatial.Types = append(spatial.Types, SpatialType(temp))
	}

	// No error
	return nil
}

// AssignProperties_From_SpatialSpec populates our SpatialSpec from the provided source SpatialSpec
func (spatial *SpatialSpec) AssignProperties_From_SpatialSpec(source *storage.SpatialSpec) error {

	// Path
	spatial.Path = genruntime.ClonePointerToString(source.Path)

	// Types
	if source.Types != nil {
		typeList := make([]SpatialType, len(source.Types))
		for typeIndex, typeItem := range source.Types {
			typeList[typeIndex] = genruntime.ToEnum(typeItem, spatialType_Values)
		}
		spatial.Types = typeList
	} else {
		spatial.Types = nil
	}

	// No error
	return nil
}

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

	// Path
	destination.Path = genruntime.ClonePointerToString(spatial.Path)

	// Types
	if spatial.Types != nil {
		typeList := make([]string, len(spatial.Types))
		for typeIndex, typeItem := range spatial.Types {
			typeList[typeIndex] = string(typeItem)
		}
		destination.Types = typeList
	} else {
		destination.Types = nil
	}

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

	// No error
	return nil
}

// Initialize_From_SpatialSpec_STATUS populates our SpatialSpec from the provided source SpatialSpec_STATUS
func (spatial *SpatialSpec) Initialize_From_SpatialSpec_STATUS(source *SpatialSpec_STATUS) error {

	// Path
	spatial.Path = genruntime.ClonePointerToString(source.Path)

	// Types
	if source.Types != nil {
		typeList := make([]SpatialType, len(source.Types))
		for typeIndex, typeItem := range source.Types {
			typeVar := genruntime.ToEnum(string(typeItem), spatialType_Values)
			typeList[typeIndex] = typeVar
		}
		spatial.Types = typeList
	} else {
		spatial.Types = nil
	}

	// No error
	return nil
}

type SpatialSpec_STATUS struct {
	// Path: The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard
	// (/path/*)
	Path *string `json:"path,omitempty"`

	// Types: List of path's spatial type
	Types []SpatialType_STATUS `json:"types,omitempty"`
}

var _ genruntime.FromARMConverter = &SpatialSpec_STATUS{}

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

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

	// Set property "Path":
	if typedInput.Path != nil {
		path := *typedInput.Path
		spatial.Path = &path
	}

	// Set property "Types":
	for _, item := range typedInput.Types {
		var temp string
		temp = string(item)
		spatial.Types = append(spatial.Types, SpatialType_STATUS(temp))
	}

	// No error
	return nil
}

// AssignProperties_From_SpatialSpec_STATUS populates our SpatialSpec_STATUS from the provided source SpatialSpec_STATUS
func (spatial *SpatialSpec_STATUS) AssignProperties_From_SpatialSpec_STATUS(source *storage.SpatialSpec_STATUS) error {

	// Path
	spatial.Path = genruntime.ClonePointerToString(source.Path)

	// Types
	if source.Types != nil {
		typeList := make([]SpatialType_STATUS, len(source.Types))
		for typeIndex, typeItem := range source.Types {
			typeList[typeIndex] = genruntime.ToEnum(typeItem, spatialType_STATUS_Values)
		}
		spatial.Types = typeList
	} else {
		spatial.Types = nil
	}

	// No error
	return nil
}

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

	// Path
	destination.Path = genruntime.ClonePointerToString(spatial.Path)

	// Types
	if spatial.Types != nil {
		typeList := make([]string, len(spatial.Types))
		for typeIndex, typeItem := range spatial.Types {
			typeList[typeIndex] = string(typeItem)
		}
		destination.Types = typeList
	} else {
		destination.Types = nil
	}

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

	// No error
	return nil
}

// The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.
type UniqueKey struct {
	// Paths: List of paths must be unique for each document in the Azure Cosmos DB service
	Paths []string `json:"paths,omitempty"`
}

var _ genruntime.ARMTransformer = &UniqueKey{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_UniqueKey populates our UniqueKey from the provided source UniqueKey
func (uniqueKey *UniqueKey) AssignProperties_From_UniqueKey(source *storage.UniqueKey) error {

	// Paths
	uniqueKey.Paths = genruntime.CloneSliceOfString(source.Paths)

	// No error
	return nil
}

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

	// Paths
	destination.Paths = genruntime.CloneSliceOfString(uniqueKey.Paths)

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

	// No error
	return nil
}

// Initialize_From_UniqueKey_STATUS populates our UniqueKey from the provided source UniqueKey_STATUS
func (uniqueKey *UniqueKey) Initialize_From_UniqueKey_STATUS(source *UniqueKey_STATUS) error {

	// Paths
	uniqueKey.Paths = genruntime.CloneSliceOfString(source.Paths)

	// No error
	return nil
}

// The unique key on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service.
type UniqueKey_STATUS struct {
	// Paths: List of paths must be unique for each document in the Azure Cosmos DB service
	Paths []string `json:"paths,omitempty"`
}

var _ genruntime.FromARMConverter = &UniqueKey_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_UniqueKey_STATUS populates our UniqueKey_STATUS from the provided source UniqueKey_STATUS
func (uniqueKey *UniqueKey_STATUS) AssignProperties_From_UniqueKey_STATUS(source *storage.UniqueKey_STATUS) error {

	// Paths
	uniqueKey.Paths = genruntime.CloneSliceOfString(source.Paths)

	// No error
	return nil
}

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

	// Paths
	destination.Paths = genruntime.CloneSliceOfString(uniqueKey.Paths)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"ascending","descending"}
type CompositePath_Order string

const (
	CompositePath_Order_Ascending  = CompositePath_Order("ascending")
	CompositePath_Order_Descending = CompositePath_Order("descending")
)

// Mapping from string to CompositePath_Order
var compositePath_Order_Values = map[string]CompositePath_Order{
	"ascending":  CompositePath_Order_Ascending,
	"descending": CompositePath_Order_Descending,
}

type CompositePath_Order_STATUS string

const (
	CompositePath_Order_STATUS_Ascending  = CompositePath_Order_STATUS("ascending")
	CompositePath_Order_STATUS_Descending = CompositePath_Order_STATUS("descending")
)

// Mapping from string to CompositePath_Order_STATUS
var compositePath_Order_STATUS_Values = map[string]CompositePath_Order_STATUS{
	"ascending":  CompositePath_Order_STATUS_Ascending,
	"descending": CompositePath_Order_STATUS_Descending,
}

// The indexes for the path.
type Indexes struct {
	// DataType: The datatype for which the indexing behavior is applied to.
	DataType *Indexes_DataType `json:"dataType,omitempty"`

	// Kind: Indicates the type of index.
	Kind *Indexes_Kind `json:"kind,omitempty"`

	// Precision: The precision of the index. -1 is maximum precision.
	Precision *int `json:"precision,omitempty"`
}

var _ genruntime.ARMTransformer = &Indexes{}

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

	// Set property "DataType":
	if indexes.DataType != nil {
		var temp string
		temp = string(*indexes.DataType)
		dataType := arm.Indexes_DataType(temp)
		result.DataType = &dataType
	}

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

	// Set property "Precision":
	if indexes.Precision != nil {
		precision := *indexes.Precision
		result.Precision = &precision
	}
	return result, nil
}

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

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

	// Set property "DataType":
	if typedInput.DataType != nil {
		var temp string
		temp = string(*typedInput.DataType)
		dataType := Indexes_DataType(temp)
		indexes.DataType = &dataType
	}

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

	// Set property "Precision":
	if typedInput.Precision != nil {
		precision := *typedInput.Precision
		indexes.Precision = &precision
	}

	// No error
	return nil
}

// AssignProperties_From_Indexes populates our Indexes from the provided source Indexes
func (indexes *Indexes) AssignProperties_From_Indexes(source *storage.Indexes) error {

	// DataType
	if source.DataType != nil {
		dataType := *source.DataType
		dataTypeTemp := genruntime.ToEnum(dataType, indexes_DataType_Values)
		indexes.DataType = &dataTypeTemp
	} else {
		indexes.DataType = nil
	}

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

	// Precision
	indexes.Precision = genruntime.ClonePointerToInt(source.Precision)

	// No error
	return nil
}

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

	// DataType
	if indexes.DataType != nil {
		dataType := string(*indexes.DataType)
		destination.DataType = &dataType
	} else {
		destination.DataType = nil
	}

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

	// Precision
	destination.Precision = genruntime.ClonePointerToInt(indexes.Precision)

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

	// No error
	return nil
}

// Initialize_From_Indexes_STATUS populates our Indexes from the provided source Indexes_STATUS
func (indexes *Indexes) Initialize_From_Indexes_STATUS(source *Indexes_STATUS) error {

	// DataType
	if source.DataType != nil {
		dataType := genruntime.ToEnum(string(*source.DataType), indexes_DataType_Values)
		indexes.DataType = &dataType
	} else {
		indexes.DataType = nil
	}

	// Kind
	if source.Kind != nil {
		kind := genruntime.ToEnum(string(*source.Kind), indexes_Kind_Values)
		indexes.Kind = &kind
	} else {
		indexes.Kind = nil
	}

	// Precision
	indexes.Precision = genruntime.ClonePointerToInt(source.Precision)

	// No error
	return nil
}

// The indexes for the path.
type Indexes_STATUS struct {
	// DataType: The datatype for which the indexing behavior is applied to.
	DataType *Indexes_DataType_STATUS `json:"dataType,omitempty"`

	// Kind: Indicates the type of index.
	Kind *Indexes_Kind_STATUS `json:"kind,omitempty"`

	// Precision: The precision of the index. -1 is maximum precision.
	Precision *int `json:"precision,omitempty"`
}

var _ genruntime.FromARMConverter = &Indexes_STATUS{}

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

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

	// Set property "DataType":
	if typedInput.DataType != nil {
		var temp string
		temp = string(*typedInput.DataType)
		dataType := Indexes_DataType_STATUS(temp)
		indexes.DataType = &dataType
	}

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

	// Set property "Precision":
	if typedInput.Precision != nil {
		precision := *typedInput.Precision
		indexes.Precision = &precision
	}

	// No error
	return nil
}

// AssignProperties_From_Indexes_STATUS populates our Indexes_STATUS from the provided source Indexes_STATUS
func (indexes *Indexes_STATUS) AssignProperties_From_Indexes_STATUS(source *storage.Indexes_STATUS) error {

	// DataType
	if source.DataType != nil {
		dataType := *source.DataType
		dataTypeTemp := genruntime.ToEnum(dataType, indexes_DataType_STATUS_Values)
		indexes.DataType = &dataTypeTemp
	} else {
		indexes.DataType = nil
	}

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

	// Precision
	indexes.Precision = genruntime.ClonePointerToInt(source.Precision)

	// No error
	return nil
}

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

	// DataType
	if indexes.DataType != nil {
		dataType := string(*indexes.DataType)
		destination.DataType = &dataType
	} else {
		destination.DataType = nil
	}

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

	// Precision
	destination.Precision = genruntime.ClonePointerToInt(indexes.Precision)

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

	// No error
	return nil
}

// Indicates the spatial type of index.
// +kubebuilder:validation:Enum={"LineString","MultiPolygon","Point","Polygon"}
type SpatialType string

const (
	SpatialType_LineString   = SpatialType("LineString")
	SpatialType_MultiPolygon = SpatialType("MultiPolygon")
	SpatialType_Point        = SpatialType("Point")
	SpatialType_Polygon      = SpatialType("Polygon")
)

// Mapping from string to SpatialType
var spatialType_Values = map[string]SpatialType{
	"linestring":   SpatialType_LineString,
	"multipolygon": SpatialType_MultiPolygon,
	"point":        SpatialType_Point,
	"polygon":      SpatialType_Polygon,
}

// Indicates the spatial type of index.
type SpatialType_STATUS string

const (
	SpatialType_STATUS_LineString   = SpatialType_STATUS("LineString")
	SpatialType_STATUS_MultiPolygon = SpatialType_STATUS("MultiPolygon")
	SpatialType_STATUS_Point        = SpatialType_STATUS("Point")
	SpatialType_STATUS_Polygon      = SpatialType_STATUS("Polygon")
)

// Mapping from string to SpatialType_STATUS
var spatialType_STATUS_Values = map[string]SpatialType_STATUS{
	"linestring":   SpatialType_STATUS_LineString,
	"multipolygon": SpatialType_STATUS_MultiPolygon,
	"point":        SpatialType_STATUS_Point,
	"polygon":      SpatialType_STATUS_Polygon,
}

// +kubebuilder:validation:Enum={"LineString","MultiPolygon","Number","Point","Polygon","String"}
type Indexes_DataType string

const (
	Indexes_DataType_LineString   = Indexes_DataType("LineString")
	Indexes_DataType_MultiPolygon = Indexes_DataType("MultiPolygon")
	Indexes_DataType_Number       = Indexes_DataType("Number")
	Indexes_DataType_Point        = Indexes_DataType("Point")
	Indexes_DataType_Polygon      = Indexes_DataType("Polygon")
	Indexes_DataType_String       = Indexes_DataType("String")
)

// Mapping from string to Indexes_DataType
var indexes_DataType_Values = map[string]Indexes_DataType{
	"linestring":   Indexes_DataType_LineString,
	"multipolygon": Indexes_DataType_MultiPolygon,
	"number":       Indexes_DataType_Number,
	"point":        Indexes_DataType_Point,
	"polygon":      Indexes_DataType_Polygon,
	"string":       Indexes_DataType_String,
}

type Indexes_DataType_STATUS string

const (
	Indexes_DataType_STATUS_LineString   = Indexes_DataType_STATUS("LineString")
	Indexes_DataType_STATUS_MultiPolygon = Indexes_DataType_STATUS("MultiPolygon")
	Indexes_DataType_STATUS_Number       = Indexes_DataType_STATUS("Number")
	Indexes_DataType_STATUS_Point        = Indexes_DataType_STATUS("Point")
	Indexes_DataType_STATUS_Polygon      = Indexes_DataType_STATUS("Polygon")
	Indexes_DataType_STATUS_String       = Indexes_DataType_STATUS("String")
)

// Mapping from string to Indexes_DataType_STATUS
var indexes_DataType_STATUS_Values = map[string]Indexes_DataType_STATUS{
	"linestring":   Indexes_DataType_STATUS_LineString,
	"multipolygon": Indexes_DataType_STATUS_MultiPolygon,
	"number":       Indexes_DataType_STATUS_Number,
	"point":        Indexes_DataType_STATUS_Point,
	"polygon":      Indexes_DataType_STATUS_Polygon,
	"string":       Indexes_DataType_STATUS_String,
}

// +kubebuilder:validation:Enum={"Hash","Range","Spatial"}
type Indexes_Kind string

const (
	Indexes_Kind_Hash    = Indexes_Kind("Hash")
	Indexes_Kind_Range   = Indexes_Kind("Range")
	Indexes_Kind_Spatial = Indexes_Kind("Spatial")
)

// Mapping from string to Indexes_Kind
var indexes_Kind_Values = map[string]Indexes_Kind{
	"hash":    Indexes_Kind_Hash,
	"range":   Indexes_Kind_Range,
	"spatial": Indexes_Kind_Spatial,
}

type Indexes_Kind_STATUS string

const (
	Indexes_Kind_STATUS_Hash    = Indexes_Kind_STATUS("Hash")
	Indexes_Kind_STATUS_Range   = Indexes_Kind_STATUS("Range")
	Indexes_Kind_STATUS_Spatial = Indexes_Kind_STATUS("Spatial")
)

// Mapping from string to Indexes_Kind_STATUS
var indexes_Kind_STATUS_Values = map[string]Indexes_Kind_STATUS{
	"hash":    Indexes_Kind_STATUS_Hash,
	"range":   Indexes_Kind_STATUS_Range,
	"spatial": Indexes_Kind_STATUS_Spatial,
}

func init() {
	SchemeBuilder.Register(&SqlDatabaseContainer{}, &SqlDatabaseContainerList{})
}
