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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/redhatopenshift/v1api20231122/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/redhatopenshift/v1api20231122/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,redhatopenshift}
// +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: /redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/redhatopenshift.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}
type OpenShiftCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              OpenShiftCluster_Spec   `json:"spec,omitempty"`
	Status            OpenShiftCluster_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &OpenShiftCluster{}

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

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

var _ conversion.Convertible = &OpenShiftCluster{}

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

	return cluster.AssignProperties_From_OpenShiftCluster(source)
}

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

	return cluster.AssignProperties_To_OpenShiftCluster(destination)
}

var _ configmaps.Exporter = &OpenShiftCluster{}

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

var _ secrets.Exporter = &OpenShiftCluster{}

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

var _ genruntime.ImportableResource = &OpenShiftCluster{}

// InitializeSpec initializes the spec for this resource from the given status
func (cluster *OpenShiftCluster) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*OpenShiftCluster_STATUS); ok {
		return cluster.Spec.Initialize_From_OpenShiftCluster_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &OpenShiftCluster{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.RedHatOpenShift/openShiftClusters"
func (cluster *OpenShiftCluster) GetType() string {
	return "Microsoft.RedHatOpenShift/openShiftClusters"
}

// NewEmptyStatus returns a new empty (blank) status
func (cluster *OpenShiftCluster) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &OpenShiftCluster_STATUS{}
}

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

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

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

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

	cluster.Status = st
	return nil
}

// AssignProperties_From_OpenShiftCluster populates our OpenShiftCluster from the provided source OpenShiftCluster
func (cluster *OpenShiftCluster) AssignProperties_From_OpenShiftCluster(source *storage.OpenShiftCluster) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_OpenShiftCluster populates the provided destination OpenShiftCluster from our OpenShiftCluster
func (cluster *OpenShiftCluster) AssignProperties_To_OpenShiftCluster(destination *storage.OpenShiftCluster) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /redhatopenshift/resource-manager/Microsoft.RedHatOpenShift/openshiftclusters/stable/2023-11-22/redhatopenshift.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}
type OpenShiftClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []OpenShiftCluster `json:"items"`
}

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

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

type OpenShiftCluster_Spec struct {
	// ApiserverProfile: The cluster API server profile.
	ApiserverProfile *APIServerProfile `json:"apiserverProfile,omitempty"`

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

	// ClusterProfile: The cluster profile.
	ClusterProfile *ClusterProfile `json:"clusterProfile,omitempty"`

	// IngressProfiles: The cluster ingress profiles.
	IngressProfiles []IngressProfile `json:"ingressProfiles,omitempty"`

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

	// MasterProfile: The cluster master profile.
	MasterProfile *MasterProfile `json:"masterProfile,omitempty"`

	// NetworkProfile: The cluster network profile.
	NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"`

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

	// ServicePrincipalProfile: The cluster service principal profile.
	ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"`

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

	// WorkerProfiles: The cluster worker profiles.
	WorkerProfiles []WorkerProfile `json:"workerProfiles,omitempty"`
}

var _ genruntime.ARMTransformer = &OpenShiftCluster_Spec{}

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

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

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

	// Set property "Properties":
	if cluster.ApiserverProfile != nil ||
		cluster.ClusterProfile != nil ||
		cluster.IngressProfiles != nil ||
		cluster.MasterProfile != nil ||
		cluster.NetworkProfile != nil ||
		cluster.ServicePrincipalProfile != nil ||
		cluster.WorkerProfiles != nil {
		result.Properties = &arm.OpenShiftClusterProperties{}
	}
	if cluster.ApiserverProfile != nil {
		apiserverProfile_ARM, err := cluster.ApiserverProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		apiserverProfile := *apiserverProfile_ARM.(*arm.APIServerProfile)
		result.Properties.ApiserverProfile = &apiserverProfile
	}
	if cluster.ClusterProfile != nil {
		clusterProfile_ARM, err := cluster.ClusterProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		clusterProfile := *clusterProfile_ARM.(*arm.ClusterProfile)
		result.Properties.ClusterProfile = &clusterProfile
	}
	for _, item := range cluster.IngressProfiles {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.IngressProfiles = append(result.Properties.IngressProfiles, *item_ARM.(*arm.IngressProfile))
	}
	if cluster.MasterProfile != nil {
		masterProfile_ARM, err := cluster.MasterProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		masterProfile := *masterProfile_ARM.(*arm.MasterProfile)
		result.Properties.MasterProfile = &masterProfile
	}
	if cluster.NetworkProfile != nil {
		networkProfile_ARM, err := cluster.NetworkProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		networkProfile := *networkProfile_ARM.(*arm.NetworkProfile)
		result.Properties.NetworkProfile = &networkProfile
	}
	if cluster.ServicePrincipalProfile != nil {
		servicePrincipalProfile_ARM, err := cluster.ServicePrincipalProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		servicePrincipalProfile := *servicePrincipalProfile_ARM.(*arm.ServicePrincipalProfile)
		result.Properties.ServicePrincipalProfile = &servicePrincipalProfile
	}
	for _, item := range cluster.WorkerProfiles {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.WorkerProfiles = append(result.Properties.WorkerProfiles, *item_ARM.(*arm.WorkerProfile))
	}

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

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

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

	// Set property "ApiserverProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiserverProfile != nil {
			var apiserverProfile1 APIServerProfile
			err := apiserverProfile1.PopulateFromARM(owner, *typedInput.Properties.ApiserverProfile)
			if err != nil {
				return err
			}
			apiserverProfile := apiserverProfile1
			cluster.ApiserverProfile = &apiserverProfile
		}
	}

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

	// Set property "ClusterProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ClusterProfile != nil {
			var clusterProfile1 ClusterProfile
			err := clusterProfile1.PopulateFromARM(owner, *typedInput.Properties.ClusterProfile)
			if err != nil {
				return err
			}
			clusterProfile := clusterProfile1
			cluster.ClusterProfile = &clusterProfile
		}
	}

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

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

	// Set property "MasterProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MasterProfile != nil {
			var masterProfile1 MasterProfile
			err := masterProfile1.PopulateFromARM(owner, *typedInput.Properties.MasterProfile)
			if err != nil {
				return err
			}
			masterProfile := masterProfile1
			cluster.MasterProfile = &masterProfile
		}
	}

	// Set property "NetworkProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkProfile != nil {
			var networkProfile1 NetworkProfile
			err := networkProfile1.PopulateFromARM(owner, *typedInput.Properties.NetworkProfile)
			if err != nil {
				return err
			}
			networkProfile := networkProfile1
			cluster.NetworkProfile = &networkProfile
		}
	}

	// no assignment for property "OperatorSpec"

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

	// Set property "ServicePrincipalProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServicePrincipalProfile != nil {
			var servicePrincipalProfile1 ServicePrincipalProfile
			err := servicePrincipalProfile1.PopulateFromARM(owner, *typedInput.Properties.ServicePrincipalProfile)
			if err != nil {
				return err
			}
			servicePrincipalProfile := servicePrincipalProfile1
			cluster.ServicePrincipalProfile = &servicePrincipalProfile
		}
	}

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &OpenShiftCluster_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.OpenShiftCluster_Spec{}
	err := cluster.AssignProperties_To_OpenShiftCluster_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_OpenShiftCluster_Spec populates our OpenShiftCluster_Spec from the provided source OpenShiftCluster_Spec
func (cluster *OpenShiftCluster_Spec) AssignProperties_From_OpenShiftCluster_Spec(source *storage.OpenShiftCluster_Spec) error {

	// ApiserverProfile
	if source.ApiserverProfile != nil {
		var apiserverProfile APIServerProfile
		err := apiserverProfile.AssignProperties_From_APIServerProfile(source.ApiserverProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_APIServerProfile() to populate field ApiserverProfile")
		}
		cluster.ApiserverProfile = &apiserverProfile
	} else {
		cluster.ApiserverProfile = nil
	}

	// AzureName
	cluster.AzureName = source.AzureName

	// ClusterProfile
	if source.ClusterProfile != nil {
		var clusterProfile ClusterProfile
		err := clusterProfile.AssignProperties_From_ClusterProfile(source.ClusterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ClusterProfile() to populate field ClusterProfile")
		}
		cluster.ClusterProfile = &clusterProfile
	} else {
		cluster.ClusterProfile = nil
	}

	// IngressProfiles
	if source.IngressProfiles != nil {
		ingressProfileList := make([]IngressProfile, len(source.IngressProfiles))
		for ingressProfileIndex, ingressProfileItem := range source.IngressProfiles {
			var ingressProfile IngressProfile
			err := ingressProfile.AssignProperties_From_IngressProfile(&ingressProfileItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IngressProfile() to populate field IngressProfiles")
			}
			ingressProfileList[ingressProfileIndex] = ingressProfile
		}
		cluster.IngressProfiles = ingressProfileList
	} else {
		cluster.IngressProfiles = nil
	}

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

	// MasterProfile
	if source.MasterProfile != nil {
		var masterProfile MasterProfile
		err := masterProfile.AssignProperties_From_MasterProfile(source.MasterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MasterProfile() to populate field MasterProfile")
		}
		cluster.MasterProfile = &masterProfile
	} else {
		cluster.MasterProfile = nil
	}

	// NetworkProfile
	if source.NetworkProfile != nil {
		var networkProfile NetworkProfile
		err := networkProfile.AssignProperties_From_NetworkProfile(source.NetworkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_NetworkProfile() to populate field NetworkProfile")
		}
		cluster.NetworkProfile = &networkProfile
	} else {
		cluster.NetworkProfile = nil
	}

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

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

	// ServicePrincipalProfile
	if source.ServicePrincipalProfile != nil {
		var servicePrincipalProfile ServicePrincipalProfile
		err := servicePrincipalProfile.AssignProperties_From_ServicePrincipalProfile(source.ServicePrincipalProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ServicePrincipalProfile() to populate field ServicePrincipalProfile")
		}
		cluster.ServicePrincipalProfile = &servicePrincipalProfile
	} else {
		cluster.ServicePrincipalProfile = nil
	}

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

	// WorkerProfiles
	if source.WorkerProfiles != nil {
		workerProfileList := make([]WorkerProfile, len(source.WorkerProfiles))
		for workerProfileIndex, workerProfileItem := range source.WorkerProfiles {
			var workerProfile WorkerProfile
			err := workerProfile.AssignProperties_From_WorkerProfile(&workerProfileItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WorkerProfile() to populate field WorkerProfiles")
			}
			workerProfileList[workerProfileIndex] = workerProfile
		}
		cluster.WorkerProfiles = workerProfileList
	} else {
		cluster.WorkerProfiles = nil
	}

	// No error
	return nil
}

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

	// ApiserverProfile
	if cluster.ApiserverProfile != nil {
		var apiserverProfile storage.APIServerProfile
		err := cluster.ApiserverProfile.AssignProperties_To_APIServerProfile(&apiserverProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_APIServerProfile() to populate field ApiserverProfile")
		}
		destination.ApiserverProfile = &apiserverProfile
	} else {
		destination.ApiserverProfile = nil
	}

	// AzureName
	destination.AzureName = cluster.AzureName

	// ClusterProfile
	if cluster.ClusterProfile != nil {
		var clusterProfile storage.ClusterProfile
		err := cluster.ClusterProfile.AssignProperties_To_ClusterProfile(&clusterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ClusterProfile() to populate field ClusterProfile")
		}
		destination.ClusterProfile = &clusterProfile
	} else {
		destination.ClusterProfile = nil
	}

	// IngressProfiles
	if cluster.IngressProfiles != nil {
		ingressProfileList := make([]storage.IngressProfile, len(cluster.IngressProfiles))
		for ingressProfileIndex, ingressProfileItem := range cluster.IngressProfiles {
			var ingressProfile storage.IngressProfile
			err := ingressProfileItem.AssignProperties_To_IngressProfile(&ingressProfile)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IngressProfile() to populate field IngressProfiles")
			}
			ingressProfileList[ingressProfileIndex] = ingressProfile
		}
		destination.IngressProfiles = ingressProfileList
	} else {
		destination.IngressProfiles = nil
	}

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

	// MasterProfile
	if cluster.MasterProfile != nil {
		var masterProfile storage.MasterProfile
		err := cluster.MasterProfile.AssignProperties_To_MasterProfile(&masterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MasterProfile() to populate field MasterProfile")
		}
		destination.MasterProfile = &masterProfile
	} else {
		destination.MasterProfile = nil
	}

	// NetworkProfile
	if cluster.NetworkProfile != nil {
		var networkProfile storage.NetworkProfile
		err := cluster.NetworkProfile.AssignProperties_To_NetworkProfile(&networkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_NetworkProfile() to populate field NetworkProfile")
		}
		destination.NetworkProfile = &networkProfile
	} else {
		destination.NetworkProfile = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = cluster.OriginalVersion()

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

	// ServicePrincipalProfile
	if cluster.ServicePrincipalProfile != nil {
		var servicePrincipalProfile storage.ServicePrincipalProfile
		err := cluster.ServicePrincipalProfile.AssignProperties_To_ServicePrincipalProfile(&servicePrincipalProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ServicePrincipalProfile() to populate field ServicePrincipalProfile")
		}
		destination.ServicePrincipalProfile = &servicePrincipalProfile
	} else {
		destination.ServicePrincipalProfile = nil
	}

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

	// WorkerProfiles
	if cluster.WorkerProfiles != nil {
		workerProfileList := make([]storage.WorkerProfile, len(cluster.WorkerProfiles))
		for workerProfileIndex, workerProfileItem := range cluster.WorkerProfiles {
			var workerProfile storage.WorkerProfile
			err := workerProfileItem.AssignProperties_To_WorkerProfile(&workerProfile)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WorkerProfile() to populate field WorkerProfiles")
			}
			workerProfileList[workerProfileIndex] = workerProfile
		}
		destination.WorkerProfiles = workerProfileList
	} else {
		destination.WorkerProfiles = nil
	}

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

	// No error
	return nil
}

// Initialize_From_OpenShiftCluster_STATUS populates our OpenShiftCluster_Spec from the provided source OpenShiftCluster_STATUS
func (cluster *OpenShiftCluster_Spec) Initialize_From_OpenShiftCluster_STATUS(source *OpenShiftCluster_STATUS) error {

	// ApiserverProfile
	if source.ApiserverProfile != nil {
		var apiserverProfile APIServerProfile
		err := apiserverProfile.Initialize_From_APIServerProfile_STATUS(source.ApiserverProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_APIServerProfile_STATUS() to populate field ApiserverProfile")
		}
		cluster.ApiserverProfile = &apiserverProfile
	} else {
		cluster.ApiserverProfile = nil
	}

	// ClusterProfile
	if source.ClusterProfile != nil {
		var clusterProfile ClusterProfile
		err := clusterProfile.Initialize_From_ClusterProfile_STATUS(source.ClusterProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ClusterProfile_STATUS() to populate field ClusterProfile")
		}
		cluster.ClusterProfile = &clusterProfile
	} else {
		cluster.ClusterProfile = nil
	}

	// IngressProfiles
	if source.IngressProfiles != nil {
		ingressProfileList := make([]IngressProfile, len(source.IngressProfiles))
		for ingressProfileIndex, ingressProfileItem := range source.IngressProfiles {
			var ingressProfile IngressProfile
			err := ingressProfile.Initialize_From_IngressProfile_STATUS(&ingressProfileItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_IngressProfile_STATUS() to populate field IngressProfiles")
			}
			ingressProfileList[ingressProfileIndex] = ingressProfile
		}
		cluster.IngressProfiles = ingressProfileList
	} else {
		cluster.IngressProfiles = nil
	}

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

	// MasterProfile
	if source.MasterProfile != nil {
		var masterProfile MasterProfile
		err := masterProfile.Initialize_From_MasterProfile_STATUS(source.MasterProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_MasterProfile_STATUS() to populate field MasterProfile")
		}
		cluster.MasterProfile = &masterProfile
	} else {
		cluster.MasterProfile = nil
	}

	// NetworkProfile
	if source.NetworkProfile != nil {
		var networkProfile NetworkProfile
		err := networkProfile.Initialize_From_NetworkProfile_STATUS(source.NetworkProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_NetworkProfile_STATUS() to populate field NetworkProfile")
		}
		cluster.NetworkProfile = &networkProfile
	} else {
		cluster.NetworkProfile = nil
	}

	// ServicePrincipalProfile
	if source.ServicePrincipalProfile != nil {
		var servicePrincipalProfile ServicePrincipalProfile
		err := servicePrincipalProfile.Initialize_From_ServicePrincipalProfile_STATUS(source.ServicePrincipalProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ServicePrincipalProfile_STATUS() to populate field ServicePrincipalProfile")
		}
		cluster.ServicePrincipalProfile = &servicePrincipalProfile
	} else {
		cluster.ServicePrincipalProfile = nil
	}

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

	// WorkerProfiles
	if source.WorkerProfiles != nil {
		workerProfileList := make([]WorkerProfile, len(source.WorkerProfiles))
		for workerProfileIndex, workerProfileItem := range source.WorkerProfiles {
			var workerProfile WorkerProfile
			err := workerProfile.Initialize_From_WorkerProfile_STATUS(&workerProfileItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_WorkerProfile_STATUS() to populate field WorkerProfiles")
			}
			workerProfileList[workerProfileIndex] = workerProfile
		}
		cluster.WorkerProfiles = workerProfileList
	} else {
		cluster.WorkerProfiles = nil
	}

	// No error
	return nil
}

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

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

// OpenShiftCluster represents an Azure Red Hat OpenShift cluster.
type OpenShiftCluster_STATUS struct {
	// ApiserverProfile: The cluster API server profile.
	ApiserverProfile *APIServerProfile_STATUS `json:"apiserverProfile,omitempty"`

	// ClusterProfile: The cluster profile.
	ClusterProfile *ClusterProfile_STATUS `json:"clusterProfile,omitempty"`

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

	// ConsoleProfile: The console profile.
	ConsoleProfile *ConsoleProfile_STATUS `json:"consoleProfile,omitempty"`

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

	// IngressProfiles: The cluster ingress profiles.
	IngressProfiles []IngressProfile_STATUS `json:"ingressProfiles,omitempty"`

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

	// MasterProfile: The cluster master profile.
	MasterProfile *MasterProfile_STATUS `json:"masterProfile,omitempty"`

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

	// NetworkProfile: The cluster network profile.
	NetworkProfile *NetworkProfile_STATUS `json:"networkProfile,omitempty"`

	// ProvisioningState: The cluster provisioning state.
	ProvisioningState *ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// ServicePrincipalProfile: The cluster service principal profile.
	ServicePrincipalProfile *ServicePrincipalProfile_STATUS `json:"servicePrincipalProfile,omitempty"`

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

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

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

	// WorkerProfiles: The cluster worker profiles.
	WorkerProfiles []WorkerProfile_STATUS `json:"workerProfiles,omitempty"`

	// WorkerProfilesStatus: The cluster worker profiles status.
	WorkerProfilesStatus []WorkerProfile_STATUS `json:"workerProfilesStatus,omitempty"`
}

var _ genruntime.ConvertibleStatus = &OpenShiftCluster_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.OpenShiftCluster_STATUS{}
	err := cluster.AssignProperties_To_OpenShiftCluster_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 = &OpenShiftCluster_STATUS{}

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

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

	// Set property "ApiserverProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiserverProfile != nil {
			var apiserverProfile1 APIServerProfile_STATUS
			err := apiserverProfile1.PopulateFromARM(owner, *typedInput.Properties.ApiserverProfile)
			if err != nil {
				return err
			}
			apiserverProfile := apiserverProfile1
			cluster.ApiserverProfile = &apiserverProfile
		}
	}

	// Set property "ClusterProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ClusterProfile != nil {
			var clusterProfile1 ClusterProfile_STATUS
			err := clusterProfile1.PopulateFromARM(owner, *typedInput.Properties.ClusterProfile)
			if err != nil {
				return err
			}
			clusterProfile := clusterProfile1
			cluster.ClusterProfile = &clusterProfile
		}
	}

	// no assignment for property "Conditions"

	// Set property "ConsoleProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConsoleProfile != nil {
			var consoleProfile1 ConsoleProfile_STATUS
			err := consoleProfile1.PopulateFromARM(owner, *typedInput.Properties.ConsoleProfile)
			if err != nil {
				return err
			}
			consoleProfile := consoleProfile1
			cluster.ConsoleProfile = &consoleProfile
		}
	}

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

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

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

	// Set property "MasterProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.MasterProfile != nil {
			var masterProfile1 MasterProfile_STATUS
			err := masterProfile1.PopulateFromARM(owner, *typedInput.Properties.MasterProfile)
			if err != nil {
				return err
			}
			masterProfile := masterProfile1
			cluster.MasterProfile = &masterProfile
		}
	}

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

	// Set property "NetworkProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NetworkProfile != nil {
			var networkProfile1 NetworkProfile_STATUS
			err := networkProfile1.PopulateFromARM(owner, *typedInput.Properties.NetworkProfile)
			if err != nil {
				return err
			}
			networkProfile := networkProfile1
			cluster.NetworkProfile = &networkProfile
		}
	}

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

	// Set property "ServicePrincipalProfile":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ServicePrincipalProfile != nil {
			var servicePrincipalProfile1 ServicePrincipalProfile_STATUS
			err := servicePrincipalProfile1.PopulateFromARM(owner, *typedInput.Properties.ServicePrincipalProfile)
			if err != nil {
				return err
			}
			servicePrincipalProfile := servicePrincipalProfile1
			cluster.ServicePrincipalProfile = &servicePrincipalProfile
		}
	}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_OpenShiftCluster_STATUS populates our OpenShiftCluster_STATUS from the provided source OpenShiftCluster_STATUS
func (cluster *OpenShiftCluster_STATUS) AssignProperties_From_OpenShiftCluster_STATUS(source *storage.OpenShiftCluster_STATUS) error {

	// ApiserverProfile
	if source.ApiserverProfile != nil {
		var apiserverProfile APIServerProfile_STATUS
		err := apiserverProfile.AssignProperties_From_APIServerProfile_STATUS(source.ApiserverProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_APIServerProfile_STATUS() to populate field ApiserverProfile")
		}
		cluster.ApiserverProfile = &apiserverProfile
	} else {
		cluster.ApiserverProfile = nil
	}

	// ClusterProfile
	if source.ClusterProfile != nil {
		var clusterProfile ClusterProfile_STATUS
		err := clusterProfile.AssignProperties_From_ClusterProfile_STATUS(source.ClusterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ClusterProfile_STATUS() to populate field ClusterProfile")
		}
		cluster.ClusterProfile = &clusterProfile
	} else {
		cluster.ClusterProfile = nil
	}

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

	// ConsoleProfile
	if source.ConsoleProfile != nil {
		var consoleProfile ConsoleProfile_STATUS
		err := consoleProfile.AssignProperties_From_ConsoleProfile_STATUS(source.ConsoleProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConsoleProfile_STATUS() to populate field ConsoleProfile")
		}
		cluster.ConsoleProfile = &consoleProfile
	} else {
		cluster.ConsoleProfile = nil
	}

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

	// IngressProfiles
	if source.IngressProfiles != nil {
		ingressProfileList := make([]IngressProfile_STATUS, len(source.IngressProfiles))
		for ingressProfileIndex, ingressProfileItem := range source.IngressProfiles {
			var ingressProfile IngressProfile_STATUS
			err := ingressProfile.AssignProperties_From_IngressProfile_STATUS(&ingressProfileItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_IngressProfile_STATUS() to populate field IngressProfiles")
			}
			ingressProfileList[ingressProfileIndex] = ingressProfile
		}
		cluster.IngressProfiles = ingressProfileList
	} else {
		cluster.IngressProfiles = nil
	}

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

	// MasterProfile
	if source.MasterProfile != nil {
		var masterProfile MasterProfile_STATUS
		err := masterProfile.AssignProperties_From_MasterProfile_STATUS(source.MasterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_MasterProfile_STATUS() to populate field MasterProfile")
		}
		cluster.MasterProfile = &masterProfile
	} else {
		cluster.MasterProfile = nil
	}

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

	// NetworkProfile
	if source.NetworkProfile != nil {
		var networkProfile NetworkProfile_STATUS
		err := networkProfile.AssignProperties_From_NetworkProfile_STATUS(source.NetworkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_NetworkProfile_STATUS() to populate field NetworkProfile")
		}
		cluster.NetworkProfile = &networkProfile
	} else {
		cluster.NetworkProfile = nil
	}

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

	// ServicePrincipalProfile
	if source.ServicePrincipalProfile != nil {
		var servicePrincipalProfile ServicePrincipalProfile_STATUS
		err := servicePrincipalProfile.AssignProperties_From_ServicePrincipalProfile_STATUS(source.ServicePrincipalProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ServicePrincipalProfile_STATUS() to populate field ServicePrincipalProfile")
		}
		cluster.ServicePrincipalProfile = &servicePrincipalProfile
	} else {
		cluster.ServicePrincipalProfile = 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")
		}
		cluster.SystemData = &systemDatum
	} else {
		cluster.SystemData = nil
	}

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

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

	// WorkerProfiles
	if source.WorkerProfiles != nil {
		workerProfileList := make([]WorkerProfile_STATUS, len(source.WorkerProfiles))
		for workerProfileIndex, workerProfileItem := range source.WorkerProfiles {
			var workerProfile WorkerProfile_STATUS
			err := workerProfile.AssignProperties_From_WorkerProfile_STATUS(&workerProfileItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WorkerProfile_STATUS() to populate field WorkerProfiles")
			}
			workerProfileList[workerProfileIndex] = workerProfile
		}
		cluster.WorkerProfiles = workerProfileList
	} else {
		cluster.WorkerProfiles = nil
	}

	// WorkerProfilesStatus
	if source.WorkerProfilesStatus != nil {
		workerProfilesStatusList := make([]WorkerProfile_STATUS, len(source.WorkerProfilesStatus))
		for workerProfilesStatusIndex, workerProfilesStatusItem := range source.WorkerProfilesStatus {
			var workerProfilesStatus WorkerProfile_STATUS
			err := workerProfilesStatus.AssignProperties_From_WorkerProfile_STATUS(&workerProfilesStatusItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WorkerProfile_STATUS() to populate field WorkerProfilesStatus")
			}
			workerProfilesStatusList[workerProfilesStatusIndex] = workerProfilesStatus
		}
		cluster.WorkerProfilesStatus = workerProfilesStatusList
	} else {
		cluster.WorkerProfilesStatus = nil
	}

	// No error
	return nil
}

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

	// ApiserverProfile
	if cluster.ApiserverProfile != nil {
		var apiserverProfile storage.APIServerProfile_STATUS
		err := cluster.ApiserverProfile.AssignProperties_To_APIServerProfile_STATUS(&apiserverProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_APIServerProfile_STATUS() to populate field ApiserverProfile")
		}
		destination.ApiserverProfile = &apiserverProfile
	} else {
		destination.ApiserverProfile = nil
	}

	// ClusterProfile
	if cluster.ClusterProfile != nil {
		var clusterProfile storage.ClusterProfile_STATUS
		err := cluster.ClusterProfile.AssignProperties_To_ClusterProfile_STATUS(&clusterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ClusterProfile_STATUS() to populate field ClusterProfile")
		}
		destination.ClusterProfile = &clusterProfile
	} else {
		destination.ClusterProfile = nil
	}

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

	// ConsoleProfile
	if cluster.ConsoleProfile != nil {
		var consoleProfile storage.ConsoleProfile_STATUS
		err := cluster.ConsoleProfile.AssignProperties_To_ConsoleProfile_STATUS(&consoleProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConsoleProfile_STATUS() to populate field ConsoleProfile")
		}
		destination.ConsoleProfile = &consoleProfile
	} else {
		destination.ConsoleProfile = nil
	}

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

	// IngressProfiles
	if cluster.IngressProfiles != nil {
		ingressProfileList := make([]storage.IngressProfile_STATUS, len(cluster.IngressProfiles))
		for ingressProfileIndex, ingressProfileItem := range cluster.IngressProfiles {
			var ingressProfile storage.IngressProfile_STATUS
			err := ingressProfileItem.AssignProperties_To_IngressProfile_STATUS(&ingressProfile)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_IngressProfile_STATUS() to populate field IngressProfiles")
			}
			ingressProfileList[ingressProfileIndex] = ingressProfile
		}
		destination.IngressProfiles = ingressProfileList
	} else {
		destination.IngressProfiles = nil
	}

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

	// MasterProfile
	if cluster.MasterProfile != nil {
		var masterProfile storage.MasterProfile_STATUS
		err := cluster.MasterProfile.AssignProperties_To_MasterProfile_STATUS(&masterProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_MasterProfile_STATUS() to populate field MasterProfile")
		}
		destination.MasterProfile = &masterProfile
	} else {
		destination.MasterProfile = nil
	}

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

	// NetworkProfile
	if cluster.NetworkProfile != nil {
		var networkProfile storage.NetworkProfile_STATUS
		err := cluster.NetworkProfile.AssignProperties_To_NetworkProfile_STATUS(&networkProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_NetworkProfile_STATUS() to populate field NetworkProfile")
		}
		destination.NetworkProfile = &networkProfile
	} else {
		destination.NetworkProfile = nil
	}

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

	// ServicePrincipalProfile
	if cluster.ServicePrincipalProfile != nil {
		var servicePrincipalProfile storage.ServicePrincipalProfile_STATUS
		err := cluster.ServicePrincipalProfile.AssignProperties_To_ServicePrincipalProfile_STATUS(&servicePrincipalProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ServicePrincipalProfile_STATUS() to populate field ServicePrincipalProfile")
		}
		destination.ServicePrincipalProfile = &servicePrincipalProfile
	} else {
		destination.ServicePrincipalProfile = nil
	}

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

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

	// WorkerProfiles
	if cluster.WorkerProfiles != nil {
		workerProfileList := make([]storage.WorkerProfile_STATUS, len(cluster.WorkerProfiles))
		for workerProfileIndex, workerProfileItem := range cluster.WorkerProfiles {
			var workerProfile storage.WorkerProfile_STATUS
			err := workerProfileItem.AssignProperties_To_WorkerProfile_STATUS(&workerProfile)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WorkerProfile_STATUS() to populate field WorkerProfiles")
			}
			workerProfileList[workerProfileIndex] = workerProfile
		}
		destination.WorkerProfiles = workerProfileList
	} else {
		destination.WorkerProfiles = nil
	}

	// WorkerProfilesStatus
	if cluster.WorkerProfilesStatus != nil {
		workerProfilesStatusList := make([]storage.WorkerProfile_STATUS, len(cluster.WorkerProfilesStatus))
		for workerProfilesStatusIndex, workerProfilesStatusItem := range cluster.WorkerProfilesStatus {
			var workerProfilesStatus storage.WorkerProfile_STATUS
			err := workerProfilesStatusItem.AssignProperties_To_WorkerProfile_STATUS(&workerProfilesStatus)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WorkerProfile_STATUS() to populate field WorkerProfilesStatus")
			}
			workerProfilesStatusList[workerProfilesStatusIndex] = workerProfilesStatus
		}
		destination.WorkerProfilesStatus = workerProfilesStatusList
	} else {
		destination.WorkerProfilesStatus = nil
	}

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

	// No error
	return nil
}

// APIServerProfile represents an API server profile.
type APIServerProfile struct {
	// Visibility: API server visibility.
	Visibility *Visibility `json:"visibility,omitempty"`
}

var _ genruntime.ARMTransformer = &APIServerProfile{}

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

	// Set property "Visibility":
	if profile.Visibility != nil {
		var temp string
		temp = string(*profile.Visibility)
		visibility := arm.Visibility(temp)
		result.Visibility = &visibility
	}
	return result, nil
}

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

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

	// Set property "Visibility":
	if typedInput.Visibility != nil {
		var temp string
		temp = string(*typedInput.Visibility)
		visibility := Visibility(temp)
		profile.Visibility = &visibility
	}

	// No error
	return nil
}

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

	// Visibility
	if source.Visibility != nil {
		visibility := *source.Visibility
		visibilityTemp := genruntime.ToEnum(visibility, visibility_Values)
		profile.Visibility = &visibilityTemp
	} else {
		profile.Visibility = nil
	}

	// No error
	return nil
}

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

	// Visibility
	if profile.Visibility != nil {
		visibility := string(*profile.Visibility)
		destination.Visibility = &visibility
	} else {
		destination.Visibility = nil
	}

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

	// No error
	return nil
}

// Initialize_From_APIServerProfile_STATUS populates our APIServerProfile from the provided source APIServerProfile_STATUS
func (profile *APIServerProfile) Initialize_From_APIServerProfile_STATUS(source *APIServerProfile_STATUS) error {

	// Visibility
	if source.Visibility != nil {
		visibility := genruntime.ToEnum(string(*source.Visibility), visibility_Values)
		profile.Visibility = &visibility
	} else {
		profile.Visibility = nil
	}

	// No error
	return nil
}

// APIServerProfile represents an API server profile.
type APIServerProfile_STATUS struct {
	// Ip: The IP of the cluster API server.
	Ip *string `json:"ip,omitempty"`

	// Url: The URL to access the cluster API server.
	Url *string `json:"url,omitempty"`

	// Visibility: API server visibility.
	Visibility *Visibility_STATUS `json:"visibility,omitempty"`
}

var _ genruntime.FromARMConverter = &APIServerProfile_STATUS{}

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

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

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

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

	// Set property "Visibility":
	if typedInput.Visibility != nil {
		var temp string
		temp = string(*typedInput.Visibility)
		visibility := Visibility_STATUS(temp)
		profile.Visibility = &visibility
	}

	// No error
	return nil
}

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

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

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

	// Visibility
	if source.Visibility != nil {
		visibility := *source.Visibility
		visibilityTemp := genruntime.ToEnum(visibility, visibility_STATUS_Values)
		profile.Visibility = &visibilityTemp
	} else {
		profile.Visibility = nil
	}

	// No error
	return nil
}

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

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

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

	// Visibility
	if profile.Visibility != nil {
		visibility := string(*profile.Visibility)
		destination.Visibility = &visibility
	} else {
		destination.Visibility = nil
	}

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

	// No error
	return nil
}

// ClusterProfile represents a cluster profile.
type ClusterProfile struct {
	// Domain: The domain for the cluster.
	Domain *string `json:"domain,omitempty"`

	// FipsValidatedModules: If FIPS validated crypto modules are used
	FipsValidatedModules *FipsValidatedModules `json:"fipsValidatedModules,omitempty"`

	// PullSecret: The pull secret for the cluster.
	PullSecret *genruntime.SecretReference `json:"pullSecret,omitempty"`

	// ResourceGroupId: The ID of the cluster resource group.
	ResourceGroupId *string `json:"resourceGroupId,omitempty"`

	// Version: The version of the cluster.
	Version *string `json:"version,omitempty"`
}

var _ genruntime.ARMTransformer = &ClusterProfile{}

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

	// Set property "Domain":
	if profile.Domain != nil {
		domain := *profile.Domain
		result.Domain = &domain
	}

	// Set property "FipsValidatedModules":
	if profile.FipsValidatedModules != nil {
		var temp string
		temp = string(*profile.FipsValidatedModules)
		fipsValidatedModules := arm.FipsValidatedModules(temp)
		result.FipsValidatedModules = &fipsValidatedModules
	}

	// Set property "PullSecret":
	if profile.PullSecret != nil {
		pullSecretSecret, err := resolved.ResolvedSecrets.Lookup(*profile.PullSecret)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property PullSecret")
		}
		pullSecret := pullSecretSecret
		result.PullSecret = &pullSecret
	}

	// Set property "ResourceGroupId":
	if profile.ResourceGroupId != nil {
		resourceGroupId := *profile.ResourceGroupId
		result.ResourceGroupId = &resourceGroupId
	}

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

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

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

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

	// Set property "FipsValidatedModules":
	if typedInput.FipsValidatedModules != nil {
		var temp string
		temp = string(*typedInput.FipsValidatedModules)
		fipsValidatedModules := FipsValidatedModules(temp)
		profile.FipsValidatedModules = &fipsValidatedModules
	}

	// no assignment for property "PullSecret"

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

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

	// No error
	return nil
}

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

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

	// FipsValidatedModules
	if source.FipsValidatedModules != nil {
		fipsValidatedModule := *source.FipsValidatedModules
		fipsValidatedModuleTemp := genruntime.ToEnum(fipsValidatedModule, fipsValidatedModules_Values)
		profile.FipsValidatedModules = &fipsValidatedModuleTemp
	} else {
		profile.FipsValidatedModules = nil
	}

	// PullSecret
	if source.PullSecret != nil {
		pullSecret := source.PullSecret.Copy()
		profile.PullSecret = &pullSecret
	} else {
		profile.PullSecret = nil
	}

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

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

	// No error
	return nil
}

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

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

	// FipsValidatedModules
	if profile.FipsValidatedModules != nil {
		fipsValidatedModule := string(*profile.FipsValidatedModules)
		destination.FipsValidatedModules = &fipsValidatedModule
	} else {
		destination.FipsValidatedModules = nil
	}

	// PullSecret
	if profile.PullSecret != nil {
		pullSecret := profile.PullSecret.Copy()
		destination.PullSecret = &pullSecret
	} else {
		destination.PullSecret = nil
	}

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

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

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

	// No error
	return nil
}

// Initialize_From_ClusterProfile_STATUS populates our ClusterProfile from the provided source ClusterProfile_STATUS
func (profile *ClusterProfile) Initialize_From_ClusterProfile_STATUS(source *ClusterProfile_STATUS) error {

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

	// FipsValidatedModules
	if source.FipsValidatedModules != nil {
		fipsValidatedModule := genruntime.ToEnum(string(*source.FipsValidatedModules), fipsValidatedModules_Values)
		profile.FipsValidatedModules = &fipsValidatedModule
	} else {
		profile.FipsValidatedModules = nil
	}

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

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

	// No error
	return nil
}

// ClusterProfile represents a cluster profile.
type ClusterProfile_STATUS struct {
	// Domain: The domain for the cluster.
	Domain *string `json:"domain,omitempty"`

	// FipsValidatedModules: If FIPS validated crypto modules are used
	FipsValidatedModules *FipsValidatedModules_STATUS `json:"fipsValidatedModules,omitempty"`

	// ResourceGroupId: The ID of the cluster resource group.
	ResourceGroupId *string `json:"resourceGroupId,omitempty"`

	// Version: The version of the cluster.
	Version *string `json:"version,omitempty"`
}

var _ genruntime.FromARMConverter = &ClusterProfile_STATUS{}

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

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

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

	// Set property "FipsValidatedModules":
	if typedInput.FipsValidatedModules != nil {
		var temp string
		temp = string(*typedInput.FipsValidatedModules)
		fipsValidatedModules := FipsValidatedModules_STATUS(temp)
		profile.FipsValidatedModules = &fipsValidatedModules
	}

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

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

	// No error
	return nil
}

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

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

	// FipsValidatedModules
	if source.FipsValidatedModules != nil {
		fipsValidatedModule := *source.FipsValidatedModules
		fipsValidatedModuleTemp := genruntime.ToEnum(fipsValidatedModule, fipsValidatedModules_STATUS_Values)
		profile.FipsValidatedModules = &fipsValidatedModuleTemp
	} else {
		profile.FipsValidatedModules = nil
	}

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

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

	// No error
	return nil
}

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

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

	// FipsValidatedModules
	if profile.FipsValidatedModules != nil {
		fipsValidatedModule := string(*profile.FipsValidatedModules)
		destination.FipsValidatedModules = &fipsValidatedModule
	} else {
		destination.FipsValidatedModules = nil
	}

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

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

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

	// No error
	return nil
}

// ConsoleProfile represents a console profile.
type ConsoleProfile_STATUS struct {
	// Url: The URL to access the cluster console.
	Url *string `json:"url,omitempty"`
}

var _ genruntime.FromARMConverter = &ConsoleProfile_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// IngressProfile represents an ingress profile.
type IngressProfile struct {
	// Name: The ingress profile name.
	Name *string `json:"name,omitempty"`

	// Visibility: Ingress visibility.
	Visibility *Visibility `json:"visibility,omitempty"`
}

var _ genruntime.ARMTransformer = &IngressProfile{}

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

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

	// Set property "Visibility":
	if profile.Visibility != nil {
		var temp string
		temp = string(*profile.Visibility)
		visibility := arm.Visibility(temp)
		result.Visibility = &visibility
	}
	return result, nil
}

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

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

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

	// Set property "Visibility":
	if typedInput.Visibility != nil {
		var temp string
		temp = string(*typedInput.Visibility)
		visibility := Visibility(temp)
		profile.Visibility = &visibility
	}

	// No error
	return nil
}

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

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

	// Visibility
	if source.Visibility != nil {
		visibility := *source.Visibility
		visibilityTemp := genruntime.ToEnum(visibility, visibility_Values)
		profile.Visibility = &visibilityTemp
	} else {
		profile.Visibility = nil
	}

	// No error
	return nil
}

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

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

	// Visibility
	if profile.Visibility != nil {
		visibility := string(*profile.Visibility)
		destination.Visibility = &visibility
	} else {
		destination.Visibility = nil
	}

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

	// No error
	return nil
}

// Initialize_From_IngressProfile_STATUS populates our IngressProfile from the provided source IngressProfile_STATUS
func (profile *IngressProfile) Initialize_From_IngressProfile_STATUS(source *IngressProfile_STATUS) error {

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

	// Visibility
	if source.Visibility != nil {
		visibility := genruntime.ToEnum(string(*source.Visibility), visibility_Values)
		profile.Visibility = &visibility
	} else {
		profile.Visibility = nil
	}

	// No error
	return nil
}

// IngressProfile represents an ingress profile.
type IngressProfile_STATUS struct {
	// Ip: The IP of the ingress.
	Ip *string `json:"ip,omitempty"`

	// Name: The ingress profile name.
	Name *string `json:"name,omitempty"`

	// Visibility: Ingress visibility.
	Visibility *Visibility_STATUS `json:"visibility,omitempty"`
}

var _ genruntime.FromARMConverter = &IngressProfile_STATUS{}

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

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

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

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

	// Set property "Visibility":
	if typedInput.Visibility != nil {
		var temp string
		temp = string(*typedInput.Visibility)
		visibility := Visibility_STATUS(temp)
		profile.Visibility = &visibility
	}

	// No error
	return nil
}

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

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

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

	// Visibility
	if source.Visibility != nil {
		visibility := *source.Visibility
		visibilityTemp := genruntime.ToEnum(visibility, visibility_STATUS_Values)
		profile.Visibility = &visibilityTemp
	} else {
		profile.Visibility = nil
	}

	// No error
	return nil
}

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

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

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

	// Visibility
	if profile.Visibility != nil {
		visibility := string(*profile.Visibility)
		destination.Visibility = &visibility
	} else {
		destination.Visibility = nil
	}

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

	// No error
	return nil
}

// MasterProfile represents a master profile.
type MasterProfile struct {
	// DiskEncryptionSetReference: The resource ID of an associated DiskEncryptionSet, if applicable.
	DiskEncryptionSetReference *genruntime.ResourceReference `armReference:"DiskEncryptionSetId" json:"diskEncryptionSetReference,omitempty"`

	// EncryptionAtHost: Whether master virtual machines are encrypted at host.
	EncryptionAtHost *EncryptionAtHost `json:"encryptionAtHost,omitempty"`

	// SubnetReference: The Azure resource ID of the master subnet.
	SubnetReference *genruntime.ResourceReference `armReference:"SubnetId" json:"subnetReference,omitempty"`

	// VmSize: The size of the master VMs.
	VmSize *string `json:"vmSize,omitempty"`
}

var _ genruntime.ARMTransformer = &MasterProfile{}

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

	// Set property "DiskEncryptionSetId":
	if profile.DiskEncryptionSetReference != nil {
		diskEncryptionSetReferenceARMID, err := resolved.ResolvedReferences.Lookup(*profile.DiskEncryptionSetReference)
		if err != nil {
			return nil, err
		}
		diskEncryptionSetReference := diskEncryptionSetReferenceARMID
		result.DiskEncryptionSetId = &diskEncryptionSetReference
	}

	// Set property "EncryptionAtHost":
	if profile.EncryptionAtHost != nil {
		var temp string
		temp = string(*profile.EncryptionAtHost)
		encryptionAtHost := arm.EncryptionAtHost(temp)
		result.EncryptionAtHost = &encryptionAtHost
	}

	// Set property "SubnetId":
	if profile.SubnetReference != nil {
		subnetReferenceARMID, err := resolved.ResolvedReferences.Lookup(*profile.SubnetReference)
		if err != nil {
			return nil, err
		}
		subnetReference := subnetReferenceARMID
		result.SubnetId = &subnetReference
	}

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

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

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

	// no assignment for property "DiskEncryptionSetReference"

	// Set property "EncryptionAtHost":
	if typedInput.EncryptionAtHost != nil {
		var temp string
		temp = string(*typedInput.EncryptionAtHost)
		encryptionAtHost := EncryptionAtHost(temp)
		profile.EncryptionAtHost = &encryptionAtHost
	}

	// no assignment for property "SubnetReference"

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

	// No error
	return nil
}

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

	// DiskEncryptionSetReference
	if source.DiskEncryptionSetReference != nil {
		diskEncryptionSetReference := source.DiskEncryptionSetReference.Copy()
		profile.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		profile.DiskEncryptionSetReference = nil
	}

	// EncryptionAtHost
	if source.EncryptionAtHost != nil {
		encryptionAtHost := *source.EncryptionAtHost
		encryptionAtHostTemp := genruntime.ToEnum(encryptionAtHost, encryptionAtHost_Values)
		profile.EncryptionAtHost = &encryptionAtHostTemp
	} else {
		profile.EncryptionAtHost = nil
	}

	// SubnetReference
	if source.SubnetReference != nil {
		subnetReference := source.SubnetReference.Copy()
		profile.SubnetReference = &subnetReference
	} else {
		profile.SubnetReference = nil
	}

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

	// No error
	return nil
}

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

	// DiskEncryptionSetReference
	if profile.DiskEncryptionSetReference != nil {
		diskEncryptionSetReference := profile.DiskEncryptionSetReference.Copy()
		destination.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		destination.DiskEncryptionSetReference = nil
	}

	// EncryptionAtHost
	if profile.EncryptionAtHost != nil {
		encryptionAtHost := string(*profile.EncryptionAtHost)
		destination.EncryptionAtHost = &encryptionAtHost
	} else {
		destination.EncryptionAtHost = nil
	}

	// SubnetReference
	if profile.SubnetReference != nil {
		subnetReference := profile.SubnetReference.Copy()
		destination.SubnetReference = &subnetReference
	} else {
		destination.SubnetReference = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_MasterProfile_STATUS populates our MasterProfile from the provided source MasterProfile_STATUS
func (profile *MasterProfile) Initialize_From_MasterProfile_STATUS(source *MasterProfile_STATUS) error {

	// DiskEncryptionSetReference
	if source.DiskEncryptionSetId != nil {
		diskEncryptionSetReference := genruntime.CreateResourceReferenceFromARMID(*source.DiskEncryptionSetId)
		profile.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		profile.DiskEncryptionSetReference = nil
	}

	// EncryptionAtHost
	if source.EncryptionAtHost != nil {
		encryptionAtHost := genruntime.ToEnum(string(*source.EncryptionAtHost), encryptionAtHost_Values)
		profile.EncryptionAtHost = &encryptionAtHost
	} else {
		profile.EncryptionAtHost = nil
	}

	// SubnetReference
	if source.SubnetId != nil {
		subnetReference := genruntime.CreateResourceReferenceFromARMID(*source.SubnetId)
		profile.SubnetReference = &subnetReference
	} else {
		profile.SubnetReference = nil
	}

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

	// No error
	return nil
}

// MasterProfile represents a master profile.
type MasterProfile_STATUS struct {
	// DiskEncryptionSetId: The resource ID of an associated DiskEncryptionSet, if applicable.
	DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"`

	// EncryptionAtHost: Whether master virtual machines are encrypted at host.
	EncryptionAtHost *EncryptionAtHost_STATUS `json:"encryptionAtHost,omitempty"`

	// SubnetId: The Azure resource ID of the master subnet.
	SubnetId *string `json:"subnetId,omitempty"`

	// VmSize: The size of the master VMs.
	VmSize *string `json:"vmSize,omitempty"`
}

var _ genruntime.FromARMConverter = &MasterProfile_STATUS{}

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

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

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

	// Set property "EncryptionAtHost":
	if typedInput.EncryptionAtHost != nil {
		var temp string
		temp = string(*typedInput.EncryptionAtHost)
		encryptionAtHost := EncryptionAtHost_STATUS(temp)
		profile.EncryptionAtHost = &encryptionAtHost
	}

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

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

	// No error
	return nil
}

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

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

	// EncryptionAtHost
	if source.EncryptionAtHost != nil {
		encryptionAtHost := *source.EncryptionAtHost
		encryptionAtHostTemp := genruntime.ToEnum(encryptionAtHost, encryptionAtHost_STATUS_Values)
		profile.EncryptionAtHost = &encryptionAtHostTemp
	} else {
		profile.EncryptionAtHost = nil
	}

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

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

	// No error
	return nil
}

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

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

	// EncryptionAtHost
	if profile.EncryptionAtHost != nil {
		encryptionAtHost := string(*profile.EncryptionAtHost)
		destination.EncryptionAtHost = &encryptionAtHost
	} else {
		destination.EncryptionAtHost = nil
	}

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

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

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

	// No error
	return nil
}

// NetworkProfile represents a network profile.
type NetworkProfile struct {
	// LoadBalancerProfile: The cluster load balancer profile.
	LoadBalancerProfile *LoadBalancerProfile `json:"loadBalancerProfile,omitempty"`

	// OutboundType: The OutboundType used for egress traffic.
	OutboundType *OutboundType `json:"outboundType,omitempty"`

	// PodCidr: The CIDR used for OpenShift/Kubernetes Pods.
	PodCidr *string `json:"podCidr,omitempty"`

	// PreconfiguredNSG: Specifies whether subnets are pre-attached with an NSG
	PreconfiguredNSG *PreconfiguredNSG `json:"preconfiguredNSG,omitempty"`

	// ServiceCidr: The CIDR used for OpenShift/Kubernetes Services.
	ServiceCidr *string `json:"serviceCidr,omitempty"`
}

var _ genruntime.ARMTransformer = &NetworkProfile{}

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

	// Set property "LoadBalancerProfile":
	if profile.LoadBalancerProfile != nil {
		loadBalancerProfile_ARM, err := profile.LoadBalancerProfile.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		loadBalancerProfile := *loadBalancerProfile_ARM.(*arm.LoadBalancerProfile)
		result.LoadBalancerProfile = &loadBalancerProfile
	}

	// Set property "OutboundType":
	if profile.OutboundType != nil {
		var temp string
		temp = string(*profile.OutboundType)
		outboundType := arm.OutboundType(temp)
		result.OutboundType = &outboundType
	}

	// Set property "PodCidr":
	if profile.PodCidr != nil {
		podCidr := *profile.PodCidr
		result.PodCidr = &podCidr
	}

	// Set property "PreconfiguredNSG":
	if profile.PreconfiguredNSG != nil {
		var temp string
		temp = string(*profile.PreconfiguredNSG)
		preconfiguredNSG := arm.PreconfiguredNSG(temp)
		result.PreconfiguredNSG = &preconfiguredNSG
	}

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

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

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

	// Set property "LoadBalancerProfile":
	if typedInput.LoadBalancerProfile != nil {
		var loadBalancerProfile1 LoadBalancerProfile
		err := loadBalancerProfile1.PopulateFromARM(owner, *typedInput.LoadBalancerProfile)
		if err != nil {
			return err
		}
		loadBalancerProfile := loadBalancerProfile1
		profile.LoadBalancerProfile = &loadBalancerProfile
	}

	// Set property "OutboundType":
	if typedInput.OutboundType != nil {
		var temp string
		temp = string(*typedInput.OutboundType)
		outboundType := OutboundType(temp)
		profile.OutboundType = &outboundType
	}

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

	// Set property "PreconfiguredNSG":
	if typedInput.PreconfiguredNSG != nil {
		var temp string
		temp = string(*typedInput.PreconfiguredNSG)
		preconfiguredNSG := PreconfiguredNSG(temp)
		profile.PreconfiguredNSG = &preconfiguredNSG
	}

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

	// No error
	return nil
}

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

	// LoadBalancerProfile
	if source.LoadBalancerProfile != nil {
		var loadBalancerProfile LoadBalancerProfile
		err := loadBalancerProfile.AssignProperties_From_LoadBalancerProfile(source.LoadBalancerProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LoadBalancerProfile() to populate field LoadBalancerProfile")
		}
		profile.LoadBalancerProfile = &loadBalancerProfile
	} else {
		profile.LoadBalancerProfile = nil
	}

	// OutboundType
	if source.OutboundType != nil {
		outboundType := *source.OutboundType
		outboundTypeTemp := genruntime.ToEnum(outboundType, outboundType_Values)
		profile.OutboundType = &outboundTypeTemp
	} else {
		profile.OutboundType = nil
	}

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

	// PreconfiguredNSG
	if source.PreconfiguredNSG != nil {
		preconfiguredNSG := *source.PreconfiguredNSG
		preconfiguredNSGTemp := genruntime.ToEnum(preconfiguredNSG, preconfiguredNSG_Values)
		profile.PreconfiguredNSG = &preconfiguredNSGTemp
	} else {
		profile.PreconfiguredNSG = nil
	}

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

	// No error
	return nil
}

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

	// LoadBalancerProfile
	if profile.LoadBalancerProfile != nil {
		var loadBalancerProfile storage.LoadBalancerProfile
		err := profile.LoadBalancerProfile.AssignProperties_To_LoadBalancerProfile(&loadBalancerProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_LoadBalancerProfile() to populate field LoadBalancerProfile")
		}
		destination.LoadBalancerProfile = &loadBalancerProfile
	} else {
		destination.LoadBalancerProfile = nil
	}

	// OutboundType
	if profile.OutboundType != nil {
		outboundType := string(*profile.OutboundType)
		destination.OutboundType = &outboundType
	} else {
		destination.OutboundType = nil
	}

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

	// PreconfiguredNSG
	if profile.PreconfiguredNSG != nil {
		preconfiguredNSG := string(*profile.PreconfiguredNSG)
		destination.PreconfiguredNSG = &preconfiguredNSG
	} else {
		destination.PreconfiguredNSG = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_NetworkProfile_STATUS populates our NetworkProfile from the provided source NetworkProfile_STATUS
func (profile *NetworkProfile) Initialize_From_NetworkProfile_STATUS(source *NetworkProfile_STATUS) error {

	// LoadBalancerProfile
	if source.LoadBalancerProfile != nil {
		var loadBalancerProfile LoadBalancerProfile
		err := loadBalancerProfile.Initialize_From_LoadBalancerProfile_STATUS(source.LoadBalancerProfile)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_LoadBalancerProfile_STATUS() to populate field LoadBalancerProfile")
		}
		profile.LoadBalancerProfile = &loadBalancerProfile
	} else {
		profile.LoadBalancerProfile = nil
	}

	// OutboundType
	if source.OutboundType != nil {
		outboundType := genruntime.ToEnum(string(*source.OutboundType), outboundType_Values)
		profile.OutboundType = &outboundType
	} else {
		profile.OutboundType = nil
	}

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

	// PreconfiguredNSG
	if source.PreconfiguredNSG != nil {
		preconfiguredNSG := genruntime.ToEnum(string(*source.PreconfiguredNSG), preconfiguredNSG_Values)
		profile.PreconfiguredNSG = &preconfiguredNSG
	} else {
		profile.PreconfiguredNSG = nil
	}

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

	// No error
	return nil
}

// NetworkProfile represents a network profile.
type NetworkProfile_STATUS struct {
	// LoadBalancerProfile: The cluster load balancer profile.
	LoadBalancerProfile *LoadBalancerProfile_STATUS `json:"loadBalancerProfile,omitempty"`

	// OutboundType: The OutboundType used for egress traffic.
	OutboundType *OutboundType_STATUS `json:"outboundType,omitempty"`

	// PodCidr: The CIDR used for OpenShift/Kubernetes Pods.
	PodCidr *string `json:"podCidr,omitempty"`

	// PreconfiguredNSG: Specifies whether subnets are pre-attached with an NSG
	PreconfiguredNSG *PreconfiguredNSG_STATUS `json:"preconfiguredNSG,omitempty"`

	// ServiceCidr: The CIDR used for OpenShift/Kubernetes Services.
	ServiceCidr *string `json:"serviceCidr,omitempty"`
}

var _ genruntime.FromARMConverter = &NetworkProfile_STATUS{}

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

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

	// Set property "LoadBalancerProfile":
	if typedInput.LoadBalancerProfile != nil {
		var loadBalancerProfile1 LoadBalancerProfile_STATUS
		err := loadBalancerProfile1.PopulateFromARM(owner, *typedInput.LoadBalancerProfile)
		if err != nil {
			return err
		}
		loadBalancerProfile := loadBalancerProfile1
		profile.LoadBalancerProfile = &loadBalancerProfile
	}

	// Set property "OutboundType":
	if typedInput.OutboundType != nil {
		var temp string
		temp = string(*typedInput.OutboundType)
		outboundType := OutboundType_STATUS(temp)
		profile.OutboundType = &outboundType
	}

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

	// Set property "PreconfiguredNSG":
	if typedInput.PreconfiguredNSG != nil {
		var temp string
		temp = string(*typedInput.PreconfiguredNSG)
		preconfiguredNSG := PreconfiguredNSG_STATUS(temp)
		profile.PreconfiguredNSG = &preconfiguredNSG
	}

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

	// No error
	return nil
}

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

	// LoadBalancerProfile
	if source.LoadBalancerProfile != nil {
		var loadBalancerProfile LoadBalancerProfile_STATUS
		err := loadBalancerProfile.AssignProperties_From_LoadBalancerProfile_STATUS(source.LoadBalancerProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_LoadBalancerProfile_STATUS() to populate field LoadBalancerProfile")
		}
		profile.LoadBalancerProfile = &loadBalancerProfile
	} else {
		profile.LoadBalancerProfile = nil
	}

	// OutboundType
	if source.OutboundType != nil {
		outboundType := *source.OutboundType
		outboundTypeTemp := genruntime.ToEnum(outboundType, outboundType_STATUS_Values)
		profile.OutboundType = &outboundTypeTemp
	} else {
		profile.OutboundType = nil
	}

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

	// PreconfiguredNSG
	if source.PreconfiguredNSG != nil {
		preconfiguredNSG := *source.PreconfiguredNSG
		preconfiguredNSGTemp := genruntime.ToEnum(preconfiguredNSG, preconfiguredNSG_STATUS_Values)
		profile.PreconfiguredNSG = &preconfiguredNSGTemp
	} else {
		profile.PreconfiguredNSG = nil
	}

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

	// No error
	return nil
}

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

	// LoadBalancerProfile
	if profile.LoadBalancerProfile != nil {
		var loadBalancerProfile storage.LoadBalancerProfile_STATUS
		err := profile.LoadBalancerProfile.AssignProperties_To_LoadBalancerProfile_STATUS(&loadBalancerProfile)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_LoadBalancerProfile_STATUS() to populate field LoadBalancerProfile")
		}
		destination.LoadBalancerProfile = &loadBalancerProfile
	} else {
		destination.LoadBalancerProfile = nil
	}

	// OutboundType
	if profile.OutboundType != nil {
		outboundType := string(*profile.OutboundType)
		destination.OutboundType = &outboundType
	} else {
		destination.OutboundType = nil
	}

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

	// PreconfiguredNSG
	if profile.PreconfiguredNSG != nil {
		preconfiguredNSG := string(*profile.PreconfiguredNSG)
		destination.PreconfiguredNSG = &preconfiguredNSG
	} else {
		destination.PreconfiguredNSG = nil
	}

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

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

	// No error
	return nil
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type OpenShiftClusterOperatorSpec 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"`

	// Secrets: configures where to place Azure generated secrets.
	Secrets *OpenShiftClusterOperatorSecrets `json:"secrets,omitempty"`
}

// AssignProperties_From_OpenShiftClusterOperatorSpec populates our OpenShiftClusterOperatorSpec from the provided source OpenShiftClusterOperatorSpec
func (operator *OpenShiftClusterOperatorSpec) AssignProperties_From_OpenShiftClusterOperatorSpec(source *storage.OpenShiftClusterOperatorSpec) 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
	}

	// Secrets
	if source.Secrets != nil {
		var secret OpenShiftClusterOperatorSecrets
		err := secret.AssignProperties_From_OpenShiftClusterOperatorSecrets(source.Secrets)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_OpenShiftClusterOperatorSecrets() to populate field Secrets")
		}
		operator.Secrets = &secret
	} else {
		operator.Secrets = nil
	}

	// No error
	return nil
}

// AssignProperties_To_OpenShiftClusterOperatorSpec populates the provided destination OpenShiftClusterOperatorSpec from our OpenShiftClusterOperatorSpec
func (operator *OpenShiftClusterOperatorSpec) AssignProperties_To_OpenShiftClusterOperatorSpec(destination *storage.OpenShiftClusterOperatorSpec) 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
	}

	// Secrets
	if operator.Secrets != nil {
		var secret storage.OpenShiftClusterOperatorSecrets
		err := operator.Secrets.AssignProperties_To_OpenShiftClusterOperatorSecrets(&secret)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_OpenShiftClusterOperatorSecrets() to populate field Secrets")
		}
		destination.Secrets = &secret
	} else {
		destination.Secrets = nil
	}

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

	// No error
	return nil
}

// ProvisioningState represents a provisioning state.
type ProvisioningState_STATUS string

const (
	ProvisioningState_STATUS_AdminUpdating = ProvisioningState_STATUS("AdminUpdating")
	ProvisioningState_STATUS_Canceled      = ProvisioningState_STATUS("Canceled")
	ProvisioningState_STATUS_Creating      = ProvisioningState_STATUS("Creating")
	ProvisioningState_STATUS_Deleting      = ProvisioningState_STATUS("Deleting")
	ProvisioningState_STATUS_Failed        = ProvisioningState_STATUS("Failed")
	ProvisioningState_STATUS_Succeeded     = ProvisioningState_STATUS("Succeeded")
	ProvisioningState_STATUS_Updating      = ProvisioningState_STATUS("Updating")
)

// Mapping from string to ProvisioningState_STATUS
var provisioningState_STATUS_Values = map[string]ProvisioningState_STATUS{
	"adminupdating": ProvisioningState_STATUS_AdminUpdating,
	"canceled":      ProvisioningState_STATUS_Canceled,
	"creating":      ProvisioningState_STATUS_Creating,
	"deleting":      ProvisioningState_STATUS_Deleting,
	"failed":        ProvisioningState_STATUS_Failed,
	"succeeded":     ProvisioningState_STATUS_Succeeded,
	"updating":      ProvisioningState_STATUS_Updating,
}

// ServicePrincipalProfile represents a service principal profile.
type ServicePrincipalProfile struct {
	// ClientId: The client ID used for the cluster.
	ClientId *string `json:"clientId,omitempty" optionalConfigMapPair:"ClientId"`

	// ClientIdFromConfig: The client ID used for the cluster.
	ClientIdFromConfig *genruntime.ConfigMapReference `json:"clientIdFromConfig,omitempty" optionalConfigMapPair:"ClientId"`

	// ClientSecret: The client secret used for the cluster.
	ClientSecret *genruntime.SecretReference `json:"clientSecret,omitempty"`
}

var _ genruntime.ARMTransformer = &ServicePrincipalProfile{}

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

	// Set property "ClientId":
	if profile.ClientId != nil {
		clientId := *profile.ClientId
		result.ClientId = &clientId
	}
	if profile.ClientIdFromConfig != nil {
		clientIdValue, err := resolved.ResolvedConfigMaps.Lookup(*profile.ClientIdFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property ClientId")
		}
		clientId := clientIdValue
		result.ClientId = &clientId
	}

	// Set property "ClientSecret":
	if profile.ClientSecret != nil {
		clientSecretSecret, err := resolved.ResolvedSecrets.Lookup(*profile.ClientSecret)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property ClientSecret")
		}
		clientSecret := clientSecretSecret
		result.ClientSecret = &clientSecret
	}
	return result, nil
}

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

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

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

	// no assignment for property "ClientIdFromConfig"

	// no assignment for property "ClientSecret"

	// No error
	return nil
}

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

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

	// ClientIdFromConfig
	if source.ClientIdFromConfig != nil {
		clientIdFromConfig := source.ClientIdFromConfig.Copy()
		profile.ClientIdFromConfig = &clientIdFromConfig
	} else {
		profile.ClientIdFromConfig = nil
	}

	// ClientSecret
	if source.ClientSecret != nil {
		clientSecret := source.ClientSecret.Copy()
		profile.ClientSecret = &clientSecret
	} else {
		profile.ClientSecret = nil
	}

	// No error
	return nil
}

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

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

	// ClientIdFromConfig
	if profile.ClientIdFromConfig != nil {
		clientIdFromConfig := profile.ClientIdFromConfig.Copy()
		destination.ClientIdFromConfig = &clientIdFromConfig
	} else {
		destination.ClientIdFromConfig = nil
	}

	// ClientSecret
	if profile.ClientSecret != nil {
		clientSecret := profile.ClientSecret.Copy()
		destination.ClientSecret = &clientSecret
	} else {
		destination.ClientSecret = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ServicePrincipalProfile_STATUS populates our ServicePrincipalProfile from the provided source ServicePrincipalProfile_STATUS
func (profile *ServicePrincipalProfile) Initialize_From_ServicePrincipalProfile_STATUS(source *ServicePrincipalProfile_STATUS) error {

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

	// No error
	return nil
}

// ServicePrincipalProfile represents a service principal profile.
type ServicePrincipalProfile_STATUS struct {
	// ClientId: The client ID used for the cluster.
	ClientId *string `json:"clientId,omitempty"`
}

var _ genruntime.FromARMConverter = &ServicePrincipalProfile_STATUS{}

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

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

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

// WorkerProfile represents a worker profile.
type WorkerProfile struct {
	// Count: The number of worker VMs.
	Count *int `json:"count,omitempty"`

	// DiskEncryptionSetReference: The resource ID of an associated DiskEncryptionSet, if applicable.
	DiskEncryptionSetReference *genruntime.ResourceReference `armReference:"DiskEncryptionSetId" json:"diskEncryptionSetReference,omitempty"`

	// DiskSizeGB: The disk size of the worker VMs.
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// EncryptionAtHost: Whether master virtual machines are encrypted at host.
	EncryptionAtHost *EncryptionAtHost `json:"encryptionAtHost,omitempty"`

	// Name: The worker profile name.
	Name *string `json:"name,omitempty"`

	// SubnetReference: The Azure resource ID of the worker subnet.
	SubnetReference *genruntime.ResourceReference `armReference:"SubnetId" json:"subnetReference,omitempty"`

	// VmSize: The size of the worker VMs.
	VmSize *string `json:"vmSize,omitempty"`
}

var _ genruntime.ARMTransformer = &WorkerProfile{}

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

	// Set property "Count":
	if profile.Count != nil {
		count := *profile.Count
		result.Count = &count
	}

	// Set property "DiskEncryptionSetId":
	if profile.DiskEncryptionSetReference != nil {
		diskEncryptionSetReferenceARMID, err := resolved.ResolvedReferences.Lookup(*profile.DiskEncryptionSetReference)
		if err != nil {
			return nil, err
		}
		diskEncryptionSetReference := diskEncryptionSetReferenceARMID
		result.DiskEncryptionSetId = &diskEncryptionSetReference
	}

	// Set property "DiskSizeGB":
	if profile.DiskSizeGB != nil {
		diskSizeGB := *profile.DiskSizeGB
		result.DiskSizeGB = &diskSizeGB
	}

	// Set property "EncryptionAtHost":
	if profile.EncryptionAtHost != nil {
		var temp string
		temp = string(*profile.EncryptionAtHost)
		encryptionAtHost := arm.EncryptionAtHost(temp)
		result.EncryptionAtHost = &encryptionAtHost
	}

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

	// Set property "SubnetId":
	if profile.SubnetReference != nil {
		subnetReferenceARMID, err := resolved.ResolvedReferences.Lookup(*profile.SubnetReference)
		if err != nil {
			return nil, err
		}
		subnetReference := subnetReferenceARMID
		result.SubnetId = &subnetReference
	}

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

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

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

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

	// no assignment for property "DiskEncryptionSetReference"

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

	// Set property "EncryptionAtHost":
	if typedInput.EncryptionAtHost != nil {
		var temp string
		temp = string(*typedInput.EncryptionAtHost)
		encryptionAtHost := EncryptionAtHost(temp)
		profile.EncryptionAtHost = &encryptionAtHost
	}

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

	// no assignment for property "SubnetReference"

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

	// No error
	return nil
}

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

	// Count
	profile.Count = genruntime.ClonePointerToInt(source.Count)

	// DiskEncryptionSetReference
	if source.DiskEncryptionSetReference != nil {
		diskEncryptionSetReference := source.DiskEncryptionSetReference.Copy()
		profile.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		profile.DiskEncryptionSetReference = nil
	}

	// DiskSizeGB
	profile.DiskSizeGB = genruntime.ClonePointerToInt(source.DiskSizeGB)

	// EncryptionAtHost
	if source.EncryptionAtHost != nil {
		encryptionAtHost := *source.EncryptionAtHost
		encryptionAtHostTemp := genruntime.ToEnum(encryptionAtHost, encryptionAtHost_Values)
		profile.EncryptionAtHost = &encryptionAtHostTemp
	} else {
		profile.EncryptionAtHost = nil
	}

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

	// SubnetReference
	if source.SubnetReference != nil {
		subnetReference := source.SubnetReference.Copy()
		profile.SubnetReference = &subnetReference
	} else {
		profile.SubnetReference = nil
	}

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

	// No error
	return nil
}

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

	// Count
	destination.Count = genruntime.ClonePointerToInt(profile.Count)

	// DiskEncryptionSetReference
	if profile.DiskEncryptionSetReference != nil {
		diskEncryptionSetReference := profile.DiskEncryptionSetReference.Copy()
		destination.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		destination.DiskEncryptionSetReference = nil
	}

	// DiskSizeGB
	destination.DiskSizeGB = genruntime.ClonePointerToInt(profile.DiskSizeGB)

	// EncryptionAtHost
	if profile.EncryptionAtHost != nil {
		encryptionAtHost := string(*profile.EncryptionAtHost)
		destination.EncryptionAtHost = &encryptionAtHost
	} else {
		destination.EncryptionAtHost = nil
	}

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

	// SubnetReference
	if profile.SubnetReference != nil {
		subnetReference := profile.SubnetReference.Copy()
		destination.SubnetReference = &subnetReference
	} else {
		destination.SubnetReference = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_WorkerProfile_STATUS populates our WorkerProfile from the provided source WorkerProfile_STATUS
func (profile *WorkerProfile) Initialize_From_WorkerProfile_STATUS(source *WorkerProfile_STATUS) error {

	// Count
	profile.Count = genruntime.ClonePointerToInt(source.Count)

	// DiskEncryptionSetReference
	if source.DiskEncryptionSetId != nil {
		diskEncryptionSetReference := genruntime.CreateResourceReferenceFromARMID(*source.DiskEncryptionSetId)
		profile.DiskEncryptionSetReference = &diskEncryptionSetReference
	} else {
		profile.DiskEncryptionSetReference = nil
	}

	// DiskSizeGB
	profile.DiskSizeGB = genruntime.ClonePointerToInt(source.DiskSizeGB)

	// EncryptionAtHost
	if source.EncryptionAtHost != nil {
		encryptionAtHost := genruntime.ToEnum(string(*source.EncryptionAtHost), encryptionAtHost_Values)
		profile.EncryptionAtHost = &encryptionAtHost
	} else {
		profile.EncryptionAtHost = nil
	}

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

	// SubnetReference
	if source.SubnetId != nil {
		subnetReference := genruntime.CreateResourceReferenceFromARMID(*source.SubnetId)
		profile.SubnetReference = &subnetReference
	} else {
		profile.SubnetReference = nil
	}

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

	// No error
	return nil
}

// WorkerProfile represents a worker profile.
type WorkerProfile_STATUS struct {
	// Count: The number of worker VMs.
	Count *int `json:"count,omitempty"`

	// DiskEncryptionSetId: The resource ID of an associated DiskEncryptionSet, if applicable.
	DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"`

	// DiskSizeGB: The disk size of the worker VMs.
	DiskSizeGB *int `json:"diskSizeGB,omitempty"`

	// EncryptionAtHost: Whether master virtual machines are encrypted at host.
	EncryptionAtHost *EncryptionAtHost_STATUS `json:"encryptionAtHost,omitempty"`

	// Name: The worker profile name.
	Name *string `json:"name,omitempty"`

	// SubnetId: The Azure resource ID of the worker subnet.
	SubnetId *string `json:"subnetId,omitempty"`

	// VmSize: The size of the worker VMs.
	VmSize *string `json:"vmSize,omitempty"`
}

var _ genruntime.FromARMConverter = &WorkerProfile_STATUS{}

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

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

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

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

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

	// Set property "EncryptionAtHost":
	if typedInput.EncryptionAtHost != nil {
		var temp string
		temp = string(*typedInput.EncryptionAtHost)
		encryptionAtHost := EncryptionAtHost_STATUS(temp)
		profile.EncryptionAtHost = &encryptionAtHost
	}

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

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

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

	// No error
	return nil
}

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

	// Count
	profile.Count = genruntime.ClonePointerToInt(source.Count)

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

	// DiskSizeGB
	profile.DiskSizeGB = genruntime.ClonePointerToInt(source.DiskSizeGB)

	// EncryptionAtHost
	if source.EncryptionAtHost != nil {
		encryptionAtHost := *source.EncryptionAtHost
		encryptionAtHostTemp := genruntime.ToEnum(encryptionAtHost, encryptionAtHost_STATUS_Values)
		profile.EncryptionAtHost = &encryptionAtHostTemp
	} else {
		profile.EncryptionAtHost = nil
	}

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

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

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

	// No error
	return nil
}

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

	// Count
	destination.Count = genruntime.ClonePointerToInt(profile.Count)

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

	// DiskSizeGB
	destination.DiskSizeGB = genruntime.ClonePointerToInt(profile.DiskSizeGB)

	// EncryptionAtHost
	if profile.EncryptionAtHost != nil {
		encryptionAtHost := string(*profile.EncryptionAtHost)
		destination.EncryptionAtHost = &encryptionAtHost
	} else {
		destination.EncryptionAtHost = nil
	}

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

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

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

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

	// No error
	return nil
}

// EncryptionAtHost represents encryption at host state
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type EncryptionAtHost string

const (
	EncryptionAtHost_Disabled = EncryptionAtHost("Disabled")
	EncryptionAtHost_Enabled  = EncryptionAtHost("Enabled")
)

// Mapping from string to EncryptionAtHost
var encryptionAtHost_Values = map[string]EncryptionAtHost{
	"disabled": EncryptionAtHost_Disabled,
	"enabled":  EncryptionAtHost_Enabled,
}

// EncryptionAtHost represents encryption at host state
type EncryptionAtHost_STATUS string

const (
	EncryptionAtHost_STATUS_Disabled = EncryptionAtHost_STATUS("Disabled")
	EncryptionAtHost_STATUS_Enabled  = EncryptionAtHost_STATUS("Enabled")
)

// Mapping from string to EncryptionAtHost_STATUS
var encryptionAtHost_STATUS_Values = map[string]EncryptionAtHost_STATUS{
	"disabled": EncryptionAtHost_STATUS_Disabled,
	"enabled":  EncryptionAtHost_STATUS_Enabled,
}

// FipsValidatedModules determines if FIPS is used.
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type FipsValidatedModules string

const (
	FipsValidatedModules_Disabled = FipsValidatedModules("Disabled")
	FipsValidatedModules_Enabled  = FipsValidatedModules("Enabled")
)

// Mapping from string to FipsValidatedModules
var fipsValidatedModules_Values = map[string]FipsValidatedModules{
	"disabled": FipsValidatedModules_Disabled,
	"enabled":  FipsValidatedModules_Enabled,
}

// FipsValidatedModules determines if FIPS is used.
type FipsValidatedModules_STATUS string

const (
	FipsValidatedModules_STATUS_Disabled = FipsValidatedModules_STATUS("Disabled")
	FipsValidatedModules_STATUS_Enabled  = FipsValidatedModules_STATUS("Enabled")
)

// Mapping from string to FipsValidatedModules_STATUS
var fipsValidatedModules_STATUS_Values = map[string]FipsValidatedModules_STATUS{
	"disabled": FipsValidatedModules_STATUS_Disabled,
	"enabled":  FipsValidatedModules_STATUS_Enabled,
}

// LoadBalancerProfile represents the profile of the cluster public load balancer.
type LoadBalancerProfile struct {
	// ManagedOutboundIps: The desired managed outbound IPs for the cluster public load balancer.
	ManagedOutboundIps *ManagedOutboundIPs `json:"managedOutboundIps,omitempty"`
}

var _ genruntime.ARMTransformer = &LoadBalancerProfile{}

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

	// Set property "ManagedOutboundIps":
	if profile.ManagedOutboundIps != nil {
		managedOutboundIps_ARM, err := profile.ManagedOutboundIps.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		managedOutboundIps := *managedOutboundIps_ARM.(*arm.ManagedOutboundIPs)
		result.ManagedOutboundIps = &managedOutboundIps
	}
	return result, nil
}

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

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

	// Set property "ManagedOutboundIps":
	if typedInput.ManagedOutboundIps != nil {
		var managedOutboundIps1 ManagedOutboundIPs
		err := managedOutboundIps1.PopulateFromARM(owner, *typedInput.ManagedOutboundIps)
		if err != nil {
			return err
		}
		managedOutboundIps := managedOutboundIps1
		profile.ManagedOutboundIps = &managedOutboundIps
	}

	// No error
	return nil
}

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

	// ManagedOutboundIps
	if source.ManagedOutboundIps != nil {
		var managedOutboundIpsIPS ManagedOutboundIPs
		err := managedOutboundIpsIPS.AssignProperties_From_ManagedOutboundIPs(source.ManagedOutboundIps)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedOutboundIPs() to populate field ManagedOutboundIps")
		}
		profile.ManagedOutboundIps = &managedOutboundIpsIPS
	} else {
		profile.ManagedOutboundIps = nil
	}

	// No error
	return nil
}

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

	// ManagedOutboundIps
	if profile.ManagedOutboundIps != nil {
		var managedOutboundIpsIPS storage.ManagedOutboundIPs
		err := profile.ManagedOutboundIps.AssignProperties_To_ManagedOutboundIPs(&managedOutboundIpsIPS)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedOutboundIPs() to populate field ManagedOutboundIps")
		}
		destination.ManagedOutboundIps = &managedOutboundIpsIPS
	} else {
		destination.ManagedOutboundIps = nil
	}

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

	// No error
	return nil
}

// Initialize_From_LoadBalancerProfile_STATUS populates our LoadBalancerProfile from the provided source LoadBalancerProfile_STATUS
func (profile *LoadBalancerProfile) Initialize_From_LoadBalancerProfile_STATUS(source *LoadBalancerProfile_STATUS) error {

	// ManagedOutboundIps
	if source.ManagedOutboundIps != nil {
		var managedOutboundIpsIPS ManagedOutboundIPs
		err := managedOutboundIpsIPS.Initialize_From_ManagedOutboundIPs_STATUS(source.ManagedOutboundIps)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ManagedOutboundIPs_STATUS() to populate field ManagedOutboundIps")
		}
		profile.ManagedOutboundIps = &managedOutboundIpsIPS
	} else {
		profile.ManagedOutboundIps = nil
	}

	// No error
	return nil
}

// LoadBalancerProfile represents the profile of the cluster public load balancer.
type LoadBalancerProfile_STATUS struct {
	// EffectiveOutboundIps: The list of effective outbound IP addresses of the public load balancer.
	EffectiveOutboundIps []EffectiveOutboundIP_STATUS `json:"effectiveOutboundIps,omitempty"`

	// ManagedOutboundIps: The desired managed outbound IPs for the cluster public load balancer.
	ManagedOutboundIps *ManagedOutboundIPs_STATUS `json:"managedOutboundIps,omitempty"`
}

var _ genruntime.FromARMConverter = &LoadBalancerProfile_STATUS{}

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

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

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

	// Set property "ManagedOutboundIps":
	if typedInput.ManagedOutboundIps != nil {
		var managedOutboundIps1 ManagedOutboundIPs_STATUS
		err := managedOutboundIps1.PopulateFromARM(owner, *typedInput.ManagedOutboundIps)
		if err != nil {
			return err
		}
		managedOutboundIps := managedOutboundIps1
		profile.ManagedOutboundIps = &managedOutboundIps
	}

	// No error
	return nil
}

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

	// EffectiveOutboundIps
	if source.EffectiveOutboundIps != nil {
		effectiveOutboundIpsIPSList := make([]EffectiveOutboundIP_STATUS, len(source.EffectiveOutboundIps))
		for effectiveOutboundIpsIPSIndex, effectiveOutboundIpsIPSItem := range source.EffectiveOutboundIps {
			var effectiveOutboundIpsIPS EffectiveOutboundIP_STATUS
			err := effectiveOutboundIpsIPS.AssignProperties_From_EffectiveOutboundIP_STATUS(&effectiveOutboundIpsIPSItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EffectiveOutboundIP_STATUS() to populate field EffectiveOutboundIps")
			}
			effectiveOutboundIpsIPSList[effectiveOutboundIpsIPSIndex] = effectiveOutboundIpsIPS
		}
		profile.EffectiveOutboundIps = effectiveOutboundIpsIPSList
	} else {
		profile.EffectiveOutboundIps = nil
	}

	// ManagedOutboundIps
	if source.ManagedOutboundIps != nil {
		var managedOutboundIpsIPS ManagedOutboundIPs_STATUS
		err := managedOutboundIpsIPS.AssignProperties_From_ManagedOutboundIPs_STATUS(source.ManagedOutboundIps)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedOutboundIPs_STATUS() to populate field ManagedOutboundIps")
		}
		profile.ManagedOutboundIps = &managedOutboundIpsIPS
	} else {
		profile.ManagedOutboundIps = nil
	}

	// No error
	return nil
}

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

	// EffectiveOutboundIps
	if profile.EffectiveOutboundIps != nil {
		effectiveOutboundIpsIPSList := make([]storage.EffectiveOutboundIP_STATUS, len(profile.EffectiveOutboundIps))
		for effectiveOutboundIpsIPSIndex, effectiveOutboundIpsIPSItem := range profile.EffectiveOutboundIps {
			var effectiveOutboundIpsIPS storage.EffectiveOutboundIP_STATUS
			err := effectiveOutboundIpsIPSItem.AssignProperties_To_EffectiveOutboundIP_STATUS(&effectiveOutboundIpsIPS)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EffectiveOutboundIP_STATUS() to populate field EffectiveOutboundIps")
			}
			effectiveOutboundIpsIPSList[effectiveOutboundIpsIPSIndex] = effectiveOutboundIpsIPS
		}
		destination.EffectiveOutboundIps = effectiveOutboundIpsIPSList
	} else {
		destination.EffectiveOutboundIps = nil
	}

	// ManagedOutboundIps
	if profile.ManagedOutboundIps != nil {
		var managedOutboundIpsIPS storage.ManagedOutboundIPs_STATUS
		err := profile.ManagedOutboundIps.AssignProperties_To_ManagedOutboundIPs_STATUS(&managedOutboundIpsIPS)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedOutboundIPs_STATUS() to populate field ManagedOutboundIps")
		}
		destination.ManagedOutboundIps = &managedOutboundIpsIPS
	} else {
		destination.ManagedOutboundIps = nil
	}

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

	// No error
	return nil
}

type OpenShiftClusterOperatorSecrets struct {
	// AdminCredentials: indicates where the AdminCredentials secret should be placed. If omitted, the secret will not be
	// retrieved from Azure.
	AdminCredentials *genruntime.SecretDestination `json:"adminCredentials,omitempty"`

	// Password: indicates where the Password secret should be placed. If omitted, the secret will not be retrieved from Azure.
	Password *genruntime.SecretDestination `json:"password,omitempty"`

	// Username: indicates where the Username secret should be placed. If omitted, the secret will not be retrieved from Azure.
	Username *genruntime.SecretDestination `json:"username,omitempty"`
}

// AssignProperties_From_OpenShiftClusterOperatorSecrets populates our OpenShiftClusterOperatorSecrets from the provided source OpenShiftClusterOperatorSecrets
func (secrets *OpenShiftClusterOperatorSecrets) AssignProperties_From_OpenShiftClusterOperatorSecrets(source *storage.OpenShiftClusterOperatorSecrets) error {

	// AdminCredentials
	if source.AdminCredentials != nil {
		adminCredential := source.AdminCredentials.Copy()
		secrets.AdminCredentials = &adminCredential
	} else {
		secrets.AdminCredentials = nil
	}

	// Password
	if source.Password != nil {
		password := source.Password.Copy()
		secrets.Password = &password
	} else {
		secrets.Password = nil
	}

	// Username
	if source.Username != nil {
		username := source.Username.Copy()
		secrets.Username = &username
	} else {
		secrets.Username = nil
	}

	// No error
	return nil
}

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

	// AdminCredentials
	if secrets.AdminCredentials != nil {
		adminCredential := secrets.AdminCredentials.Copy()
		destination.AdminCredentials = &adminCredential
	} else {
		destination.AdminCredentials = nil
	}

	// Password
	if secrets.Password != nil {
		password := secrets.Password.Copy()
		destination.Password = &password
	} else {
		destination.Password = nil
	}

	// Username
	if secrets.Username != nil {
		username := secrets.Username.Copy()
		destination.Username = &username
	} else {
		destination.Username = nil
	}

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

	// No error
	return nil
}

// The outbound routing strategy used to provide your cluster egress to the internet.
// +kubebuilder:validation:Enum={"Loadbalancer","UserDefinedRouting"}
type OutboundType string

const (
	OutboundType_Loadbalancer       = OutboundType("Loadbalancer")
	OutboundType_UserDefinedRouting = OutboundType("UserDefinedRouting")
)

// Mapping from string to OutboundType
var outboundType_Values = map[string]OutboundType{
	"loadbalancer":       OutboundType_Loadbalancer,
	"userdefinedrouting": OutboundType_UserDefinedRouting,
}

// The outbound routing strategy used to provide your cluster egress to the internet.
type OutboundType_STATUS string

const (
	OutboundType_STATUS_Loadbalancer       = OutboundType_STATUS("Loadbalancer")
	OutboundType_STATUS_UserDefinedRouting = OutboundType_STATUS("UserDefinedRouting")
)

// Mapping from string to OutboundType_STATUS
var outboundType_STATUS_Values = map[string]OutboundType_STATUS{
	"loadbalancer":       OutboundType_STATUS_Loadbalancer,
	"userdefinedrouting": OutboundType_STATUS_UserDefinedRouting,
}

// PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type PreconfiguredNSG string

const (
	PreconfiguredNSG_Disabled = PreconfiguredNSG("Disabled")
	PreconfiguredNSG_Enabled  = PreconfiguredNSG("Enabled")
)

// Mapping from string to PreconfiguredNSG
var preconfiguredNSG_Values = map[string]PreconfiguredNSG{
	"disabled": PreconfiguredNSG_Disabled,
	"enabled":  PreconfiguredNSG_Enabled,
}

// PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets
type PreconfiguredNSG_STATUS string

const (
	PreconfiguredNSG_STATUS_Disabled = PreconfiguredNSG_STATUS("Disabled")
	PreconfiguredNSG_STATUS_Enabled  = PreconfiguredNSG_STATUS("Enabled")
)

// Mapping from string to PreconfiguredNSG_STATUS
var preconfiguredNSG_STATUS_Values = map[string]PreconfiguredNSG_STATUS{
	"disabled": PreconfiguredNSG_STATUS_Disabled,
	"enabled":  PreconfiguredNSG_STATUS_Enabled,
}

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

// Visibility represents visibility.
// +kubebuilder:validation:Enum={"Private","Public"}
type Visibility string

const (
	Visibility_Private = Visibility("Private")
	Visibility_Public  = Visibility("Public")
)

// Mapping from string to Visibility
var visibility_Values = map[string]Visibility{
	"private": Visibility_Private,
	"public":  Visibility_Public,
}

// Visibility represents visibility.
type Visibility_STATUS string

const (
	Visibility_STATUS_Private = Visibility_STATUS("Private")
	Visibility_STATUS_Public  = Visibility_STATUS("Public")
)

// Mapping from string to Visibility_STATUS
var visibility_STATUS_Values = map[string]Visibility_STATUS{
	"private": Visibility_STATUS_Private,
	"public":  Visibility_STATUS_Public,
}

// EffectiveOutboundIP represents an effective outbound IP resource of the cluster public load balancer.
type EffectiveOutboundIP_STATUS struct {
	// Id: The fully qualified Azure resource id of an IP address resource.
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &EffectiveOutboundIP_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_EffectiveOutboundIP_STATUS populates our EffectiveOutboundIP_STATUS from the provided source EffectiveOutboundIP_STATUS
func (outboundIP *EffectiveOutboundIP_STATUS) AssignProperties_From_EffectiveOutboundIP_STATUS(source *storage.EffectiveOutboundIP_STATUS) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// ManagedOutboundIPs represents the desired managed outbound IPs for the cluster public load balancer.
type ManagedOutboundIPs struct {
	// Count: Count represents the desired number of IPv4 outbound IPs created and managed by Azure for the cluster public load
	// balancer.  Allowed values are in the range of 1 - 20.  The default value is 1.
	Count *int `json:"count,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagedOutboundIPs{}

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

	// Set property "Count":
	if iPs.Count != nil {
		count := *iPs.Count
		result.Count = &count
	}
	return result, nil
}

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

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

	// Set property "Count":
	if typedInput.Count != nil {
		count := *typedInput.Count
		iPs.Count = &count
	}

	// No error
	return nil
}

// AssignProperties_From_ManagedOutboundIPs populates our ManagedOutboundIPs from the provided source ManagedOutboundIPs
func (iPs *ManagedOutboundIPs) AssignProperties_From_ManagedOutboundIPs(source *storage.ManagedOutboundIPs) error {

	// Count
	iPs.Count = genruntime.ClonePointerToInt(source.Count)

	// No error
	return nil
}

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

	// Count
	destination.Count = genruntime.ClonePointerToInt(iPs.Count)

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

	// No error
	return nil
}

// Initialize_From_ManagedOutboundIPs_STATUS populates our ManagedOutboundIPs from the provided source ManagedOutboundIPs_STATUS
func (iPs *ManagedOutboundIPs) Initialize_From_ManagedOutboundIPs_STATUS(source *ManagedOutboundIPs_STATUS) error {

	// Count
	iPs.Count = genruntime.ClonePointerToInt(source.Count)

	// No error
	return nil
}

// ManagedOutboundIPs represents the desired managed outbound IPs for the cluster public load balancer.
type ManagedOutboundIPs_STATUS struct {
	// Count: Count represents the desired number of IPv4 outbound IPs created and managed by Azure for the cluster public load
	// balancer.  Allowed values are in the range of 1 - 20.  The default value is 1.
	Count *int `json:"count,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagedOutboundIPs_STATUS{}

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

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

	// Set property "Count":
	if typedInput.Count != nil {
		count := *typedInput.Count
		iPs.Count = &count
	}

	// No error
	return nil
}

// AssignProperties_From_ManagedOutboundIPs_STATUS populates our ManagedOutboundIPs_STATUS from the provided source ManagedOutboundIPs_STATUS
func (iPs *ManagedOutboundIPs_STATUS) AssignProperties_From_ManagedOutboundIPs_STATUS(source *storage.ManagedOutboundIPs_STATUS) error {

	// Count
	iPs.Count = genruntime.ClonePointerToInt(source.Count)

	// No error
	return nil
}

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

	// Count
	destination.Count = genruntime.ClonePointerToInt(iPs.Count)

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&OpenShiftCluster{}, &OpenShiftClusterList{})
}
