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

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

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,monitor}
// +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: /monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}
type Account struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Account_Spec   `json:"spec,omitempty"`
	Status            Account_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Account{}

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

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

var _ conversion.Convertible = &Account{}

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

	return account.AssignProperties_From_Account(source)
}

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

	return account.AssignProperties_To_Account(destination)
}

var _ configmaps.Exporter = &Account{}

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

var _ secrets.Exporter = &Account{}

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

var _ genruntime.ImportableResource = &Account{}

// InitializeSpec initializes the spec for this resource from the given status
func (account *Account) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Account_STATUS); ok {
		return account.Spec.Initialize_From_Account_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Account{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2023-04-03"
func (account Account) GetAPIVersion() string {
	return "2023-04-03"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Monitor/accounts"
func (account *Account) GetType() string {
	return "Microsoft.Monitor/accounts"
}

// NewEmptyStatus returns a new empty (blank) status
func (account *Account) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Account_STATUS{}
}

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

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

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

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

	account.Status = st
	return nil
}

// AssignProperties_From_Account populates our Account from the provided source Account
func (account *Account) AssignProperties_From_Account(source *storage.Account) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Account populates the provided destination Account from our Account
func (account *Account) AssignProperties_To_Account(destination *storage.Account) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/accounts/{azureMonitorWorkspaceName}
type AccountList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Account `json:"items"`
}

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

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

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *AccountOperatorSpec `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: Gets or sets allow or disallow public network access to Azure Monitor Workspace
	PublicNetworkAccess *AzureMonitorWorkspace_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

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

var _ genruntime.ARMTransformer = &Account_Spec{}

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

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

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

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

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

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

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

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

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

	// no assignment for property "OperatorSpec"

	// Set property "Owner":
	account.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 := AzureMonitorWorkspace_PublicNetworkAccess(temp)
			account.PublicNetworkAccess = &publicNetworkAccess
		}
	}

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Account_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Account_Spec{}
	err := account.AssignProperties_To_Account_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_Account_Spec populates our Account_Spec from the provided source Account_Spec
func (account *Account_Spec) AssignProperties_From_Account_Spec(source *storage.Account_Spec) error {

	// AzureName
	account.AzureName = source.AzureName

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

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

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

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = account.AzureName

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

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

	// OriginalVersion
	destination.OriginalVersion = account.OriginalVersion()

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

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

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

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

	// No error
	return nil
}

// Initialize_From_Account_STATUS populates our Account_Spec from the provided source Account_STATUS
func (account *Account_Spec) Initialize_From_Account_STATUS(source *Account_STATUS) error {

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

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

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

	// No error
	return nil
}

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

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

type Account_STATUS struct {
	// AccountId: The immutable Id of the Azure Monitor Workspace. This property is read-only.
	AccountId *string `json:"accountId,omitempty"`

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

	// DefaultIngestionSettings: The Data Collection Rule and Endpoint used for ingestion by default.
	DefaultIngestionSettings *IngestionSettings_STATUS `json:"defaultIngestionSettings,omitempty"`

	// Etag: Resource entity tag (ETag)
	Etag *string `json:"etag,omitempty"`

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

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

	// Metrics: Properties related to the metrics container in the Azure Monitor Workspace
	Metrics *Metrics_STATUS `json:"metrics,omitempty"`

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

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

	// ProvisioningState: The provisioning state of the Azure Monitor Workspace. Set to Succeeded if everything is healthy.
	ProvisioningState *AzureMonitorWorkspace_ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Gets or sets allow or disallow public network access to Azure Monitor Workspace
	PublicNetworkAccess *AzureMonitorWorkspace_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// SystemData: Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

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

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

var _ genruntime.ConvertibleStatus = &Account_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Account_STATUS{}
	err := account.AssignProperties_To_Account_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 = &Account_STATUS{}

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

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

	// Set property "AccountId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.AccountId != nil {
			accountId := *typedInput.Properties.AccountId
			account.AccountId = &accountId
		}
	}

	// no assignment for property "Conditions"

	// Set property "DefaultIngestionSettings":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DefaultIngestionSettings != nil {
			var defaultIngestionSettings1 IngestionSettings_STATUS
			err := defaultIngestionSettings1.PopulateFromARM(owner, *typedInput.Properties.DefaultIngestionSettings)
			if err != nil {
				return err
			}
			defaultIngestionSettings := defaultIngestionSettings1
			account.DefaultIngestionSettings = &defaultIngestionSettings
		}
	}

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

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

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

	// Set property "Metrics":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Metrics != nil {
			var metrics1 Metrics_STATUS
			err := metrics1.PopulateFromARM(owner, *typedInput.Properties.Metrics)
			if err != nil {
				return err
			}
			metrics := metrics1
			account.Metrics = &metrics
		}
	}

	// Set property "Name":
	if typedInput.Name != nil {
		name := *typedInput.Name
		account.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
			}
			account.PrivateEndpointConnections = append(account.PrivateEndpointConnections, item1)
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			var temp string
			temp = string(*typedInput.Properties.ProvisioningState)
			provisioningState := AzureMonitorWorkspace_ProvisioningState_STATUS(temp)
			account.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 := AzureMonitorWorkspace_PublicNetworkAccess_STATUS(temp)
			account.PublicNetworkAccess = &publicNetworkAccess
		}
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Account_STATUS populates our Account_STATUS from the provided source Account_STATUS
func (account *Account_STATUS) AssignProperties_From_Account_STATUS(source *storage.Account_STATUS) error {

	// AccountId
	account.AccountId = genruntime.ClonePointerToString(source.AccountId)

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

	// DefaultIngestionSettings
	if source.DefaultIngestionSettings != nil {
		var defaultIngestionSetting IngestionSettings_STATUS
		err := defaultIngestionSetting.AssignProperties_From_IngestionSettings_STATUS(source.DefaultIngestionSettings)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_IngestionSettings_STATUS() to populate field DefaultIngestionSettings")
		}
		account.DefaultIngestionSettings = &defaultIngestionSetting
	} else {
		account.DefaultIngestionSettings = nil
	}

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

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

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

	// Metrics
	if source.Metrics != nil {
		var metric Metrics_STATUS
		err := metric.AssignProperties_From_Metrics_STATUS(source.Metrics)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Metrics_STATUS() to populate field Metrics")
		}
		account.Metrics = &metric
	} else {
		account.Metrics = nil
	}

	// Name
	account.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
		}
		account.PrivateEndpointConnections = privateEndpointConnectionList
	} else {
		account.PrivateEndpointConnections = nil
	}

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

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

	// SystemData
	if source.SystemData != nil {
		var systemDatum SystemData_STATUS
		err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData")
		}
		account.SystemData = &systemDatum
	} else {
		account.SystemData = nil
	}

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

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

	// No error
	return nil
}

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

	// AccountId
	destination.AccountId = genruntime.ClonePointerToString(account.AccountId)

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

	// DefaultIngestionSettings
	if account.DefaultIngestionSettings != nil {
		var defaultIngestionSetting storage.IngestionSettings_STATUS
		err := account.DefaultIngestionSettings.AssignProperties_To_IngestionSettings_STATUS(&defaultIngestionSetting)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_IngestionSettings_STATUS() to populate field DefaultIngestionSettings")
		}
		destination.DefaultIngestionSettings = &defaultIngestionSetting
	} else {
		destination.DefaultIngestionSettings = nil
	}

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

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

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

	// Metrics
	if account.Metrics != nil {
		var metric storage.Metrics_STATUS
		err := account.Metrics.AssignProperties_To_Metrics_STATUS(&metric)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Metrics_STATUS() to populate field Metrics")
		}
		destination.Metrics = &metric
	} else {
		destination.Metrics = nil
	}

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

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

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

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

	// SystemData
	if account.SystemData != nil {
		var systemDatum storage.SystemData_STATUS
		err := account.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData")
		}
		destination.SystemData = &systemDatum
	} else {
		destination.SystemData = nil
	}

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

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"2023-04-03"}
type APIVersion string

const APIVersion_Value = APIVersion("2023-04-03")

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type AccountOperatorSpec 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_AccountOperatorSpec populates our AccountOperatorSpec from the provided source AccountOperatorSpec
func (operator *AccountOperatorSpec) AssignProperties_From_AccountOperatorSpec(source *storage.AccountOperatorSpec) 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_AccountOperatorSpec populates the provided destination AccountOperatorSpec from our AccountOperatorSpec
func (operator *AccountOperatorSpec) AssignProperties_To_AccountOperatorSpec(destination *storage.AccountOperatorSpec) 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
}

type AzureMonitorWorkspace_ProvisioningState_STATUS string

const (
	AzureMonitorWorkspace_ProvisioningState_STATUS_Canceled  = AzureMonitorWorkspace_ProvisioningState_STATUS("Canceled")
	AzureMonitorWorkspace_ProvisioningState_STATUS_Creating  = AzureMonitorWorkspace_ProvisioningState_STATUS("Creating")
	AzureMonitorWorkspace_ProvisioningState_STATUS_Deleting  = AzureMonitorWorkspace_ProvisioningState_STATUS("Deleting")
	AzureMonitorWorkspace_ProvisioningState_STATUS_Failed    = AzureMonitorWorkspace_ProvisioningState_STATUS("Failed")
	AzureMonitorWorkspace_ProvisioningState_STATUS_Succeeded = AzureMonitorWorkspace_ProvisioningState_STATUS("Succeeded")
)

// Mapping from string to AzureMonitorWorkspace_ProvisioningState_STATUS
var azureMonitorWorkspace_ProvisioningState_STATUS_Values = map[string]AzureMonitorWorkspace_ProvisioningState_STATUS{
	"canceled":  AzureMonitorWorkspace_ProvisioningState_STATUS_Canceled,
	"creating":  AzureMonitorWorkspace_ProvisioningState_STATUS_Creating,
	"deleting":  AzureMonitorWorkspace_ProvisioningState_STATUS_Deleting,
	"failed":    AzureMonitorWorkspace_ProvisioningState_STATUS_Failed,
	"succeeded": AzureMonitorWorkspace_ProvisioningState_STATUS_Succeeded,
}

// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type AzureMonitorWorkspace_PublicNetworkAccess string

const (
	AzureMonitorWorkspace_PublicNetworkAccess_Disabled = AzureMonitorWorkspace_PublicNetworkAccess("Disabled")
	AzureMonitorWorkspace_PublicNetworkAccess_Enabled  = AzureMonitorWorkspace_PublicNetworkAccess("Enabled")
)

// Mapping from string to AzureMonitorWorkspace_PublicNetworkAccess
var azureMonitorWorkspace_PublicNetworkAccess_Values = map[string]AzureMonitorWorkspace_PublicNetworkAccess{
	"disabled": AzureMonitorWorkspace_PublicNetworkAccess_Disabled,
	"enabled":  AzureMonitorWorkspace_PublicNetworkAccess_Enabled,
}

type AzureMonitorWorkspace_PublicNetworkAccess_STATUS string

const (
	AzureMonitorWorkspace_PublicNetworkAccess_STATUS_Disabled = AzureMonitorWorkspace_PublicNetworkAccess_STATUS("Disabled")
	AzureMonitorWorkspace_PublicNetworkAccess_STATUS_Enabled  = AzureMonitorWorkspace_PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to AzureMonitorWorkspace_PublicNetworkAccess_STATUS
var azureMonitorWorkspace_PublicNetworkAccess_STATUS_Values = map[string]AzureMonitorWorkspace_PublicNetworkAccess_STATUS{
	"disabled": AzureMonitorWorkspace_PublicNetworkAccess_STATUS_Disabled,
	"enabled":  AzureMonitorWorkspace_PublicNetworkAccess_STATUS_Enabled,
}

// Settings for data ingestion
type IngestionSettings_STATUS struct {
	// DataCollectionEndpointResourceId: The Azure resource Id of the default data collection endpoint for this Azure Monitor
	// Workspace.
	DataCollectionEndpointResourceId *string `json:"dataCollectionEndpointResourceId,omitempty"`

	// DataCollectionRuleResourceId: The Azure resource Id of the default data collection rule for this Azure Monitor Workspace.
	DataCollectionRuleResourceId *string `json:"dataCollectionRuleResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &IngestionSettings_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

	// DataCollectionEndpointResourceId
	settings.DataCollectionEndpointResourceId = genruntime.ClonePointerToString(source.DataCollectionEndpointResourceId)

	// DataCollectionRuleResourceId
	settings.DataCollectionRuleResourceId = genruntime.ClonePointerToString(source.DataCollectionRuleResourceId)

	// No error
	return nil
}

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

	// DataCollectionEndpointResourceId
	destination.DataCollectionEndpointResourceId = genruntime.ClonePointerToString(settings.DataCollectionEndpointResourceId)

	// DataCollectionRuleResourceId
	destination.DataCollectionRuleResourceId = genruntime.ClonePointerToString(settings.DataCollectionRuleResourceId)

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

	// No error
	return nil
}

// Properties related to the metrics container in the Azure Monitor Workspace
type Metrics_STATUS struct {
	// InternalId: An internal identifier for the metrics container. Only to be used by the system
	InternalId *string `json:"internalId,omitempty"`

	// PrometheusQueryEndpoint: The Prometheus query endpoint for the Azure Monitor Workspace
	PrometheusQueryEndpoint *string `json:"prometheusQueryEndpoint,omitempty"`
}

var _ genruntime.FromARMConverter = &Metrics_STATUS{}

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

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

	// Set property "InternalId":
	if typedInput.InternalId != nil {
		internalId := *typedInput.InternalId
		metrics.InternalId = &internalId
	}

	// Set property "PrometheusQueryEndpoint":
	if typedInput.PrometheusQueryEndpoint != nil {
		prometheusQueryEndpoint := *typedInput.PrometheusQueryEndpoint
		metrics.PrometheusQueryEndpoint = &prometheusQueryEndpoint
	}

	// No error
	return nil
}

// AssignProperties_From_Metrics_STATUS populates our Metrics_STATUS from the provided source Metrics_STATUS
func (metrics *Metrics_STATUS) AssignProperties_From_Metrics_STATUS(source *storage.Metrics_STATUS) error {

	// InternalId
	metrics.InternalId = genruntime.ClonePointerToString(source.InternalId)

	// PrometheusQueryEndpoint
	metrics.PrometheusQueryEndpoint = genruntime.ClonePointerToString(source.PrometheusQueryEndpoint)

	// No error
	return nil
}

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

	// InternalId
	destination.InternalId = genruntime.ClonePointerToString(metrics.InternalId)

	// PrometheusQueryEndpoint
	destination.PrometheusQueryEndpoint = genruntime.ClonePointerToString(metrics.PrometheusQueryEndpoint)

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

	// No error
	return nil
}

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

var _ genruntime.FromARMConverter = &PrivateEndpointConnection_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
	// CreatedAt: The timestamp of resource creation (UTC).
	CreatedAt *string `json:"createdAt,omitempty"`

	// CreatedBy: The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType: The type of identity that created the resource.
	CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"`

	// LastModifiedAt: The timestamp of resource last modification (UTC)
	LastModifiedAt *string `json:"lastModifiedAt,omitempty"`

	// LastModifiedBy: The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// LastModifiedByType: The type of identity that last modified the resource.
	LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"`
}

var _ genruntime.FromARMConverter = &SystemData_STATUS{}

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

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

	// Set property "CreatedAt":
	if typedInput.CreatedAt != nil {
		createdAt := *typedInput.CreatedAt
		data.CreatedAt = &createdAt
	}

	// Set property "CreatedBy":
	if typedInput.CreatedBy != nil {
		createdBy := *typedInput.CreatedBy
		data.CreatedBy = &createdBy
	}

	// Set property "CreatedByType":
	if typedInput.CreatedByType != nil {
		var temp string
		temp = string(*typedInput.CreatedByType)
		createdByType := SystemData_CreatedByType_STATUS(temp)
		data.CreatedByType = &createdByType
	}

	// Set property "LastModifiedAt":
	if typedInput.LastModifiedAt != nil {
		lastModifiedAt := *typedInput.LastModifiedAt
		data.LastModifiedAt = &lastModifiedAt
	}

	// Set property "LastModifiedBy":
	if typedInput.LastModifiedBy != nil {
		lastModifiedBy := *typedInput.LastModifiedBy
		data.LastModifiedBy = &lastModifiedBy
	}

	// Set property "LastModifiedByType":
	if typedInput.LastModifiedByType != nil {
		var temp string
		temp = string(*typedInput.LastModifiedByType)
		lastModifiedByType := SystemData_LastModifiedByType_STATUS(temp)
		data.LastModifiedByType = &lastModifiedByType
	}

	// No error
	return nil
}

// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS
func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *storage.SystemData_STATUS) error {

	// CreatedAt
	data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt)

	// CreatedBy
	data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy)

	// CreatedByType
	if source.CreatedByType != nil {
		createdByType := *source.CreatedByType
		createdByTypeTemp := genruntime.ToEnum(createdByType, systemData_CreatedByType_STATUS_Values)
		data.CreatedByType = &createdByTypeTemp
	} else {
		data.CreatedByType = nil
	}

	// LastModifiedAt
	data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt)

	// LastModifiedBy
	data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy)

	// LastModifiedByType
	if source.LastModifiedByType != nil {
		lastModifiedByType := *source.LastModifiedByType
		lastModifiedByTypeTemp := genruntime.ToEnum(lastModifiedByType, systemData_LastModifiedByType_STATUS_Values)
		data.LastModifiedByType = &lastModifiedByTypeTemp
	} else {
		data.LastModifiedByType = nil
	}

	// No error
	return nil
}

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

	// CreatedAt
	destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt)

	// CreatedBy
	destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy)

	// CreatedByType
	if data.CreatedByType != nil {
		createdByType := string(*data.CreatedByType)
		destination.CreatedByType = &createdByType
	} else {
		destination.CreatedByType = nil
	}

	// LastModifiedAt
	destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt)

	// LastModifiedBy
	destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy)

	// LastModifiedByType
	if data.LastModifiedByType != nil {
		lastModifiedByType := string(*data.LastModifiedByType)
		destination.LastModifiedByType = &lastModifiedByType
	} else {
		destination.LastModifiedByType = nil
	}

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

	// No error
	return nil
}

type SystemData_CreatedByType_STATUS string

const (
	SystemData_CreatedByType_STATUS_Application     = SystemData_CreatedByType_STATUS("Application")
	SystemData_CreatedByType_STATUS_Key             = SystemData_CreatedByType_STATUS("Key")
	SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity")
	SystemData_CreatedByType_STATUS_User            = SystemData_CreatedByType_STATUS("User")
)

// Mapping from string to SystemData_CreatedByType_STATUS
var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{
	"application":     SystemData_CreatedByType_STATUS_Application,
	"key":             SystemData_CreatedByType_STATUS_Key,
	"managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity,
	"user":            SystemData_CreatedByType_STATUS_User,
}

type SystemData_LastModifiedByType_STATUS string

const (
	SystemData_LastModifiedByType_STATUS_Application     = SystemData_LastModifiedByType_STATUS("Application")
	SystemData_LastModifiedByType_STATUS_Key             = SystemData_LastModifiedByType_STATUS("Key")
	SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity")
	SystemData_LastModifiedByType_STATUS_User            = SystemData_LastModifiedByType_STATUS("User")
)

// Mapping from string to SystemData_LastModifiedByType_STATUS
var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{
	"application":     SystemData_LastModifiedByType_STATUS_Application,
	"key":             SystemData_LastModifiedByType_STATUS_Key,
	"managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity,
	"user":            SystemData_LastModifiedByType_STATUS_User,
}

func init() {
	SchemeBuilder.Register(&Account{}, &AccountList{})
}
