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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/operationalinsights/v1api20210601/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,operationalinsights}
// +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: /operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/Workspaces.json
// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}
type Workspace struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Workspace_Spec   `json:"spec,omitempty"`
	Status            Workspace_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Workspace{}

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

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

var _ conversion.Convertible = &Workspace{}

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

	return workspace.AssignProperties_From_Workspace(source)
}

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

	return workspace.AssignProperties_To_Workspace(destination)
}

var _ configmaps.Exporter = &Workspace{}

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

var _ secrets.Exporter = &Workspace{}

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

var _ genruntime.ImportableResource = &Workspace{}

// InitializeSpec initializes the spec for this resource from the given status
func (workspace *Workspace) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Workspace_STATUS); ok {
		return workspace.Spec.Initialize_From_Workspace_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Workspace{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.OperationalInsights/workspaces"
func (workspace *Workspace) GetType() string {
	return "Microsoft.OperationalInsights/workspaces"
}

// NewEmptyStatus returns a new empty (blank) status
func (workspace *Workspace) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Workspace_STATUS{}
}

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

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

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

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

	workspace.Status = st
	return nil
}

// AssignProperties_From_Workspace populates our Workspace from the provided source Workspace
func (workspace *Workspace) AssignProperties_From_Workspace(source *storage.Workspace) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Workspace populates the provided destination Workspace from our Workspace
func (workspace *Workspace) AssignProperties_To_Workspace(destination *storage.Workspace) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/Workspaces.json
// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}
type WorkspaceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Workspace `json:"items"`
}

// +kubebuilder:validation:Enum={"2021-06-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2021-06-01")

type Workspace_Spec struct {
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:MinLength=4
	// +kubebuilder:validation:Pattern="^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"
	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName string `json:"azureName,omitempty"`

	// Etag: The etag of the workspace.
	Etag *string `json:"etag,omitempty"`

	// Features: Workspace features.
	Features *WorkspaceFeatures `json:"features,omitempty"`

	// ForceCmkForQuery: Indicates whether customer managed storage is mandatory for query management.
	ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"`

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

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *WorkspaceOperatorSpec `json:"operatorSpec,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`

	// ProvisioningState: The provisioning state of the workspace.
	ProvisioningState *WorkspaceProperties_ProvisioningState `json:"provisioningState,omitempty"`

	// PublicNetworkAccessForIngestion: The network access type for accessing Log Analytics ingestion.
	PublicNetworkAccessForIngestion *PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"`

	// PublicNetworkAccessForQuery: The network access type for accessing Log Analytics query.
	PublicNetworkAccessForQuery *PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"`

	// RetentionInDays: The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers
	// documentation for details.
	RetentionInDays *int `json:"retentionInDays,omitempty"`

	// Sku: The SKU of the workspace.
	Sku *WorkspaceSku `json:"sku,omitempty"`

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

	// WorkspaceCapping: The daily volume cap for ingestion.
	WorkspaceCapping *WorkspaceCapping `json:"workspaceCapping,omitempty"`
}

var _ genruntime.ARMTransformer = &Workspace_Spec{}

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

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

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

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

	// Set property "Properties":
	if workspace.Features != nil ||
		workspace.ForceCmkForQuery != nil ||
		workspace.ProvisioningState != nil ||
		workspace.PublicNetworkAccessForIngestion != nil ||
		workspace.PublicNetworkAccessForQuery != nil ||
		workspace.RetentionInDays != nil ||
		workspace.Sku != nil ||
		workspace.WorkspaceCapping != nil {
		result.Properties = &arm.WorkspaceProperties{}
	}
	if workspace.Features != nil {
		features_ARM, err := workspace.Features.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		features := *features_ARM.(*arm.WorkspaceFeatures)
		result.Properties.Features = &features
	}
	if workspace.ForceCmkForQuery != nil {
		forceCmkForQuery := *workspace.ForceCmkForQuery
		result.Properties.ForceCmkForQuery = &forceCmkForQuery
	}
	if workspace.ProvisioningState != nil {
		var temp string
		temp = string(*workspace.ProvisioningState)
		provisioningState := arm.WorkspaceProperties_ProvisioningState(temp)
		result.Properties.ProvisioningState = &provisioningState
	}
	if workspace.PublicNetworkAccessForIngestion != nil {
		var temp string
		temp = string(*workspace.PublicNetworkAccessForIngestion)
		publicNetworkAccessForIngestion := arm.PublicNetworkAccessType(temp)
		result.Properties.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion
	}
	if workspace.PublicNetworkAccessForQuery != nil {
		var temp string
		temp = string(*workspace.PublicNetworkAccessForQuery)
		publicNetworkAccessForQuery := arm.PublicNetworkAccessType(temp)
		result.Properties.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery
	}
	if workspace.RetentionInDays != nil {
		retentionInDays := *workspace.RetentionInDays
		result.Properties.RetentionInDays = &retentionInDays
	}
	if workspace.Sku != nil {
		sku_ARM, err := workspace.Sku.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sku := *sku_ARM.(*arm.WorkspaceSku)
		result.Properties.Sku = &sku
	}
	if workspace.WorkspaceCapping != nil {
		workspaceCapping_ARM, err := workspace.WorkspaceCapping.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		workspaceCapping := *workspaceCapping_ARM.(*arm.WorkspaceCapping)
		result.Properties.WorkspaceCapping = &workspaceCapping
	}

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

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

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

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

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

	// Set property "Features":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Features != nil {
			var features1 WorkspaceFeatures
			err := features1.PopulateFromARM(owner, *typedInput.Properties.Features)
			if err != nil {
				return err
			}
			features := features1
			workspace.Features = &features
		}
	}

	// Set property "ForceCmkForQuery":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ForceCmkForQuery != nil {
			forceCmkForQuery := *typedInput.Properties.ForceCmkForQuery
			workspace.ForceCmkForQuery = &forceCmkForQuery
		}
	}

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

	// no assignment for property "OperatorSpec"

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

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := WorkspaceProperties_ProvisioningState(temp)
			workspace.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicNetworkAccessForIngestion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccessForIngestion != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccessForIngestion)
			publicNetworkAccessForIngestion := PublicNetworkAccessType(temp)
			workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion
		}
	}

	// Set property "PublicNetworkAccessForQuery":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccessForQuery != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccessForQuery)
			publicNetworkAccessForQuery := PublicNetworkAccessType(temp)
			workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery
		}
	}

	// Set property "RetentionInDays":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RetentionInDays != nil {
			retentionInDays := *typedInput.Properties.RetentionInDays
			workspace.RetentionInDays = &retentionInDays
		}
	}

	// Set property "Sku":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Sku != nil {
			var sku1 WorkspaceSku
			err := sku1.PopulateFromARM(owner, *typedInput.Properties.Sku)
			if err != nil {
				return err
			}
			sku := sku1
			workspace.Sku = &sku
		}
	}

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

	// Set property "WorkspaceCapping":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WorkspaceCapping != nil {
			var workspaceCapping1 WorkspaceCapping
			err := workspaceCapping1.PopulateFromARM(owner, *typedInput.Properties.WorkspaceCapping)
			if err != nil {
				return err
			}
			workspaceCapping := workspaceCapping1
			workspace.WorkspaceCapping = &workspaceCapping
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Workspace_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Workspace_Spec{}
	err := workspace.AssignProperties_To_Workspace_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_Workspace_Spec populates our Workspace_Spec from the provided source Workspace_Spec
func (workspace *Workspace_Spec) AssignProperties_From_Workspace_Spec(source *storage.Workspace_Spec) error {

	// AzureName
	workspace.AzureName = source.AzureName

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

	// Features
	if source.Features != nil {
		var feature WorkspaceFeatures
		err := feature.AssignProperties_From_WorkspaceFeatures(source.Features)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFeatures() to populate field Features")
		}
		workspace.Features = &feature
	} else {
		workspace.Features = nil
	}

	// ForceCmkForQuery
	if source.ForceCmkForQuery != nil {
		forceCmkForQuery := *source.ForceCmkForQuery
		workspace.ForceCmkForQuery = &forceCmkForQuery
	} else {
		workspace.ForceCmkForQuery = nil
	}

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

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

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

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

	// PublicNetworkAccessForIngestion
	if source.PublicNetworkAccessForIngestion != nil {
		publicNetworkAccessForIngestion := *source.PublicNetworkAccessForIngestion
		publicNetworkAccessForIngestionTemp := genruntime.ToEnum(publicNetworkAccessForIngestion, publicNetworkAccessType_Values)
		workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestionTemp
	} else {
		workspace.PublicNetworkAccessForIngestion = nil
	}

	// PublicNetworkAccessForQuery
	if source.PublicNetworkAccessForQuery != nil {
		publicNetworkAccessForQuery := *source.PublicNetworkAccessForQuery
		publicNetworkAccessForQueryTemp := genruntime.ToEnum(publicNetworkAccessForQuery, publicNetworkAccessType_Values)
		workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQueryTemp
	} else {
		workspace.PublicNetworkAccessForQuery = nil
	}

	// RetentionInDays
	workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)

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

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

	// WorkspaceCapping
	if source.WorkspaceCapping != nil {
		var workspaceCapping WorkspaceCapping
		err := workspaceCapping.AssignProperties_From_WorkspaceCapping(source.WorkspaceCapping)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceCapping() to populate field WorkspaceCapping")
		}
		workspace.WorkspaceCapping = &workspaceCapping
	} else {
		workspace.WorkspaceCapping = nil
	}

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = workspace.AzureName

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

	// Features
	if workspace.Features != nil {
		var feature storage.WorkspaceFeatures
		err := workspace.Features.AssignProperties_To_WorkspaceFeatures(&feature)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFeatures() to populate field Features")
		}
		destination.Features = &feature
	} else {
		destination.Features = nil
	}

	// ForceCmkForQuery
	if workspace.ForceCmkForQuery != nil {
		forceCmkForQuery := *workspace.ForceCmkForQuery
		destination.ForceCmkForQuery = &forceCmkForQuery
	} else {
		destination.ForceCmkForQuery = nil
	}

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

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

	// OriginalVersion
	destination.OriginalVersion = workspace.OriginalVersion()

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

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

	// PublicNetworkAccessForIngestion
	if workspace.PublicNetworkAccessForIngestion != nil {
		publicNetworkAccessForIngestion := string(*workspace.PublicNetworkAccessForIngestion)
		destination.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion
	} else {
		destination.PublicNetworkAccessForIngestion = nil
	}

	// PublicNetworkAccessForQuery
	if workspace.PublicNetworkAccessForQuery != nil {
		publicNetworkAccessForQuery := string(*workspace.PublicNetworkAccessForQuery)
		destination.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery
	} else {
		destination.PublicNetworkAccessForQuery = nil
	}

	// RetentionInDays
	destination.RetentionInDays = genruntime.ClonePointerToInt(workspace.RetentionInDays)

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

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

	// WorkspaceCapping
	if workspace.WorkspaceCapping != nil {
		var workspaceCapping storage.WorkspaceCapping
		err := workspace.WorkspaceCapping.AssignProperties_To_WorkspaceCapping(&workspaceCapping)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceCapping() to populate field WorkspaceCapping")
		}
		destination.WorkspaceCapping = &workspaceCapping
	} else {
		destination.WorkspaceCapping = nil
	}

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

	// No error
	return nil
}

// Initialize_From_Workspace_STATUS populates our Workspace_Spec from the provided source Workspace_STATUS
func (workspace *Workspace_Spec) Initialize_From_Workspace_STATUS(source *Workspace_STATUS) error {

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

	// Features
	if source.Features != nil {
		var feature WorkspaceFeatures
		err := feature.Initialize_From_WorkspaceFeatures_STATUS(source.Features)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_WorkspaceFeatures_STATUS() to populate field Features")
		}
		workspace.Features = &feature
	} else {
		workspace.Features = nil
	}

	// ForceCmkForQuery
	if source.ForceCmkForQuery != nil {
		forceCmkForQuery := *source.ForceCmkForQuery
		workspace.ForceCmkForQuery = &forceCmkForQuery
	} else {
		workspace.ForceCmkForQuery = nil
	}

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

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := genruntime.ToEnum(string(*source.ProvisioningState), workspaceProperties_ProvisioningState_Values)
		workspace.ProvisioningState = &provisioningState
	} else {
		workspace.ProvisioningState = nil
	}

	// PublicNetworkAccessForIngestion
	if source.PublicNetworkAccessForIngestion != nil {
		publicNetworkAccessForIngestion := genruntime.ToEnum(string(*source.PublicNetworkAccessForIngestion), publicNetworkAccessType_Values)
		workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion
	} else {
		workspace.PublicNetworkAccessForIngestion = nil
	}

	// PublicNetworkAccessForQuery
	if source.PublicNetworkAccessForQuery != nil {
		publicNetworkAccessForQuery := genruntime.ToEnum(string(*source.PublicNetworkAccessForQuery), publicNetworkAccessType_Values)
		workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery
	} else {
		workspace.PublicNetworkAccessForQuery = nil
	}

	// RetentionInDays
	workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)

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

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

	// WorkspaceCapping
	if source.WorkspaceCapping != nil {
		var workspaceCapping WorkspaceCapping
		err := workspaceCapping.Initialize_From_WorkspaceCapping_STATUS(source.WorkspaceCapping)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_WorkspaceCapping_STATUS() to populate field WorkspaceCapping")
		}
		workspace.WorkspaceCapping = &workspaceCapping
	} else {
		workspace.WorkspaceCapping = nil
	}

	// No error
	return nil
}

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

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

// The top level Workspace resource container.
type Workspace_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// CreatedDate: Workspace creation date.
	CreatedDate *string `json:"createdDate,omitempty"`

	// CustomerId: This is a read-only property. Represents the ID associated with the workspace.
	CustomerId *string `json:"customerId,omitempty"`

	// Etag: The etag of the workspace.
	Etag *string `json:"etag,omitempty"`

	// Features: Workspace features.
	Features *WorkspaceFeatures_STATUS `json:"features,omitempty"`

	// ForceCmkForQuery: Indicates whether customer managed storage is mandatory for query management.
	ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"`

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

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

	// ModifiedDate: Workspace modification date.
	ModifiedDate *string `json:"modifiedDate,omitempty"`

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

	// PrivateLinkScopedResources: List of linked private link scope resources.
	PrivateLinkScopedResources []PrivateLinkScopedResource_STATUS `json:"privateLinkScopedResources,omitempty"`

	// ProvisioningState: The provisioning state of the workspace.
	ProvisioningState *WorkspaceProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicNetworkAccessForIngestion: The network access type for accessing Log Analytics ingestion.
	PublicNetworkAccessForIngestion *PublicNetworkAccessType_STATUS `json:"publicNetworkAccessForIngestion,omitempty"`

	// PublicNetworkAccessForQuery: The network access type for accessing Log Analytics query.
	PublicNetworkAccessForQuery *PublicNetworkAccessType_STATUS `json:"publicNetworkAccessForQuery,omitempty"`

	// RetentionInDays: The workspace data retention in days. Allowed values are per pricing plan. See pricing tiers
	// documentation for details.
	RetentionInDays *int `json:"retentionInDays,omitempty"`

	// Sku: The SKU of the workspace.
	Sku *WorkspaceSku_STATUS `json:"sku,omitempty"`

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

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

	// WorkspaceCapping: The daily volume cap for ingestion.
	WorkspaceCapping *WorkspaceCapping_STATUS `json:"workspaceCapping,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Workspace_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Workspace_STATUS{}
	err := workspace.AssignProperties_To_Workspace_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 = &Workspace_STATUS{}

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

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

	// no assignment for property "Conditions"

	// Set property "CreatedDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreatedDate != nil {
			createdDate := *typedInput.Properties.CreatedDate
			workspace.CreatedDate = &createdDate
		}
	}

	// Set property "CustomerId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomerId != nil {
			customerId := *typedInput.Properties.CustomerId
			workspace.CustomerId = &customerId
		}
	}

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

	// Set property "Features":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Features != nil {
			var features1 WorkspaceFeatures_STATUS
			err := features1.PopulateFromARM(owner, *typedInput.Properties.Features)
			if err != nil {
				return err
			}
			features := features1
			workspace.Features = &features
		}
	}

	// Set property "ForceCmkForQuery":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ForceCmkForQuery != nil {
			forceCmkForQuery := *typedInput.Properties.ForceCmkForQuery
			workspace.ForceCmkForQuery = &forceCmkForQuery
		}
	}

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

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

	// Set property "ModifiedDate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ModifiedDate != nil {
			modifiedDate := *typedInput.Properties.ModifiedDate
			workspace.ModifiedDate = &modifiedDate
		}
	}

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

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

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := WorkspaceProperties_ProvisioningState_STATUS(temp)
			workspace.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicNetworkAccessForIngestion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccessForIngestion != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccessForIngestion)
			publicNetworkAccessForIngestion := PublicNetworkAccessType_STATUS(temp)
			workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion
		}
	}

	// Set property "PublicNetworkAccessForQuery":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccessForQuery != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccessForQuery)
			publicNetworkAccessForQuery := PublicNetworkAccessType_STATUS(temp)
			workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery
		}
	}

	// Set property "RetentionInDays":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.RetentionInDays != nil {
			retentionInDays := *typedInput.Properties.RetentionInDays
			workspace.RetentionInDays = &retentionInDays
		}
	}

	// Set property "Sku":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Sku != nil {
			var sku1 WorkspaceSku_STATUS
			err := sku1.PopulateFromARM(owner, *typedInput.Properties.Sku)
			if err != nil {
				return err
			}
			sku := sku1
			workspace.Sku = &sku
		}
	}

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

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

	// Set property "WorkspaceCapping":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WorkspaceCapping != nil {
			var workspaceCapping1 WorkspaceCapping_STATUS
			err := workspaceCapping1.PopulateFromARM(owner, *typedInput.Properties.WorkspaceCapping)
			if err != nil {
				return err
			}
			workspaceCapping := workspaceCapping1
			workspace.WorkspaceCapping = &workspaceCapping
		}
	}

	// No error
	return nil
}

// AssignProperties_From_Workspace_STATUS populates our Workspace_STATUS from the provided source Workspace_STATUS
func (workspace *Workspace_STATUS) AssignProperties_From_Workspace_STATUS(source *storage.Workspace_STATUS) error {

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

	// CreatedDate
	workspace.CreatedDate = genruntime.ClonePointerToString(source.CreatedDate)

	// CustomerId
	workspace.CustomerId = genruntime.ClonePointerToString(source.CustomerId)

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

	// Features
	if source.Features != nil {
		var feature WorkspaceFeatures_STATUS
		err := feature.AssignProperties_From_WorkspaceFeatures_STATUS(source.Features)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceFeatures_STATUS() to populate field Features")
		}
		workspace.Features = &feature
	} else {
		workspace.Features = nil
	}

	// ForceCmkForQuery
	if source.ForceCmkForQuery != nil {
		forceCmkForQuery := *source.ForceCmkForQuery
		workspace.ForceCmkForQuery = &forceCmkForQuery
	} else {
		workspace.ForceCmkForQuery = nil
	}

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

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

	// ModifiedDate
	workspace.ModifiedDate = genruntime.ClonePointerToString(source.ModifiedDate)

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

	// PrivateLinkScopedResources
	if source.PrivateLinkScopedResources != nil {
		privateLinkScopedResourceList := make([]PrivateLinkScopedResource_STATUS, len(source.PrivateLinkScopedResources))
		for privateLinkScopedResourceIndex, privateLinkScopedResourceItem := range source.PrivateLinkScopedResources {
			var privateLinkScopedResource PrivateLinkScopedResource_STATUS
			err := privateLinkScopedResource.AssignProperties_From_PrivateLinkScopedResource_STATUS(&privateLinkScopedResourceItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkScopedResource_STATUS() to populate field PrivateLinkScopedResources")
			}
			privateLinkScopedResourceList[privateLinkScopedResourceIndex] = privateLinkScopedResource
		}
		workspace.PrivateLinkScopedResources = privateLinkScopedResourceList
	} else {
		workspace.PrivateLinkScopedResources = nil
	}

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

	// PublicNetworkAccessForIngestion
	if source.PublicNetworkAccessForIngestion != nil {
		publicNetworkAccessForIngestion := *source.PublicNetworkAccessForIngestion
		publicNetworkAccessForIngestionTemp := genruntime.ToEnum(publicNetworkAccessForIngestion, publicNetworkAccessType_STATUS_Values)
		workspace.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestionTemp
	} else {
		workspace.PublicNetworkAccessForIngestion = nil
	}

	// PublicNetworkAccessForQuery
	if source.PublicNetworkAccessForQuery != nil {
		publicNetworkAccessForQuery := *source.PublicNetworkAccessForQuery
		publicNetworkAccessForQueryTemp := genruntime.ToEnum(publicNetworkAccessForQuery, publicNetworkAccessType_STATUS_Values)
		workspace.PublicNetworkAccessForQuery = &publicNetworkAccessForQueryTemp
	} else {
		workspace.PublicNetworkAccessForQuery = nil
	}

	// RetentionInDays
	workspace.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)

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

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

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

	// WorkspaceCapping
	if source.WorkspaceCapping != nil {
		var workspaceCapping WorkspaceCapping_STATUS
		err := workspaceCapping.AssignProperties_From_WorkspaceCapping_STATUS(source.WorkspaceCapping)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceCapping_STATUS() to populate field WorkspaceCapping")
		}
		workspace.WorkspaceCapping = &workspaceCapping
	} else {
		workspace.WorkspaceCapping = nil
	}

	// No error
	return nil
}

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

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

	// CreatedDate
	destination.CreatedDate = genruntime.ClonePointerToString(workspace.CreatedDate)

	// CustomerId
	destination.CustomerId = genruntime.ClonePointerToString(workspace.CustomerId)

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

	// Features
	if workspace.Features != nil {
		var feature storage.WorkspaceFeatures_STATUS
		err := workspace.Features.AssignProperties_To_WorkspaceFeatures_STATUS(&feature)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceFeatures_STATUS() to populate field Features")
		}
		destination.Features = &feature
	} else {
		destination.Features = nil
	}

	// ForceCmkForQuery
	if workspace.ForceCmkForQuery != nil {
		forceCmkForQuery := *workspace.ForceCmkForQuery
		destination.ForceCmkForQuery = &forceCmkForQuery
	} else {
		destination.ForceCmkForQuery = nil
	}

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

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

	// ModifiedDate
	destination.ModifiedDate = genruntime.ClonePointerToString(workspace.ModifiedDate)

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

	// PrivateLinkScopedResources
	if workspace.PrivateLinkScopedResources != nil {
		privateLinkScopedResourceList := make([]storage.PrivateLinkScopedResource_STATUS, len(workspace.PrivateLinkScopedResources))
		for privateLinkScopedResourceIndex, privateLinkScopedResourceItem := range workspace.PrivateLinkScopedResources {
			var privateLinkScopedResource storage.PrivateLinkScopedResource_STATUS
			err := privateLinkScopedResourceItem.AssignProperties_To_PrivateLinkScopedResource_STATUS(&privateLinkScopedResource)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkScopedResource_STATUS() to populate field PrivateLinkScopedResources")
			}
			privateLinkScopedResourceList[privateLinkScopedResourceIndex] = privateLinkScopedResource
		}
		destination.PrivateLinkScopedResources = privateLinkScopedResourceList
	} else {
		destination.PrivateLinkScopedResources = nil
	}

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

	// PublicNetworkAccessForIngestion
	if workspace.PublicNetworkAccessForIngestion != nil {
		publicNetworkAccessForIngestion := string(*workspace.PublicNetworkAccessForIngestion)
		destination.PublicNetworkAccessForIngestion = &publicNetworkAccessForIngestion
	} else {
		destination.PublicNetworkAccessForIngestion = nil
	}

	// PublicNetworkAccessForQuery
	if workspace.PublicNetworkAccessForQuery != nil {
		publicNetworkAccessForQuery := string(*workspace.PublicNetworkAccessForQuery)
		destination.PublicNetworkAccessForQuery = &publicNetworkAccessForQuery
	} else {
		destination.PublicNetworkAccessForQuery = nil
	}

	// RetentionInDays
	destination.RetentionInDays = genruntime.ClonePointerToInt(workspace.RetentionInDays)

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

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

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

	// WorkspaceCapping
	if workspace.WorkspaceCapping != nil {
		var workspaceCapping storage.WorkspaceCapping_STATUS
		err := workspace.WorkspaceCapping.AssignProperties_To_WorkspaceCapping_STATUS(&workspaceCapping)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceCapping_STATUS() to populate field WorkspaceCapping")
		}
		destination.WorkspaceCapping = &workspaceCapping
	} else {
		destination.WorkspaceCapping = nil
	}

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

	// No error
	return nil
}

// The private link scope resource reference.
type PrivateLinkScopedResource_STATUS struct {
	// ResourceId: The full resource Id of the private link scope resource.
	ResourceId *string `json:"resourceId,omitempty"`

	// ScopeId: The private link scope unique Identifier.
	ScopeId *string `json:"scopeId,omitempty"`
}

var _ genruntime.FromARMConverter = &PrivateLinkScopedResource_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// The network access type for operating on the Log Analytics Workspace. By default it is Enabled
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type PublicNetworkAccessType string

const (
	PublicNetworkAccessType_Disabled = PublicNetworkAccessType("Disabled")
	PublicNetworkAccessType_Enabled  = PublicNetworkAccessType("Enabled")
)

// Mapping from string to PublicNetworkAccessType
var publicNetworkAccessType_Values = map[string]PublicNetworkAccessType{
	"disabled": PublicNetworkAccessType_Disabled,
	"enabled":  PublicNetworkAccessType_Enabled,
}

// The network access type for operating on the Log Analytics Workspace. By default it is Enabled
type PublicNetworkAccessType_STATUS string

const (
	PublicNetworkAccessType_STATUS_Disabled = PublicNetworkAccessType_STATUS("Disabled")
	PublicNetworkAccessType_STATUS_Enabled  = PublicNetworkAccessType_STATUS("Enabled")
)

// Mapping from string to PublicNetworkAccessType_STATUS
var publicNetworkAccessType_STATUS_Values = map[string]PublicNetworkAccessType_STATUS{
	"disabled": PublicNetworkAccessType_STATUS_Disabled,
	"enabled":  PublicNetworkAccessType_STATUS_Enabled,
}

// The daily volume cap for ingestion.
type WorkspaceCapping struct {
	// DailyQuotaGb: The workspace daily quota for ingestion.
	DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"`
}

var _ genruntime.ARMTransformer = &WorkspaceCapping{}

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

	// Set property "DailyQuotaGb":
	if capping.DailyQuotaGb != nil {
		dailyQuotaGb := *capping.DailyQuotaGb
		result.DailyQuotaGb = &dailyQuotaGb
	}
	return result, nil
}

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

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

	// Set property "DailyQuotaGb":
	if typedInput.DailyQuotaGb != nil {
		dailyQuotaGb := *typedInput.DailyQuotaGb
		capping.DailyQuotaGb = &dailyQuotaGb
	}

	// No error
	return nil
}

// AssignProperties_From_WorkspaceCapping populates our WorkspaceCapping from the provided source WorkspaceCapping
func (capping *WorkspaceCapping) AssignProperties_From_WorkspaceCapping(source *storage.WorkspaceCapping) error {

	// DailyQuotaGb
	if source.DailyQuotaGb != nil {
		dailyQuotaGb := *source.DailyQuotaGb
		capping.DailyQuotaGb = &dailyQuotaGb
	} else {
		capping.DailyQuotaGb = nil
	}

	// No error
	return nil
}

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

	// DailyQuotaGb
	if capping.DailyQuotaGb != nil {
		dailyQuotaGb := *capping.DailyQuotaGb
		destination.DailyQuotaGb = &dailyQuotaGb
	} else {
		destination.DailyQuotaGb = nil
	}

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

	// No error
	return nil
}

// Initialize_From_WorkspaceCapping_STATUS populates our WorkspaceCapping from the provided source WorkspaceCapping_STATUS
func (capping *WorkspaceCapping) Initialize_From_WorkspaceCapping_STATUS(source *WorkspaceCapping_STATUS) error {

	// DailyQuotaGb
	if source.DailyQuotaGb != nil {
		dailyQuotaGb := *source.DailyQuotaGb
		capping.DailyQuotaGb = &dailyQuotaGb
	} else {
		capping.DailyQuotaGb = nil
	}

	// No error
	return nil
}

// The daily volume cap for ingestion.
type WorkspaceCapping_STATUS struct {
	// DailyQuotaGb: The workspace daily quota for ingestion.
	DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"`

	// DataIngestionStatus: The status of data ingestion for this workspace.
	DataIngestionStatus *WorkspaceCapping_DataIngestionStatus_STATUS `json:"dataIngestionStatus,omitempty"`

	// QuotaNextResetTime: The time when the quota will be rest.
	QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"`
}

var _ genruntime.FromARMConverter = &WorkspaceCapping_STATUS{}

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

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

	// Set property "DailyQuotaGb":
	if typedInput.DailyQuotaGb != nil {
		dailyQuotaGb := *typedInput.DailyQuotaGb
		capping.DailyQuotaGb = &dailyQuotaGb
	}

	// Set property "DataIngestionStatus":
	if typedInput.DataIngestionStatus != nil {
		var temp string
		temp = string(*typedInput.DataIngestionStatus)
		dataIngestionStatus := WorkspaceCapping_DataIngestionStatus_STATUS(temp)
		capping.DataIngestionStatus = &dataIngestionStatus
	}

	// Set property "QuotaNextResetTime":
	if typedInput.QuotaNextResetTime != nil {
		quotaNextResetTime := *typedInput.QuotaNextResetTime
		capping.QuotaNextResetTime = &quotaNextResetTime
	}

	// No error
	return nil
}

// AssignProperties_From_WorkspaceCapping_STATUS populates our WorkspaceCapping_STATUS from the provided source WorkspaceCapping_STATUS
func (capping *WorkspaceCapping_STATUS) AssignProperties_From_WorkspaceCapping_STATUS(source *storage.WorkspaceCapping_STATUS) error {

	// DailyQuotaGb
	if source.DailyQuotaGb != nil {
		dailyQuotaGb := *source.DailyQuotaGb
		capping.DailyQuotaGb = &dailyQuotaGb
	} else {
		capping.DailyQuotaGb = nil
	}

	// DataIngestionStatus
	if source.DataIngestionStatus != nil {
		dataIngestionStatus := *source.DataIngestionStatus
		dataIngestionStatusTemp := genruntime.ToEnum(dataIngestionStatus, workspaceCapping_DataIngestionStatus_STATUS_Values)
		capping.DataIngestionStatus = &dataIngestionStatusTemp
	} else {
		capping.DataIngestionStatus = nil
	}

	// QuotaNextResetTime
	capping.QuotaNextResetTime = genruntime.ClonePointerToString(source.QuotaNextResetTime)

	// No error
	return nil
}

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

	// DailyQuotaGb
	if capping.DailyQuotaGb != nil {
		dailyQuotaGb := *capping.DailyQuotaGb
		destination.DailyQuotaGb = &dailyQuotaGb
	} else {
		destination.DailyQuotaGb = nil
	}

	// DataIngestionStatus
	if capping.DataIngestionStatus != nil {
		dataIngestionStatus := string(*capping.DataIngestionStatus)
		destination.DataIngestionStatus = &dataIngestionStatus
	} else {
		destination.DataIngestionStatus = nil
	}

	// QuotaNextResetTime
	destination.QuotaNextResetTime = genruntime.ClonePointerToString(capping.QuotaNextResetTime)

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

	// No error
	return nil
}

// Workspace features.
type WorkspaceFeatures struct {
	// ClusterResourceReference: Dedicated LA cluster resourceId that is linked to the workspaces.
	ClusterResourceReference *genruntime.ResourceReference `armReference:"ClusterResourceId" json:"clusterResourceReference,omitempty"`

	// DisableLocalAuth: Disable Non-AAD based Auth.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// EnableDataExport: Flag that indicate if data should be exported.
	EnableDataExport *bool `json:"enableDataExport,omitempty"`

	// EnableLogAccessUsingOnlyResourcePermissions: Flag that indicate which permission to use - resource or workspace or both.
	EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"`

	// ImmediatePurgeDataOn30Days: Flag that describes if we want to remove the data after 30 days.
	ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"`
}

var _ genruntime.ARMTransformer = &WorkspaceFeatures{}

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

	// Set property "ClusterResourceId":
	if features.ClusterResourceReference != nil {
		clusterResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*features.ClusterResourceReference)
		if err != nil {
			return nil, err
		}
		clusterResourceReference := clusterResourceReferenceARMID
		result.ClusterResourceId = &clusterResourceReference
	}

	// Set property "DisableLocalAuth":
	if features.DisableLocalAuth != nil {
		disableLocalAuth := *features.DisableLocalAuth
		result.DisableLocalAuth = &disableLocalAuth
	}

	// Set property "EnableDataExport":
	if features.EnableDataExport != nil {
		enableDataExport := *features.EnableDataExport
		result.EnableDataExport = &enableDataExport
	}

	// Set property "EnableLogAccessUsingOnlyResourcePermissions":
	if features.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermissions := *features.EnableLogAccessUsingOnlyResourcePermissions
		result.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions
	}

	// Set property "ImmediatePurgeDataOn30Days":
	if features.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Days := *features.ImmediatePurgeDataOn30Days
		result.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days
	}
	return result, nil
}

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

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

	// no assignment for property "ClusterResourceReference"

	// Set property "DisableLocalAuth":
	if typedInput.DisableLocalAuth != nil {
		disableLocalAuth := *typedInput.DisableLocalAuth
		features.DisableLocalAuth = &disableLocalAuth
	}

	// Set property "EnableDataExport":
	if typedInput.EnableDataExport != nil {
		enableDataExport := *typedInput.EnableDataExport
		features.EnableDataExport = &enableDataExport
	}

	// Set property "EnableLogAccessUsingOnlyResourcePermissions":
	if typedInput.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermissions := *typedInput.EnableLogAccessUsingOnlyResourcePermissions
		features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions
	}

	// Set property "ImmediatePurgeDataOn30Days":
	if typedInput.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Days := *typedInput.ImmediatePurgeDataOn30Days
		features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days
	}

	// No error
	return nil
}

// AssignProperties_From_WorkspaceFeatures populates our WorkspaceFeatures from the provided source WorkspaceFeatures
func (features *WorkspaceFeatures) AssignProperties_From_WorkspaceFeatures(source *storage.WorkspaceFeatures) error {

	// ClusterResourceReference
	if source.ClusterResourceReference != nil {
		clusterResourceReference := source.ClusterResourceReference.Copy()
		features.ClusterResourceReference = &clusterResourceReference
	} else {
		features.ClusterResourceReference = nil
	}

	// DisableLocalAuth
	if source.DisableLocalAuth != nil {
		disableLocalAuth := *source.DisableLocalAuth
		features.DisableLocalAuth = &disableLocalAuth
	} else {
		features.DisableLocalAuth = nil
	}

	// EnableDataExport
	if source.EnableDataExport != nil {
		enableDataExport := *source.EnableDataExport
		features.EnableDataExport = &enableDataExport
	} else {
		features.EnableDataExport = nil
	}

	// EnableLogAccessUsingOnlyResourcePermissions
	if source.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions
		features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission
	} else {
		features.EnableLogAccessUsingOnlyResourcePermissions = nil
	}

	// ImmediatePurgeDataOn30Days
	if source.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days
		features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day
	} else {
		features.ImmediatePurgeDataOn30Days = nil
	}

	// No error
	return nil
}

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

	// ClusterResourceReference
	if features.ClusterResourceReference != nil {
		clusterResourceReference := features.ClusterResourceReference.Copy()
		destination.ClusterResourceReference = &clusterResourceReference
	} else {
		destination.ClusterResourceReference = nil
	}

	// DisableLocalAuth
	if features.DisableLocalAuth != nil {
		disableLocalAuth := *features.DisableLocalAuth
		destination.DisableLocalAuth = &disableLocalAuth
	} else {
		destination.DisableLocalAuth = nil
	}

	// EnableDataExport
	if features.EnableDataExport != nil {
		enableDataExport := *features.EnableDataExport
		destination.EnableDataExport = &enableDataExport
	} else {
		destination.EnableDataExport = nil
	}

	// EnableLogAccessUsingOnlyResourcePermissions
	if features.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermission := *features.EnableLogAccessUsingOnlyResourcePermissions
		destination.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission
	} else {
		destination.EnableLogAccessUsingOnlyResourcePermissions = nil
	}

	// ImmediatePurgeDataOn30Days
	if features.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Day := *features.ImmediatePurgeDataOn30Days
		destination.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day
	} else {
		destination.ImmediatePurgeDataOn30Days = nil
	}

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

	// No error
	return nil
}

// Initialize_From_WorkspaceFeatures_STATUS populates our WorkspaceFeatures from the provided source WorkspaceFeatures_STATUS
func (features *WorkspaceFeatures) Initialize_From_WorkspaceFeatures_STATUS(source *WorkspaceFeatures_STATUS) error {

	// ClusterResourceReference
	if source.ClusterResourceId != nil {
		clusterResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.ClusterResourceId)
		features.ClusterResourceReference = &clusterResourceReference
	} else {
		features.ClusterResourceReference = nil
	}

	// DisableLocalAuth
	if source.DisableLocalAuth != nil {
		disableLocalAuth := *source.DisableLocalAuth
		features.DisableLocalAuth = &disableLocalAuth
	} else {
		features.DisableLocalAuth = nil
	}

	// EnableDataExport
	if source.EnableDataExport != nil {
		enableDataExport := *source.EnableDataExport
		features.EnableDataExport = &enableDataExport
	} else {
		features.EnableDataExport = nil
	}

	// EnableLogAccessUsingOnlyResourcePermissions
	if source.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions
		features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission
	} else {
		features.EnableLogAccessUsingOnlyResourcePermissions = nil
	}

	// ImmediatePurgeDataOn30Days
	if source.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days
		features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day
	} else {
		features.ImmediatePurgeDataOn30Days = nil
	}

	// No error
	return nil
}

// Workspace features.
type WorkspaceFeatures_STATUS struct {
	// ClusterResourceId: Dedicated LA cluster resourceId that is linked to the workspaces.
	ClusterResourceId *string `json:"clusterResourceId,omitempty"`

	// DisableLocalAuth: Disable Non-AAD based Auth.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// EnableDataExport: Flag that indicate if data should be exported.
	EnableDataExport *bool `json:"enableDataExport,omitempty"`

	// EnableLogAccessUsingOnlyResourcePermissions: Flag that indicate which permission to use - resource or workspace or both.
	EnableLogAccessUsingOnlyResourcePermissions *bool `json:"enableLogAccessUsingOnlyResourcePermissions,omitempty"`

	// ImmediatePurgeDataOn30Days: Flag that describes if we want to remove the data after 30 days.
	ImmediatePurgeDataOn30Days *bool `json:"immediatePurgeDataOn30Days,omitempty"`
}

var _ genruntime.FromARMConverter = &WorkspaceFeatures_STATUS{}

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

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

	// Set property "ClusterResourceId":
	if typedInput.ClusterResourceId != nil {
		clusterResourceId := *typedInput.ClusterResourceId
		features.ClusterResourceId = &clusterResourceId
	}

	// Set property "DisableLocalAuth":
	if typedInput.DisableLocalAuth != nil {
		disableLocalAuth := *typedInput.DisableLocalAuth
		features.DisableLocalAuth = &disableLocalAuth
	}

	// Set property "EnableDataExport":
	if typedInput.EnableDataExport != nil {
		enableDataExport := *typedInput.EnableDataExport
		features.EnableDataExport = &enableDataExport
	}

	// Set property "EnableLogAccessUsingOnlyResourcePermissions":
	if typedInput.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermissions := *typedInput.EnableLogAccessUsingOnlyResourcePermissions
		features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermissions
	}

	// Set property "ImmediatePurgeDataOn30Days":
	if typedInput.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Days := *typedInput.ImmediatePurgeDataOn30Days
		features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Days
	}

	// No error
	return nil
}

// AssignProperties_From_WorkspaceFeatures_STATUS populates our WorkspaceFeatures_STATUS from the provided source WorkspaceFeatures_STATUS
func (features *WorkspaceFeatures_STATUS) AssignProperties_From_WorkspaceFeatures_STATUS(source *storage.WorkspaceFeatures_STATUS) error {

	// ClusterResourceId
	features.ClusterResourceId = genruntime.ClonePointerToString(source.ClusterResourceId)

	// DisableLocalAuth
	if source.DisableLocalAuth != nil {
		disableLocalAuth := *source.DisableLocalAuth
		features.DisableLocalAuth = &disableLocalAuth
	} else {
		features.DisableLocalAuth = nil
	}

	// EnableDataExport
	if source.EnableDataExport != nil {
		enableDataExport := *source.EnableDataExport
		features.EnableDataExport = &enableDataExport
	} else {
		features.EnableDataExport = nil
	}

	// EnableLogAccessUsingOnlyResourcePermissions
	if source.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermission := *source.EnableLogAccessUsingOnlyResourcePermissions
		features.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission
	} else {
		features.EnableLogAccessUsingOnlyResourcePermissions = nil
	}

	// ImmediatePurgeDataOn30Days
	if source.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Day := *source.ImmediatePurgeDataOn30Days
		features.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day
	} else {
		features.ImmediatePurgeDataOn30Days = nil
	}

	// No error
	return nil
}

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

	// ClusterResourceId
	destination.ClusterResourceId = genruntime.ClonePointerToString(features.ClusterResourceId)

	// DisableLocalAuth
	if features.DisableLocalAuth != nil {
		disableLocalAuth := *features.DisableLocalAuth
		destination.DisableLocalAuth = &disableLocalAuth
	} else {
		destination.DisableLocalAuth = nil
	}

	// EnableDataExport
	if features.EnableDataExport != nil {
		enableDataExport := *features.EnableDataExport
		destination.EnableDataExport = &enableDataExport
	} else {
		destination.EnableDataExport = nil
	}

	// EnableLogAccessUsingOnlyResourcePermissions
	if features.EnableLogAccessUsingOnlyResourcePermissions != nil {
		enableLogAccessUsingOnlyResourcePermission := *features.EnableLogAccessUsingOnlyResourcePermissions
		destination.EnableLogAccessUsingOnlyResourcePermissions = &enableLogAccessUsingOnlyResourcePermission
	} else {
		destination.EnableLogAccessUsingOnlyResourcePermissions = nil
	}

	// ImmediatePurgeDataOn30Days
	if features.ImmediatePurgeDataOn30Days != nil {
		immediatePurgeDataOn30Day := *features.ImmediatePurgeDataOn30Days
		destination.ImmediatePurgeDataOn30Days = &immediatePurgeDataOn30Day
	} else {
		destination.ImmediatePurgeDataOn30Days = nil
	}

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

	// No error
	return nil
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type WorkspaceOperatorSpec 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_WorkspaceOperatorSpec populates our WorkspaceOperatorSpec from the provided source WorkspaceOperatorSpec
func (operator *WorkspaceOperatorSpec) AssignProperties_From_WorkspaceOperatorSpec(source *storage.WorkspaceOperatorSpec) 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_WorkspaceOperatorSpec populates the provided destination WorkspaceOperatorSpec from our WorkspaceOperatorSpec
func (operator *WorkspaceOperatorSpec) AssignProperties_To_WorkspaceOperatorSpec(destination *storage.WorkspaceOperatorSpec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Canceled","Creating","Deleting","Failed","ProvisioningAccount","Succeeded","Updating"}
type WorkspaceProperties_ProvisioningState string

const (
	WorkspaceProperties_ProvisioningState_Canceled            = WorkspaceProperties_ProvisioningState("Canceled")
	WorkspaceProperties_ProvisioningState_Creating            = WorkspaceProperties_ProvisioningState("Creating")
	WorkspaceProperties_ProvisioningState_Deleting            = WorkspaceProperties_ProvisioningState("Deleting")
	WorkspaceProperties_ProvisioningState_Failed              = WorkspaceProperties_ProvisioningState("Failed")
	WorkspaceProperties_ProvisioningState_ProvisioningAccount = WorkspaceProperties_ProvisioningState("ProvisioningAccount")
	WorkspaceProperties_ProvisioningState_Succeeded           = WorkspaceProperties_ProvisioningState("Succeeded")
	WorkspaceProperties_ProvisioningState_Updating            = WorkspaceProperties_ProvisioningState("Updating")
)

// Mapping from string to WorkspaceProperties_ProvisioningState
var workspaceProperties_ProvisioningState_Values = map[string]WorkspaceProperties_ProvisioningState{
	"canceled":            WorkspaceProperties_ProvisioningState_Canceled,
	"creating":            WorkspaceProperties_ProvisioningState_Creating,
	"deleting":            WorkspaceProperties_ProvisioningState_Deleting,
	"failed":              WorkspaceProperties_ProvisioningState_Failed,
	"provisioningaccount": WorkspaceProperties_ProvisioningState_ProvisioningAccount,
	"succeeded":           WorkspaceProperties_ProvisioningState_Succeeded,
	"updating":            WorkspaceProperties_ProvisioningState_Updating,
}

type WorkspaceProperties_ProvisioningState_STATUS string

const (
	WorkspaceProperties_ProvisioningState_STATUS_Canceled            = WorkspaceProperties_ProvisioningState_STATUS("Canceled")
	WorkspaceProperties_ProvisioningState_STATUS_Creating            = WorkspaceProperties_ProvisioningState_STATUS("Creating")
	WorkspaceProperties_ProvisioningState_STATUS_Deleting            = WorkspaceProperties_ProvisioningState_STATUS("Deleting")
	WorkspaceProperties_ProvisioningState_STATUS_Failed              = WorkspaceProperties_ProvisioningState_STATUS("Failed")
	WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount = WorkspaceProperties_ProvisioningState_STATUS("ProvisioningAccount")
	WorkspaceProperties_ProvisioningState_STATUS_Succeeded           = WorkspaceProperties_ProvisioningState_STATUS("Succeeded")
	WorkspaceProperties_ProvisioningState_STATUS_Updating            = WorkspaceProperties_ProvisioningState_STATUS("Updating")
)

// Mapping from string to WorkspaceProperties_ProvisioningState_STATUS
var workspaceProperties_ProvisioningState_STATUS_Values = map[string]WorkspaceProperties_ProvisioningState_STATUS{
	"canceled":            WorkspaceProperties_ProvisioningState_STATUS_Canceled,
	"creating":            WorkspaceProperties_ProvisioningState_STATUS_Creating,
	"deleting":            WorkspaceProperties_ProvisioningState_STATUS_Deleting,
	"failed":              WorkspaceProperties_ProvisioningState_STATUS_Failed,
	"provisioningaccount": WorkspaceProperties_ProvisioningState_STATUS_ProvisioningAccount,
	"succeeded":           WorkspaceProperties_ProvisioningState_STATUS_Succeeded,
	"updating":            WorkspaceProperties_ProvisioningState_STATUS_Updating,
}

// The SKU (tier) of a workspace.
type WorkspaceSku struct {
	// CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is
	// selected.
	CapacityReservationLevel *WorkspaceSku_CapacityReservationLevel `json:"capacityReservationLevel,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the SKU.
	Name *WorkspaceSku_Name `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &WorkspaceSku{}

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

	// Set property "CapacityReservationLevel":
	if workspaceSku.CapacityReservationLevel != nil {
		var temp int
		temp = int(*workspaceSku.CapacityReservationLevel)
		capacityReservationLevel := arm.WorkspaceSku_CapacityReservationLevel(temp)
		result.CapacityReservationLevel = &capacityReservationLevel
	}

	// Set property "Name":
	if workspaceSku.Name != nil {
		var temp string
		temp = string(*workspaceSku.Name)
		name := arm.WorkspaceSku_Name(temp)
		result.Name = &name
	}
	return result, nil
}

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

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

	// Set property "CapacityReservationLevel":
	if typedInput.CapacityReservationLevel != nil {
		var temp int
		temp = int(*typedInput.CapacityReservationLevel)
		capacityReservationLevel := WorkspaceSku_CapacityReservationLevel(temp)
		workspaceSku.CapacityReservationLevel = &capacityReservationLevel
	}

	// Set property "Name":
	if typedInput.Name != nil {
		var temp string
		temp = string(*typedInput.Name)
		name := WorkspaceSku_Name(temp)
		workspaceSku.Name = &name
	}

	// No error
	return nil
}

// AssignProperties_From_WorkspaceSku populates our WorkspaceSku from the provided source WorkspaceSku
func (workspaceSku *WorkspaceSku) AssignProperties_From_WorkspaceSku(source *storage.WorkspaceSku) error {

	// CapacityReservationLevel
	if source.CapacityReservationLevel != nil {
		capacityReservationLevel := WorkspaceSku_CapacityReservationLevel(*source.CapacityReservationLevel)
		workspaceSku.CapacityReservationLevel = &capacityReservationLevel
	} else {
		workspaceSku.CapacityReservationLevel = nil
	}

	// Name
	if source.Name != nil {
		name := *source.Name
		nameTemp := genruntime.ToEnum(name, workspaceSku_Name_Values)
		workspaceSku.Name = &nameTemp
	} else {
		workspaceSku.Name = nil
	}

	// No error
	return nil
}

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

	// CapacityReservationLevel
	if workspaceSku.CapacityReservationLevel != nil {
		capacityReservationLevel := int(*workspaceSku.CapacityReservationLevel)
		destination.CapacityReservationLevel = &capacityReservationLevel
	} else {
		destination.CapacityReservationLevel = nil
	}

	// Name
	if workspaceSku.Name != nil {
		name := string(*workspaceSku.Name)
		destination.Name = &name
	} else {
		destination.Name = nil
	}

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

	// No error
	return nil
}

// Initialize_From_WorkspaceSku_STATUS populates our WorkspaceSku from the provided source WorkspaceSku_STATUS
func (workspaceSku *WorkspaceSku) Initialize_From_WorkspaceSku_STATUS(source *WorkspaceSku_STATUS) error {

	// CapacityReservationLevel
	if source.CapacityReservationLevel != nil {
		capacityReservationLevel := WorkspaceSku_CapacityReservationLevel(*source.CapacityReservationLevel)
		workspaceSku.CapacityReservationLevel = &capacityReservationLevel
	} else {
		workspaceSku.CapacityReservationLevel = nil
	}

	// Name
	if source.Name != nil {
		name := genruntime.ToEnum(string(*source.Name), workspaceSku_Name_Values)
		workspaceSku.Name = &name
	} else {
		workspaceSku.Name = nil
	}

	// No error
	return nil
}

// The SKU (tier) of a workspace.
type WorkspaceSku_STATUS struct {
	// CapacityReservationLevel: The capacity reservation level in GB for this workspace, when CapacityReservation sku is
	// selected.
	CapacityReservationLevel *WorkspaceSku_CapacityReservationLevel_STATUS `json:"capacityReservationLevel,omitempty"`

	// LastSkuUpdate: The last time when the sku was updated.
	LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"`

	// Name: The name of the SKU.
	Name *WorkspaceSku_Name_STATUS `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &WorkspaceSku_STATUS{}

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

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

	// Set property "CapacityReservationLevel":
	if typedInput.CapacityReservationLevel != nil {
		var temp int
		temp = int(*typedInput.CapacityReservationLevel)
		capacityReservationLevel := WorkspaceSku_CapacityReservationLevel_STATUS(temp)
		workspaceSku.CapacityReservationLevel = &capacityReservationLevel
	}

	// Set property "LastSkuUpdate":
	if typedInput.LastSkuUpdate != nil {
		lastSkuUpdate := *typedInput.LastSkuUpdate
		workspaceSku.LastSkuUpdate = &lastSkuUpdate
	}

	// Set property "Name":
	if typedInput.Name != nil {
		var temp string
		temp = string(*typedInput.Name)
		name := WorkspaceSku_Name_STATUS(temp)
		workspaceSku.Name = &name
	}

	// No error
	return nil
}

// AssignProperties_From_WorkspaceSku_STATUS populates our WorkspaceSku_STATUS from the provided source WorkspaceSku_STATUS
func (workspaceSku *WorkspaceSku_STATUS) AssignProperties_From_WorkspaceSku_STATUS(source *storage.WorkspaceSku_STATUS) error {

	// CapacityReservationLevel
	if source.CapacityReservationLevel != nil {
		capacityReservationLevel := WorkspaceSku_CapacityReservationLevel_STATUS(*source.CapacityReservationLevel)
		workspaceSku.CapacityReservationLevel = &capacityReservationLevel
	} else {
		workspaceSku.CapacityReservationLevel = nil
	}

	// LastSkuUpdate
	workspaceSku.LastSkuUpdate = genruntime.ClonePointerToString(source.LastSkuUpdate)

	// Name
	if source.Name != nil {
		name := *source.Name
		nameTemp := genruntime.ToEnum(name, workspaceSku_Name_STATUS_Values)
		workspaceSku.Name = &nameTemp
	} else {
		workspaceSku.Name = nil
	}

	// No error
	return nil
}

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

	// CapacityReservationLevel
	if workspaceSku.CapacityReservationLevel != nil {
		capacityReservationLevel := int(*workspaceSku.CapacityReservationLevel)
		destination.CapacityReservationLevel = &capacityReservationLevel
	} else {
		destination.CapacityReservationLevel = nil
	}

	// LastSkuUpdate
	destination.LastSkuUpdate = genruntime.ClonePointerToString(workspaceSku.LastSkuUpdate)

	// Name
	if workspaceSku.Name != nil {
		name := string(*workspaceSku.Name)
		destination.Name = &name
	} else {
		destination.Name = nil
	}

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

	// No error
	return nil
}

type WorkspaceCapping_DataIngestionStatus_STATUS string

const (
	WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota      = WorkspaceCapping_DataIngestionStatus_STATUS("ApproachingQuota")
	WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff              = WorkspaceCapping_DataIngestionStatus_STATUS("ForceOff")
	WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn               = WorkspaceCapping_DataIngestionStatus_STATUS("ForceOn")
	WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota             = WorkspaceCapping_DataIngestionStatus_STATUS("OverQuota")
	WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota          = WorkspaceCapping_DataIngestionStatus_STATUS("RespectQuota")
	WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended = WorkspaceCapping_DataIngestionStatus_STATUS("SubscriptionSuspended")
)

// Mapping from string to WorkspaceCapping_DataIngestionStatus_STATUS
var workspaceCapping_DataIngestionStatus_STATUS_Values = map[string]WorkspaceCapping_DataIngestionStatus_STATUS{
	"approachingquota":      WorkspaceCapping_DataIngestionStatus_STATUS_ApproachingQuota,
	"forceoff":              WorkspaceCapping_DataIngestionStatus_STATUS_ForceOff,
	"forceon":               WorkspaceCapping_DataIngestionStatus_STATUS_ForceOn,
	"overquota":             WorkspaceCapping_DataIngestionStatus_STATUS_OverQuota,
	"respectquota":          WorkspaceCapping_DataIngestionStatus_STATUS_RespectQuota,
	"subscriptionsuspended": WorkspaceCapping_DataIngestionStatus_STATUS_SubscriptionSuspended,
}

// +kubebuilder:validation:Enum={100,200,300,400,500,1000,2000,5000}
type WorkspaceSku_CapacityReservationLevel int

const (
	WorkspaceSku_CapacityReservationLevel_100  = WorkspaceSku_CapacityReservationLevel(100)
	WorkspaceSku_CapacityReservationLevel_200  = WorkspaceSku_CapacityReservationLevel(200)
	WorkspaceSku_CapacityReservationLevel_300  = WorkspaceSku_CapacityReservationLevel(300)
	WorkspaceSku_CapacityReservationLevel_400  = WorkspaceSku_CapacityReservationLevel(400)
	WorkspaceSku_CapacityReservationLevel_500  = WorkspaceSku_CapacityReservationLevel(500)
	WorkspaceSku_CapacityReservationLevel_1000 = WorkspaceSku_CapacityReservationLevel(1000)
	WorkspaceSku_CapacityReservationLevel_2000 = WorkspaceSku_CapacityReservationLevel(2000)
	WorkspaceSku_CapacityReservationLevel_5000 = WorkspaceSku_CapacityReservationLevel(5000)
)

type WorkspaceSku_CapacityReservationLevel_STATUS int

const (
	WorkspaceSku_CapacityReservationLevel_STATUS_100  = WorkspaceSku_CapacityReservationLevel_STATUS(100)
	WorkspaceSku_CapacityReservationLevel_STATUS_200  = WorkspaceSku_CapacityReservationLevel_STATUS(200)
	WorkspaceSku_CapacityReservationLevel_STATUS_300  = WorkspaceSku_CapacityReservationLevel_STATUS(300)
	WorkspaceSku_CapacityReservationLevel_STATUS_400  = WorkspaceSku_CapacityReservationLevel_STATUS(400)
	WorkspaceSku_CapacityReservationLevel_STATUS_500  = WorkspaceSku_CapacityReservationLevel_STATUS(500)
	WorkspaceSku_CapacityReservationLevel_STATUS_1000 = WorkspaceSku_CapacityReservationLevel_STATUS(1000)
	WorkspaceSku_CapacityReservationLevel_STATUS_2000 = WorkspaceSku_CapacityReservationLevel_STATUS(2000)
	WorkspaceSku_CapacityReservationLevel_STATUS_5000 = WorkspaceSku_CapacityReservationLevel_STATUS(5000)
)

// +kubebuilder:validation:Enum={"CapacityReservation","Free","LACluster","PerGB2018","PerNode","Premium","Standalone","Standard"}
type WorkspaceSku_Name string

const (
	WorkspaceSku_Name_CapacityReservation = WorkspaceSku_Name("CapacityReservation")
	WorkspaceSku_Name_Free                = WorkspaceSku_Name("Free")
	WorkspaceSku_Name_LACluster           = WorkspaceSku_Name("LACluster")
	WorkspaceSku_Name_PerGB2018           = WorkspaceSku_Name("PerGB2018")
	WorkspaceSku_Name_PerNode             = WorkspaceSku_Name("PerNode")
	WorkspaceSku_Name_Premium             = WorkspaceSku_Name("Premium")
	WorkspaceSku_Name_Standalone          = WorkspaceSku_Name("Standalone")
	WorkspaceSku_Name_Standard            = WorkspaceSku_Name("Standard")
)

// Mapping from string to WorkspaceSku_Name
var workspaceSku_Name_Values = map[string]WorkspaceSku_Name{
	"capacityreservation": WorkspaceSku_Name_CapacityReservation,
	"free":                WorkspaceSku_Name_Free,
	"lacluster":           WorkspaceSku_Name_LACluster,
	"pergb2018":           WorkspaceSku_Name_PerGB2018,
	"pernode":             WorkspaceSku_Name_PerNode,
	"premium":             WorkspaceSku_Name_Premium,
	"standalone":          WorkspaceSku_Name_Standalone,
	"standard":            WorkspaceSku_Name_Standard,
}

type WorkspaceSku_Name_STATUS string

const (
	WorkspaceSku_Name_STATUS_CapacityReservation = WorkspaceSku_Name_STATUS("CapacityReservation")
	WorkspaceSku_Name_STATUS_Free                = WorkspaceSku_Name_STATUS("Free")
	WorkspaceSku_Name_STATUS_LACluster           = WorkspaceSku_Name_STATUS("LACluster")
	WorkspaceSku_Name_STATUS_PerGB2018           = WorkspaceSku_Name_STATUS("PerGB2018")
	WorkspaceSku_Name_STATUS_PerNode             = WorkspaceSku_Name_STATUS("PerNode")
	WorkspaceSku_Name_STATUS_Premium             = WorkspaceSku_Name_STATUS("Premium")
	WorkspaceSku_Name_STATUS_Standalone          = WorkspaceSku_Name_STATUS("Standalone")
	WorkspaceSku_Name_STATUS_Standard            = WorkspaceSku_Name_STATUS("Standard")
)

// Mapping from string to WorkspaceSku_Name_STATUS
var workspaceSku_Name_STATUS_Values = map[string]WorkspaceSku_Name_STATUS{
	"capacityreservation": WorkspaceSku_Name_STATUS_CapacityReservation,
	"free":                WorkspaceSku_Name_STATUS_Free,
	"lacluster":           WorkspaceSku_Name_STATUS_LACluster,
	"pergb2018":           WorkspaceSku_Name_STATUS_PerGB2018,
	"pernode":             WorkspaceSku_Name_STATUS_PerNode,
	"premium":             WorkspaceSku_Name_STATUS_Premium,
	"standalone":          WorkspaceSku_Name_STATUS_Standalone,
	"standard":            WorkspaceSku_Name_STATUS_Standard,
}

func init() {
	SchemeBuilder.Register(&Workspace{}, &WorkspaceList{})
}
