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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/cdn/v1api20230501/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/cdn/v1api20230501/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,cdn}
// +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: /cdn/resource-manager/Microsoft.Cdn/Cdn/stable/2023-05-01/afdx.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}
type Secret struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Secret_Spec   `json:"spec,omitempty"`
	Status            Secret_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Secret{}

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

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

var _ conversion.Convertible = &Secret{}

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

	return secret.AssignProperties_From_Secret(source)
}

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

	return secret.AssignProperties_To_Secret(destination)
}

var _ configmaps.Exporter = &Secret{}

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

var _ secrets.Exporter = &Secret{}

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

var _ genruntime.ImportableResource = &Secret{}

// InitializeSpec initializes the spec for this resource from the given status
func (secret *Secret) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*Secret_STATUS); ok {
		return secret.Spec.Initialize_From_Secret_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &Secret{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2023-05-01"
func (secret Secret) GetAPIVersion() string {
	return "2023-05-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Cdn/profiles/secrets"
func (secret *Secret) GetType() string {
	return "Microsoft.Cdn/profiles/secrets"
}

// NewEmptyStatus returns a new empty (blank) status
func (secret *Secret) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Secret_STATUS{}
}

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

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

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

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

	secret.Status = st
	return nil
}

// AssignProperties_From_Secret populates our Secret from the provided source Secret
func (secret *Secret) AssignProperties_From_Secret(source *storage.Secret) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Secret populates the provided destination Secret from our Secret
func (secret *Secret) AssignProperties_To_Secret(destination *storage.Secret) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /cdn/resource-manager/Microsoft.Cdn/Cdn/stable/2023-05-01/afdx.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/secrets/{secretName}
type SecretList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Secret `json:"items"`
}

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

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *SecretOperatorSpec `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 cdn.azure.com/Profile resource
	Owner *genruntime.KnownResourceReference `group:"cdn.azure.com" json:"owner,omitempty" kind:"Profile"`

	// Parameters: object which contains secret parameters
	Parameters *SecretParameters `json:"parameters,omitempty"`
}

var _ genruntime.ARMTransformer = &Secret_Spec{}

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

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

	// Set property "Properties":
	if secret.Parameters != nil {
		result.Properties = &arm.SecretProperties{}
	}
	if secret.Parameters != nil {
		parameters_ARM, err := secret.Parameters.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		parameters := *parameters_ARM.(*arm.SecretParameters)
		result.Properties.Parameters = &parameters
	}
	return result, nil
}

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

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

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

	// no assignment for property "OperatorSpec"

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

	// Set property "Parameters":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Parameters != nil {
			var parameters1 SecretParameters
			err := parameters1.PopulateFromARM(owner, *typedInput.Properties.Parameters)
			if err != nil {
				return err
			}
			parameters := parameters1
			secret.Parameters = &parameters
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &Secret_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Secret_Spec{}
	err := secret.AssignProperties_To_Secret_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_Secret_Spec populates our Secret_Spec from the provided source Secret_Spec
func (secret *Secret_Spec) AssignProperties_From_Secret_Spec(source *storage.Secret_Spec) error {

	// AzureName
	secret.AzureName = source.AzureName

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

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

	// Parameters
	if source.Parameters != nil {
		var parameter SecretParameters
		err := parameter.AssignProperties_From_SecretParameters(source.Parameters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SecretParameters() to populate field Parameters")
		}
		secret.Parameters = &parameter
	} else {
		secret.Parameters = nil
	}

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = secret.AzureName

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

	// OriginalVersion
	destination.OriginalVersion = secret.OriginalVersion()

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

	// Parameters
	if secret.Parameters != nil {
		var parameter storage.SecretParameters
		err := secret.Parameters.AssignProperties_To_SecretParameters(&parameter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SecretParameters() to populate field Parameters")
		}
		destination.Parameters = &parameter
	} else {
		destination.Parameters = nil
	}

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

	// No error
	return nil
}

// Initialize_From_Secret_STATUS populates our Secret_Spec from the provided source Secret_STATUS
func (secret *Secret_Spec) Initialize_From_Secret_STATUS(source *Secret_STATUS) error {

	// Parameters
	if source.Parameters != nil {
		var parameter SecretParameters
		err := parameter.Initialize_From_SecretParameters_STATUS(source.Parameters)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SecretParameters_STATUS() to populate field Parameters")
		}
		secret.Parameters = &parameter
	} else {
		secret.Parameters = nil
	}

	// No error
	return nil
}

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

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

type Secret_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions       []conditions.Condition                    `json:"conditions,omitempty"`
	DeploymentStatus *SecretProperties_DeploymentStatus_STATUS `json:"deploymentStatus,omitempty"`

	// Id: Resource ID.
	Id *string `json:"id,omitempty"`

	// Name: Resource name.
	Name *string `json:"name,omitempty"`

	// Parameters: object which contains secret parameters
	Parameters *SecretParameters_STATUS `json:"parameters,omitempty"`

	// ProfileName: The name of the profile which holds the secret.
	ProfileName *string `json:"profileName,omitempty"`

	// ProvisioningState: Provisioning status
	ProvisioningState *SecretProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// SystemData: Read only system data
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

	// Type: Resource type.
	Type *string `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Secret_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.Secret_STATUS{}
	err := secret.AssignProperties_To_Secret_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 = &Secret_STATUS{}

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

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

	// no assignment for property "Conditions"

	// Set property "DeploymentStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeploymentStatus != nil {
			var temp string
			temp = string(*typedInput.Properties.DeploymentStatus)
			deploymentStatus := SecretProperties_DeploymentStatus_STATUS(temp)
			secret.DeploymentStatus = &deploymentStatus
		}
	}

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

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

	// Set property "Parameters":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Parameters != nil {
			var parameters1 SecretParameters_STATUS
			err := parameters1.PopulateFromARM(owner, *typedInput.Properties.Parameters)
			if err != nil {
				return err
			}
			parameters := parameters1
			secret.Parameters = &parameters
		}
	}

	// Set property "ProfileName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProfileName != nil {
			profileName := *typedInput.Properties.ProfileName
			secret.ProfileName = &profileName
		}
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_Secret_STATUS populates our Secret_STATUS from the provided source Secret_STATUS
func (secret *Secret_STATUS) AssignProperties_From_Secret_STATUS(source *storage.Secret_STATUS) error {

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

	// DeploymentStatus
	if source.DeploymentStatus != nil {
		deploymentStatus := *source.DeploymentStatus
		deploymentStatusTemp := genruntime.ToEnum(deploymentStatus, secretProperties_DeploymentStatus_STATUS_Values)
		secret.DeploymentStatus = &deploymentStatusTemp
	} else {
		secret.DeploymentStatus = nil
	}

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

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

	// Parameters
	if source.Parameters != nil {
		var parameter SecretParameters_STATUS
		err := parameter.AssignProperties_From_SecretParameters_STATUS(source.Parameters)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SecretParameters_STATUS() to populate field Parameters")
		}
		secret.Parameters = &parameter
	} else {
		secret.Parameters = nil
	}

	// ProfileName
	secret.ProfileName = genruntime.ClonePointerToString(source.ProfileName)

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

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

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

	// No error
	return nil
}

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

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

	// DeploymentStatus
	if secret.DeploymentStatus != nil {
		deploymentStatus := string(*secret.DeploymentStatus)
		destination.DeploymentStatus = &deploymentStatus
	} else {
		destination.DeploymentStatus = nil
	}

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

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

	// Parameters
	if secret.Parameters != nil {
		var parameter storage.SecretParameters_STATUS
		err := secret.Parameters.AssignProperties_To_SecretParameters_STATUS(&parameter)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SecretParameters_STATUS() to populate field Parameters")
		}
		destination.Parameters = &parameter
	} else {
		destination.Parameters = nil
	}

	// ProfileName
	destination.ProfileName = genruntime.ClonePointerToString(secret.ProfileName)

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

	// SystemData
	if secret.SystemData != nil {
		var systemDatum storage.SystemData_STATUS
		err := secret.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
	}

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

	// 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 SecretOperatorSpec struct {
	// ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

	// SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions).
	SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_SecretOperatorSpec populates our SecretOperatorSpec from the provided source SecretOperatorSpec
func (operator *SecretOperatorSpec) AssignProperties_From_SecretOperatorSpec(source *storage.SecretOperatorSpec) error {

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

type SecretParameters struct {
	// AzureFirstPartyManagedCertificate: Mutually exclusive with all other properties
	AzureFirstPartyManagedCertificate *AzureFirstPartyManagedCertificateParameters `json:"azureFirstPartyManagedCertificate,omitempty"`

	// CustomerCertificate: Mutually exclusive with all other properties
	CustomerCertificate *CustomerCertificateParameters `json:"customerCertificate,omitempty"`

	// ManagedCertificate: Mutually exclusive with all other properties
	ManagedCertificate *ManagedCertificateParameters `json:"managedCertificate,omitempty"`

	// UrlSigningKey: Mutually exclusive with all other properties
	UrlSigningKey *UrlSigningKeyParameters `json:"urlSigningKey,omitempty"`
}

var _ genruntime.ARMTransformer = &SecretParameters{}

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

	// Set property "AzureFirstPartyManagedCertificate":
	if parameters.AzureFirstPartyManagedCertificate != nil {
		azureFirstPartyManagedCertificate_ARM, err := parameters.AzureFirstPartyManagedCertificate.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		azureFirstPartyManagedCertificate := *azureFirstPartyManagedCertificate_ARM.(*arm.AzureFirstPartyManagedCertificateParameters)
		result.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	}

	// Set property "CustomerCertificate":
	if parameters.CustomerCertificate != nil {
		customerCertificate_ARM, err := parameters.CustomerCertificate.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		customerCertificate := *customerCertificate_ARM.(*arm.CustomerCertificateParameters)
		result.CustomerCertificate = &customerCertificate
	}

	// Set property "ManagedCertificate":
	if parameters.ManagedCertificate != nil {
		managedCertificate_ARM, err := parameters.ManagedCertificate.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		managedCertificate := *managedCertificate_ARM.(*arm.ManagedCertificateParameters)
		result.ManagedCertificate = &managedCertificate
	}

	// Set property "UrlSigningKey":
	if parameters.UrlSigningKey != nil {
		urlSigningKey_ARM, err := parameters.UrlSigningKey.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		urlSigningKey := *urlSigningKey_ARM.(*arm.UrlSigningKeyParameters)
		result.UrlSigningKey = &urlSigningKey
	}
	return result, nil
}

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

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

	// Set property "AzureFirstPartyManagedCertificate":
	if typedInput.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate1 AzureFirstPartyManagedCertificateParameters
		err := azureFirstPartyManagedCertificate1.PopulateFromARM(owner, *typedInput.AzureFirstPartyManagedCertificate)
		if err != nil {
			return err
		}
		azureFirstPartyManagedCertificate := azureFirstPartyManagedCertificate1
		parameters.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	}

	// Set property "CustomerCertificate":
	if typedInput.CustomerCertificate != nil {
		var customerCertificate1 CustomerCertificateParameters
		err := customerCertificate1.PopulateFromARM(owner, *typedInput.CustomerCertificate)
		if err != nil {
			return err
		}
		customerCertificate := customerCertificate1
		parameters.CustomerCertificate = &customerCertificate
	}

	// Set property "ManagedCertificate":
	if typedInput.ManagedCertificate != nil {
		var managedCertificate1 ManagedCertificateParameters
		err := managedCertificate1.PopulateFromARM(owner, *typedInput.ManagedCertificate)
		if err != nil {
			return err
		}
		managedCertificate := managedCertificate1
		parameters.ManagedCertificate = &managedCertificate
	}

	// Set property "UrlSigningKey":
	if typedInput.UrlSigningKey != nil {
		var urlSigningKey1 UrlSigningKeyParameters
		err := urlSigningKey1.PopulateFromARM(owner, *typedInput.UrlSigningKey)
		if err != nil {
			return err
		}
		urlSigningKey := urlSigningKey1
		parameters.UrlSigningKey = &urlSigningKey
	}

	// No error
	return nil
}

// AssignProperties_From_SecretParameters populates our SecretParameters from the provided source SecretParameters
func (parameters *SecretParameters) AssignProperties_From_SecretParameters(source *storage.SecretParameters) error {

	// AzureFirstPartyManagedCertificate
	if source.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate AzureFirstPartyManagedCertificateParameters
		err := azureFirstPartyManagedCertificate.AssignProperties_From_AzureFirstPartyManagedCertificateParameters(source.AzureFirstPartyManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AzureFirstPartyManagedCertificateParameters() to populate field AzureFirstPartyManagedCertificate")
		}
		parameters.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	} else {
		parameters.AzureFirstPartyManagedCertificate = nil
	}

	// CustomerCertificate
	if source.CustomerCertificate != nil {
		var customerCertificate CustomerCertificateParameters
		err := customerCertificate.AssignProperties_From_CustomerCertificateParameters(source.CustomerCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CustomerCertificateParameters() to populate field CustomerCertificate")
		}
		parameters.CustomerCertificate = &customerCertificate
	} else {
		parameters.CustomerCertificate = nil
	}

	// ManagedCertificate
	if source.ManagedCertificate != nil {
		var managedCertificate ManagedCertificateParameters
		err := managedCertificate.AssignProperties_From_ManagedCertificateParameters(source.ManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedCertificateParameters() to populate field ManagedCertificate")
		}
		parameters.ManagedCertificate = &managedCertificate
	} else {
		parameters.ManagedCertificate = nil
	}

	// UrlSigningKey
	if source.UrlSigningKey != nil {
		var urlSigningKey UrlSigningKeyParameters
		err := urlSigningKey.AssignProperties_From_UrlSigningKeyParameters(source.UrlSigningKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UrlSigningKeyParameters() to populate field UrlSigningKey")
		}
		parameters.UrlSigningKey = &urlSigningKey
	} else {
		parameters.UrlSigningKey = nil
	}

	// No error
	return nil
}

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

	// AzureFirstPartyManagedCertificate
	if parameters.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate storage.AzureFirstPartyManagedCertificateParameters
		err := parameters.AzureFirstPartyManagedCertificate.AssignProperties_To_AzureFirstPartyManagedCertificateParameters(&azureFirstPartyManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AzureFirstPartyManagedCertificateParameters() to populate field AzureFirstPartyManagedCertificate")
		}
		destination.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	} else {
		destination.AzureFirstPartyManagedCertificate = nil
	}

	// CustomerCertificate
	if parameters.CustomerCertificate != nil {
		var customerCertificate storage.CustomerCertificateParameters
		err := parameters.CustomerCertificate.AssignProperties_To_CustomerCertificateParameters(&customerCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CustomerCertificateParameters() to populate field CustomerCertificate")
		}
		destination.CustomerCertificate = &customerCertificate
	} else {
		destination.CustomerCertificate = nil
	}

	// ManagedCertificate
	if parameters.ManagedCertificate != nil {
		var managedCertificate storage.ManagedCertificateParameters
		err := parameters.ManagedCertificate.AssignProperties_To_ManagedCertificateParameters(&managedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedCertificateParameters() to populate field ManagedCertificate")
		}
		destination.ManagedCertificate = &managedCertificate
	} else {
		destination.ManagedCertificate = nil
	}

	// UrlSigningKey
	if parameters.UrlSigningKey != nil {
		var urlSigningKey storage.UrlSigningKeyParameters
		err := parameters.UrlSigningKey.AssignProperties_To_UrlSigningKeyParameters(&urlSigningKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UrlSigningKeyParameters() to populate field UrlSigningKey")
		}
		destination.UrlSigningKey = &urlSigningKey
	} else {
		destination.UrlSigningKey = nil
	}

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

	// No error
	return nil
}

// Initialize_From_SecretParameters_STATUS populates our SecretParameters from the provided source SecretParameters_STATUS
func (parameters *SecretParameters) Initialize_From_SecretParameters_STATUS(source *SecretParameters_STATUS) error {

	// AzureFirstPartyManagedCertificate
	if source.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate AzureFirstPartyManagedCertificateParameters
		err := azureFirstPartyManagedCertificate.Initialize_From_AzureFirstPartyManagedCertificateParameters_STATUS(source.AzureFirstPartyManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_AzureFirstPartyManagedCertificateParameters_STATUS() to populate field AzureFirstPartyManagedCertificate")
		}
		parameters.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	} else {
		parameters.AzureFirstPartyManagedCertificate = nil
	}

	// CustomerCertificate
	if source.CustomerCertificate != nil {
		var customerCertificate CustomerCertificateParameters
		err := customerCertificate.Initialize_From_CustomerCertificateParameters_STATUS(source.CustomerCertificate)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_CustomerCertificateParameters_STATUS() to populate field CustomerCertificate")
		}
		parameters.CustomerCertificate = &customerCertificate
	} else {
		parameters.CustomerCertificate = nil
	}

	// ManagedCertificate
	if source.ManagedCertificate != nil {
		var managedCertificate ManagedCertificateParameters
		err := managedCertificate.Initialize_From_ManagedCertificateParameters_STATUS(source.ManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ManagedCertificateParameters_STATUS() to populate field ManagedCertificate")
		}
		parameters.ManagedCertificate = &managedCertificate
	} else {
		parameters.ManagedCertificate = nil
	}

	// UrlSigningKey
	if source.UrlSigningKey != nil {
		var urlSigningKey UrlSigningKeyParameters
		err := urlSigningKey.Initialize_From_UrlSigningKeyParameters_STATUS(source.UrlSigningKey)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_UrlSigningKeyParameters_STATUS() to populate field UrlSigningKey")
		}
		parameters.UrlSigningKey = &urlSigningKey
	} else {
		parameters.UrlSigningKey = nil
	}

	// No error
	return nil
}

type SecretParameters_STATUS struct {
	// AzureFirstPartyManagedCertificate: Mutually exclusive with all other properties
	AzureFirstPartyManagedCertificate *AzureFirstPartyManagedCertificateParameters_STATUS `json:"azureFirstPartyManagedCertificate,omitempty"`

	// CustomerCertificate: Mutually exclusive with all other properties
	CustomerCertificate *CustomerCertificateParameters_STATUS `json:"customerCertificate,omitempty"`

	// ManagedCertificate: Mutually exclusive with all other properties
	ManagedCertificate *ManagedCertificateParameters_STATUS `json:"managedCertificate,omitempty"`

	// UrlSigningKey: Mutually exclusive with all other properties
	UrlSigningKey *UrlSigningKeyParameters_STATUS `json:"urlSigningKey,omitempty"`
}

var _ genruntime.FromARMConverter = &SecretParameters_STATUS{}

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

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

	// Set property "AzureFirstPartyManagedCertificate":
	if typedInput.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate1 AzureFirstPartyManagedCertificateParameters_STATUS
		err := azureFirstPartyManagedCertificate1.PopulateFromARM(owner, *typedInput.AzureFirstPartyManagedCertificate)
		if err != nil {
			return err
		}
		azureFirstPartyManagedCertificate := azureFirstPartyManagedCertificate1
		parameters.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	}

	// Set property "CustomerCertificate":
	if typedInput.CustomerCertificate != nil {
		var customerCertificate1 CustomerCertificateParameters_STATUS
		err := customerCertificate1.PopulateFromARM(owner, *typedInput.CustomerCertificate)
		if err != nil {
			return err
		}
		customerCertificate := customerCertificate1
		parameters.CustomerCertificate = &customerCertificate
	}

	// Set property "ManagedCertificate":
	if typedInput.ManagedCertificate != nil {
		var managedCertificate1 ManagedCertificateParameters_STATUS
		err := managedCertificate1.PopulateFromARM(owner, *typedInput.ManagedCertificate)
		if err != nil {
			return err
		}
		managedCertificate := managedCertificate1
		parameters.ManagedCertificate = &managedCertificate
	}

	// Set property "UrlSigningKey":
	if typedInput.UrlSigningKey != nil {
		var urlSigningKey1 UrlSigningKeyParameters_STATUS
		err := urlSigningKey1.PopulateFromARM(owner, *typedInput.UrlSigningKey)
		if err != nil {
			return err
		}
		urlSigningKey := urlSigningKey1
		parameters.UrlSigningKey = &urlSigningKey
	}

	// No error
	return nil
}

// AssignProperties_From_SecretParameters_STATUS populates our SecretParameters_STATUS from the provided source SecretParameters_STATUS
func (parameters *SecretParameters_STATUS) AssignProperties_From_SecretParameters_STATUS(source *storage.SecretParameters_STATUS) error {

	// AzureFirstPartyManagedCertificate
	if source.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate AzureFirstPartyManagedCertificateParameters_STATUS
		err := azureFirstPartyManagedCertificate.AssignProperties_From_AzureFirstPartyManagedCertificateParameters_STATUS(source.AzureFirstPartyManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_AzureFirstPartyManagedCertificateParameters_STATUS() to populate field AzureFirstPartyManagedCertificate")
		}
		parameters.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	} else {
		parameters.AzureFirstPartyManagedCertificate = nil
	}

	// CustomerCertificate
	if source.CustomerCertificate != nil {
		var customerCertificate CustomerCertificateParameters_STATUS
		err := customerCertificate.AssignProperties_From_CustomerCertificateParameters_STATUS(source.CustomerCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CustomerCertificateParameters_STATUS() to populate field CustomerCertificate")
		}
		parameters.CustomerCertificate = &customerCertificate
	} else {
		parameters.CustomerCertificate = nil
	}

	// ManagedCertificate
	if source.ManagedCertificate != nil {
		var managedCertificate ManagedCertificateParameters_STATUS
		err := managedCertificate.AssignProperties_From_ManagedCertificateParameters_STATUS(source.ManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ManagedCertificateParameters_STATUS() to populate field ManagedCertificate")
		}
		parameters.ManagedCertificate = &managedCertificate
	} else {
		parameters.ManagedCertificate = nil
	}

	// UrlSigningKey
	if source.UrlSigningKey != nil {
		var urlSigningKey UrlSigningKeyParameters_STATUS
		err := urlSigningKey.AssignProperties_From_UrlSigningKeyParameters_STATUS(source.UrlSigningKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_UrlSigningKeyParameters_STATUS() to populate field UrlSigningKey")
		}
		parameters.UrlSigningKey = &urlSigningKey
	} else {
		parameters.UrlSigningKey = nil
	}

	// No error
	return nil
}

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

	// AzureFirstPartyManagedCertificate
	if parameters.AzureFirstPartyManagedCertificate != nil {
		var azureFirstPartyManagedCertificate storage.AzureFirstPartyManagedCertificateParameters_STATUS
		err := parameters.AzureFirstPartyManagedCertificate.AssignProperties_To_AzureFirstPartyManagedCertificateParameters_STATUS(&azureFirstPartyManagedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_AzureFirstPartyManagedCertificateParameters_STATUS() to populate field AzureFirstPartyManagedCertificate")
		}
		destination.AzureFirstPartyManagedCertificate = &azureFirstPartyManagedCertificate
	} else {
		destination.AzureFirstPartyManagedCertificate = nil
	}

	// CustomerCertificate
	if parameters.CustomerCertificate != nil {
		var customerCertificate storage.CustomerCertificateParameters_STATUS
		err := parameters.CustomerCertificate.AssignProperties_To_CustomerCertificateParameters_STATUS(&customerCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CustomerCertificateParameters_STATUS() to populate field CustomerCertificate")
		}
		destination.CustomerCertificate = &customerCertificate
	} else {
		destination.CustomerCertificate = nil
	}

	// ManagedCertificate
	if parameters.ManagedCertificate != nil {
		var managedCertificate storage.ManagedCertificateParameters_STATUS
		err := parameters.ManagedCertificate.AssignProperties_To_ManagedCertificateParameters_STATUS(&managedCertificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ManagedCertificateParameters_STATUS() to populate field ManagedCertificate")
		}
		destination.ManagedCertificate = &managedCertificate
	} else {
		destination.ManagedCertificate = nil
	}

	// UrlSigningKey
	if parameters.UrlSigningKey != nil {
		var urlSigningKey storage.UrlSigningKeyParameters_STATUS
		err := parameters.UrlSigningKey.AssignProperties_To_UrlSigningKeyParameters_STATUS(&urlSigningKey)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_UrlSigningKeyParameters_STATUS() to populate field UrlSigningKey")
		}
		destination.UrlSigningKey = &urlSigningKey
	} else {
		destination.UrlSigningKey = nil
	}

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

	// No error
	return nil
}

type SecretProperties_DeploymentStatus_STATUS string

const (
	SecretProperties_DeploymentStatus_STATUS_Failed     = SecretProperties_DeploymentStatus_STATUS("Failed")
	SecretProperties_DeploymentStatus_STATUS_InProgress = SecretProperties_DeploymentStatus_STATUS("InProgress")
	SecretProperties_DeploymentStatus_STATUS_NotStarted = SecretProperties_DeploymentStatus_STATUS("NotStarted")
	SecretProperties_DeploymentStatus_STATUS_Succeeded  = SecretProperties_DeploymentStatus_STATUS("Succeeded")
)

// Mapping from string to SecretProperties_DeploymentStatus_STATUS
var secretProperties_DeploymentStatus_STATUS_Values = map[string]SecretProperties_DeploymentStatus_STATUS{
	"failed":     SecretProperties_DeploymentStatus_STATUS_Failed,
	"inprogress": SecretProperties_DeploymentStatus_STATUS_InProgress,
	"notstarted": SecretProperties_DeploymentStatus_STATUS_NotStarted,
	"succeeded":  SecretProperties_DeploymentStatus_STATUS_Succeeded,
}

type SecretProperties_ProvisioningState_STATUS string

const (
	SecretProperties_ProvisioningState_STATUS_Creating  = SecretProperties_ProvisioningState_STATUS("Creating")
	SecretProperties_ProvisioningState_STATUS_Deleting  = SecretProperties_ProvisioningState_STATUS("Deleting")
	SecretProperties_ProvisioningState_STATUS_Failed    = SecretProperties_ProvisioningState_STATUS("Failed")
	SecretProperties_ProvisioningState_STATUS_Succeeded = SecretProperties_ProvisioningState_STATUS("Succeeded")
	SecretProperties_ProvisioningState_STATUS_Updating  = SecretProperties_ProvisioningState_STATUS("Updating")
)

// Mapping from string to SecretProperties_ProvisioningState_STATUS
var secretProperties_ProvisioningState_STATUS_Values = map[string]SecretProperties_ProvisioningState_STATUS{
	"creating":  SecretProperties_ProvisioningState_STATUS_Creating,
	"deleting":  SecretProperties_ProvisioningState_STATUS_Deleting,
	"failed":    SecretProperties_ProvisioningState_STATUS_Failed,
	"succeeded": SecretProperties_ProvisioningState_STATUS_Succeeded,
	"updating":  SecretProperties_ProvisioningState_STATUS_Updating,
}

type AzureFirstPartyManagedCertificateParameters struct {
	// SubjectAlternativeNames: The list of SANs.
	SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`

	// +kubebuilder:validation:Required
	Type *AzureFirstPartyManagedCertificateParameters_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &AzureFirstPartyManagedCertificateParameters{}

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

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

	// Set property "Type":
	if parameters.Type != nil {
		var temp arm.AzureFirstPartyManagedCertificateParameters_Type
		var temp1 string
		temp1 = string(*parameters.Type)
		temp = arm.AzureFirstPartyManagedCertificateParameters_Type(temp1)
		result.Type = temp
	}
	return result, nil
}

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

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

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

	// Set property "Type":
	var temp AzureFirstPartyManagedCertificateParameters_Type
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = AzureFirstPartyManagedCertificateParameters_Type(temp1)
	parameters.Type = &temp

	// No error
	return nil
}

// AssignProperties_From_AzureFirstPartyManagedCertificateParameters populates our AzureFirstPartyManagedCertificateParameters from the provided source AzureFirstPartyManagedCertificateParameters
func (parameters *AzureFirstPartyManagedCertificateParameters) AssignProperties_From_AzureFirstPartyManagedCertificateParameters(source *storage.AzureFirstPartyManagedCertificateParameters) error {

	// SubjectAlternativeNames
	parameters.SubjectAlternativeNames = genruntime.CloneSliceOfString(source.SubjectAlternativeNames)

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

	// No error
	return nil
}

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

	// SubjectAlternativeNames
	destination.SubjectAlternativeNames = genruntime.CloneSliceOfString(parameters.SubjectAlternativeNames)

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

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

	// No error
	return nil
}

// Initialize_From_AzureFirstPartyManagedCertificateParameters_STATUS populates our AzureFirstPartyManagedCertificateParameters from the provided source AzureFirstPartyManagedCertificateParameters_STATUS
func (parameters *AzureFirstPartyManagedCertificateParameters) Initialize_From_AzureFirstPartyManagedCertificateParameters_STATUS(source *AzureFirstPartyManagedCertificateParameters_STATUS) error {

	// SubjectAlternativeNames
	parameters.SubjectAlternativeNames = genruntime.CloneSliceOfString(source.SubjectAlternativeNames)

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

	// No error
	return nil
}

type AzureFirstPartyManagedCertificateParameters_STATUS struct {
	// CertificateAuthority: Certificate issuing authority.
	CertificateAuthority *string `json:"certificateAuthority,omitempty"`

	// ExpirationDate: Certificate expiration date.
	ExpirationDate *string `json:"expirationDate,omitempty"`

	// SecretSource: Resource reference to the Azure Key Vault certificate. Expected to be in format of
	// /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
	SecretSource *ResourceReference_STATUS `json:"secretSource,omitempty"`

	// Subject: Subject name in the certificate.
	Subject *string `json:"subject,omitempty"`

	// SubjectAlternativeNames: The list of SANs.
	SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`

	// Thumbprint: Certificate thumbprint.
	Thumbprint *string                                                  `json:"thumbprint,omitempty"`
	Type       *AzureFirstPartyManagedCertificateParameters_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &AzureFirstPartyManagedCertificateParameters_STATUS{}

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

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

	// Set property "CertificateAuthority":
	if typedInput.CertificateAuthority != nil {
		certificateAuthority := *typedInput.CertificateAuthority
		parameters.CertificateAuthority = &certificateAuthority
	}

	// Set property "ExpirationDate":
	if typedInput.ExpirationDate != nil {
		expirationDate := *typedInput.ExpirationDate
		parameters.ExpirationDate = &expirationDate
	}

	// Set property "SecretSource":
	if typedInput.SecretSource != nil {
		var secretSource1 ResourceReference_STATUS
		err := secretSource1.PopulateFromARM(owner, *typedInput.SecretSource)
		if err != nil {
			return err
		}
		secretSource := secretSource1
		parameters.SecretSource = &secretSource
	}

	// Set property "Subject":
	if typedInput.Subject != nil {
		subject := *typedInput.Subject
		parameters.Subject = &subject
	}

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

	// Set property "Thumbprint":
	if typedInput.Thumbprint != nil {
		thumbprint := *typedInput.Thumbprint
		parameters.Thumbprint = &thumbprint
	}

	// Set property "Type":
	var temp AzureFirstPartyManagedCertificateParameters_Type_STATUS
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = AzureFirstPartyManagedCertificateParameters_Type_STATUS(temp1)
	parameters.Type = &temp

	// No error
	return nil
}

// AssignProperties_From_AzureFirstPartyManagedCertificateParameters_STATUS populates our AzureFirstPartyManagedCertificateParameters_STATUS from the provided source AzureFirstPartyManagedCertificateParameters_STATUS
func (parameters *AzureFirstPartyManagedCertificateParameters_STATUS) AssignProperties_From_AzureFirstPartyManagedCertificateParameters_STATUS(source *storage.AzureFirstPartyManagedCertificateParameters_STATUS) error {

	// CertificateAuthority
	parameters.CertificateAuthority = genruntime.ClonePointerToString(source.CertificateAuthority)

	// ExpirationDate
	parameters.ExpirationDate = genruntime.ClonePointerToString(source.ExpirationDate)

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference_STATUS
		err := secretSource.AssignProperties_From_ResourceReference_STATUS(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceReference_STATUS() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// Subject
	parameters.Subject = genruntime.ClonePointerToString(source.Subject)

	// SubjectAlternativeNames
	parameters.SubjectAlternativeNames = genruntime.CloneSliceOfString(source.SubjectAlternativeNames)

	// Thumbprint
	parameters.Thumbprint = genruntime.ClonePointerToString(source.Thumbprint)

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

	// No error
	return nil
}

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

	// CertificateAuthority
	destination.CertificateAuthority = genruntime.ClonePointerToString(parameters.CertificateAuthority)

	// ExpirationDate
	destination.ExpirationDate = genruntime.ClonePointerToString(parameters.ExpirationDate)

	// SecretSource
	if parameters.SecretSource != nil {
		var secretSource storage.ResourceReference_STATUS
		err := parameters.SecretSource.AssignProperties_To_ResourceReference_STATUS(&secretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceReference_STATUS() to populate field SecretSource")
		}
		destination.SecretSource = &secretSource
	} else {
		destination.SecretSource = nil
	}

	// Subject
	destination.Subject = genruntime.ClonePointerToString(parameters.Subject)

	// SubjectAlternativeNames
	destination.SubjectAlternativeNames = genruntime.CloneSliceOfString(parameters.SubjectAlternativeNames)

	// Thumbprint
	destination.Thumbprint = genruntime.ClonePointerToString(parameters.Thumbprint)

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

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

	// No error
	return nil
}

type CustomerCertificateParameters struct {
	// +kubebuilder:validation:Required
	// SecretSource: Resource reference to the Azure Key Vault certificate. Expected to be in format of
	// /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
	SecretSource *ResourceReference `json:"secretSource,omitempty"`

	// SecretVersion: Version of the secret to be used
	SecretVersion *string `json:"secretVersion,omitempty"`

	// SubjectAlternativeNames: The list of SANs.
	SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`

	// +kubebuilder:validation:Required
	Type *CustomerCertificateParameters_Type `json:"type,omitempty"`

	// UseLatestVersion: Whether to use the latest version for the certificate
	UseLatestVersion *bool `json:"useLatestVersion,omitempty"`
}

var _ genruntime.ARMTransformer = &CustomerCertificateParameters{}

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

	// Set property "SecretSource":
	if parameters.SecretSource != nil {
		secretSource_ARM, err := parameters.SecretSource.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		secretSource := *secretSource_ARM.(*arm.ResourceReference)
		result.SecretSource = &secretSource
	}

	// Set property "SecretVersion":
	if parameters.SecretVersion != nil {
		secretVersion := *parameters.SecretVersion
		result.SecretVersion = &secretVersion
	}

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

	// Set property "Type":
	if parameters.Type != nil {
		var temp arm.CustomerCertificateParameters_Type
		var temp1 string
		temp1 = string(*parameters.Type)
		temp = arm.CustomerCertificateParameters_Type(temp1)
		result.Type = temp
	}

	// Set property "UseLatestVersion":
	if parameters.UseLatestVersion != nil {
		useLatestVersion := *parameters.UseLatestVersion
		result.UseLatestVersion = &useLatestVersion
	}
	return result, nil
}

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

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

	// Set property "SecretSource":
	if typedInput.SecretSource != nil {
		var secretSource1 ResourceReference
		err := secretSource1.PopulateFromARM(owner, *typedInput.SecretSource)
		if err != nil {
			return err
		}
		secretSource := secretSource1
		parameters.SecretSource = &secretSource
	}

	// Set property "SecretVersion":
	if typedInput.SecretVersion != nil {
		secretVersion := *typedInput.SecretVersion
		parameters.SecretVersion = &secretVersion
	}

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

	// Set property "Type":
	var temp CustomerCertificateParameters_Type
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = CustomerCertificateParameters_Type(temp1)
	parameters.Type = &temp

	// Set property "UseLatestVersion":
	if typedInput.UseLatestVersion != nil {
		useLatestVersion := *typedInput.UseLatestVersion
		parameters.UseLatestVersion = &useLatestVersion
	}

	// No error
	return nil
}

// AssignProperties_From_CustomerCertificateParameters populates our CustomerCertificateParameters from the provided source CustomerCertificateParameters
func (parameters *CustomerCertificateParameters) AssignProperties_From_CustomerCertificateParameters(source *storage.CustomerCertificateParameters) error {

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference
		err := secretSource.AssignProperties_From_ResourceReference(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceReference() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// SecretVersion
	parameters.SecretVersion = genruntime.ClonePointerToString(source.SecretVersion)

	// SubjectAlternativeNames
	parameters.SubjectAlternativeNames = genruntime.CloneSliceOfString(source.SubjectAlternativeNames)

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

	// UseLatestVersion
	if source.UseLatestVersion != nil {
		useLatestVersion := *source.UseLatestVersion
		parameters.UseLatestVersion = &useLatestVersion
	} else {
		parameters.UseLatestVersion = nil
	}

	// No error
	return nil
}

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

	// SecretSource
	if parameters.SecretSource != nil {
		var secretSource storage.ResourceReference
		err := parameters.SecretSource.AssignProperties_To_ResourceReference(&secretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceReference() to populate field SecretSource")
		}
		destination.SecretSource = &secretSource
	} else {
		destination.SecretSource = nil
	}

	// SecretVersion
	destination.SecretVersion = genruntime.ClonePointerToString(parameters.SecretVersion)

	// SubjectAlternativeNames
	destination.SubjectAlternativeNames = genruntime.CloneSliceOfString(parameters.SubjectAlternativeNames)

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

	// UseLatestVersion
	if parameters.UseLatestVersion != nil {
		useLatestVersion := *parameters.UseLatestVersion
		destination.UseLatestVersion = &useLatestVersion
	} else {
		destination.UseLatestVersion = nil
	}

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

	// No error
	return nil
}

// Initialize_From_CustomerCertificateParameters_STATUS populates our CustomerCertificateParameters from the provided source CustomerCertificateParameters_STATUS
func (parameters *CustomerCertificateParameters) Initialize_From_CustomerCertificateParameters_STATUS(source *CustomerCertificateParameters_STATUS) error {

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference
		err := secretSource.Initialize_From_ResourceReference_STATUS(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ResourceReference_STATUS() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// SecretVersion
	parameters.SecretVersion = genruntime.ClonePointerToString(source.SecretVersion)

	// SubjectAlternativeNames
	parameters.SubjectAlternativeNames = genruntime.CloneSliceOfString(source.SubjectAlternativeNames)

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

	// UseLatestVersion
	if source.UseLatestVersion != nil {
		useLatestVersion := *source.UseLatestVersion
		parameters.UseLatestVersion = &useLatestVersion
	} else {
		parameters.UseLatestVersion = nil
	}

	// No error
	return nil
}

type CustomerCertificateParameters_STATUS struct {
	// CertificateAuthority: Certificate issuing authority.
	CertificateAuthority *string `json:"certificateAuthority,omitempty"`

	// ExpirationDate: Certificate expiration date.
	ExpirationDate *string `json:"expirationDate,omitempty"`

	// SecretSource: Resource reference to the Azure Key Vault certificate. Expected to be in format of
	// /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
	SecretSource *ResourceReference_STATUS `json:"secretSource,omitempty"`

	// SecretVersion: Version of the secret to be used
	SecretVersion *string `json:"secretVersion,omitempty"`

	// Subject: Subject name in the certificate.
	Subject *string `json:"subject,omitempty"`

	// SubjectAlternativeNames: The list of SANs.
	SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty"`

	// Thumbprint: Certificate thumbprint.
	Thumbprint *string                                    `json:"thumbprint,omitempty"`
	Type       *CustomerCertificateParameters_Type_STATUS `json:"type,omitempty"`

	// UseLatestVersion: Whether to use the latest version for the certificate
	UseLatestVersion *bool `json:"useLatestVersion,omitempty"`
}

var _ genruntime.FromARMConverter = &CustomerCertificateParameters_STATUS{}

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

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

	// Set property "CertificateAuthority":
	if typedInput.CertificateAuthority != nil {
		certificateAuthority := *typedInput.CertificateAuthority
		parameters.CertificateAuthority = &certificateAuthority
	}

	// Set property "ExpirationDate":
	if typedInput.ExpirationDate != nil {
		expirationDate := *typedInput.ExpirationDate
		parameters.ExpirationDate = &expirationDate
	}

	// Set property "SecretSource":
	if typedInput.SecretSource != nil {
		var secretSource1 ResourceReference_STATUS
		err := secretSource1.PopulateFromARM(owner, *typedInput.SecretSource)
		if err != nil {
			return err
		}
		secretSource := secretSource1
		parameters.SecretSource = &secretSource
	}

	// Set property "SecretVersion":
	if typedInput.SecretVersion != nil {
		secretVersion := *typedInput.SecretVersion
		parameters.SecretVersion = &secretVersion
	}

	// Set property "Subject":
	if typedInput.Subject != nil {
		subject := *typedInput.Subject
		parameters.Subject = &subject
	}

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

	// Set property "Thumbprint":
	if typedInput.Thumbprint != nil {
		thumbprint := *typedInput.Thumbprint
		parameters.Thumbprint = &thumbprint
	}

	// Set property "Type":
	var temp CustomerCertificateParameters_Type_STATUS
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = CustomerCertificateParameters_Type_STATUS(temp1)
	parameters.Type = &temp

	// Set property "UseLatestVersion":
	if typedInput.UseLatestVersion != nil {
		useLatestVersion := *typedInput.UseLatestVersion
		parameters.UseLatestVersion = &useLatestVersion
	}

	// No error
	return nil
}

// AssignProperties_From_CustomerCertificateParameters_STATUS populates our CustomerCertificateParameters_STATUS from the provided source CustomerCertificateParameters_STATUS
func (parameters *CustomerCertificateParameters_STATUS) AssignProperties_From_CustomerCertificateParameters_STATUS(source *storage.CustomerCertificateParameters_STATUS) error {

	// CertificateAuthority
	parameters.CertificateAuthority = genruntime.ClonePointerToString(source.CertificateAuthority)

	// ExpirationDate
	parameters.ExpirationDate = genruntime.ClonePointerToString(source.ExpirationDate)

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference_STATUS
		err := secretSource.AssignProperties_From_ResourceReference_STATUS(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceReference_STATUS() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// SecretVersion
	parameters.SecretVersion = genruntime.ClonePointerToString(source.SecretVersion)

	// Subject
	parameters.Subject = genruntime.ClonePointerToString(source.Subject)

	// SubjectAlternativeNames
	parameters.SubjectAlternativeNames = genruntime.CloneSliceOfString(source.SubjectAlternativeNames)

	// Thumbprint
	parameters.Thumbprint = genruntime.ClonePointerToString(source.Thumbprint)

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

	// UseLatestVersion
	if source.UseLatestVersion != nil {
		useLatestVersion := *source.UseLatestVersion
		parameters.UseLatestVersion = &useLatestVersion
	} else {
		parameters.UseLatestVersion = nil
	}

	// No error
	return nil
}

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

	// CertificateAuthority
	destination.CertificateAuthority = genruntime.ClonePointerToString(parameters.CertificateAuthority)

	// ExpirationDate
	destination.ExpirationDate = genruntime.ClonePointerToString(parameters.ExpirationDate)

	// SecretSource
	if parameters.SecretSource != nil {
		var secretSource storage.ResourceReference_STATUS
		err := parameters.SecretSource.AssignProperties_To_ResourceReference_STATUS(&secretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceReference_STATUS() to populate field SecretSource")
		}
		destination.SecretSource = &secretSource
	} else {
		destination.SecretSource = nil
	}

	// SecretVersion
	destination.SecretVersion = genruntime.ClonePointerToString(parameters.SecretVersion)

	// Subject
	destination.Subject = genruntime.ClonePointerToString(parameters.Subject)

	// SubjectAlternativeNames
	destination.SubjectAlternativeNames = genruntime.CloneSliceOfString(parameters.SubjectAlternativeNames)

	// Thumbprint
	destination.Thumbprint = genruntime.ClonePointerToString(parameters.Thumbprint)

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

	// UseLatestVersion
	if parameters.UseLatestVersion != nil {
		useLatestVersion := *parameters.UseLatestVersion
		destination.UseLatestVersion = &useLatestVersion
	} else {
		destination.UseLatestVersion = nil
	}

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

	// No error
	return nil
}

type ManagedCertificateParameters struct {
	// +kubebuilder:validation:Required
	Type *ManagedCertificateParameters_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &ManagedCertificateParameters{}

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

	// Set property "Type":
	if parameters.Type != nil {
		var temp arm.ManagedCertificateParameters_Type
		var temp1 string
		temp1 = string(*parameters.Type)
		temp = arm.ManagedCertificateParameters_Type(temp1)
		result.Type = temp
	}
	return result, nil
}

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

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

	// Set property "Type":
	var temp ManagedCertificateParameters_Type
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = ManagedCertificateParameters_Type(temp1)
	parameters.Type = &temp

	// No error
	return nil
}

// AssignProperties_From_ManagedCertificateParameters populates our ManagedCertificateParameters from the provided source ManagedCertificateParameters
func (parameters *ManagedCertificateParameters) AssignProperties_From_ManagedCertificateParameters(source *storage.ManagedCertificateParameters) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Initialize_From_ManagedCertificateParameters_STATUS populates our ManagedCertificateParameters from the provided source ManagedCertificateParameters_STATUS
func (parameters *ManagedCertificateParameters) Initialize_From_ManagedCertificateParameters_STATUS(source *ManagedCertificateParameters_STATUS) error {

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

	// No error
	return nil
}

type ManagedCertificateParameters_STATUS struct {
	// ExpirationDate: Certificate expiration date.
	ExpirationDate *string `json:"expirationDate,omitempty"`

	// Subject: Subject name in the certificate.
	Subject *string                                   `json:"subject,omitempty"`
	Type    *ManagedCertificateParameters_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &ManagedCertificateParameters_STATUS{}

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

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

	// Set property "ExpirationDate":
	if typedInput.ExpirationDate != nil {
		expirationDate := *typedInput.ExpirationDate
		parameters.ExpirationDate = &expirationDate
	}

	// Set property "Subject":
	if typedInput.Subject != nil {
		subject := *typedInput.Subject
		parameters.Subject = &subject
	}

	// Set property "Type":
	var temp ManagedCertificateParameters_Type_STATUS
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = ManagedCertificateParameters_Type_STATUS(temp1)
	parameters.Type = &temp

	// No error
	return nil
}

// AssignProperties_From_ManagedCertificateParameters_STATUS populates our ManagedCertificateParameters_STATUS from the provided source ManagedCertificateParameters_STATUS
func (parameters *ManagedCertificateParameters_STATUS) AssignProperties_From_ManagedCertificateParameters_STATUS(source *storage.ManagedCertificateParameters_STATUS) error {

	// ExpirationDate
	parameters.ExpirationDate = genruntime.ClonePointerToString(source.ExpirationDate)

	// Subject
	parameters.Subject = genruntime.ClonePointerToString(source.Subject)

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

	// No error
	return nil
}

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

	// ExpirationDate
	destination.ExpirationDate = genruntime.ClonePointerToString(parameters.ExpirationDate)

	// Subject
	destination.Subject = genruntime.ClonePointerToString(parameters.Subject)

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

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

	// No error
	return nil
}

type UrlSigningKeyParameters struct {
	// +kubebuilder:validation:Required
	// KeyId: Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form
	// the hash.
	KeyId *string `json:"keyId,omitempty"`

	// +kubebuilder:validation:Required
	// SecretSource: Resource reference to the Azure Key Vault secret. Expected to be in format of
	// /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
	SecretSource *ResourceReference `json:"secretSource,omitempty"`

	// SecretVersion: Version of the secret to be used
	SecretVersion *string `json:"secretVersion,omitempty"`

	// +kubebuilder:validation:Required
	Type *UrlSigningKeyParameters_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &UrlSigningKeyParameters{}

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

	// Set property "KeyId":
	if parameters.KeyId != nil {
		keyId := *parameters.KeyId
		result.KeyId = &keyId
	}

	// Set property "SecretSource":
	if parameters.SecretSource != nil {
		secretSource_ARM, err := parameters.SecretSource.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		secretSource := *secretSource_ARM.(*arm.ResourceReference)
		result.SecretSource = &secretSource
	}

	// Set property "SecretVersion":
	if parameters.SecretVersion != nil {
		secretVersion := *parameters.SecretVersion
		result.SecretVersion = &secretVersion
	}

	// Set property "Type":
	if parameters.Type != nil {
		var temp arm.UrlSigningKeyParameters_Type
		var temp1 string
		temp1 = string(*parameters.Type)
		temp = arm.UrlSigningKeyParameters_Type(temp1)
		result.Type = temp
	}
	return result, nil
}

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

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

	// Set property "KeyId":
	if typedInput.KeyId != nil {
		keyId := *typedInput.KeyId
		parameters.KeyId = &keyId
	}

	// Set property "SecretSource":
	if typedInput.SecretSource != nil {
		var secretSource1 ResourceReference
		err := secretSource1.PopulateFromARM(owner, *typedInput.SecretSource)
		if err != nil {
			return err
		}
		secretSource := secretSource1
		parameters.SecretSource = &secretSource
	}

	// Set property "SecretVersion":
	if typedInput.SecretVersion != nil {
		secretVersion := *typedInput.SecretVersion
		parameters.SecretVersion = &secretVersion
	}

	// Set property "Type":
	var temp UrlSigningKeyParameters_Type
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = UrlSigningKeyParameters_Type(temp1)
	parameters.Type = &temp

	// No error
	return nil
}

// AssignProperties_From_UrlSigningKeyParameters populates our UrlSigningKeyParameters from the provided source UrlSigningKeyParameters
func (parameters *UrlSigningKeyParameters) AssignProperties_From_UrlSigningKeyParameters(source *storage.UrlSigningKeyParameters) error {

	// KeyId
	parameters.KeyId = genruntime.ClonePointerToString(source.KeyId)

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference
		err := secretSource.AssignProperties_From_ResourceReference(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceReference() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// SecretVersion
	parameters.SecretVersion = genruntime.ClonePointerToString(source.SecretVersion)

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

	// No error
	return nil
}

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

	// KeyId
	destination.KeyId = genruntime.ClonePointerToString(parameters.KeyId)

	// SecretSource
	if parameters.SecretSource != nil {
		var secretSource storage.ResourceReference
		err := parameters.SecretSource.AssignProperties_To_ResourceReference(&secretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceReference() to populate field SecretSource")
		}
		destination.SecretSource = &secretSource
	} else {
		destination.SecretSource = nil
	}

	// SecretVersion
	destination.SecretVersion = genruntime.ClonePointerToString(parameters.SecretVersion)

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

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

	// No error
	return nil
}

// Initialize_From_UrlSigningKeyParameters_STATUS populates our UrlSigningKeyParameters from the provided source UrlSigningKeyParameters_STATUS
func (parameters *UrlSigningKeyParameters) Initialize_From_UrlSigningKeyParameters_STATUS(source *UrlSigningKeyParameters_STATUS) error {

	// KeyId
	parameters.KeyId = genruntime.ClonePointerToString(source.KeyId)

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference
		err := secretSource.Initialize_From_ResourceReference_STATUS(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_ResourceReference_STATUS() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// SecretVersion
	parameters.SecretVersion = genruntime.ClonePointerToString(source.SecretVersion)

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

	// No error
	return nil
}

type UrlSigningKeyParameters_STATUS struct {
	// KeyId: Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form
	// the hash.
	KeyId *string `json:"keyId,omitempty"`

	// SecretSource: Resource reference to the Azure Key Vault secret. Expected to be in format of
	// /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
	SecretSource *ResourceReference_STATUS `json:"secretSource,omitempty"`

	// SecretVersion: Version of the secret to be used
	SecretVersion *string                              `json:"secretVersion,omitempty"`
	Type          *UrlSigningKeyParameters_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &UrlSigningKeyParameters_STATUS{}

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

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

	// Set property "KeyId":
	if typedInput.KeyId != nil {
		keyId := *typedInput.KeyId
		parameters.KeyId = &keyId
	}

	// Set property "SecretSource":
	if typedInput.SecretSource != nil {
		var secretSource1 ResourceReference_STATUS
		err := secretSource1.PopulateFromARM(owner, *typedInput.SecretSource)
		if err != nil {
			return err
		}
		secretSource := secretSource1
		parameters.SecretSource = &secretSource
	}

	// Set property "SecretVersion":
	if typedInput.SecretVersion != nil {
		secretVersion := *typedInput.SecretVersion
		parameters.SecretVersion = &secretVersion
	}

	// Set property "Type":
	var temp UrlSigningKeyParameters_Type_STATUS
	var temp1 string
	temp1 = string(typedInput.Type)
	temp = UrlSigningKeyParameters_Type_STATUS(temp1)
	parameters.Type = &temp

	// No error
	return nil
}

// AssignProperties_From_UrlSigningKeyParameters_STATUS populates our UrlSigningKeyParameters_STATUS from the provided source UrlSigningKeyParameters_STATUS
func (parameters *UrlSigningKeyParameters_STATUS) AssignProperties_From_UrlSigningKeyParameters_STATUS(source *storage.UrlSigningKeyParameters_STATUS) error {

	// KeyId
	parameters.KeyId = genruntime.ClonePointerToString(source.KeyId)

	// SecretSource
	if source.SecretSource != nil {
		var secretSource ResourceReference_STATUS
		err := secretSource.AssignProperties_From_ResourceReference_STATUS(source.SecretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ResourceReference_STATUS() to populate field SecretSource")
		}
		parameters.SecretSource = &secretSource
	} else {
		parameters.SecretSource = nil
	}

	// SecretVersion
	parameters.SecretVersion = genruntime.ClonePointerToString(source.SecretVersion)

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

	// No error
	return nil
}

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

	// KeyId
	destination.KeyId = genruntime.ClonePointerToString(parameters.KeyId)

	// SecretSource
	if parameters.SecretSource != nil {
		var secretSource storage.ResourceReference_STATUS
		err := parameters.SecretSource.AssignProperties_To_ResourceReference_STATUS(&secretSource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ResourceReference_STATUS() to populate field SecretSource")
		}
		destination.SecretSource = &secretSource
	} else {
		destination.SecretSource = nil
	}

	// SecretVersion
	destination.SecretVersion = genruntime.ClonePointerToString(parameters.SecretVersion)

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"AzureFirstPartyManagedCertificate"}
type AzureFirstPartyManagedCertificateParameters_Type string

const AzureFirstPartyManagedCertificateParameters_Type_AzureFirstPartyManagedCertificate = AzureFirstPartyManagedCertificateParameters_Type("AzureFirstPartyManagedCertificate")

// Mapping from string to AzureFirstPartyManagedCertificateParameters_Type
var azureFirstPartyManagedCertificateParameters_Type_Values = map[string]AzureFirstPartyManagedCertificateParameters_Type{
	"azurefirstpartymanagedcertificate": AzureFirstPartyManagedCertificateParameters_Type_AzureFirstPartyManagedCertificate,
}

type AzureFirstPartyManagedCertificateParameters_Type_STATUS string

const AzureFirstPartyManagedCertificateParameters_Type_STATUS_AzureFirstPartyManagedCertificate = AzureFirstPartyManagedCertificateParameters_Type_STATUS("AzureFirstPartyManagedCertificate")

// Mapping from string to AzureFirstPartyManagedCertificateParameters_Type_STATUS
var azureFirstPartyManagedCertificateParameters_Type_STATUS_Values = map[string]AzureFirstPartyManagedCertificateParameters_Type_STATUS{
	"azurefirstpartymanagedcertificate": AzureFirstPartyManagedCertificateParameters_Type_STATUS_AzureFirstPartyManagedCertificate,
}

// +kubebuilder:validation:Enum={"CustomerCertificate"}
type CustomerCertificateParameters_Type string

const CustomerCertificateParameters_Type_CustomerCertificate = CustomerCertificateParameters_Type("CustomerCertificate")

// Mapping from string to CustomerCertificateParameters_Type
var customerCertificateParameters_Type_Values = map[string]CustomerCertificateParameters_Type{
	"customercertificate": CustomerCertificateParameters_Type_CustomerCertificate,
}

type CustomerCertificateParameters_Type_STATUS string

const CustomerCertificateParameters_Type_STATUS_CustomerCertificate = CustomerCertificateParameters_Type_STATUS("CustomerCertificate")

// Mapping from string to CustomerCertificateParameters_Type_STATUS
var customerCertificateParameters_Type_STATUS_Values = map[string]CustomerCertificateParameters_Type_STATUS{
	"customercertificate": CustomerCertificateParameters_Type_STATUS_CustomerCertificate,
}

// +kubebuilder:validation:Enum={"ManagedCertificate"}
type ManagedCertificateParameters_Type string

const ManagedCertificateParameters_Type_ManagedCertificate = ManagedCertificateParameters_Type("ManagedCertificate")

// Mapping from string to ManagedCertificateParameters_Type
var managedCertificateParameters_Type_Values = map[string]ManagedCertificateParameters_Type{
	"managedcertificate": ManagedCertificateParameters_Type_ManagedCertificate,
}

type ManagedCertificateParameters_Type_STATUS string

const ManagedCertificateParameters_Type_STATUS_ManagedCertificate = ManagedCertificateParameters_Type_STATUS("ManagedCertificate")

// Mapping from string to ManagedCertificateParameters_Type_STATUS
var managedCertificateParameters_Type_STATUS_Values = map[string]ManagedCertificateParameters_Type_STATUS{
	"managedcertificate": ManagedCertificateParameters_Type_STATUS_ManagedCertificate,
}

// +kubebuilder:validation:Enum={"UrlSigningKey"}
type UrlSigningKeyParameters_Type string

const UrlSigningKeyParameters_Type_UrlSigningKey = UrlSigningKeyParameters_Type("UrlSigningKey")

// Mapping from string to UrlSigningKeyParameters_Type
var urlSigningKeyParameters_Type_Values = map[string]UrlSigningKeyParameters_Type{
	"urlsigningkey": UrlSigningKeyParameters_Type_UrlSigningKey,
}

type UrlSigningKeyParameters_Type_STATUS string

const UrlSigningKeyParameters_Type_STATUS_UrlSigningKey = UrlSigningKeyParameters_Type_STATUS("UrlSigningKey")

// Mapping from string to UrlSigningKeyParameters_Type_STATUS
var urlSigningKeyParameters_Type_STATUS_Values = map[string]UrlSigningKeyParameters_Type_STATUS{
	"urlsigningkey": UrlSigningKeyParameters_Type_STATUS_UrlSigningKey,
}

func init() {
	SchemeBuilder.Register(&Secret{}, &SecretList{})
}
