// 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/synapse/v1api20210601/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/synapse/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"
	"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	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,synapse}
// +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: /synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/workspace.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/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 synapse/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 synapse/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.Synapse/workspaces"
func (workspace *Workspace) GetType() string {
	return "Microsoft.Synapse/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: /synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/workspace.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/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 {
	// AzureADOnlyAuthentication: Enable or Disable AzureADOnlyAuthentication on All Workspace subresource
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`

	// 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"`

	// CspWorkspaceAdminProperties: Initial workspace AAD admin properties for a CSP subscription
	CspWorkspaceAdminProperties *CspWorkspaceAdminProperties `json:"cspWorkspaceAdminProperties,omitempty"`

	// DefaultDataLakeStorage: Workspace default data lake storage account details
	DefaultDataLakeStorage *DataLakeStorageAccountDetails `json:"defaultDataLakeStorage,omitempty"`

	// Encryption: The encryption details of the workspace
	Encryption *EncryptionDetails `json:"encryption,omitempty"`

	// Identity: Identity of the workspace
	Identity *ManagedIdentity `json:"identity,omitempty"`

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

	// ManagedResourceGroupName: Workspace managed resource group. The resource group name uniquely identifies the resource
	// group within the user subscriptionId. The resource group name must be no longer than 90 characters long, and must be
	// alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name cannot end with '.'
	ManagedResourceGroupName *string `json:"managedResourceGroupName,omitempty"`

	// ManagedVirtualNetwork: Setting this to 'default' will ensure that all compute for this workspace is in a virtual network
	// managed on behalf of the user.
	ManagedVirtualNetwork *string `json:"managedVirtualNetwork,omitempty"`

	// ManagedVirtualNetworkSettings: Managed Virtual Network Settings
	ManagedVirtualNetworkSettings *ManagedVirtualNetworkSettings `json:"managedVirtualNetworkSettings,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"`

	// PublicNetworkAccess: Enable or Disable public network access to workspace
	PublicNetworkAccess *WorkspaceProperties_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// PurviewConfiguration: Purview Configuration
	PurviewConfiguration *PurviewConfiguration `json:"purviewConfiguration,omitempty"`

	// SqlAdministratorLogin: Login for workspace SQL active directory administrator
	SqlAdministratorLogin *string `json:"sqlAdministratorLogin,omitempty"`

	// SqlAdministratorLoginPassword: SQL administrator login password
	SqlAdministratorLoginPassword *genruntime.SecretReference `json:"sqlAdministratorLoginPassword,omitempty"`

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

	// TrustedServiceBypassEnabled: Is trustedServiceBypassEnabled for the workspace
	TrustedServiceBypassEnabled *bool `json:"trustedServiceBypassEnabled,omitempty"`

	// VirtualNetworkProfile: Virtual Network profile
	VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"`

	// WorkspaceRepositoryConfiguration: Git integration settings
	WorkspaceRepositoryConfiguration *WorkspaceRepositoryConfiguration `json:"workspaceRepositoryConfiguration,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 "Identity":
	if workspace.Identity != nil {
		identity_ARM, err := workspace.Identity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		identity := *identity_ARM.(*arm.ManagedIdentity)
		result.Identity = &identity
	}

	// 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.AzureADOnlyAuthentication != nil ||
		workspace.CspWorkspaceAdminProperties != nil ||
		workspace.DefaultDataLakeStorage != nil ||
		workspace.Encryption != nil ||
		workspace.ManagedResourceGroupName != nil ||
		workspace.ManagedVirtualNetwork != nil ||
		workspace.ManagedVirtualNetworkSettings != nil ||
		workspace.PublicNetworkAccess != nil ||
		workspace.PurviewConfiguration != nil ||
		workspace.SqlAdministratorLogin != nil ||
		workspace.SqlAdministratorLoginPassword != nil ||
		workspace.TrustedServiceBypassEnabled != nil ||
		workspace.VirtualNetworkProfile != nil ||
		workspace.WorkspaceRepositoryConfiguration != nil {
		result.Properties = &arm.WorkspaceProperties{}
	}
	if workspace.AzureADOnlyAuthentication != nil {
		azureADOnlyAuthentication := *workspace.AzureADOnlyAuthentication
		result.Properties.AzureADOnlyAuthentication = &azureADOnlyAuthentication
	}
	if workspace.CspWorkspaceAdminProperties != nil {
		cspWorkspaceAdminProperties_ARM, err := workspace.CspWorkspaceAdminProperties.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		cspWorkspaceAdminProperties := *cspWorkspaceAdminProperties_ARM.(*arm.CspWorkspaceAdminProperties)
		result.Properties.CspWorkspaceAdminProperties = &cspWorkspaceAdminProperties
	}
	if workspace.DefaultDataLakeStorage != nil {
		defaultDataLakeStorage_ARM, err := workspace.DefaultDataLakeStorage.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		defaultDataLakeStorage := *defaultDataLakeStorage_ARM.(*arm.DataLakeStorageAccountDetails)
		result.Properties.DefaultDataLakeStorage = &defaultDataLakeStorage
	}
	if workspace.Encryption != nil {
		encryption_ARM, err := workspace.Encryption.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		encryption := *encryption_ARM.(*arm.EncryptionDetails)
		result.Properties.Encryption = &encryption
	}
	if workspace.ManagedResourceGroupName != nil {
		managedResourceGroupName := *workspace.ManagedResourceGroupName
		result.Properties.ManagedResourceGroupName = &managedResourceGroupName
	}
	if workspace.ManagedVirtualNetwork != nil {
		managedVirtualNetwork := *workspace.ManagedVirtualNetwork
		result.Properties.ManagedVirtualNetwork = &managedVirtualNetwork
	}
	if workspace.ManagedVirtualNetworkSettings != nil {
		managedVirtualNetworkSettings_ARM, err := workspace.ManagedVirtualNetworkSettings.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		managedVirtualNetworkSettings := *managedVirtualNetworkSettings_ARM.(*arm.ManagedVirtualNetworkSettings)
		result.Properties.ManagedVirtualNetworkSettings = &managedVirtualNetworkSettings
	}
	if workspace.PublicNetworkAccess != nil {
		var temp string
		temp = string(*workspace.PublicNetworkAccess)
		publicNetworkAccess := arm.WorkspaceProperties_PublicNetworkAccess(temp)
		result.Properties.PublicNetworkAccess = &publicNetworkAccess
	}
	if workspace.PurviewConfiguration != nil {
		purviewConfiguration_ARM, err := workspace.PurviewConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		purviewConfiguration := *purviewConfiguration_ARM.(*arm.PurviewConfiguration)
		result.Properties.PurviewConfiguration = &purviewConfiguration
	}
	if workspace.SqlAdministratorLogin != nil {
		sqlAdministratorLogin := *workspace.SqlAdministratorLogin
		result.Properties.SqlAdministratorLogin = &sqlAdministratorLogin
	}
	if workspace.SqlAdministratorLoginPassword != nil {
		sqlAdministratorLoginPasswordSecret, err := resolved.ResolvedSecrets.Lookup(*workspace.SqlAdministratorLoginPassword)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property SqlAdministratorLoginPassword")
		}
		sqlAdministratorLoginPassword := sqlAdministratorLoginPasswordSecret
		result.Properties.SqlAdministratorLoginPassword = &sqlAdministratorLoginPassword
	}
	if workspace.TrustedServiceBypassEnabled != nil {
		trustedServiceBypassEnabled := *workspace.TrustedServiceBypassEnabled
		result.Properties.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled
	}
	if workspace.VirtualNetworkProfile != nil {
		virtualNetworkProfile_ARM, err := workspace.VirtualNetworkProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		virtualNetworkProfile := *virtualNetworkProfile_ARM.(*arm.VirtualNetworkProfile)
		result.Properties.VirtualNetworkProfile = &virtualNetworkProfile
	}
	if workspace.WorkspaceRepositoryConfiguration != nil {
		workspaceRepositoryConfiguration_ARM, err := workspace.WorkspaceRepositoryConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		workspaceRepositoryConfiguration := *workspaceRepositoryConfiguration_ARM.(*arm.WorkspaceRepositoryConfiguration)
		result.Properties.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
	}

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

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

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

	// Set property "DefaultDataLakeStorage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultDataLakeStorage != nil {
			var defaultDataLakeStorage1 DataLakeStorageAccountDetails
			err := defaultDataLakeStorage1.PopulateFromARM(owner, *typedInput.Properties.DefaultDataLakeStorage)
			if err != nil {
				return err
			}
			defaultDataLakeStorage := defaultDataLakeStorage1
			workspace.DefaultDataLakeStorage = &defaultDataLakeStorage
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 EncryptionDetails
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			workspace.Encryption = &encryption
		}
	}

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ManagedIdentity
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		workspace.Identity = &identity
	}

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

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

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

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

	// no assignment for property "OperatorSpec"

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

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

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

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

	// no assignment for property "SqlAdministratorLoginPassword"

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

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

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

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

	// AzureADOnlyAuthentication
	if source.AzureADOnlyAuthentication != nil {
		azureADOnlyAuthentication := *source.AzureADOnlyAuthentication
		workspace.AzureADOnlyAuthentication = &azureADOnlyAuthentication
	} else {
		workspace.AzureADOnlyAuthentication = nil
	}

	// AzureName
	workspace.AzureName = source.AzureName

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

	// DefaultDataLakeStorage
	if source.DefaultDataLakeStorage != nil {
		var defaultDataLakeStorage DataLakeStorageAccountDetails
		err := defaultDataLakeStorage.AssignProperties_From_DataLakeStorageAccountDetails(source.DefaultDataLakeStorage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DataLakeStorageAccountDetails() to populate field DefaultDataLakeStorage")
		}
		workspace.DefaultDataLakeStorage = &defaultDataLakeStorage
	} else {
		workspace.DefaultDataLakeStorage = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption EncryptionDetails
		err := encryption.AssignProperties_From_EncryptionDetails(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EncryptionDetails() to populate field Encryption")
		}
		workspace.Encryption = &encryption
	} else {
		workspace.Encryption = nil
	}

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

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

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

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

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

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

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

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

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

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

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

	// TrustedServiceBypassEnabled
	if source.TrustedServiceBypassEnabled != nil {
		trustedServiceBypassEnabled := *source.TrustedServiceBypassEnabled
		workspace.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled
	} else {
		workspace.TrustedServiceBypassEnabled = nil
	}

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

	// WorkspaceRepositoryConfiguration
	if source.WorkspaceRepositoryConfiguration != nil {
		var workspaceRepositoryConfiguration WorkspaceRepositoryConfiguration
		err := workspaceRepositoryConfiguration.AssignProperties_From_WorkspaceRepositoryConfiguration(source.WorkspaceRepositoryConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceRepositoryConfiguration() to populate field WorkspaceRepositoryConfiguration")
		}
		workspace.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
	} else {
		workspace.WorkspaceRepositoryConfiguration = 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()

	// AzureADOnlyAuthentication
	if workspace.AzureADOnlyAuthentication != nil {
		azureADOnlyAuthentication := *workspace.AzureADOnlyAuthentication
		destination.AzureADOnlyAuthentication = &azureADOnlyAuthentication
	} else {
		destination.AzureADOnlyAuthentication = nil
	}

	// AzureName
	destination.AzureName = workspace.AzureName

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

	// DefaultDataLakeStorage
	if workspace.DefaultDataLakeStorage != nil {
		var defaultDataLakeStorage storage.DataLakeStorageAccountDetails
		err := workspace.DefaultDataLakeStorage.AssignProperties_To_DataLakeStorageAccountDetails(&defaultDataLakeStorage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DataLakeStorageAccountDetails() to populate field DefaultDataLakeStorage")
		}
		destination.DefaultDataLakeStorage = &defaultDataLakeStorage
	} else {
		destination.DefaultDataLakeStorage = nil
	}

	// Encryption
	if workspace.Encryption != nil {
		var encryption storage.EncryptionDetails
		err := workspace.Encryption.AssignProperties_To_EncryptionDetails(&encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EncryptionDetails() to populate field Encryption")
		}
		destination.Encryption = &encryption
	} else {
		destination.Encryption = nil
	}

	// Identity
	if workspace.Identity != nil {
		var identity storage.ManagedIdentity
		err := workspace.Identity.AssignProperties_To_ManagedIdentity(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedIdentity() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

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

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

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

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

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

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

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

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

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

	// TrustedServiceBypassEnabled
	if workspace.TrustedServiceBypassEnabled != nil {
		trustedServiceBypassEnabled := *workspace.TrustedServiceBypassEnabled
		destination.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled
	} else {
		destination.TrustedServiceBypassEnabled = nil
	}

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

	// WorkspaceRepositoryConfiguration
	if workspace.WorkspaceRepositoryConfiguration != nil {
		var workspaceRepositoryConfiguration storage.WorkspaceRepositoryConfiguration
		err := workspace.WorkspaceRepositoryConfiguration.AssignProperties_To_WorkspaceRepositoryConfiguration(&workspaceRepositoryConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceRepositoryConfiguration() to populate field WorkspaceRepositoryConfiguration")
		}
		destination.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
	} else {
		destination.WorkspaceRepositoryConfiguration = 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 {

	// AzureADOnlyAuthentication
	if source.AzureADOnlyAuthentication != nil {
		azureADOnlyAuthentication := *source.AzureADOnlyAuthentication
		workspace.AzureADOnlyAuthentication = &azureADOnlyAuthentication
	} else {
		workspace.AzureADOnlyAuthentication = nil
	}

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

	// DefaultDataLakeStorage
	if source.DefaultDataLakeStorage != nil {
		var defaultDataLakeStorage DataLakeStorageAccountDetails
		err := defaultDataLakeStorage.Initialize_From_DataLakeStorageAccountDetails_STATUS(source.DefaultDataLakeStorage)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_DataLakeStorageAccountDetails_STATUS() to populate field DefaultDataLakeStorage")
		}
		workspace.DefaultDataLakeStorage = &defaultDataLakeStorage
	} else {
		workspace.DefaultDataLakeStorage = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption EncryptionDetails
		err := encryption.Initialize_From_EncryptionDetails_STATUS(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_EncryptionDetails_STATUS() to populate field Encryption")
		}
		workspace.Encryption = &encryption
	} else {
		workspace.Encryption = nil
	}

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

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

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

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

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

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

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

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

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

	// TrustedServiceBypassEnabled
	if source.TrustedServiceBypassEnabled != nil {
		trustedServiceBypassEnabled := *source.TrustedServiceBypassEnabled
		workspace.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled
	} else {
		workspace.TrustedServiceBypassEnabled = nil
	}

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

	// WorkspaceRepositoryConfiguration
	if source.WorkspaceRepositoryConfiguration != nil {
		var workspaceRepositoryConfiguration WorkspaceRepositoryConfiguration
		err := workspaceRepositoryConfiguration.Initialize_From_WorkspaceRepositoryConfiguration_STATUS(source.WorkspaceRepositoryConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_WorkspaceRepositoryConfiguration_STATUS() to populate field WorkspaceRepositoryConfiguration")
		}
		workspace.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
	} else {
		workspace.WorkspaceRepositoryConfiguration = 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 }

// A workspace
type Workspace_STATUS struct {
	// AdlaResourceId: The ADLA resource ID.
	AdlaResourceId *string `json:"adlaResourceId,omitempty"`

	// AzureADOnlyAuthentication: Enable or Disable AzureADOnlyAuthentication on All Workspace subresource
	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`

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

	// ConnectivityEndpoints: Connectivity endpoints
	ConnectivityEndpoints map[string]string `json:"connectivityEndpoints,omitempty"`

	// CspWorkspaceAdminProperties: Initial workspace AAD admin properties for a CSP subscription
	CspWorkspaceAdminProperties *CspWorkspaceAdminProperties_STATUS `json:"cspWorkspaceAdminProperties,omitempty"`

	// DefaultDataLakeStorage: Workspace default data lake storage account details
	DefaultDataLakeStorage *DataLakeStorageAccountDetails_STATUS `json:"defaultDataLakeStorage,omitempty"`

	// Encryption: The encryption details of the workspace
	Encryption *EncryptionDetails_STATUS `json:"encryption,omitempty"`

	// ExtraProperties: Workspace level configs and feature flags
	ExtraProperties map[string]v1.JSON `json:"extraProperties,omitempty"`

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

	// Identity: Identity of the workspace
	Identity *ManagedIdentity_STATUS `json:"identity,omitempty"`

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

	// ManagedResourceGroupName: Workspace managed resource group. The resource group name uniquely identifies the resource
	// group within the user subscriptionId. The resource group name must be no longer than 90 characters long, and must be
	// alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note that the name cannot end with '.'
	ManagedResourceGroupName *string `json:"managedResourceGroupName,omitempty"`

	// ManagedVirtualNetwork: Setting this to 'default' will ensure that all compute for this workspace is in a virtual network
	// managed on behalf of the user.
	ManagedVirtualNetwork *string `json:"managedVirtualNetwork,omitempty"`

	// ManagedVirtualNetworkSettings: Managed Virtual Network Settings
	ManagedVirtualNetworkSettings *ManagedVirtualNetworkSettings_STATUS `json:"managedVirtualNetworkSettings,omitempty"`

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

	// PrivateEndpointConnections: Private endpoint connections to the workspace
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"`

	// ProvisioningState: Resource provisioning state
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Enable or Disable public network access to workspace
	PublicNetworkAccess *WorkspaceProperties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// PurviewConfiguration: Purview Configuration
	PurviewConfiguration *PurviewConfiguration_STATUS `json:"purviewConfiguration,omitempty"`

	// Settings: Workspace settings
	Settings map[string]v1.JSON `json:"settings,omitempty"`

	// SqlAdministratorLogin: Login for workspace SQL active directory administrator
	SqlAdministratorLogin *string `json:"sqlAdministratorLogin,omitempty"`

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

	// TrustedServiceBypassEnabled: Is trustedServiceBypassEnabled for the workspace
	TrustedServiceBypassEnabled *bool `json:"trustedServiceBypassEnabled,omitempty"`

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

	// VirtualNetworkProfile: Virtual Network profile
	VirtualNetworkProfile *VirtualNetworkProfile_STATUS `json:"virtualNetworkProfile,omitempty"`

	// WorkspaceRepositoryConfiguration: Git integration settings
	WorkspaceRepositoryConfiguration *WorkspaceRepositoryConfiguration_STATUS `json:"workspaceRepositoryConfiguration,omitempty"`

	// WorkspaceUID: The workspace unique identifier
	WorkspaceUID *string `json:"workspaceUID,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)
	}

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

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

	// no assignment for property "Conditions"

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

	// Set property "CspWorkspaceAdminProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CspWorkspaceAdminProperties != nil {
			var cspWorkspaceAdminProperties1 CspWorkspaceAdminProperties_STATUS
			err := cspWorkspaceAdminProperties1.PopulateFromARM(owner, *typedInput.Properties.CspWorkspaceAdminProperties)
			if err != nil {
				return err
			}
			cspWorkspaceAdminProperties := cspWorkspaceAdminProperties1
			workspace.CspWorkspaceAdminProperties = &cspWorkspaceAdminProperties
		}
	}

	// Set property "DefaultDataLakeStorage":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultDataLakeStorage != nil {
			var defaultDataLakeStorage1 DataLakeStorageAccountDetails_STATUS
			err := defaultDataLakeStorage1.PopulateFromARM(owner, *typedInput.Properties.DefaultDataLakeStorage)
			if err != nil {
				return err
			}
			defaultDataLakeStorage := defaultDataLakeStorage1
			workspace.DefaultDataLakeStorage = &defaultDataLakeStorage
		}
	}

	// Set property "Encryption":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Encryption != nil {
			var encryption1 EncryptionDetails_STATUS
			err := encryption1.PopulateFromARM(owner, *typedInput.Properties.Encryption)
			if err != nil {
				return err
			}
			encryption := encryption1
			workspace.Encryption = &encryption
		}
	}

	// Set property "ExtraProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ExtraProperties != nil {
			workspace.ExtraProperties = make(map[string]v1.JSON, len(typedInput.Properties.ExtraProperties))
			for key, value := range typedInput.Properties.ExtraProperties {
				workspace.ExtraProperties[key] = *value.DeepCopy()
			}
		}
	}

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

	// Set property "Identity":
	if typedInput.Identity != nil {
		var identity1 ManagedIdentity_STATUS
		err := identity1.PopulateFromARM(owner, *typedInput.Identity)
		if err != nil {
			return err
		}
		identity := identity1
		workspace.Identity = &identity
	}

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

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

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

	// Set property "ManagedVirtualNetworkSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ManagedVirtualNetworkSettings != nil {
			var managedVirtualNetworkSettings1 ManagedVirtualNetworkSettings_STATUS
			err := managedVirtualNetworkSettings1.PopulateFromARM(owner, *typedInput.Properties.ManagedVirtualNetworkSettings)
			if err != nil {
				return err
			}
			managedVirtualNetworkSettings := managedVirtualNetworkSettings1
			workspace.ManagedVirtualNetworkSettings = &managedVirtualNetworkSettings
		}
	}

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

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

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

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

	// Set property "PurviewConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PurviewConfiguration != nil {
			var purviewConfiguration1 PurviewConfiguration_STATUS
			err := purviewConfiguration1.PopulateFromARM(owner, *typedInput.Properties.PurviewConfiguration)
			if err != nil {
				return err
			}
			purviewConfiguration := purviewConfiguration1
			workspace.PurviewConfiguration = &purviewConfiguration
		}
	}

	// Set property "Settings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Settings != nil {
			workspace.Settings = make(map[string]v1.JSON, len(typedInput.Properties.Settings))
			for key, value := range typedInput.Properties.Settings {
				workspace.Settings[key] = *value.DeepCopy()
			}
		}
	}

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

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

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

	// Set property "VirtualNetworkProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualNetworkProfile != nil {
			var virtualNetworkProfile1 VirtualNetworkProfile_STATUS
			err := virtualNetworkProfile1.PopulateFromARM(owner, *typedInput.Properties.VirtualNetworkProfile)
			if err != nil {
				return err
			}
			virtualNetworkProfile := virtualNetworkProfile1
			workspace.VirtualNetworkProfile = &virtualNetworkProfile
		}
	}

	// Set property "WorkspaceRepositoryConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.WorkspaceRepositoryConfiguration != nil {
			var workspaceRepositoryConfiguration1 WorkspaceRepositoryConfiguration_STATUS
			err := workspaceRepositoryConfiguration1.PopulateFromARM(owner, *typedInput.Properties.WorkspaceRepositoryConfiguration)
			if err != nil {
				return err
			}
			workspaceRepositoryConfiguration := workspaceRepositoryConfiguration1
			workspace.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
		}
	}

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

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

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

	// AzureADOnlyAuthentication
	if source.AzureADOnlyAuthentication != nil {
		azureADOnlyAuthentication := *source.AzureADOnlyAuthentication
		workspace.AzureADOnlyAuthentication = &azureADOnlyAuthentication
	} else {
		workspace.AzureADOnlyAuthentication = nil
	}

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

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

	// CspWorkspaceAdminProperties
	if source.CspWorkspaceAdminProperties != nil {
		var cspWorkspaceAdminProperty CspWorkspaceAdminProperties_STATUS
		err := cspWorkspaceAdminProperty.AssignProperties_From_CspWorkspaceAdminProperties_STATUS(source.CspWorkspaceAdminProperties)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CspWorkspaceAdminProperties_STATUS() to populate field CspWorkspaceAdminProperties")
		}
		workspace.CspWorkspaceAdminProperties = &cspWorkspaceAdminProperty
	} else {
		workspace.CspWorkspaceAdminProperties = nil
	}

	// DefaultDataLakeStorage
	if source.DefaultDataLakeStorage != nil {
		var defaultDataLakeStorage DataLakeStorageAccountDetails_STATUS
		err := defaultDataLakeStorage.AssignProperties_From_DataLakeStorageAccountDetails_STATUS(source.DefaultDataLakeStorage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_DataLakeStorageAccountDetails_STATUS() to populate field DefaultDataLakeStorage")
		}
		workspace.DefaultDataLakeStorage = &defaultDataLakeStorage
	} else {
		workspace.DefaultDataLakeStorage = nil
	}

	// Encryption
	if source.Encryption != nil {
		var encryption EncryptionDetails_STATUS
		err := encryption.AssignProperties_From_EncryptionDetails_STATUS(source.Encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_EncryptionDetails_STATUS() to populate field Encryption")
		}
		workspace.Encryption = &encryption
	} else {
		workspace.Encryption = nil
	}

	// ExtraProperties
	if source.ExtraProperties != nil {
		extraPropertyMap := make(map[string]v1.JSON, len(source.ExtraProperties))
		for extraPropertyKey, extraPropertyValue := range source.ExtraProperties {
			extraPropertyMap[extraPropertyKey] = *extraPropertyValue.DeepCopy()
		}
		workspace.ExtraProperties = extraPropertyMap
	} else {
		workspace.ExtraProperties = nil
	}

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

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

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

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

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

	// ManagedVirtualNetworkSettings
	if source.ManagedVirtualNetworkSettings != nil {
		var managedVirtualNetworkSetting ManagedVirtualNetworkSettings_STATUS
		err := managedVirtualNetworkSetting.AssignProperties_From_ManagedVirtualNetworkSettings_STATUS(source.ManagedVirtualNetworkSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedVirtualNetworkSettings_STATUS() to populate field ManagedVirtualNetworkSettings")
		}
		workspace.ManagedVirtualNetworkSettings = &managedVirtualNetworkSetting
	} else {
		workspace.ManagedVirtualNetworkSettings = nil
	}

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

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

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

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

	// PurviewConfiguration
	if source.PurviewConfiguration != nil {
		var purviewConfiguration PurviewConfiguration_STATUS
		err := purviewConfiguration.AssignProperties_From_PurviewConfiguration_STATUS(source.PurviewConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PurviewConfiguration_STATUS() to populate field PurviewConfiguration")
		}
		workspace.PurviewConfiguration = &purviewConfiguration
	} else {
		workspace.PurviewConfiguration = nil
	}

	// Settings
	if source.Settings != nil {
		settingMap := make(map[string]v1.JSON, len(source.Settings))
		for settingKey, settingValue := range source.Settings {
			settingMap[settingKey] = *settingValue.DeepCopy()
		}
		workspace.Settings = settingMap
	} else {
		workspace.Settings = nil
	}

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

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

	// TrustedServiceBypassEnabled
	if source.TrustedServiceBypassEnabled != nil {
		trustedServiceBypassEnabled := *source.TrustedServiceBypassEnabled
		workspace.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled
	} else {
		workspace.TrustedServiceBypassEnabled = nil
	}

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

	// VirtualNetworkProfile
	if source.VirtualNetworkProfile != nil {
		var virtualNetworkProfile VirtualNetworkProfile_STATUS
		err := virtualNetworkProfile.AssignProperties_From_VirtualNetworkProfile_STATUS(source.VirtualNetworkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkProfile_STATUS() to populate field VirtualNetworkProfile")
		}
		workspace.VirtualNetworkProfile = &virtualNetworkProfile
	} else {
		workspace.VirtualNetworkProfile = nil
	}

	// WorkspaceRepositoryConfiguration
	if source.WorkspaceRepositoryConfiguration != nil {
		var workspaceRepositoryConfiguration WorkspaceRepositoryConfiguration_STATUS
		err := workspaceRepositoryConfiguration.AssignProperties_From_WorkspaceRepositoryConfiguration_STATUS(source.WorkspaceRepositoryConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceRepositoryConfiguration_STATUS() to populate field WorkspaceRepositoryConfiguration")
		}
		workspace.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
	} else {
		workspace.WorkspaceRepositoryConfiguration = nil
	}

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

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

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

	// AzureADOnlyAuthentication
	if workspace.AzureADOnlyAuthentication != nil {
		azureADOnlyAuthentication := *workspace.AzureADOnlyAuthentication
		destination.AzureADOnlyAuthentication = &azureADOnlyAuthentication
	} else {
		destination.AzureADOnlyAuthentication = nil
	}

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

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

	// CspWorkspaceAdminProperties
	if workspace.CspWorkspaceAdminProperties != nil {
		var cspWorkspaceAdminProperty storage.CspWorkspaceAdminProperties_STATUS
		err := workspace.CspWorkspaceAdminProperties.AssignProperties_To_CspWorkspaceAdminProperties_STATUS(&cspWorkspaceAdminProperty)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CspWorkspaceAdminProperties_STATUS() to populate field CspWorkspaceAdminProperties")
		}
		destination.CspWorkspaceAdminProperties = &cspWorkspaceAdminProperty
	} else {
		destination.CspWorkspaceAdminProperties = nil
	}

	// DefaultDataLakeStorage
	if workspace.DefaultDataLakeStorage != nil {
		var defaultDataLakeStorage storage.DataLakeStorageAccountDetails_STATUS
		err := workspace.DefaultDataLakeStorage.AssignProperties_To_DataLakeStorageAccountDetails_STATUS(&defaultDataLakeStorage)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_DataLakeStorageAccountDetails_STATUS() to populate field DefaultDataLakeStorage")
		}
		destination.DefaultDataLakeStorage = &defaultDataLakeStorage
	} else {
		destination.DefaultDataLakeStorage = nil
	}

	// Encryption
	if workspace.Encryption != nil {
		var encryption storage.EncryptionDetails_STATUS
		err := workspace.Encryption.AssignProperties_To_EncryptionDetails_STATUS(&encryption)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_EncryptionDetails_STATUS() to populate field Encryption")
		}
		destination.Encryption = &encryption
	} else {
		destination.Encryption = nil
	}

	// ExtraProperties
	if workspace.ExtraProperties != nil {
		extraPropertyMap := make(map[string]v1.JSON, len(workspace.ExtraProperties))
		for extraPropertyKey, extraPropertyValue := range workspace.ExtraProperties {
			extraPropertyMap[extraPropertyKey] = *extraPropertyValue.DeepCopy()
		}
		destination.ExtraProperties = extraPropertyMap
	} else {
		destination.ExtraProperties = nil
	}

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

	// Identity
	if workspace.Identity != nil {
		var identity storage.ManagedIdentity_STATUS
		err := workspace.Identity.AssignProperties_To_ManagedIdentity_STATUS(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedIdentity_STATUS() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

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

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

	// ManagedVirtualNetworkSettings
	if workspace.ManagedVirtualNetworkSettings != nil {
		var managedVirtualNetworkSetting storage.ManagedVirtualNetworkSettings_STATUS
		err := workspace.ManagedVirtualNetworkSettings.AssignProperties_To_ManagedVirtualNetworkSettings_STATUS(&managedVirtualNetworkSetting)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedVirtualNetworkSettings_STATUS() to populate field ManagedVirtualNetworkSettings")
		}
		destination.ManagedVirtualNetworkSettings = &managedVirtualNetworkSetting
	} else {
		destination.ManagedVirtualNetworkSettings = nil
	}

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

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

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

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

	// PurviewConfiguration
	if workspace.PurviewConfiguration != nil {
		var purviewConfiguration storage.PurviewConfiguration_STATUS
		err := workspace.PurviewConfiguration.AssignProperties_To_PurviewConfiguration_STATUS(&purviewConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PurviewConfiguration_STATUS() to populate field PurviewConfiguration")
		}
		destination.PurviewConfiguration = &purviewConfiguration
	} else {
		destination.PurviewConfiguration = nil
	}

	// Settings
	if workspace.Settings != nil {
		settingMap := make(map[string]v1.JSON, len(workspace.Settings))
		for settingKey, settingValue := range workspace.Settings {
			settingMap[settingKey] = *settingValue.DeepCopy()
		}
		destination.Settings = settingMap
	} else {
		destination.Settings = nil
	}

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

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

	// TrustedServiceBypassEnabled
	if workspace.TrustedServiceBypassEnabled != nil {
		trustedServiceBypassEnabled := *workspace.TrustedServiceBypassEnabled
		destination.TrustedServiceBypassEnabled = &trustedServiceBypassEnabled
	} else {
		destination.TrustedServiceBypassEnabled = nil
	}

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

	// VirtualNetworkProfile
	if workspace.VirtualNetworkProfile != nil {
		var virtualNetworkProfile storage.VirtualNetworkProfile_STATUS
		err := workspace.VirtualNetworkProfile.AssignProperties_To_VirtualNetworkProfile_STATUS(&virtualNetworkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkProfile_STATUS() to populate field VirtualNetworkProfile")
		}
		destination.VirtualNetworkProfile = &virtualNetworkProfile
	} else {
		destination.VirtualNetworkProfile = nil
	}

	// WorkspaceRepositoryConfiguration
	if workspace.WorkspaceRepositoryConfiguration != nil {
		var workspaceRepositoryConfiguration storage.WorkspaceRepositoryConfiguration_STATUS
		err := workspace.WorkspaceRepositoryConfiguration.AssignProperties_To_WorkspaceRepositoryConfiguration_STATUS(&workspaceRepositoryConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceRepositoryConfiguration_STATUS() to populate field WorkspaceRepositoryConfiguration")
		}
		destination.WorkspaceRepositoryConfiguration = &workspaceRepositoryConfiguration
	} else {
		destination.WorkspaceRepositoryConfiguration = nil
	}

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

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

	// No error
	return nil
}

// Initial workspace AAD admin properties for a CSP subscription
type CspWorkspaceAdminProperties struct {
	// InitialWorkspaceAdminObjectId: AAD object ID of initial workspace admin
	InitialWorkspaceAdminObjectId *string `json:"initialWorkspaceAdminObjectId,omitempty"`
}

var _ genruntime.ARMTransformer = &CspWorkspaceAdminProperties{}

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

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

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_CspWorkspaceAdminProperties_STATUS populates our CspWorkspaceAdminProperties from the provided source CspWorkspaceAdminProperties_STATUS
func (properties *CspWorkspaceAdminProperties) Initialize_From_CspWorkspaceAdminProperties_STATUS(source *CspWorkspaceAdminProperties_STATUS) error {

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

	// No error
	return nil
}

// Initial workspace AAD admin properties for a CSP subscription
type CspWorkspaceAdminProperties_STATUS struct {
	// InitialWorkspaceAdminObjectId: AAD object ID of initial workspace admin
	InitialWorkspaceAdminObjectId *string `json:"initialWorkspaceAdminObjectId,omitempty"`
}

var _ genruntime.FromARMConverter = &CspWorkspaceAdminProperties_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Details of the data lake storage account associated with the workspace
type DataLakeStorageAccountDetails struct {
	// AccountUrl: Account URL
	AccountUrl *string `json:"accountUrl,omitempty" optionalConfigMapPair:"AccountUrl"`

	// AccountUrlFromConfig: Account URL
	AccountUrlFromConfig *genruntime.ConfigMapReference `json:"accountUrlFromConfig,omitempty" optionalConfigMapPair:"AccountUrl"`

	// CreateManagedPrivateEndpoint: Create managed private endpoint to this storage account or not
	CreateManagedPrivateEndpoint *bool `json:"createManagedPrivateEndpoint,omitempty"`

	// Filesystem: Filesystem name
	Filesystem *string `json:"filesystem,omitempty"`

	// ResourceReference: ARM resource Id of this storage account
	ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`
}

var _ genruntime.ARMTransformer = &DataLakeStorageAccountDetails{}

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

	// Set property "AccountUrl":
	if details.AccountUrl != nil {
		accountUrl := *details.AccountUrl
		result.AccountUrl = &accountUrl
	}
	if details.AccountUrlFromConfig != nil {
		accountUrlValue, err := resolved.ResolvedConfigMaps.Lookup(*details.AccountUrlFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property AccountUrl")
		}
		accountUrl := accountUrlValue
		result.AccountUrl = &accountUrl
	}

	// Set property "CreateManagedPrivateEndpoint":
	if details.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *details.CreateManagedPrivateEndpoint
		result.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	}

	// Set property "Filesystem":
	if details.Filesystem != nil {
		filesystem := *details.Filesystem
		result.Filesystem = &filesystem
	}

	// Set property "ResourceId":
	if details.ResourceReference != nil {
		resourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*details.ResourceReference)
		if err != nil {
			return nil, err
		}
		resourceReference := resourceReferenceARMID
		result.ResourceId = &resourceReference
	}
	return result, nil
}

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

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

	// Set property "AccountUrl":
	if typedInput.AccountUrl != nil {
		accountUrl := *typedInput.AccountUrl
		details.AccountUrl = &accountUrl
	}

	// no assignment for property "AccountUrlFromConfig"

	// Set property "CreateManagedPrivateEndpoint":
	if typedInput.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *typedInput.CreateManagedPrivateEndpoint
		details.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	}

	// Set property "Filesystem":
	if typedInput.Filesystem != nil {
		filesystem := *typedInput.Filesystem
		details.Filesystem = &filesystem
	}

	// no assignment for property "ResourceReference"

	// No error
	return nil
}

// AssignProperties_From_DataLakeStorageAccountDetails populates our DataLakeStorageAccountDetails from the provided source DataLakeStorageAccountDetails
func (details *DataLakeStorageAccountDetails) AssignProperties_From_DataLakeStorageAccountDetails(source *storage.DataLakeStorageAccountDetails) error {

	// AccountUrl
	details.AccountUrl = genruntime.ClonePointerToString(source.AccountUrl)

	// AccountUrlFromConfig
	if source.AccountUrlFromConfig != nil {
		accountUrlFromConfig := source.AccountUrlFromConfig.Copy()
		details.AccountUrlFromConfig = &accountUrlFromConfig
	} else {
		details.AccountUrlFromConfig = nil
	}

	// CreateManagedPrivateEndpoint
	if source.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *source.CreateManagedPrivateEndpoint
		details.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	} else {
		details.CreateManagedPrivateEndpoint = nil
	}

	// Filesystem
	details.Filesystem = genruntime.ClonePointerToString(source.Filesystem)

	// ResourceReference
	if source.ResourceReference != nil {
		resourceReference := source.ResourceReference.Copy()
		details.ResourceReference = &resourceReference
	} else {
		details.ResourceReference = nil
	}

	// No error
	return nil
}

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

	// AccountUrl
	destination.AccountUrl = genruntime.ClonePointerToString(details.AccountUrl)

	// AccountUrlFromConfig
	if details.AccountUrlFromConfig != nil {
		accountUrlFromConfig := details.AccountUrlFromConfig.Copy()
		destination.AccountUrlFromConfig = &accountUrlFromConfig
	} else {
		destination.AccountUrlFromConfig = nil
	}

	// CreateManagedPrivateEndpoint
	if details.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *details.CreateManagedPrivateEndpoint
		destination.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	} else {
		destination.CreateManagedPrivateEndpoint = nil
	}

	// Filesystem
	destination.Filesystem = genruntime.ClonePointerToString(details.Filesystem)

	// ResourceReference
	if details.ResourceReference != nil {
		resourceReference := details.ResourceReference.Copy()
		destination.ResourceReference = &resourceReference
	} else {
		destination.ResourceReference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_DataLakeStorageAccountDetails_STATUS populates our DataLakeStorageAccountDetails from the provided source DataLakeStorageAccountDetails_STATUS
func (details *DataLakeStorageAccountDetails) Initialize_From_DataLakeStorageAccountDetails_STATUS(source *DataLakeStorageAccountDetails_STATUS) error {

	// AccountUrl
	details.AccountUrl = genruntime.ClonePointerToString(source.AccountUrl)

	// CreateManagedPrivateEndpoint
	if source.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *source.CreateManagedPrivateEndpoint
		details.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	} else {
		details.CreateManagedPrivateEndpoint = nil
	}

	// Filesystem
	details.Filesystem = genruntime.ClonePointerToString(source.Filesystem)

	// ResourceReference
	if source.ResourceId != nil {
		resourceReference := genruntime.CreateResourceReferenceFromARMID(*source.ResourceId)
		details.ResourceReference = &resourceReference
	} else {
		details.ResourceReference = nil
	}

	// No error
	return nil
}

// Details of the data lake storage account associated with the workspace
type DataLakeStorageAccountDetails_STATUS struct {
	// AccountUrl: Account URL
	AccountUrl *string `json:"accountUrl,omitempty"`

	// CreateManagedPrivateEndpoint: Create managed private endpoint to this storage account or not
	CreateManagedPrivateEndpoint *bool `json:"createManagedPrivateEndpoint,omitempty"`

	// Filesystem: Filesystem name
	Filesystem *string `json:"filesystem,omitempty"`

	// ResourceId: ARM resource Id of this storage account
	ResourceId *string `json:"resourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &DataLakeStorageAccountDetails_STATUS{}

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

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

	// Set property "AccountUrl":
	if typedInput.AccountUrl != nil {
		accountUrl := *typedInput.AccountUrl
		details.AccountUrl = &accountUrl
	}

	// Set property "CreateManagedPrivateEndpoint":
	if typedInput.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *typedInput.CreateManagedPrivateEndpoint
		details.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	}

	// Set property "Filesystem":
	if typedInput.Filesystem != nil {
		filesystem := *typedInput.Filesystem
		details.Filesystem = &filesystem
	}

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

	// No error
	return nil
}

// AssignProperties_From_DataLakeStorageAccountDetails_STATUS populates our DataLakeStorageAccountDetails_STATUS from the provided source DataLakeStorageAccountDetails_STATUS
func (details *DataLakeStorageAccountDetails_STATUS) AssignProperties_From_DataLakeStorageAccountDetails_STATUS(source *storage.DataLakeStorageAccountDetails_STATUS) error {

	// AccountUrl
	details.AccountUrl = genruntime.ClonePointerToString(source.AccountUrl)

	// CreateManagedPrivateEndpoint
	if source.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *source.CreateManagedPrivateEndpoint
		details.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	} else {
		details.CreateManagedPrivateEndpoint = nil
	}

	// Filesystem
	details.Filesystem = genruntime.ClonePointerToString(source.Filesystem)

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

	// No error
	return nil
}

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

	// AccountUrl
	destination.AccountUrl = genruntime.ClonePointerToString(details.AccountUrl)

	// CreateManagedPrivateEndpoint
	if details.CreateManagedPrivateEndpoint != nil {
		createManagedPrivateEndpoint := *details.CreateManagedPrivateEndpoint
		destination.CreateManagedPrivateEndpoint = &createManagedPrivateEndpoint
	} else {
		destination.CreateManagedPrivateEndpoint = nil
	}

	// Filesystem
	destination.Filesystem = genruntime.ClonePointerToString(details.Filesystem)

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

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

	// No error
	return nil
}

// Details of the encryption associated with the workspace
type EncryptionDetails struct {
	// Cmk: Customer Managed Key Details
	Cmk *CustomerManagedKeyDetails `json:"cmk,omitempty"`
}

var _ genruntime.ARMTransformer = &EncryptionDetails{}

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

	// Set property "Cmk":
	if details.Cmk != nil {
		cmk_ARM, err := details.Cmk.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		cmk := *cmk_ARM.(*arm.CustomerManagedKeyDetails)
		result.Cmk = &cmk
	}
	return result, nil
}

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

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

	// Set property "Cmk":
	if typedInput.Cmk != nil {
		var cmk1 CustomerManagedKeyDetails
		err := cmk1.PopulateFromARM(owner, *typedInput.Cmk)
		if err != nil {
			return err
		}
		cmk := cmk1
		details.Cmk = &cmk
	}

	// No error
	return nil
}

// AssignProperties_From_EncryptionDetails populates our EncryptionDetails from the provided source EncryptionDetails
func (details *EncryptionDetails) AssignProperties_From_EncryptionDetails(source *storage.EncryptionDetails) error {

	// Cmk
	if source.Cmk != nil {
		var cmk CustomerManagedKeyDetails
		err := cmk.AssignProperties_From_CustomerManagedKeyDetails(source.Cmk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CustomerManagedKeyDetails() to populate field Cmk")
		}
		details.Cmk = &cmk
	} else {
		details.Cmk = nil
	}

	// No error
	return nil
}

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

	// Cmk
	if details.Cmk != nil {
		var cmk storage.CustomerManagedKeyDetails
		err := details.Cmk.AssignProperties_To_CustomerManagedKeyDetails(&cmk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CustomerManagedKeyDetails() to populate field Cmk")
		}
		destination.Cmk = &cmk
	} else {
		destination.Cmk = nil
	}

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

	// No error
	return nil
}

// Initialize_From_EncryptionDetails_STATUS populates our EncryptionDetails from the provided source EncryptionDetails_STATUS
func (details *EncryptionDetails) Initialize_From_EncryptionDetails_STATUS(source *EncryptionDetails_STATUS) error {

	// Cmk
	if source.Cmk != nil {
		var cmk CustomerManagedKeyDetails
		err := cmk.Initialize_From_CustomerManagedKeyDetails_STATUS(source.Cmk)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_CustomerManagedKeyDetails_STATUS() to populate field Cmk")
		}
		details.Cmk = &cmk
	} else {
		details.Cmk = nil
	}

	// No error
	return nil
}

// Details of the encryption associated with the workspace
type EncryptionDetails_STATUS struct {
	// Cmk: Customer Managed Key Details
	Cmk *CustomerManagedKeyDetails_STATUS `json:"cmk,omitempty"`

	// DoubleEncryptionEnabled: Double Encryption enabled
	DoubleEncryptionEnabled *bool `json:"doubleEncryptionEnabled,omitempty"`
}

var _ genruntime.FromARMConverter = &EncryptionDetails_STATUS{}

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

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

	// Set property "Cmk":
	if typedInput.Cmk != nil {
		var cmk1 CustomerManagedKeyDetails_STATUS
		err := cmk1.PopulateFromARM(owner, *typedInput.Cmk)
		if err != nil {
			return err
		}
		cmk := cmk1
		details.Cmk = &cmk
	}

	// Set property "DoubleEncryptionEnabled":
	if typedInput.DoubleEncryptionEnabled != nil {
		doubleEncryptionEnabled := *typedInput.DoubleEncryptionEnabled
		details.DoubleEncryptionEnabled = &doubleEncryptionEnabled
	}

	// No error
	return nil
}

// AssignProperties_From_EncryptionDetails_STATUS populates our EncryptionDetails_STATUS from the provided source EncryptionDetails_STATUS
func (details *EncryptionDetails_STATUS) AssignProperties_From_EncryptionDetails_STATUS(source *storage.EncryptionDetails_STATUS) error {

	// Cmk
	if source.Cmk != nil {
		var cmk CustomerManagedKeyDetails_STATUS
		err := cmk.AssignProperties_From_CustomerManagedKeyDetails_STATUS(source.Cmk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CustomerManagedKeyDetails_STATUS() to populate field Cmk")
		}
		details.Cmk = &cmk
	} else {
		details.Cmk = nil
	}

	// DoubleEncryptionEnabled
	if source.DoubleEncryptionEnabled != nil {
		doubleEncryptionEnabled := *source.DoubleEncryptionEnabled
		details.DoubleEncryptionEnabled = &doubleEncryptionEnabled
	} else {
		details.DoubleEncryptionEnabled = nil
	}

	// No error
	return nil
}

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

	// Cmk
	if details.Cmk != nil {
		var cmk storage.CustomerManagedKeyDetails_STATUS
		err := details.Cmk.AssignProperties_To_CustomerManagedKeyDetails_STATUS(&cmk)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CustomerManagedKeyDetails_STATUS() to populate field Cmk")
		}
		destination.Cmk = &cmk
	} else {
		destination.Cmk = nil
	}

	// DoubleEncryptionEnabled
	if details.DoubleEncryptionEnabled != nil {
		doubleEncryptionEnabled := *details.DoubleEncryptionEnabled
		destination.DoubleEncryptionEnabled = &doubleEncryptionEnabled
	} else {
		destination.DoubleEncryptionEnabled = nil
	}

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

	// No error
	return nil
}

// The workspace managed identity
type ManagedIdentity struct {
	// Type: The type of managed identity for the workspace
	Type *ManagedIdentity_Type `json:"type,omitempty"`

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

var _ genruntime.ARMTransformer = &ManagedIdentity{}

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

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

	// Set property "UserAssignedIdentities":
	result.UserAssignedIdentities = make(map[string]arm.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities))
	for _, ident := range identity.UserAssignedIdentities {
		identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference)
		if err != nil {
			return nil, err
		}
		key := identARMID
		result.UserAssignedIdentities[key] = arm.UserAssignedIdentityDetails{}
	}
	return result, nil
}

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

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Initialize_From_ManagedIdentity_STATUS populates our ManagedIdentity from the provided source ManagedIdentity_STATUS
func (identity *ManagedIdentity) Initialize_From_ManagedIdentity_STATUS(source *ManagedIdentity_STATUS) error {

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

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

	// No error
	return nil
}

// The workspace managed identity
type ManagedIdentity_STATUS struct {
	// PrincipalId: The principal ID of the workspace managed identity
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: The tenant ID of the workspace managed identity
	TenantId *string `json:"tenantId,omitempty"`

	// Type: The type of managed identity for the workspace
	Type *ManagedIdentity_Type_STATUS `json:"type,omitempty"`

	// UserAssignedIdentities: The user assigned managed identities.
	UserAssignedIdentities map[string]UserAssignedManagedIdentity_STATUS `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagedIdentity_STATUS{}

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

	// No error
	return nil
}

// Managed Virtual Network Settings
type ManagedVirtualNetworkSettings struct {
	// AllowedAadTenantIdsForLinking: Allowed Aad Tenant Ids For Linking
	AllowedAadTenantIdsForLinking []string `json:"allowedAadTenantIdsForLinking,omitempty"`

	// LinkedAccessCheckOnTargetResource: Linked Access Check On Target Resource
	LinkedAccessCheckOnTargetResource *bool `json:"linkedAccessCheckOnTargetResource,omitempty"`

	// PreventDataExfiltration: Prevent Data Exfiltration
	PreventDataExfiltration *bool `json:"preventDataExfiltration,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagedVirtualNetworkSettings{}

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

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

	// Set property "LinkedAccessCheckOnTargetResource":
	if settings.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *settings.LinkedAccessCheckOnTargetResource
		result.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	}

	// Set property "PreventDataExfiltration":
	if settings.PreventDataExfiltration != nil {
		preventDataExfiltration := *settings.PreventDataExfiltration
		result.PreventDataExfiltration = &preventDataExfiltration
	}
	return result, nil
}

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

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

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

	// Set property "LinkedAccessCheckOnTargetResource":
	if typedInput.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *typedInput.LinkedAccessCheckOnTargetResource
		settings.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	}

	// Set property "PreventDataExfiltration":
	if typedInput.PreventDataExfiltration != nil {
		preventDataExfiltration := *typedInput.PreventDataExfiltration
		settings.PreventDataExfiltration = &preventDataExfiltration
	}

	// No error
	return nil
}

// AssignProperties_From_ManagedVirtualNetworkSettings populates our ManagedVirtualNetworkSettings from the provided source ManagedVirtualNetworkSettings
func (settings *ManagedVirtualNetworkSettings) AssignProperties_From_ManagedVirtualNetworkSettings(source *storage.ManagedVirtualNetworkSettings) error {

	// AllowedAadTenantIdsForLinking
	settings.AllowedAadTenantIdsForLinking = genruntime.CloneSliceOfString(source.AllowedAadTenantIdsForLinking)

	// LinkedAccessCheckOnTargetResource
	if source.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *source.LinkedAccessCheckOnTargetResource
		settings.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	} else {
		settings.LinkedAccessCheckOnTargetResource = nil
	}

	// PreventDataExfiltration
	if source.PreventDataExfiltration != nil {
		preventDataExfiltration := *source.PreventDataExfiltration
		settings.PreventDataExfiltration = &preventDataExfiltration
	} else {
		settings.PreventDataExfiltration = nil
	}

	// No error
	return nil
}

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

	// AllowedAadTenantIdsForLinking
	destination.AllowedAadTenantIdsForLinking = genruntime.CloneSliceOfString(settings.AllowedAadTenantIdsForLinking)

	// LinkedAccessCheckOnTargetResource
	if settings.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *settings.LinkedAccessCheckOnTargetResource
		destination.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	} else {
		destination.LinkedAccessCheckOnTargetResource = nil
	}

	// PreventDataExfiltration
	if settings.PreventDataExfiltration != nil {
		preventDataExfiltration := *settings.PreventDataExfiltration
		destination.PreventDataExfiltration = &preventDataExfiltration
	} else {
		destination.PreventDataExfiltration = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ManagedVirtualNetworkSettings_STATUS populates our ManagedVirtualNetworkSettings from the provided source ManagedVirtualNetworkSettings_STATUS
func (settings *ManagedVirtualNetworkSettings) Initialize_From_ManagedVirtualNetworkSettings_STATUS(source *ManagedVirtualNetworkSettings_STATUS) error {

	// AllowedAadTenantIdsForLinking
	settings.AllowedAadTenantIdsForLinking = genruntime.CloneSliceOfString(source.AllowedAadTenantIdsForLinking)

	// LinkedAccessCheckOnTargetResource
	if source.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *source.LinkedAccessCheckOnTargetResource
		settings.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	} else {
		settings.LinkedAccessCheckOnTargetResource = nil
	}

	// PreventDataExfiltration
	if source.PreventDataExfiltration != nil {
		preventDataExfiltration := *source.PreventDataExfiltration
		settings.PreventDataExfiltration = &preventDataExfiltration
	} else {
		settings.PreventDataExfiltration = nil
	}

	// No error
	return nil
}

// Managed Virtual Network Settings
type ManagedVirtualNetworkSettings_STATUS struct {
	// AllowedAadTenantIdsForLinking: Allowed Aad Tenant Ids For Linking
	AllowedAadTenantIdsForLinking []string `json:"allowedAadTenantIdsForLinking,omitempty"`

	// LinkedAccessCheckOnTargetResource: Linked Access Check On Target Resource
	LinkedAccessCheckOnTargetResource *bool `json:"linkedAccessCheckOnTargetResource,omitempty"`

	// PreventDataExfiltration: Prevent Data Exfiltration
	PreventDataExfiltration *bool `json:"preventDataExfiltration,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagedVirtualNetworkSettings_STATUS{}

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

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

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

	// Set property "LinkedAccessCheckOnTargetResource":
	if typedInput.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *typedInput.LinkedAccessCheckOnTargetResource
		settings.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	}

	// Set property "PreventDataExfiltration":
	if typedInput.PreventDataExfiltration != nil {
		preventDataExfiltration := *typedInput.PreventDataExfiltration
		settings.PreventDataExfiltration = &preventDataExfiltration
	}

	// No error
	return nil
}

// AssignProperties_From_ManagedVirtualNetworkSettings_STATUS populates our ManagedVirtualNetworkSettings_STATUS from the provided source ManagedVirtualNetworkSettings_STATUS
func (settings *ManagedVirtualNetworkSettings_STATUS) AssignProperties_From_ManagedVirtualNetworkSettings_STATUS(source *storage.ManagedVirtualNetworkSettings_STATUS) error {

	// AllowedAadTenantIdsForLinking
	settings.AllowedAadTenantIdsForLinking = genruntime.CloneSliceOfString(source.AllowedAadTenantIdsForLinking)

	// LinkedAccessCheckOnTargetResource
	if source.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *source.LinkedAccessCheckOnTargetResource
		settings.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	} else {
		settings.LinkedAccessCheckOnTargetResource = nil
	}

	// PreventDataExfiltration
	if source.PreventDataExfiltration != nil {
		preventDataExfiltration := *source.PreventDataExfiltration
		settings.PreventDataExfiltration = &preventDataExfiltration
	} else {
		settings.PreventDataExfiltration = nil
	}

	// No error
	return nil
}

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

	// AllowedAadTenantIdsForLinking
	destination.AllowedAadTenantIdsForLinking = genruntime.CloneSliceOfString(settings.AllowedAadTenantIdsForLinking)

	// LinkedAccessCheckOnTargetResource
	if settings.LinkedAccessCheckOnTargetResource != nil {
		linkedAccessCheckOnTargetResource := *settings.LinkedAccessCheckOnTargetResource
		destination.LinkedAccessCheckOnTargetResource = &linkedAccessCheckOnTargetResource
	} else {
		destination.LinkedAccessCheckOnTargetResource = nil
	}

	// PreventDataExfiltration
	if settings.PreventDataExfiltration != nil {
		preventDataExfiltration := *settings.PreventDataExfiltration
		destination.PreventDataExfiltration = &preventDataExfiltration
	} else {
		destination.PreventDataExfiltration = nil
	}

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

	// No error
	return nil
}

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

var _ genruntime.FromARMConverter = &PrivateEndpointConnection_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_PrivateEndpointConnection_STATUS populates our PrivateEndpointConnection_STATUS from the provided source PrivateEndpointConnection_STATUS
func (connection *PrivateEndpointConnection_STATUS) AssignProperties_From_PrivateEndpointConnection_STATUS(source *storage.PrivateEndpointConnection_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Purview Configuration
type PurviewConfiguration struct {
	// PurviewResourceReference: Purview Resource ID
	PurviewResourceReference *genruntime.ResourceReference `armReference:"PurviewResourceId" json:"purviewResourceReference,omitempty"`
}

var _ genruntime.ARMTransformer = &PurviewConfiguration{}

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

	// Set property "PurviewResourceId":
	if configuration.PurviewResourceReference != nil {
		purviewResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*configuration.PurviewResourceReference)
		if err != nil {
			return nil, err
		}
		purviewResourceReference := purviewResourceReferenceARMID
		result.PurviewResourceId = &purviewResourceReference
	}
	return result, nil
}

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

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

	// no assignment for property "PurviewResourceReference"

	// No error
	return nil
}

// AssignProperties_From_PurviewConfiguration populates our PurviewConfiguration from the provided source PurviewConfiguration
func (configuration *PurviewConfiguration) AssignProperties_From_PurviewConfiguration(source *storage.PurviewConfiguration) error {

	// PurviewResourceReference
	if source.PurviewResourceReference != nil {
		purviewResourceReference := source.PurviewResourceReference.Copy()
		configuration.PurviewResourceReference = &purviewResourceReference
	} else {
		configuration.PurviewResourceReference = nil
	}

	// No error
	return nil
}

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

	// PurviewResourceReference
	if configuration.PurviewResourceReference != nil {
		purviewResourceReference := configuration.PurviewResourceReference.Copy()
		destination.PurviewResourceReference = &purviewResourceReference
	} else {
		destination.PurviewResourceReference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_PurviewConfiguration_STATUS populates our PurviewConfiguration from the provided source PurviewConfiguration_STATUS
func (configuration *PurviewConfiguration) Initialize_From_PurviewConfiguration_STATUS(source *PurviewConfiguration_STATUS) error {

	// PurviewResourceReference
	if source.PurviewResourceId != nil {
		purviewResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.PurviewResourceId)
		configuration.PurviewResourceReference = &purviewResourceReference
	} else {
		configuration.PurviewResourceReference = nil
	}

	// No error
	return nil
}

// Purview Configuration
type PurviewConfiguration_STATUS struct {
	// PurviewResourceId: Purview Resource ID
	PurviewResourceId *string `json:"purviewResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &PurviewConfiguration_STATUS{}

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

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

	// Set property "PurviewResourceId":
	if typedInput.PurviewResourceId != nil {
		purviewResourceId := *typedInput.PurviewResourceId
		configuration.PurviewResourceId = &purviewResourceId
	}

	// No error
	return nil
}

// AssignProperties_From_PurviewConfiguration_STATUS populates our PurviewConfiguration_STATUS from the provided source PurviewConfiguration_STATUS
func (configuration *PurviewConfiguration_STATUS) AssignProperties_From_PurviewConfiguration_STATUS(source *storage.PurviewConfiguration_STATUS) error {

	// PurviewResourceId
	configuration.PurviewResourceId = genruntime.ClonePointerToString(source.PurviewResourceId)

	// No error
	return nil
}

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

	// PurviewResourceId
	destination.PurviewResourceId = genruntime.ClonePointerToString(configuration.PurviewResourceId)

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

	// No error
	return nil
}

// Virtual Network Profile
type VirtualNetworkProfile struct {
	// ComputeSubnetId: Subnet ID used for computes in workspace
	ComputeSubnetId *string `json:"computeSubnetId,omitempty"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkProfile{}

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

	// Set property "ComputeSubnetId":
	if profile.ComputeSubnetId != nil {
		computeSubnetId := *profile.ComputeSubnetId
		result.ComputeSubnetId = &computeSubnetId
	}
	return result, nil
}

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

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

	// Set property "ComputeSubnetId":
	if typedInput.ComputeSubnetId != nil {
		computeSubnetId := *typedInput.ComputeSubnetId
		profile.ComputeSubnetId = &computeSubnetId
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkProfile populates our VirtualNetworkProfile from the provided source VirtualNetworkProfile
func (profile *VirtualNetworkProfile) AssignProperties_From_VirtualNetworkProfile(source *storage.VirtualNetworkProfile) error {

	// ComputeSubnetId
	profile.ComputeSubnetId = genruntime.ClonePointerToString(source.ComputeSubnetId)

	// No error
	return nil
}

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

	// ComputeSubnetId
	destination.ComputeSubnetId = genruntime.ClonePointerToString(profile.ComputeSubnetId)

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

	// No error
	return nil
}

// Initialize_From_VirtualNetworkProfile_STATUS populates our VirtualNetworkProfile from the provided source VirtualNetworkProfile_STATUS
func (profile *VirtualNetworkProfile) Initialize_From_VirtualNetworkProfile_STATUS(source *VirtualNetworkProfile_STATUS) error {

	// ComputeSubnetId
	profile.ComputeSubnetId = genruntime.ClonePointerToString(source.ComputeSubnetId)

	// No error
	return nil
}

// Virtual Network Profile
type VirtualNetworkProfile_STATUS struct {
	// ComputeSubnetId: Subnet ID used for computes in workspace
	ComputeSubnetId *string `json:"computeSubnetId,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkProfile_STATUS{}

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

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

	// Set property "ComputeSubnetId":
	if typedInput.ComputeSubnetId != nil {
		computeSubnetId := *typedInput.ComputeSubnetId
		profile.ComputeSubnetId = &computeSubnetId
	}

	// No error
	return nil
}

// AssignProperties_From_VirtualNetworkProfile_STATUS populates our VirtualNetworkProfile_STATUS from the provided source VirtualNetworkProfile_STATUS
func (profile *VirtualNetworkProfile_STATUS) AssignProperties_From_VirtualNetworkProfile_STATUS(source *storage.VirtualNetworkProfile_STATUS) error {

	// ComputeSubnetId
	profile.ComputeSubnetId = genruntime.ClonePointerToString(source.ComputeSubnetId)

	// No error
	return nil
}

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

	// ComputeSubnetId
	destination.ComputeSubnetId = genruntime.ClonePointerToString(profile.ComputeSubnetId)

	// 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={"Disabled","Enabled"}
type WorkspaceProperties_PublicNetworkAccess string

const (
	WorkspaceProperties_PublicNetworkAccess_Disabled = WorkspaceProperties_PublicNetworkAccess("Disabled")
	WorkspaceProperties_PublicNetworkAccess_Enabled  = WorkspaceProperties_PublicNetworkAccess("Enabled")
)

// Mapping from string to WorkspaceProperties_PublicNetworkAccess
var workspaceProperties_PublicNetworkAccess_Values = map[string]WorkspaceProperties_PublicNetworkAccess{
	"disabled": WorkspaceProperties_PublicNetworkAccess_Disabled,
	"enabled":  WorkspaceProperties_PublicNetworkAccess_Enabled,
}

type WorkspaceProperties_PublicNetworkAccess_STATUS string

const (
	WorkspaceProperties_PublicNetworkAccess_STATUS_Disabled = WorkspaceProperties_PublicNetworkAccess_STATUS("Disabled")
	WorkspaceProperties_PublicNetworkAccess_STATUS_Enabled  = WorkspaceProperties_PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to WorkspaceProperties_PublicNetworkAccess_STATUS
var workspaceProperties_PublicNetworkAccess_STATUS_Values = map[string]WorkspaceProperties_PublicNetworkAccess_STATUS{
	"disabled": WorkspaceProperties_PublicNetworkAccess_STATUS_Disabled,
	"enabled":  WorkspaceProperties_PublicNetworkAccess_STATUS_Enabled,
}

// Git integration settings
type WorkspaceRepositoryConfiguration struct {
	// AccountName: Account name
	AccountName *string `json:"accountName,omitempty"`

	// CollaborationBranch: Collaboration branch
	CollaborationBranch *string `json:"collaborationBranch,omitempty"`

	// HostName: GitHub Enterprise host name. For example: `https://github.mydomain.com`
	HostName *string `json:"hostName,omitempty"`

	// LastCommitId: The last commit ID
	LastCommitId *string `json:"lastCommitId,omitempty"`

	// ProjectName: VSTS project name
	ProjectName *string `json:"projectName,omitempty"`

	// RepositoryName: Repository name
	RepositoryName *string `json:"repositoryName,omitempty"`

	// RootFolder: Root folder to use in the repository
	RootFolder *string `json:"rootFolder,omitempty"`

	// +kubebuilder:validation:Pattern="^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"
	// TenantId: The VSTS tenant ID
	TenantId *string `json:"tenantId,omitempty"`

	// Type: Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration
	Type *string `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &WorkspaceRepositoryConfiguration{}

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

	// Set property "AccountName":
	if configuration.AccountName != nil {
		accountName := *configuration.AccountName
		result.AccountName = &accountName
	}

	// Set property "CollaborationBranch":
	if configuration.CollaborationBranch != nil {
		collaborationBranch := *configuration.CollaborationBranch
		result.CollaborationBranch = &collaborationBranch
	}

	// Set property "HostName":
	if configuration.HostName != nil {
		hostName := *configuration.HostName
		result.HostName = &hostName
	}

	// Set property "LastCommitId":
	if configuration.LastCommitId != nil {
		lastCommitId := *configuration.LastCommitId
		result.LastCommitId = &lastCommitId
	}

	// Set property "ProjectName":
	if configuration.ProjectName != nil {
		projectName := *configuration.ProjectName
		result.ProjectName = &projectName
	}

	// Set property "RepositoryName":
	if configuration.RepositoryName != nil {
		repositoryName := *configuration.RepositoryName
		result.RepositoryName = &repositoryName
	}

	// Set property "RootFolder":
	if configuration.RootFolder != nil {
		rootFolder := *configuration.RootFolder
		result.RootFolder = &rootFolder
	}

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

	// Set property "Type":
	if configuration.Type != nil {
		typeVar := *configuration.Type
		result.Type = &typeVar
	}
	return result, nil
}

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

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

	// Set property "AccountName":
	if typedInput.AccountName != nil {
		accountName := *typedInput.AccountName
		configuration.AccountName = &accountName
	}

	// Set property "CollaborationBranch":
	if typedInput.CollaborationBranch != nil {
		collaborationBranch := *typedInput.CollaborationBranch
		configuration.CollaborationBranch = &collaborationBranch
	}

	// Set property "HostName":
	if typedInput.HostName != nil {
		hostName := *typedInput.HostName
		configuration.HostName = &hostName
	}

	// Set property "LastCommitId":
	if typedInput.LastCommitId != nil {
		lastCommitId := *typedInput.LastCommitId
		configuration.LastCommitId = &lastCommitId
	}

	// Set property "ProjectName":
	if typedInput.ProjectName != nil {
		projectName := *typedInput.ProjectName
		configuration.ProjectName = &projectName
	}

	// Set property "RepositoryName":
	if typedInput.RepositoryName != nil {
		repositoryName := *typedInput.RepositoryName
		configuration.RepositoryName = &repositoryName
	}

	// Set property "RootFolder":
	if typedInput.RootFolder != nil {
		rootFolder := *typedInput.RootFolder
		configuration.RootFolder = &rootFolder
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_WorkspaceRepositoryConfiguration populates our WorkspaceRepositoryConfiguration from the provided source WorkspaceRepositoryConfiguration
func (configuration *WorkspaceRepositoryConfiguration) AssignProperties_From_WorkspaceRepositoryConfiguration(source *storage.WorkspaceRepositoryConfiguration) error {

	// AccountName
	configuration.AccountName = genruntime.ClonePointerToString(source.AccountName)

	// CollaborationBranch
	configuration.CollaborationBranch = genruntime.ClonePointerToString(source.CollaborationBranch)

	// HostName
	configuration.HostName = genruntime.ClonePointerToString(source.HostName)

	// LastCommitId
	configuration.LastCommitId = genruntime.ClonePointerToString(source.LastCommitId)

	// ProjectName
	configuration.ProjectName = genruntime.ClonePointerToString(source.ProjectName)

	// RepositoryName
	configuration.RepositoryName = genruntime.ClonePointerToString(source.RepositoryName)

	// RootFolder
	configuration.RootFolder = genruntime.ClonePointerToString(source.RootFolder)

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

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

	// No error
	return nil
}

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

	// AccountName
	destination.AccountName = genruntime.ClonePointerToString(configuration.AccountName)

	// CollaborationBranch
	destination.CollaborationBranch = genruntime.ClonePointerToString(configuration.CollaborationBranch)

	// HostName
	destination.HostName = genruntime.ClonePointerToString(configuration.HostName)

	// LastCommitId
	destination.LastCommitId = genruntime.ClonePointerToString(configuration.LastCommitId)

	// ProjectName
	destination.ProjectName = genruntime.ClonePointerToString(configuration.ProjectName)

	// RepositoryName
	destination.RepositoryName = genruntime.ClonePointerToString(configuration.RepositoryName)

	// RootFolder
	destination.RootFolder = genruntime.ClonePointerToString(configuration.RootFolder)

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

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

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

	// No error
	return nil
}

// Initialize_From_WorkspaceRepositoryConfiguration_STATUS populates our WorkspaceRepositoryConfiguration from the provided source WorkspaceRepositoryConfiguration_STATUS
func (configuration *WorkspaceRepositoryConfiguration) Initialize_From_WorkspaceRepositoryConfiguration_STATUS(source *WorkspaceRepositoryConfiguration_STATUS) error {

	// AccountName
	configuration.AccountName = genruntime.ClonePointerToString(source.AccountName)

	// CollaborationBranch
	configuration.CollaborationBranch = genruntime.ClonePointerToString(source.CollaborationBranch)

	// HostName
	configuration.HostName = genruntime.ClonePointerToString(source.HostName)

	// LastCommitId
	configuration.LastCommitId = genruntime.ClonePointerToString(source.LastCommitId)

	// ProjectName
	configuration.ProjectName = genruntime.ClonePointerToString(source.ProjectName)

	// RepositoryName
	configuration.RepositoryName = genruntime.ClonePointerToString(source.RepositoryName)

	// RootFolder
	configuration.RootFolder = genruntime.ClonePointerToString(source.RootFolder)

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

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

	// No error
	return nil
}

// Git integration settings
type WorkspaceRepositoryConfiguration_STATUS struct {
	// AccountName: Account name
	AccountName *string `json:"accountName,omitempty"`

	// CollaborationBranch: Collaboration branch
	CollaborationBranch *string `json:"collaborationBranch,omitempty"`

	// HostName: GitHub Enterprise host name. For example: `https://github.mydomain.com`
	HostName *string `json:"hostName,omitempty"`

	// LastCommitId: The last commit ID
	LastCommitId *string `json:"lastCommitId,omitempty"`

	// ProjectName: VSTS project name
	ProjectName *string `json:"projectName,omitempty"`

	// RepositoryName: Repository name
	RepositoryName *string `json:"repositoryName,omitempty"`

	// RootFolder: Root folder to use in the repository
	RootFolder *string `json:"rootFolder,omitempty"`

	// TenantId: The VSTS tenant ID
	TenantId *string `json:"tenantId,omitempty"`

	// Type: Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration
	Type *string `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &WorkspaceRepositoryConfiguration_STATUS{}

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

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

	// Set property "AccountName":
	if typedInput.AccountName != nil {
		accountName := *typedInput.AccountName
		configuration.AccountName = &accountName
	}

	// Set property "CollaborationBranch":
	if typedInput.CollaborationBranch != nil {
		collaborationBranch := *typedInput.CollaborationBranch
		configuration.CollaborationBranch = &collaborationBranch
	}

	// Set property "HostName":
	if typedInput.HostName != nil {
		hostName := *typedInput.HostName
		configuration.HostName = &hostName
	}

	// Set property "LastCommitId":
	if typedInput.LastCommitId != nil {
		lastCommitId := *typedInput.LastCommitId
		configuration.LastCommitId = &lastCommitId
	}

	// Set property "ProjectName":
	if typedInput.ProjectName != nil {
		projectName := *typedInput.ProjectName
		configuration.ProjectName = &projectName
	}

	// Set property "RepositoryName":
	if typedInput.RepositoryName != nil {
		repositoryName := *typedInput.RepositoryName
		configuration.RepositoryName = &repositoryName
	}

	// Set property "RootFolder":
	if typedInput.RootFolder != nil {
		rootFolder := *typedInput.RootFolder
		configuration.RootFolder = &rootFolder
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_WorkspaceRepositoryConfiguration_STATUS populates our WorkspaceRepositoryConfiguration_STATUS from the provided source WorkspaceRepositoryConfiguration_STATUS
func (configuration *WorkspaceRepositoryConfiguration_STATUS) AssignProperties_From_WorkspaceRepositoryConfiguration_STATUS(source *storage.WorkspaceRepositoryConfiguration_STATUS) error {

	// AccountName
	configuration.AccountName = genruntime.ClonePointerToString(source.AccountName)

	// CollaborationBranch
	configuration.CollaborationBranch = genruntime.ClonePointerToString(source.CollaborationBranch)

	// HostName
	configuration.HostName = genruntime.ClonePointerToString(source.HostName)

	// LastCommitId
	configuration.LastCommitId = genruntime.ClonePointerToString(source.LastCommitId)

	// ProjectName
	configuration.ProjectName = genruntime.ClonePointerToString(source.ProjectName)

	// RepositoryName
	configuration.RepositoryName = genruntime.ClonePointerToString(source.RepositoryName)

	// RootFolder
	configuration.RootFolder = genruntime.ClonePointerToString(source.RootFolder)

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

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

	// No error
	return nil
}

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

	// AccountName
	destination.AccountName = genruntime.ClonePointerToString(configuration.AccountName)

	// CollaborationBranch
	destination.CollaborationBranch = genruntime.ClonePointerToString(configuration.CollaborationBranch)

	// HostName
	destination.HostName = genruntime.ClonePointerToString(configuration.HostName)

	// LastCommitId
	destination.LastCommitId = genruntime.ClonePointerToString(configuration.LastCommitId)

	// ProjectName
	destination.ProjectName = genruntime.ClonePointerToString(configuration.ProjectName)

	// RepositoryName
	destination.RepositoryName = genruntime.ClonePointerToString(configuration.RepositoryName)

	// RootFolder
	destination.RootFolder = genruntime.ClonePointerToString(configuration.RootFolder)

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

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

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

	// No error
	return nil
}

// Details of the customer managed key associated with the workspace
type CustomerManagedKeyDetails struct {
	// KekIdentity: Key encryption key
	KekIdentity *KekIdentityProperties `json:"kekIdentity,omitempty"`

	// Key: The key object of the workspace
	Key *WorkspaceKeyDetails `json:"key,omitempty"`
}

var _ genruntime.ARMTransformer = &CustomerManagedKeyDetails{}

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

	// Set property "KekIdentity":
	if details.KekIdentity != nil {
		kekIdentity_ARM, err := details.KekIdentity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		kekIdentity := *kekIdentity_ARM.(*arm.KekIdentityProperties)
		result.KekIdentity = &kekIdentity
	}

	// Set property "Key":
	if details.Key != nil {
		key_ARM, err := details.Key.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		key := *key_ARM.(*arm.WorkspaceKeyDetails)
		result.Key = &key
	}
	return result, nil
}

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

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

	// Set property "KekIdentity":
	if typedInput.KekIdentity != nil {
		var kekIdentity1 KekIdentityProperties
		err := kekIdentity1.PopulateFromARM(owner, *typedInput.KekIdentity)
		if err != nil {
			return err
		}
		kekIdentity := kekIdentity1
		details.KekIdentity = &kekIdentity
	}

	// Set property "Key":
	if typedInput.Key != nil {
		var key1 WorkspaceKeyDetails
		err := key1.PopulateFromARM(owner, *typedInput.Key)
		if err != nil {
			return err
		}
		key := key1
		details.Key = &key
	}

	// No error
	return nil
}

// AssignProperties_From_CustomerManagedKeyDetails populates our CustomerManagedKeyDetails from the provided source CustomerManagedKeyDetails
func (details *CustomerManagedKeyDetails) AssignProperties_From_CustomerManagedKeyDetails(source *storage.CustomerManagedKeyDetails) error {

	// KekIdentity
	if source.KekIdentity != nil {
		var kekIdentity KekIdentityProperties
		err := kekIdentity.AssignProperties_From_KekIdentityProperties(source.KekIdentity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KekIdentityProperties() to populate field KekIdentity")
		}
		details.KekIdentity = &kekIdentity
	} else {
		details.KekIdentity = nil
	}

	// Key
	if source.Key != nil {
		var key WorkspaceKeyDetails
		err := key.AssignProperties_From_WorkspaceKeyDetails(source.Key)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceKeyDetails() to populate field Key")
		}
		details.Key = &key
	} else {
		details.Key = nil
	}

	// No error
	return nil
}

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

	// KekIdentity
	if details.KekIdentity != nil {
		var kekIdentity storage.KekIdentityProperties
		err := details.KekIdentity.AssignProperties_To_KekIdentityProperties(&kekIdentity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KekIdentityProperties() to populate field KekIdentity")
		}
		destination.KekIdentity = &kekIdentity
	} else {
		destination.KekIdentity = nil
	}

	// Key
	if details.Key != nil {
		var key storage.WorkspaceKeyDetails
		err := details.Key.AssignProperties_To_WorkspaceKeyDetails(&key)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceKeyDetails() to populate field Key")
		}
		destination.Key = &key
	} else {
		destination.Key = nil
	}

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

	// No error
	return nil
}

// Initialize_From_CustomerManagedKeyDetails_STATUS populates our CustomerManagedKeyDetails from the provided source CustomerManagedKeyDetails_STATUS
func (details *CustomerManagedKeyDetails) Initialize_From_CustomerManagedKeyDetails_STATUS(source *CustomerManagedKeyDetails_STATUS) error {

	// KekIdentity
	if source.KekIdentity != nil {
		var kekIdentity KekIdentityProperties
		err := kekIdentity.Initialize_From_KekIdentityProperties_STATUS(source.KekIdentity)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_KekIdentityProperties_STATUS() to populate field KekIdentity")
		}
		details.KekIdentity = &kekIdentity
	} else {
		details.KekIdentity = nil
	}

	// Key
	if source.Key != nil {
		var key WorkspaceKeyDetails
		err := key.Initialize_From_WorkspaceKeyDetails_STATUS(source.Key)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_WorkspaceKeyDetails_STATUS() to populate field Key")
		}
		details.Key = &key
	} else {
		details.Key = nil
	}

	// No error
	return nil
}

// Details of the customer managed key associated with the workspace
type CustomerManagedKeyDetails_STATUS struct {
	// KekIdentity: Key encryption key
	KekIdentity *KekIdentityProperties_STATUS `json:"kekIdentity,omitempty"`

	// Key: The key object of the workspace
	Key *WorkspaceKeyDetails_STATUS `json:"key,omitempty"`

	// Status: The customer managed key status on the workspace
	Status *string `json:"status,omitempty"`
}

var _ genruntime.FromARMConverter = &CustomerManagedKeyDetails_STATUS{}

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

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

	// Set property "KekIdentity":
	if typedInput.KekIdentity != nil {
		var kekIdentity1 KekIdentityProperties_STATUS
		err := kekIdentity1.PopulateFromARM(owner, *typedInput.KekIdentity)
		if err != nil {
			return err
		}
		kekIdentity := kekIdentity1
		details.KekIdentity = &kekIdentity
	}

	// Set property "Key":
	if typedInput.Key != nil {
		var key1 WorkspaceKeyDetails_STATUS
		err := key1.PopulateFromARM(owner, *typedInput.Key)
		if err != nil {
			return err
		}
		key := key1
		details.Key = &key
	}

	// Set property "Status":
	if typedInput.Status != nil {
		status := *typedInput.Status
		details.Status = &status
	}

	// No error
	return nil
}

// AssignProperties_From_CustomerManagedKeyDetails_STATUS populates our CustomerManagedKeyDetails_STATUS from the provided source CustomerManagedKeyDetails_STATUS
func (details *CustomerManagedKeyDetails_STATUS) AssignProperties_From_CustomerManagedKeyDetails_STATUS(source *storage.CustomerManagedKeyDetails_STATUS) error {

	// KekIdentity
	if source.KekIdentity != nil {
		var kekIdentity KekIdentityProperties_STATUS
		err := kekIdentity.AssignProperties_From_KekIdentityProperties_STATUS(source.KekIdentity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_KekIdentityProperties_STATUS() to populate field KekIdentity")
		}
		details.KekIdentity = &kekIdentity
	} else {
		details.KekIdentity = nil
	}

	// Key
	if source.Key != nil {
		var key WorkspaceKeyDetails_STATUS
		err := key.AssignProperties_From_WorkspaceKeyDetails_STATUS(source.Key)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_WorkspaceKeyDetails_STATUS() to populate field Key")
		}
		details.Key = &key
	} else {
		details.Key = nil
	}

	// Status
	details.Status = genruntime.ClonePointerToString(source.Status)

	// No error
	return nil
}

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

	// KekIdentity
	if details.KekIdentity != nil {
		var kekIdentity storage.KekIdentityProperties_STATUS
		err := details.KekIdentity.AssignProperties_To_KekIdentityProperties_STATUS(&kekIdentity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_KekIdentityProperties_STATUS() to populate field KekIdentity")
		}
		destination.KekIdentity = &kekIdentity
	} else {
		destination.KekIdentity = nil
	}

	// Key
	if details.Key != nil {
		var key storage.WorkspaceKeyDetails_STATUS
		err := details.Key.AssignProperties_To_WorkspaceKeyDetails_STATUS(&key)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_WorkspaceKeyDetails_STATUS() to populate field Key")
		}
		destination.Key = &key
	} else {
		destination.Key = nil
	}

	// Status
	destination.Status = genruntime.ClonePointerToString(details.Status)

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

	// No error
	return nil
}

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

const (
	ManagedIdentity_Type_None                       = ManagedIdentity_Type("None")
	ManagedIdentity_Type_SystemAssigned             = ManagedIdentity_Type("SystemAssigned")
	ManagedIdentity_Type_SystemAssignedUserAssigned = ManagedIdentity_Type("SystemAssigned,UserAssigned")
)

// Mapping from string to ManagedIdentity_Type
var managedIdentity_Type_Values = map[string]ManagedIdentity_Type{
	"none":                        ManagedIdentity_Type_None,
	"systemassigned":              ManagedIdentity_Type_SystemAssigned,
	"systemassigned,userassigned": ManagedIdentity_Type_SystemAssignedUserAssigned,
}

type ManagedIdentity_Type_STATUS string

const (
	ManagedIdentity_Type_STATUS_None                       = ManagedIdentity_Type_STATUS("None")
	ManagedIdentity_Type_STATUS_SystemAssigned             = ManagedIdentity_Type_STATUS("SystemAssigned")
	ManagedIdentity_Type_STATUS_SystemAssignedUserAssigned = ManagedIdentity_Type_STATUS("SystemAssigned,UserAssigned")
)

// Mapping from string to ManagedIdentity_Type_STATUS
var managedIdentity_Type_STATUS_Values = map[string]ManagedIdentity_Type_STATUS{
	"none":                        ManagedIdentity_Type_STATUS_None,
	"systemassigned":              ManagedIdentity_Type_STATUS_SystemAssigned,
	"systemassigned,userassigned": ManagedIdentity_Type_STATUS_SystemAssignedUserAssigned,
}

// Information about the user assigned identity for the resource
type UserAssignedIdentityDetails struct {
	Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"`
}

// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails
func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *storage.UserAssignedIdentityDetails) error {

	// Reference
	details.Reference = source.Reference.Copy()

	// No error
	return nil
}

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

	// Reference
	destination.Reference = details.Reference.Copy()

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

	// No error
	return nil
}

// User Assigned Managed Identity
type UserAssignedManagedIdentity_STATUS struct {
	// ClientId: The client ID.
	ClientId *string `json:"clientId,omitempty"`

	// PrincipalId: The principal ID.
	PrincipalId *string `json:"principalId,omitempty"`
}

var _ genruntime.FromARMConverter = &UserAssignedManagedIdentity_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Key encryption key properties
type KekIdentityProperties struct {
	// UseSystemAssignedIdentity: Boolean specifying whether to use system assigned identity or not
	UseSystemAssignedIdentity *v1.JSON `json:"useSystemAssignedIdentity,omitempty"`

	// UserAssignedIdentityReference: User assigned identity resource Id
	UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"`
}

var _ genruntime.ARMTransformer = &KekIdentityProperties{}

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

	// Set property "UseSystemAssignedIdentity":
	if properties.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *properties.UseSystemAssignedIdentity.DeepCopy()
		result.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	}

	// Set property "UserAssignedIdentity":
	if properties.UserAssignedIdentityReference != nil {
		userAssignedIdentityReferenceARMID, err := resolved.ResolvedReferences.Lookup(*properties.UserAssignedIdentityReference)
		if err != nil {
			return nil, err
		}
		userAssignedIdentityReference := userAssignedIdentityReferenceARMID
		result.UserAssignedIdentity = &userAssignedIdentityReference
	}
	return result, nil
}

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

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

	// Set property "UseSystemAssignedIdentity":
	if typedInput.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *typedInput.UseSystemAssignedIdentity.DeepCopy()
		properties.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	}

	// no assignment for property "UserAssignedIdentityReference"

	// No error
	return nil
}

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

	// UseSystemAssignedIdentity
	if source.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *source.UseSystemAssignedIdentity.DeepCopy()
		properties.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	} else {
		properties.UseSystemAssignedIdentity = nil
	}

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

	// No error
	return nil
}

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

	// UseSystemAssignedIdentity
	if properties.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *properties.UseSystemAssignedIdentity.DeepCopy()
		destination.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	} else {
		destination.UseSystemAssignedIdentity = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_KekIdentityProperties_STATUS populates our KekIdentityProperties from the provided source KekIdentityProperties_STATUS
func (properties *KekIdentityProperties) Initialize_From_KekIdentityProperties_STATUS(source *KekIdentityProperties_STATUS) error {

	// UseSystemAssignedIdentity
	if source.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *source.UseSystemAssignedIdentity.DeepCopy()
		properties.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	} else {
		properties.UseSystemAssignedIdentity = nil
	}

	// No error
	return nil
}

// Key encryption key properties
type KekIdentityProperties_STATUS struct {
	// UseSystemAssignedIdentity: Boolean specifying whether to use system assigned identity or not
	UseSystemAssignedIdentity *v1.JSON `json:"useSystemAssignedIdentity,omitempty"`

	// UserAssignedIdentity: User assigned identity resource Id
	UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"`
}

var _ genruntime.FromARMConverter = &KekIdentityProperties_STATUS{}

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

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

	// Set property "UseSystemAssignedIdentity":
	if typedInput.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *typedInput.UseSystemAssignedIdentity.DeepCopy()
		properties.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	}

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

	// No error
	return nil
}

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

	// UseSystemAssignedIdentity
	if source.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *source.UseSystemAssignedIdentity.DeepCopy()
		properties.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	} else {
		properties.UseSystemAssignedIdentity = nil
	}

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

	// No error
	return nil
}

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

	// UseSystemAssignedIdentity
	if properties.UseSystemAssignedIdentity != nil {
		useSystemAssignedIdentity := *properties.UseSystemAssignedIdentity.DeepCopy()
		destination.UseSystemAssignedIdentity = &useSystemAssignedIdentity
	} else {
		destination.UseSystemAssignedIdentity = nil
	}

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

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

	// No error
	return nil
}

// Details of the customer managed key associated with the workspace
type WorkspaceKeyDetails struct {
	// KeyVaultUrl: Workspace Key sub-resource key vault url
	KeyVaultUrl *string `json:"keyVaultUrl,omitempty"`

	// Name: Workspace Key sub-resource name
	Name *string `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &WorkspaceKeyDetails{}

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

	// Set property "KeyVaultUrl":
	if details.KeyVaultUrl != nil {
		keyVaultUrl := *details.KeyVaultUrl
		result.KeyVaultUrl = &keyVaultUrl
	}

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

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

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

	// Set property "KeyVaultUrl":
	if typedInput.KeyVaultUrl != nil {
		keyVaultUrl := *typedInput.KeyVaultUrl
		details.KeyVaultUrl = &keyVaultUrl
	}

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

	// No error
	return nil
}

// AssignProperties_From_WorkspaceKeyDetails populates our WorkspaceKeyDetails from the provided source WorkspaceKeyDetails
func (details *WorkspaceKeyDetails) AssignProperties_From_WorkspaceKeyDetails(source *storage.WorkspaceKeyDetails) error {

	// KeyVaultUrl
	details.KeyVaultUrl = genruntime.ClonePointerToString(source.KeyVaultUrl)

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

	// No error
	return nil
}

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

	// KeyVaultUrl
	destination.KeyVaultUrl = genruntime.ClonePointerToString(details.KeyVaultUrl)

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

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

	// No error
	return nil
}

// Initialize_From_WorkspaceKeyDetails_STATUS populates our WorkspaceKeyDetails from the provided source WorkspaceKeyDetails_STATUS
func (details *WorkspaceKeyDetails) Initialize_From_WorkspaceKeyDetails_STATUS(source *WorkspaceKeyDetails_STATUS) error {

	// KeyVaultUrl
	details.KeyVaultUrl = genruntime.ClonePointerToString(source.KeyVaultUrl)

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

	// No error
	return nil
}

// Details of the customer managed key associated with the workspace
type WorkspaceKeyDetails_STATUS struct {
	// KeyVaultUrl: Workspace Key sub-resource key vault url
	KeyVaultUrl *string `json:"keyVaultUrl,omitempty"`

	// Name: Workspace Key sub-resource name
	Name *string `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &WorkspaceKeyDetails_STATUS{}

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

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

	// Set property "KeyVaultUrl":
	if typedInput.KeyVaultUrl != nil {
		keyVaultUrl := *typedInput.KeyVaultUrl
		details.KeyVaultUrl = &keyVaultUrl
	}

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

	// No error
	return nil
}

// AssignProperties_From_WorkspaceKeyDetails_STATUS populates our WorkspaceKeyDetails_STATUS from the provided source WorkspaceKeyDetails_STATUS
func (details *WorkspaceKeyDetails_STATUS) AssignProperties_From_WorkspaceKeyDetails_STATUS(source *storage.WorkspaceKeyDetails_STATUS) error {

	// KeyVaultUrl
	details.KeyVaultUrl = genruntime.ClonePointerToString(source.KeyVaultUrl)

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

	// No error
	return nil
}

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

	// KeyVaultUrl
	destination.KeyVaultUrl = genruntime.ClonePointerToString(details.KeyVaultUrl)

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

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

	// No error
	return nil
}

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