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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230311/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230311/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,insights}
// +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.Insights/stable/2023-03-11/dataCollectionEndpoints_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}
type DataCollectionEndpoint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DataCollectionEndpoint_Spec           `json:"spec,omitempty"`
	Status            DataCollectionEndpointResource_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &DataCollectionEndpoint{}

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

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

var _ conversion.Convertible = &DataCollectionEndpoint{}

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

	return endpoint.AssignProperties_From_DataCollectionEndpoint(source)
}

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

	return endpoint.AssignProperties_To_DataCollectionEndpoint(destination)
}

var _ configmaps.Exporter = &DataCollectionEndpoint{}

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

var _ secrets.Exporter = &DataCollectionEndpoint{}

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

var _ genruntime.ImportableResource = &DataCollectionEndpoint{}

// InitializeSpec initializes the spec for this resource from the given status
func (endpoint *DataCollectionEndpoint) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*DataCollectionEndpointResource_STATUS); ok {
		return endpoint.Spec.Initialize_From_DataCollectionEndpointResource_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &DataCollectionEndpoint{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/dataCollectionEndpoints"
func (endpoint *DataCollectionEndpoint) GetType() string {
	return "Microsoft.Insights/dataCollectionEndpoints"
}

// NewEmptyStatus returns a new empty (blank) status
func (endpoint *DataCollectionEndpoint) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &DataCollectionEndpointResource_STATUS{}
}

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

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

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

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

	endpoint.Status = st
	return nil
}

// AssignProperties_From_DataCollectionEndpoint populates our DataCollectionEndpoint from the provided source DataCollectionEndpoint
func (endpoint *DataCollectionEndpoint) AssignProperties_From_DataCollectionEndpoint(source *storage.DataCollectionEndpoint) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_DataCollectionEndpoint populates the provided destination DataCollectionEndpoint from our DataCollectionEndpoint
func (endpoint *DataCollectionEndpoint) AssignProperties_To_DataCollectionEndpoint(destination *storage.DataCollectionEndpoint) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Insights/stable/2023-03-11/dataCollectionEndpoints_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}
type DataCollectionEndpointList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DataCollectionEndpoint `json:"items"`
}

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

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

type DataCollectionEndpoint_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"`

	// Description: Description of the data collection endpoint.
	Description *string `json:"description,omitempty"`

	// Identity: Managed service identity of the resource.
	Identity *ManagedServiceIdentity `json:"identity,omitempty"`

	// Kind: The kind of the resource.
	Kind *DataCollectionEndpoint_Kind_Spec `json:"kind,omitempty"`

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

	// NetworkAcls: Network access control rules for the endpoints.
	NetworkAcls *NetworkRuleSet `json:"networkAcls,omitempty"`

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

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

var _ genruntime.ARMTransformer = &DataCollectionEndpoint_Spec{}

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

	// Set property "Identity":
	if endpoint.Identity != nil {
		identity_ARM, err := endpoint.Identity.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		identity := *identity_ARM.(*arm.ManagedServiceIdentity)
		result.Identity = &identity
	}

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

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

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

	// Set property "Properties":
	if endpoint.Description != nil || endpoint.NetworkAcls != nil {
		result.Properties = &arm.DataCollectionEndpointSpec{}
	}
	if endpoint.Description != nil {
		description := *endpoint.Description
		result.Properties.Description = &description
	}
	if endpoint.NetworkAcls != nil {
		networkAcls_ARM, err := endpoint.NetworkAcls.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		networkAcls := *networkAcls_ARM.(*arm.NetworkRuleSet)
		result.Properties.NetworkAcls = &networkAcls
	}

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

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

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

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

	// Set property "Description":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Description != nil {
			description := *typedInput.Properties.Description
			endpoint.Description = &description
		}
	}

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

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

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

	// Set property "NetworkAcls":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAcls != nil {
			var networkAcls1 NetworkRuleSet
			err := networkAcls1.PopulateFromARM(owner, *typedInput.Properties.NetworkAcls)
			if err != nil {
				return err
			}
			networkAcls := networkAcls1
			endpoint.NetworkAcls = &networkAcls
		}
	}

	// no assignment for property "OperatorSpec"

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &DataCollectionEndpoint_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.DataCollectionEndpoint_Spec{}
	err := endpoint.AssignProperties_To_DataCollectionEndpoint_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_DataCollectionEndpoint_Spec populates our DataCollectionEndpoint_Spec from the provided source DataCollectionEndpoint_Spec
func (endpoint *DataCollectionEndpoint_Spec) AssignProperties_From_DataCollectionEndpoint_Spec(source *storage.DataCollectionEndpoint_Spec) error {

	// AzureName
	endpoint.AzureName = source.AzureName

	// Description
	endpoint.Description = genruntime.ClonePointerToString(source.Description)

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

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

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

	// NetworkAcls
	if source.NetworkAcls != nil {
		var networkAcl NetworkRuleSet
		err := networkAcl.AssignProperties_From_NetworkRuleSet(source.NetworkAcls)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_NetworkRuleSet() to populate field NetworkAcls")
		}
		endpoint.NetworkAcls = &networkAcl
	} else {
		endpoint.NetworkAcls = nil
	}

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

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = endpoint.AzureName

	// Description
	destination.Description = genruntime.ClonePointerToString(endpoint.Description)

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

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

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

	// NetworkAcls
	if endpoint.NetworkAcls != nil {
		var networkAcl storage.NetworkRuleSet
		err := endpoint.NetworkAcls.AssignProperties_To_NetworkRuleSet(&networkAcl)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_NetworkRuleSet() to populate field NetworkAcls")
		}
		destination.NetworkAcls = &networkAcl
	} else {
		destination.NetworkAcls = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = endpoint.OriginalVersion()

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

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

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

	// No error
	return nil
}

// Initialize_From_DataCollectionEndpointResource_STATUS populates our DataCollectionEndpoint_Spec from the provided source DataCollectionEndpointResource_STATUS
func (endpoint *DataCollectionEndpoint_Spec) Initialize_From_DataCollectionEndpointResource_STATUS(source *DataCollectionEndpointResource_STATUS) error {

	// Description
	endpoint.Description = genruntime.ClonePointerToString(source.Description)

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

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

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

	// NetworkAcls
	if source.NetworkAcls != nil {
		var networkAcl NetworkRuleSet
		err := networkAcl.Initialize_From_NetworkRuleSet_STATUS(source.NetworkAcls)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_NetworkRuleSet_STATUS() to populate field NetworkAcls")
		}
		endpoint.NetworkAcls = &networkAcl
	} else {
		endpoint.NetworkAcls = nil
	}

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

	// No error
	return nil
}

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

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

// Definition of ARM tracked top level resource.
type DataCollectionEndpointResource_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// ConfigurationAccess: The endpoint used by clients to access their configuration.
	ConfigurationAccess *ConfigurationAccessEndpointSpec_STATUS `json:"configurationAccess,omitempty"`

	// Description: Description of the data collection endpoint.
	Description *string `json:"description,omitempty"`

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

	// FailoverConfiguration: Failover configuration on this endpoint. This property is READ-ONLY.
	FailoverConfiguration *FailoverConfigurationSpec_STATUS `json:"failoverConfiguration,omitempty"`

	// Id: Fully qualified ID of the resource.
	Id *string `json:"id,omitempty"`

	// Identity: Managed service identity of the resource.
	Identity *ManagedServiceIdentity_STATUS `json:"identity,omitempty"`

	// ImmutableId: The immutable ID of this data collection endpoint resource. This property is READ-ONLY.
	ImmutableId *string `json:"immutableId,omitempty"`

	// Kind: The kind of the resource.
	Kind *DataCollectionEndpointResource_Kind_STATUS `json:"kind,omitempty"`

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

	// LogsIngestion: The endpoint used by clients to ingest logs.
	LogsIngestion *LogsIngestionEndpointSpec_STATUS `json:"logsIngestion,omitempty"`

	// Metadata: Metadata for the resource. This property is READ-ONLY.
	Metadata *Metadata_STATUS `json:"metadata,omitempty"`

	// MetricsIngestion: The endpoint used by clients to ingest metrics.
	MetricsIngestion *MetricsIngestionEndpointSpec_STATUS `json:"metricsIngestion,omitempty"`

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

	// NetworkAcls: Network access control rules for the endpoints.
	NetworkAcls *NetworkRuleSet_STATUS `json:"networkAcls,omitempty"`

	// PrivateLinkScopedResources: List of Azure Monitor Private Link Scope Resources to which this data collection endpoint
	// resource is associated. This property is READ-ONLY.
	PrivateLinkScopedResources []PrivateLinkScopedResource_STATUS `json:"privateLinkScopedResources,omitempty"`

	// ProvisioningState: The resource provisioning state. This property is READ-ONLY.
	ProvisioningState *DataCollectionEndpoint_ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// SystemData: Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

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

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

var _ genruntime.ConvertibleStatus = &DataCollectionEndpointResource_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.DataCollectionEndpointResource_STATUS{}
	err := resource.AssignProperties_To_DataCollectionEndpointResource_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 = &DataCollectionEndpointResource_STATUS{}

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

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

	// no assignment for property "Conditions"

	// Set property "ConfigurationAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConfigurationAccess != nil {
			var configurationAccess1 ConfigurationAccessEndpointSpec_STATUS
			err := configurationAccess1.PopulateFromARM(owner, *typedInput.Properties.ConfigurationAccess)
			if err != nil {
				return err
			}
			configurationAccess := configurationAccess1
			resource.ConfigurationAccess = &configurationAccess
		}
	}

	// Set property "Description":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Description != nil {
			description := *typedInput.Properties.Description
			resource.Description = &description
		}
	}

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

	// Set property "FailoverConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.FailoverConfiguration != nil {
			var failoverConfiguration1 FailoverConfigurationSpec_STATUS
			err := failoverConfiguration1.PopulateFromARM(owner, *typedInput.Properties.FailoverConfiguration)
			if err != nil {
				return err
			}
			failoverConfiguration := failoverConfiguration1
			resource.FailoverConfiguration = &failoverConfiguration
		}
	}

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

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

	// Set property "ImmutableId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ImmutableId != nil {
			immutableId := *typedInput.Properties.ImmutableId
			resource.ImmutableId = &immutableId
		}
	}

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

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

	// Set property "LogsIngestion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LogsIngestion != nil {
			var logsIngestion1 LogsIngestionEndpointSpec_STATUS
			err := logsIngestion1.PopulateFromARM(owner, *typedInput.Properties.LogsIngestion)
			if err != nil {
				return err
			}
			logsIngestion := logsIngestion1
			resource.LogsIngestion = &logsIngestion
		}
	}

	// Set property "Metadata":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Metadata != nil {
			var metadata1 Metadata_STATUS
			err := metadata1.PopulateFromARM(owner, *typedInput.Properties.Metadata)
			if err != nil {
				return err
			}
			metadata := metadata1
			resource.Metadata = &metadata
		}
	}

	// Set property "MetricsIngestion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MetricsIngestion != nil {
			var metricsIngestion1 MetricsIngestionEndpointSpec_STATUS
			err := metricsIngestion1.PopulateFromARM(owner, *typedInput.Properties.MetricsIngestion)
			if err != nil {
				return err
			}
			metricsIngestion := metricsIngestion1
			resource.MetricsIngestion = &metricsIngestion
		}
	}

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

	// Set property "NetworkAcls":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkAcls != nil {
			var networkAcls1 NetworkRuleSet_STATUS
			err := networkAcls1.PopulateFromARM(owner, *typedInput.Properties.NetworkAcls)
			if err != nil {
				return err
			}
			networkAcls := networkAcls1
			resource.NetworkAcls = &networkAcls
		}
	}

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

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

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

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

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

	// No error
	return nil
}

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

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

	// ConfigurationAccess
	if source.ConfigurationAccess != nil {
		var configurationAccess ConfigurationAccessEndpointSpec_STATUS
		err := configurationAccess.AssignProperties_From_ConfigurationAccessEndpointSpec_STATUS(source.ConfigurationAccess)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConfigurationAccessEndpointSpec_STATUS() to populate field ConfigurationAccess")
		}
		resource.ConfigurationAccess = &configurationAccess
	} else {
		resource.ConfigurationAccess = nil
	}

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

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

	// FailoverConfiguration
	if source.FailoverConfiguration != nil {
		var failoverConfiguration FailoverConfigurationSpec_STATUS
		err := failoverConfiguration.AssignProperties_From_FailoverConfigurationSpec_STATUS(source.FailoverConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_FailoverConfigurationSpec_STATUS() to populate field FailoverConfiguration")
		}
		resource.FailoverConfiguration = &failoverConfiguration
	} else {
		resource.FailoverConfiguration = nil
	}

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

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

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

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

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

	// LogsIngestion
	if source.LogsIngestion != nil {
		var logsIngestion LogsIngestionEndpointSpec_STATUS
		err := logsIngestion.AssignProperties_From_LogsIngestionEndpointSpec_STATUS(source.LogsIngestion)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LogsIngestionEndpointSpec_STATUS() to populate field LogsIngestion")
		}
		resource.LogsIngestion = &logsIngestion
	} else {
		resource.LogsIngestion = nil
	}

	// Metadata
	if source.Metadata != nil {
		var metadatum Metadata_STATUS
		err := metadatum.AssignProperties_From_Metadata_STATUS(source.Metadata)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Metadata_STATUS() to populate field Metadata")
		}
		resource.Metadata = &metadatum
	} else {
		resource.Metadata = nil
	}

	// MetricsIngestion
	if source.MetricsIngestion != nil {
		var metricsIngestion MetricsIngestionEndpointSpec_STATUS
		err := metricsIngestion.AssignProperties_From_MetricsIngestionEndpointSpec_STATUS(source.MetricsIngestion)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MetricsIngestionEndpointSpec_STATUS() to populate field MetricsIngestion")
		}
		resource.MetricsIngestion = &metricsIngestion
	} else {
		resource.MetricsIngestion = nil
	}

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

	// NetworkAcls
	if source.NetworkAcls != nil {
		var networkAcl NetworkRuleSet_STATUS
		err := networkAcl.AssignProperties_From_NetworkRuleSet_STATUS(source.NetworkAcls)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_NetworkRuleSet_STATUS() to populate field NetworkAcls")
		}
		resource.NetworkAcls = &networkAcl
	} else {
		resource.NetworkAcls = nil
	}

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

	// ProvisioningState
	if source.ProvisioningState != nil {
		provisioningState := *source.ProvisioningState
		provisioningStateTemp := genruntime.ToEnum(provisioningState, dataCollectionEndpoint_ProvisioningState_STATUS_Values)
		resource.ProvisioningState = &provisioningStateTemp
	} else {
		resource.ProvisioningState = 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")
		}
		resource.SystemData = &systemDatum
	} else {
		resource.SystemData = nil
	}

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

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

	// No error
	return nil
}

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

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

	// ConfigurationAccess
	if resource.ConfigurationAccess != nil {
		var configurationAccess storage.ConfigurationAccessEndpointSpec_STATUS
		err := resource.ConfigurationAccess.AssignProperties_To_ConfigurationAccessEndpointSpec_STATUS(&configurationAccess)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConfigurationAccessEndpointSpec_STATUS() to populate field ConfigurationAccess")
		}
		destination.ConfigurationAccess = &configurationAccess
	} else {
		destination.ConfigurationAccess = nil
	}

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

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

	// FailoverConfiguration
	if resource.FailoverConfiguration != nil {
		var failoverConfiguration storage.FailoverConfigurationSpec_STATUS
		err := resource.FailoverConfiguration.AssignProperties_To_FailoverConfigurationSpec_STATUS(&failoverConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_FailoverConfigurationSpec_STATUS() to populate field FailoverConfiguration")
		}
		destination.FailoverConfiguration = &failoverConfiguration
	} else {
		destination.FailoverConfiguration = nil
	}

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

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

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

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

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

	// LogsIngestion
	if resource.LogsIngestion != nil {
		var logsIngestion storage.LogsIngestionEndpointSpec_STATUS
		err := resource.LogsIngestion.AssignProperties_To_LogsIngestionEndpointSpec_STATUS(&logsIngestion)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_LogsIngestionEndpointSpec_STATUS() to populate field LogsIngestion")
		}
		destination.LogsIngestion = &logsIngestion
	} else {
		destination.LogsIngestion = nil
	}

	// Metadata
	if resource.Metadata != nil {
		var metadatum storage.Metadata_STATUS
		err := resource.Metadata.AssignProperties_To_Metadata_STATUS(&metadatum)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Metadata_STATUS() to populate field Metadata")
		}
		destination.Metadata = &metadatum
	} else {
		destination.Metadata = nil
	}

	// MetricsIngestion
	if resource.MetricsIngestion != nil {
		var metricsIngestion storage.MetricsIngestionEndpointSpec_STATUS
		err := resource.MetricsIngestion.AssignProperties_To_MetricsIngestionEndpointSpec_STATUS(&metricsIngestion)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MetricsIngestionEndpointSpec_STATUS() to populate field MetricsIngestion")
		}
		destination.MetricsIngestion = &metricsIngestion
	} else {
		destination.MetricsIngestion = nil
	}

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

	// NetworkAcls
	if resource.NetworkAcls != nil {
		var networkAcl storage.NetworkRuleSet_STATUS
		err := resource.NetworkAcls.AssignProperties_To_NetworkRuleSet_STATUS(&networkAcl)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_NetworkRuleSet_STATUS() to populate field NetworkAcls")
		}
		destination.NetworkAcls = &networkAcl
	} else {
		destination.NetworkAcls = nil
	}

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

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

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

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

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

	// No error
	return nil
}

// Definition of the endpoint used for accessing configuration.
type ConfigurationAccessEndpointSpec_STATUS struct {
	// Endpoint: The endpoint. This property is READ-ONLY.
	Endpoint *string `json:"endpoint,omitempty"`
}

var _ genruntime.FromARMConverter = &ConfigurationAccessEndpointSpec_STATUS{}

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

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

	// Set property "Endpoint":
	if typedInput.Endpoint != nil {
		endpoint1 := *typedInput.Endpoint
		endpoint.Endpoint = &endpoint1
	}

	// No error
	return nil
}

// AssignProperties_From_ConfigurationAccessEndpointSpec_STATUS populates our ConfigurationAccessEndpointSpec_STATUS from the provided source ConfigurationAccessEndpointSpec_STATUS
func (endpoint *ConfigurationAccessEndpointSpec_STATUS) AssignProperties_From_ConfigurationAccessEndpointSpec_STATUS(source *storage.ConfigurationAccessEndpointSpec_STATUS) error {

	// Endpoint
	endpoint.Endpoint = genruntime.ClonePointerToString(source.Endpoint)

	// No error
	return nil
}

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

	// Endpoint
	destination.Endpoint = genruntime.ClonePointerToString(endpoint.Endpoint)

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"Linux","Windows"}
type DataCollectionEndpoint_Kind_Spec string

const (
	DataCollectionEndpoint_Kind_Spec_Linux   = DataCollectionEndpoint_Kind_Spec("Linux")
	DataCollectionEndpoint_Kind_Spec_Windows = DataCollectionEndpoint_Kind_Spec("Windows")
)

// Mapping from string to DataCollectionEndpoint_Kind_Spec
var dataCollectionEndpoint_Kind_Spec_Values = map[string]DataCollectionEndpoint_Kind_Spec{
	"linux":   DataCollectionEndpoint_Kind_Spec_Linux,
	"windows": DataCollectionEndpoint_Kind_Spec_Windows,
}

type DataCollectionEndpoint_ProvisioningState_STATUS string

const (
	DataCollectionEndpoint_ProvisioningState_STATUS_Canceled  = DataCollectionEndpoint_ProvisioningState_STATUS("Canceled")
	DataCollectionEndpoint_ProvisioningState_STATUS_Creating  = DataCollectionEndpoint_ProvisioningState_STATUS("Creating")
	DataCollectionEndpoint_ProvisioningState_STATUS_Deleting  = DataCollectionEndpoint_ProvisioningState_STATUS("Deleting")
	DataCollectionEndpoint_ProvisioningState_STATUS_Failed    = DataCollectionEndpoint_ProvisioningState_STATUS("Failed")
	DataCollectionEndpoint_ProvisioningState_STATUS_Succeeded = DataCollectionEndpoint_ProvisioningState_STATUS("Succeeded")
	DataCollectionEndpoint_ProvisioningState_STATUS_Updating  = DataCollectionEndpoint_ProvisioningState_STATUS("Updating")
)

// Mapping from string to DataCollectionEndpoint_ProvisioningState_STATUS
var dataCollectionEndpoint_ProvisioningState_STATUS_Values = map[string]DataCollectionEndpoint_ProvisioningState_STATUS{
	"canceled":  DataCollectionEndpoint_ProvisioningState_STATUS_Canceled,
	"creating":  DataCollectionEndpoint_ProvisioningState_STATUS_Creating,
	"deleting":  DataCollectionEndpoint_ProvisioningState_STATUS_Deleting,
	"failed":    DataCollectionEndpoint_ProvisioningState_STATUS_Failed,
	"succeeded": DataCollectionEndpoint_ProvisioningState_STATUS_Succeeded,
	"updating":  DataCollectionEndpoint_ProvisioningState_STATUS_Updating,
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type DataCollectionEndpointOperatorSpec 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_DataCollectionEndpointOperatorSpec populates our DataCollectionEndpointOperatorSpec from the provided source DataCollectionEndpointOperatorSpec
func (operator *DataCollectionEndpointOperatorSpec) AssignProperties_From_DataCollectionEndpointOperatorSpec(source *storage.DataCollectionEndpointOperatorSpec) 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_DataCollectionEndpointOperatorSpec populates the provided destination DataCollectionEndpointOperatorSpec from our DataCollectionEndpointOperatorSpec
func (operator *DataCollectionEndpointOperatorSpec) AssignProperties_To_DataCollectionEndpointOperatorSpec(destination *storage.DataCollectionEndpointOperatorSpec) 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 DataCollectionEndpointResource_Kind_STATUS string

const (
	DataCollectionEndpointResource_Kind_STATUS_Linux   = DataCollectionEndpointResource_Kind_STATUS("Linux")
	DataCollectionEndpointResource_Kind_STATUS_Windows = DataCollectionEndpointResource_Kind_STATUS("Windows")
)

// Mapping from string to DataCollectionEndpointResource_Kind_STATUS
var dataCollectionEndpointResource_Kind_STATUS_Values = map[string]DataCollectionEndpointResource_Kind_STATUS{
	"linux":   DataCollectionEndpointResource_Kind_STATUS_Linux,
	"windows": DataCollectionEndpointResource_Kind_STATUS_Windows,
}

type FailoverConfigurationSpec_STATUS struct {
	// ActiveLocation: Active location where data flow will occur.
	ActiveLocation *string `json:"activeLocation,omitempty"`

	// Locations: Locations that are configured for failover.
	Locations []LocationSpec_STATUS `json:"locations,omitempty"`
}

var _ genruntime.FromARMConverter = &FailoverConfigurationSpec_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

	// Locations
	if source.Locations != nil {
		locationList := make([]LocationSpec_STATUS, len(source.Locations))
		for locationIndex, locationItem := range source.Locations {
			var location LocationSpec_STATUS
			err := location.AssignProperties_From_LocationSpec_STATUS(&locationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_LocationSpec_STATUS() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		configuration.Locations = locationList
	} else {
		configuration.Locations = nil
	}

	// No error
	return nil
}

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

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

	// Locations
	if configuration.Locations != nil {
		locationList := make([]storage.LocationSpec_STATUS, len(configuration.Locations))
		for locationIndex, locationItem := range configuration.Locations {
			var location storage.LocationSpec_STATUS
			err := locationItem.AssignProperties_To_LocationSpec_STATUS(&location)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_LocationSpec_STATUS() to populate field Locations")
			}
			locationList[locationIndex] = location
		}
		destination.Locations = locationList
	} else {
		destination.Locations = nil
	}

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

	// No error
	return nil
}

// Definition of the endpoint used for ingesting logs.
type LogsIngestionEndpointSpec_STATUS struct {
	// Endpoint: The endpoint. This property is READ-ONLY.
	Endpoint *string `json:"endpoint,omitempty"`
}

var _ genruntime.FromARMConverter = &LogsIngestionEndpointSpec_STATUS{}

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

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

	// Set property "Endpoint":
	if typedInput.Endpoint != nil {
		endpoint1 := *typedInput.Endpoint
		endpoint.Endpoint = &endpoint1
	}

	// No error
	return nil
}

// AssignProperties_From_LogsIngestionEndpointSpec_STATUS populates our LogsIngestionEndpointSpec_STATUS from the provided source LogsIngestionEndpointSpec_STATUS
func (endpoint *LogsIngestionEndpointSpec_STATUS) AssignProperties_From_LogsIngestionEndpointSpec_STATUS(source *storage.LogsIngestionEndpointSpec_STATUS) error {

	// Endpoint
	endpoint.Endpoint = genruntime.ClonePointerToString(source.Endpoint)

	// No error
	return nil
}

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

	// Endpoint
	destination.Endpoint = genruntime.ClonePointerToString(endpoint.Endpoint)

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

	// No error
	return nil
}

// Managed service identity (system assigned and/or user assigned identities)
type ManagedServiceIdentity struct {
	// +kubebuilder:validation:Required
	// Type: Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
	Type                   *ManagedServiceIdentityType   `json:"type,omitempty"`
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagedServiceIdentity{}

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

	// Set property "Type":
	if identity.Type != nil {
		var temp string
		temp = string(*identity.Type)
		typeVar := arm.ManagedServiceIdentityType(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 *ManagedServiceIdentity) NewEmptyARMValue() genruntime.ARMResourceStatus {
	return &arm.ManagedServiceIdentity{}
}

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

	// Type
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, managedServiceIdentityType_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_ManagedServiceIdentity populates the provided destination ManagedServiceIdentity from our ManagedServiceIdentity
func (identity *ManagedServiceIdentity) AssignProperties_To_ManagedServiceIdentity(destination *storage.ManagedServiceIdentity) 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_ManagedServiceIdentity_STATUS populates our ManagedServiceIdentity from the provided source ManagedServiceIdentity_STATUS
func (identity *ManagedServiceIdentity) Initialize_From_ManagedServiceIdentity_STATUS(source *ManagedServiceIdentity_STATUS) error {

	// Type
	if source.Type != nil {
		typeVar := genruntime.ToEnum(string(*source.Type), managedServiceIdentityType_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
}

// Managed service identity (system assigned and/or user assigned identities)
type ManagedServiceIdentity_STATUS struct {
	// PrincipalId: The service principal ID of the system assigned identity. This property will only be provided for a system
	// assigned identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: The tenant ID of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	TenantId *string `json:"tenantId,omitempty"`

	// Type: Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
	Type                   *ManagedServiceIdentityType_STATUS     `json:"type,omitempty"`
	UserAssignedIdentities map[string]UserAssignedIdentity_STATUS `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagedServiceIdentity_STATUS{}

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

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (identity *ManagedServiceIdentity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.ManagedServiceIdentity_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.ManagedServiceIdentity_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 := ManagedServiceIdentityType_STATUS(temp)
		identity.Type = &typeVar
	}

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

	// No error
	return nil
}

// AssignProperties_From_ManagedServiceIdentity_STATUS populates our ManagedServiceIdentity_STATUS from the provided source ManagedServiceIdentity_STATUS
func (identity *ManagedServiceIdentity_STATUS) AssignProperties_From_ManagedServiceIdentity_STATUS(source *storage.ManagedServiceIdentity_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, managedServiceIdentityType_STATUS_Values)
		identity.Type = &typeTemp
	} else {
		identity.Type = nil
	}

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

	// No error
	return nil
}

// AssignProperties_To_ManagedServiceIdentity_STATUS populates the provided destination ManagedServiceIdentity_STATUS from our ManagedServiceIdentity_STATUS
func (identity *ManagedServiceIdentity_STATUS) AssignProperties_To_ManagedServiceIdentity_STATUS(destination *storage.ManagedServiceIdentity_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.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities {
			var userAssignedIdentity storage.UserAssignedIdentity_STATUS
			err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentity_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
}

// Metadata about the resource
type Metadata_STATUS struct {
	// ProvisionedBy: Azure offering managing this resource on-behalf-of customer.
	ProvisionedBy *string `json:"provisionedBy,omitempty"`

	// ProvisionedByImmutableId: Immutable Id of azure offering managing this resource on-behalf-of customer.
	ProvisionedByImmutableId *string `json:"provisionedByImmutableId,omitempty"`

	// ProvisionedByResourceId: Resource Id of azure offering managing this resource on-behalf-of customer.
	ProvisionedByResourceId *string `json:"provisionedByResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &Metadata_STATUS{}

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

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

	// Set property "ProvisionedBy":
	if typedInput.ProvisionedBy != nil {
		provisionedBy := *typedInput.ProvisionedBy
		metadata.ProvisionedBy = &provisionedBy
	}

	// Set property "ProvisionedByImmutableId":
	if typedInput.ProvisionedByImmutableId != nil {
		provisionedByImmutableId := *typedInput.ProvisionedByImmutableId
		metadata.ProvisionedByImmutableId = &provisionedByImmutableId
	}

	// Set property "ProvisionedByResourceId":
	if typedInput.ProvisionedByResourceId != nil {
		provisionedByResourceId := *typedInput.ProvisionedByResourceId
		metadata.ProvisionedByResourceId = &provisionedByResourceId
	}

	// No error
	return nil
}

// AssignProperties_From_Metadata_STATUS populates our Metadata_STATUS from the provided source Metadata_STATUS
func (metadata *Metadata_STATUS) AssignProperties_From_Metadata_STATUS(source *storage.Metadata_STATUS) error {

	// ProvisionedBy
	metadata.ProvisionedBy = genruntime.ClonePointerToString(source.ProvisionedBy)

	// ProvisionedByImmutableId
	metadata.ProvisionedByImmutableId = genruntime.ClonePointerToString(source.ProvisionedByImmutableId)

	// ProvisionedByResourceId
	metadata.ProvisionedByResourceId = genruntime.ClonePointerToString(source.ProvisionedByResourceId)

	// No error
	return nil
}

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

	// ProvisionedBy
	destination.ProvisionedBy = genruntime.ClonePointerToString(metadata.ProvisionedBy)

	// ProvisionedByImmutableId
	destination.ProvisionedByImmutableId = genruntime.ClonePointerToString(metadata.ProvisionedByImmutableId)

	// ProvisionedByResourceId
	destination.ProvisionedByResourceId = genruntime.ClonePointerToString(metadata.ProvisionedByResourceId)

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

	// No error
	return nil
}

// Definition of the endpoint used for ingesting metrics.
type MetricsIngestionEndpointSpec_STATUS struct {
	// Endpoint: The endpoint. This property is READ-ONLY.
	Endpoint *string `json:"endpoint,omitempty"`
}

var _ genruntime.FromARMConverter = &MetricsIngestionEndpointSpec_STATUS{}

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

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

	// Set property "Endpoint":
	if typedInput.Endpoint != nil {
		endpoint1 := *typedInput.Endpoint
		endpoint.Endpoint = &endpoint1
	}

	// No error
	return nil
}

// AssignProperties_From_MetricsIngestionEndpointSpec_STATUS populates our MetricsIngestionEndpointSpec_STATUS from the provided source MetricsIngestionEndpointSpec_STATUS
func (endpoint *MetricsIngestionEndpointSpec_STATUS) AssignProperties_From_MetricsIngestionEndpointSpec_STATUS(source *storage.MetricsIngestionEndpointSpec_STATUS) error {

	// Endpoint
	endpoint.Endpoint = genruntime.ClonePointerToString(source.Endpoint)

	// No error
	return nil
}

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

	// Endpoint
	destination.Endpoint = genruntime.ClonePointerToString(endpoint.Endpoint)

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

	// No error
	return nil
}

// Definition of the network rules.
type NetworkRuleSet struct {
	// PublicNetworkAccess: The configuration to set whether network access from public internet to the endpoints are allowed.
	PublicNetworkAccess *NetworkRuleSet_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
}

var _ genruntime.ARMTransformer = &NetworkRuleSet{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NetworkRuleSet populates our NetworkRuleSet from the provided source NetworkRuleSet
func (ruleSet *NetworkRuleSet) AssignProperties_From_NetworkRuleSet(source *storage.NetworkRuleSet) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_NetworkRuleSet_STATUS populates our NetworkRuleSet from the provided source NetworkRuleSet_STATUS
func (ruleSet *NetworkRuleSet) Initialize_From_NetworkRuleSet_STATUS(source *NetworkRuleSet_STATUS) error {

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

	// No error
	return nil
}

// Definition of the network rules.
type NetworkRuleSet_STATUS struct {
	// PublicNetworkAccess: The configuration to set whether network access from public internet to the endpoints are allowed.
	PublicNetworkAccess *NetworkRuleSet_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`
}

var _ genruntime.FromARMConverter = &NetworkRuleSet_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NetworkRuleSet_STATUS populates our NetworkRuleSet_STATUS from the provided source NetworkRuleSet_STATUS
func (ruleSet *NetworkRuleSet_STATUS) AssignProperties_From_NetworkRuleSet_STATUS(source *storage.NetworkRuleSet_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

type PrivateLinkScopedResource_STATUS struct {
	// ResourceId: The resourceId of the Azure Monitor Private Link Scope Scoped Resource through which this DCE is associated
	// with a Azure Monitor Private Link Scope.
	ResourceId *string `json:"resourceId,omitempty"`

	// ScopeId: The immutableId of the Azure Monitor Private Link Scope Resource to which the association is.
	ScopeId *string `json:"scopeId,omitempty"`
}

var _ genruntime.FromARMConverter = &PrivateLinkScopedResource_STATUS{}

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

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

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// 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 LocationSpec_STATUS struct {
	// Location: Name of location.
	Location *string `json:"location,omitempty"`

	// ProvisioningStatus: The resource provisioning state in this location.
	ProvisioningStatus *LocationSpec_ProvisioningStatus_STATUS `json:"provisioningStatus,omitempty"`
}

var _ genruntime.FromARMConverter = &LocationSpec_STATUS{}

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

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

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

	// Set property "ProvisioningStatus":
	if typedInput.ProvisioningStatus != nil {
		var temp string
		temp = string(*typedInput.ProvisioningStatus)
		provisioningStatus := LocationSpec_ProvisioningStatus_STATUS(temp)
		location.ProvisioningStatus = &provisioningStatus
	}

	// No error
	return nil
}

// AssignProperties_From_LocationSpec_STATUS populates our LocationSpec_STATUS from the provided source LocationSpec_STATUS
func (location *LocationSpec_STATUS) AssignProperties_From_LocationSpec_STATUS(source *storage.LocationSpec_STATUS) error {

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

	// ProvisioningStatus
	if source.ProvisioningStatus != nil {
		provisioningStatus := *source.ProvisioningStatus
		provisioningStatusTemp := genruntime.ToEnum(provisioningStatus, locationSpec_ProvisioningStatus_STATUS_Values)
		location.ProvisioningStatus = &provisioningStatusTemp
	} else {
		location.ProvisioningStatus = nil
	}

	// No error
	return nil
}

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

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

	// ProvisioningStatus
	if location.ProvisioningStatus != nil {
		provisioningStatus := string(*location.ProvisioningStatus)
		destination.ProvisioningStatus = &provisioningStatus
	} else {
		destination.ProvisioningStatus = nil
	}

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

	// No error
	return nil
}

// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned,UserAssigned","UserAssigned"}
type ManagedServiceIdentityType string

const (
	ManagedServiceIdentityType_None                       = ManagedServiceIdentityType("None")
	ManagedServiceIdentityType_SystemAssigned             = ManagedServiceIdentityType("SystemAssigned")
	ManagedServiceIdentityType_SystemAssignedUserAssigned = ManagedServiceIdentityType("SystemAssigned,UserAssigned")
	ManagedServiceIdentityType_UserAssigned               = ManagedServiceIdentityType("UserAssigned")
)

// Mapping from string to ManagedServiceIdentityType
var managedServiceIdentityType_Values = map[string]ManagedServiceIdentityType{
	"none":                        ManagedServiceIdentityType_None,
	"systemassigned":              ManagedServiceIdentityType_SystemAssigned,
	"systemassigned,userassigned": ManagedServiceIdentityType_SystemAssignedUserAssigned,
	"userassigned":                ManagedServiceIdentityType_UserAssigned,
}

// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
type ManagedServiceIdentityType_STATUS string

const (
	ManagedServiceIdentityType_STATUS_None                       = ManagedServiceIdentityType_STATUS("None")
	ManagedServiceIdentityType_STATUS_SystemAssigned             = ManagedServiceIdentityType_STATUS("SystemAssigned")
	ManagedServiceIdentityType_STATUS_SystemAssignedUserAssigned = ManagedServiceIdentityType_STATUS("SystemAssigned,UserAssigned")
	ManagedServiceIdentityType_STATUS_UserAssigned               = ManagedServiceIdentityType_STATUS("UserAssigned")
)

// Mapping from string to ManagedServiceIdentityType_STATUS
var managedServiceIdentityType_STATUS_Values = map[string]ManagedServiceIdentityType_STATUS{
	"none":                        ManagedServiceIdentityType_STATUS_None,
	"systemassigned":              ManagedServiceIdentityType_STATUS_SystemAssigned,
	"systemassigned,userassigned": ManagedServiceIdentityType_STATUS_SystemAssignedUserAssigned,
	"userassigned":                ManagedServiceIdentityType_STATUS_UserAssigned,
}

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

const (
	NetworkRuleSet_PublicNetworkAccess_Disabled           = NetworkRuleSet_PublicNetworkAccess("Disabled")
	NetworkRuleSet_PublicNetworkAccess_Enabled            = NetworkRuleSet_PublicNetworkAccess("Enabled")
	NetworkRuleSet_PublicNetworkAccess_SecuredByPerimeter = NetworkRuleSet_PublicNetworkAccess("SecuredByPerimeter")
)

// Mapping from string to NetworkRuleSet_PublicNetworkAccess
var networkRuleSet_PublicNetworkAccess_Values = map[string]NetworkRuleSet_PublicNetworkAccess{
	"disabled":           NetworkRuleSet_PublicNetworkAccess_Disabled,
	"enabled":            NetworkRuleSet_PublicNetworkAccess_Enabled,
	"securedbyperimeter": NetworkRuleSet_PublicNetworkAccess_SecuredByPerimeter,
}

type NetworkRuleSet_PublicNetworkAccess_STATUS string

const (
	NetworkRuleSet_PublicNetworkAccess_STATUS_Disabled           = NetworkRuleSet_PublicNetworkAccess_STATUS("Disabled")
	NetworkRuleSet_PublicNetworkAccess_STATUS_Enabled            = NetworkRuleSet_PublicNetworkAccess_STATUS("Enabled")
	NetworkRuleSet_PublicNetworkAccess_STATUS_SecuredByPerimeter = NetworkRuleSet_PublicNetworkAccess_STATUS("SecuredByPerimeter")
)

// Mapping from string to NetworkRuleSet_PublicNetworkAccess_STATUS
var networkRuleSet_PublicNetworkAccess_STATUS_Values = map[string]NetworkRuleSet_PublicNetworkAccess_STATUS{
	"disabled":           NetworkRuleSet_PublicNetworkAccess_STATUS_Disabled,
	"enabled":            NetworkRuleSet_PublicNetworkAccess_STATUS_Enabled,
	"securedbyperimeter": NetworkRuleSet_PublicNetworkAccess_STATUS_SecuredByPerimeter,
}

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

// User assigned identity properties
type UserAssignedIdentity_STATUS struct {
	// ClientId: The client ID of the assigned identity.
	ClientId *string `json:"clientId,omitempty"`

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

var _ genruntime.FromARMConverter = &UserAssignedIdentity_STATUS{}

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

// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object
func (identity *UserAssignedIdentity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error {
	typedInput, ok := armInput.(arm.UserAssignedIdentity_STATUS)
	if !ok {
		return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.UserAssignedIdentity_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_UserAssignedIdentity_STATUS populates our UserAssignedIdentity_STATUS from the provided source UserAssignedIdentity_STATUS
func (identity *UserAssignedIdentity_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *storage.UserAssignedIdentity_STATUS) error {

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

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

	// No error
	return nil
}

// AssignProperties_To_UserAssignedIdentity_STATUS populates the provided destination UserAssignedIdentity_STATUS from our UserAssignedIdentity_STATUS
func (identity *UserAssignedIdentity_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *storage.UserAssignedIdentity_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
}

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

type LocationSpec_ProvisioningStatus_STATUS string

const (
	LocationSpec_ProvisioningStatus_STATUS_Canceled  = LocationSpec_ProvisioningStatus_STATUS("Canceled")
	LocationSpec_ProvisioningStatus_STATUS_Creating  = LocationSpec_ProvisioningStatus_STATUS("Creating")
	LocationSpec_ProvisioningStatus_STATUS_Deleting  = LocationSpec_ProvisioningStatus_STATUS("Deleting")
	LocationSpec_ProvisioningStatus_STATUS_Failed    = LocationSpec_ProvisioningStatus_STATUS("Failed")
	LocationSpec_ProvisioningStatus_STATUS_Succeeded = LocationSpec_ProvisioningStatus_STATUS("Succeeded")
	LocationSpec_ProvisioningStatus_STATUS_Updating  = LocationSpec_ProvisioningStatus_STATUS("Updating")
)

// Mapping from string to LocationSpec_ProvisioningStatus_STATUS
var locationSpec_ProvisioningStatus_STATUS_Values = map[string]LocationSpec_ProvisioningStatus_STATUS{
	"canceled":  LocationSpec_ProvisioningStatus_STATUS_Canceled,
	"creating":  LocationSpec_ProvisioningStatus_STATUS_Creating,
	"deleting":  LocationSpec_ProvisioningStatus_STATUS_Deleting,
	"failed":    LocationSpec_ProvisioningStatus_STATUS_Failed,
	"succeeded": LocationSpec_ProvisioningStatus_STATUS_Succeeded,
	"updating":  LocationSpec_ProvisioningStatus_STATUS_Updating,
}

func init() {
	SchemeBuilder.Register(&DataCollectionEndpoint{}, &DataCollectionEndpointList{})
}
