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

import (
	"fmt"
	storage "github.com/Azure/azure-service-operator/v2/api/network/v1api20240301/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,network}
// +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"
// Storage version of v1api20220701.BastionHost
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2022-07-01/bastionHost.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}
type BastionHost struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              BastionHost_Spec   `json:"spec,omitempty"`
	Status            BastionHost_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &BastionHost{}

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

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

var _ conversion.Convertible = &BastionHost{}

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

	return host.AssignProperties_From_BastionHost(source)
}

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

	return host.AssignProperties_To_BastionHost(destination)
}

var _ configmaps.Exporter = &BastionHost{}

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

var _ secrets.Exporter = &BastionHost{}

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

var _ genruntime.KubernetesResource = &BastionHost{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2022-07-01"
func (host BastionHost) GetAPIVersion() string {
	return "2022-07-01"
}

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Network/bastionHosts"
func (host *BastionHost) GetType() string {
	return "Microsoft.Network/bastionHosts"
}

// NewEmptyStatus returns a new empty (blank) status
func (host *BastionHost) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &BastionHost_STATUS{}
}

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

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

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

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

	host.Status = st
	return nil
}

// AssignProperties_From_BastionHost populates our BastionHost from the provided source BastionHost
func (host *BastionHost) AssignProperties_From_BastionHost(source *storage.BastionHost) error {

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

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

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

	// Invoke the augmentConversionForBastionHost interface (if implemented) to customize the conversion
	var hostAsAny any = host
	if augmentedHost, ok := hostAsAny.(augmentConversionForBastionHost); ok {
		err := augmentedHost.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BastionHost populates the provided destination BastionHost from our BastionHost
func (host *BastionHost) AssignProperties_To_BastionHost(destination *storage.BastionHost) error {

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

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

	// Status
	var status storage.BastionHost_STATUS
	err = host.Status.AssignProperties_To_BastionHost_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_BastionHost_STATUS() to populate field Status")
	}
	destination.Status = status

	// Invoke the augmentConversionForBastionHost interface (if implemented) to customize the conversion
	var hostAsAny any = host
	if augmentedHost, ok := hostAsAny.(augmentConversionForBastionHost); ok {
		err := augmentedHost.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (host *BastionHost) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: host.Spec.OriginalVersion,
		Kind:    "BastionHost",
	}
}

// +kubebuilder:object:root=true
// Storage version of v1api20220701.BastionHost
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2022-07-01/bastionHost.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}
type BastionHostList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []BastionHost `json:"items"`
}

type augmentConversionForBastionHost interface {
	AssignPropertiesFrom(src *storage.BastionHost) error
	AssignPropertiesTo(dst *storage.BastionHost) error
}

// Storage version of v1api20220701.BastionHost_Spec
type BastionHost_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"`
	DisableCopyPaste    *bool                        `json:"disableCopyPaste,omitempty"`
	DnsName             *string                      `json:"dnsName,omitempty"`
	EnableFileCopy      *bool                        `json:"enableFileCopy,omitempty"`
	EnableIpConnect     *bool                        `json:"enableIpConnect,omitempty"`
	EnableShareableLink *bool                        `json:"enableShareableLink,omitempty"`
	EnableTunneling     *bool                        `json:"enableTunneling,omitempty"`
	IpConfigurations    []BastionHostIPConfiguration `json:"ipConfigurations,omitempty"`
	Location            *string                      `json:"location,omitempty"`
	OperatorSpec        *BastionHostOperatorSpec     `json:"operatorSpec,omitempty"`
	OriginalVersion     string                       `json:"originalVersion,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner       *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`
	PropertyBag genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
	ScaleUnits  *int                               `json:"scaleUnits,omitempty"`
	Sku         *Sku                               `json:"sku,omitempty"`
	Tags        map[string]string                  `json:"tags,omitempty"`
}

var _ genruntime.ConvertibleSpec = &BastionHost_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.BastionHost_Spec{}
	err := host.AssignProperties_To_BastionHost_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_BastionHost_Spec populates our BastionHost_Spec from the provided source BastionHost_Spec
func (host *BastionHost_Spec) AssignProperties_From_BastionHost_Spec(source *storage.BastionHost_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AzureName
	host.AzureName = source.AzureName

	// DisableCopyPaste
	if source.DisableCopyPaste != nil {
		disableCopyPaste := *source.DisableCopyPaste
		host.DisableCopyPaste = &disableCopyPaste
	} else {
		host.DisableCopyPaste = nil
	}

	// DnsName
	host.DnsName = genruntime.ClonePointerToString(source.DnsName)

	// EnableFileCopy
	if source.EnableFileCopy != nil {
		enableFileCopy := *source.EnableFileCopy
		host.EnableFileCopy = &enableFileCopy
	} else {
		host.EnableFileCopy = nil
	}

	// EnableIpConnect
	if source.EnableIpConnect != nil {
		enableIpConnect := *source.EnableIpConnect
		host.EnableIpConnect = &enableIpConnect
	} else {
		host.EnableIpConnect = nil
	}

	// EnableKerberos
	if source.EnableKerberos != nil {
		propertyBag.Add("EnableKerberos", *source.EnableKerberos)
	} else {
		propertyBag.Remove("EnableKerberos")
	}

	// EnableSessionRecording
	if source.EnableSessionRecording != nil {
		propertyBag.Add("EnableSessionRecording", *source.EnableSessionRecording)
	} else {
		propertyBag.Remove("EnableSessionRecording")
	}

	// EnableShareableLink
	if source.EnableShareableLink != nil {
		enableShareableLink := *source.EnableShareableLink
		host.EnableShareableLink = &enableShareableLink
	} else {
		host.EnableShareableLink = nil
	}

	// EnableTunneling
	if source.EnableTunneling != nil {
		enableTunneling := *source.EnableTunneling
		host.EnableTunneling = &enableTunneling
	} else {
		host.EnableTunneling = nil
	}

	// IpConfigurations
	if source.IpConfigurations != nil {
		ipConfigurationList := make([]BastionHostIPConfiguration, len(source.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range source.IpConfigurations {
			var ipConfiguration BastionHostIPConfiguration
			err := ipConfiguration.AssignProperties_From_BastionHostIPConfiguration(&ipConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_BastionHostIPConfiguration() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		host.IpConfigurations = ipConfigurationList
	} else {
		host.IpConfigurations = nil
	}

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

	// NetworkAcls
	if source.NetworkAcls != nil {
		propertyBag.Add("NetworkAcls", *source.NetworkAcls)
	} else {
		propertyBag.Remove("NetworkAcls")
	}

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

	// OriginalVersion
	host.OriginalVersion = source.OriginalVersion

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

	// ScaleUnits
	host.ScaleUnits = genruntime.ClonePointerToInt(source.ScaleUnits)

	// Sku
	if source.Sku != nil {
		var sku Sku
		err := sku.AssignProperties_From_Sku(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku")
		}
		host.Sku = &sku
	} else {
		host.Sku = nil
	}

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

	// VirtualNetwork
	if source.VirtualNetwork != nil {
		propertyBag.Add("VirtualNetwork", *source.VirtualNetwork)
	} else {
		propertyBag.Remove("VirtualNetwork")
	}

	// Zones
	if len(source.Zones) > 0 {
		propertyBag.Add("Zones", source.Zones)
	} else {
		propertyBag.Remove("Zones")
	}

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

	// Invoke the augmentConversionForBastionHost_Spec interface (if implemented) to customize the conversion
	var hostAsAny any = host
	if augmentedHost, ok := hostAsAny.(augmentConversionForBastionHost_Spec); ok {
		err := augmentedHost.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BastionHost_Spec populates the provided destination BastionHost_Spec from our BastionHost_Spec
func (host *BastionHost_Spec) AssignProperties_To_BastionHost_Spec(destination *storage.BastionHost_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(host.PropertyBag)

	// AzureName
	destination.AzureName = host.AzureName

	// DisableCopyPaste
	if host.DisableCopyPaste != nil {
		disableCopyPaste := *host.DisableCopyPaste
		destination.DisableCopyPaste = &disableCopyPaste
	} else {
		destination.DisableCopyPaste = nil
	}

	// DnsName
	destination.DnsName = genruntime.ClonePointerToString(host.DnsName)

	// EnableFileCopy
	if host.EnableFileCopy != nil {
		enableFileCopy := *host.EnableFileCopy
		destination.EnableFileCopy = &enableFileCopy
	} else {
		destination.EnableFileCopy = nil
	}

	// EnableIpConnect
	if host.EnableIpConnect != nil {
		enableIpConnect := *host.EnableIpConnect
		destination.EnableIpConnect = &enableIpConnect
	} else {
		destination.EnableIpConnect = nil
	}

	// EnableKerberos
	if propertyBag.Contains("EnableKerberos") {
		var enableKerbero bool
		err := propertyBag.Pull("EnableKerberos", &enableKerbero)
		if err != nil {
			return eris.Wrap(err, "pulling 'EnableKerberos' from propertyBag")
		}

		destination.EnableKerberos = &enableKerbero
	} else {
		destination.EnableKerberos = nil
	}

	// EnableSessionRecording
	if propertyBag.Contains("EnableSessionRecording") {
		var enableSessionRecording bool
		err := propertyBag.Pull("EnableSessionRecording", &enableSessionRecording)
		if err != nil {
			return eris.Wrap(err, "pulling 'EnableSessionRecording' from propertyBag")
		}

		destination.EnableSessionRecording = &enableSessionRecording
	} else {
		destination.EnableSessionRecording = nil
	}

	// EnableShareableLink
	if host.EnableShareableLink != nil {
		enableShareableLink := *host.EnableShareableLink
		destination.EnableShareableLink = &enableShareableLink
	} else {
		destination.EnableShareableLink = nil
	}

	// EnableTunneling
	if host.EnableTunneling != nil {
		enableTunneling := *host.EnableTunneling
		destination.EnableTunneling = &enableTunneling
	} else {
		destination.EnableTunneling = nil
	}

	// IpConfigurations
	if host.IpConfigurations != nil {
		ipConfigurationList := make([]storage.BastionHostIPConfiguration, len(host.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range host.IpConfigurations {
			var ipConfiguration storage.BastionHostIPConfiguration
			err := ipConfigurationItem.AssignProperties_To_BastionHostIPConfiguration(&ipConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_BastionHostIPConfiguration() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		destination.IpConfigurations = ipConfigurationList
	} else {
		destination.IpConfigurations = nil
	}

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

	// NetworkAcls
	if propertyBag.Contains("NetworkAcls") {
		var networkAcl storage.BastionHostPropertiesFormat_NetworkAcls
		err := propertyBag.Pull("NetworkAcls", &networkAcl)
		if err != nil {
			return eris.Wrap(err, "pulling 'NetworkAcls' from propertyBag")
		}

		destination.NetworkAcls = &networkAcl
	} else {
		destination.NetworkAcls = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = host.OriginalVersion

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

	// ScaleUnits
	destination.ScaleUnits = genruntime.ClonePointerToInt(host.ScaleUnits)

	// Sku
	if host.Sku != nil {
		var sku storage.Sku
		err := host.Sku.AssignProperties_To_Sku(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Sku() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

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

	// VirtualNetwork
	if propertyBag.Contains("VirtualNetwork") {
		var virtualNetwork storage.SubResource
		err := propertyBag.Pull("VirtualNetwork", &virtualNetwork)
		if err != nil {
			return eris.Wrap(err, "pulling 'VirtualNetwork' from propertyBag")
		}

		destination.VirtualNetwork = &virtualNetwork
	} else {
		destination.VirtualNetwork = nil
	}

	// Zones
	if propertyBag.Contains("Zones") {
		var zone []string
		err := propertyBag.Pull("Zones", &zone)
		if err != nil {
			return eris.Wrap(err, "pulling 'Zones' from propertyBag")
		}

		destination.Zones = zone
	} else {
		destination.Zones = nil
	}

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

	// Invoke the augmentConversionForBastionHost_Spec interface (if implemented) to customize the conversion
	var hostAsAny any = host
	if augmentedHost, ok := hostAsAny.(augmentConversionForBastionHost_Spec); ok {
		err := augmentedHost.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20220701.BastionHost_STATUS
// Bastion Host resource.
type BastionHost_STATUS struct {
	Conditions          []conditions.Condition              `json:"conditions,omitempty"`
	DisableCopyPaste    *bool                               `json:"disableCopyPaste,omitempty"`
	DnsName             *string                             `json:"dnsName,omitempty"`
	EnableFileCopy      *bool                               `json:"enableFileCopy,omitempty"`
	EnableIpConnect     *bool                               `json:"enableIpConnect,omitempty"`
	EnableShareableLink *bool                               `json:"enableShareableLink,omitempty"`
	EnableTunneling     *bool                               `json:"enableTunneling,omitempty"`
	Etag                *string                             `json:"etag,omitempty"`
	Id                  *string                             `json:"id,omitempty"`
	IpConfigurations    []BastionHostIPConfiguration_STATUS `json:"ipConfigurations,omitempty"`
	Location            *string                             `json:"location,omitempty"`
	Name                *string                             `json:"name,omitempty"`
	PropertyBag         genruntime.PropertyBag              `json:"$propertyBag,omitempty"`
	ProvisioningState   *string                             `json:"provisioningState,omitempty"`
	ScaleUnits          *int                                `json:"scaleUnits,omitempty"`
	Sku                 *Sku_STATUS                         `json:"sku,omitempty"`
	Tags                map[string]string                   `json:"tags,omitempty"`
	Type                *string                             `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &BastionHost_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.BastionHost_STATUS{}
	err := host.AssignProperties_To_BastionHost_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
}

// AssignProperties_From_BastionHost_STATUS populates our BastionHost_STATUS from the provided source BastionHost_STATUS
func (host *BastionHost_STATUS) AssignProperties_From_BastionHost_STATUS(source *storage.BastionHost_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

	// DisableCopyPaste
	if source.DisableCopyPaste != nil {
		disableCopyPaste := *source.DisableCopyPaste
		host.DisableCopyPaste = &disableCopyPaste
	} else {
		host.DisableCopyPaste = nil
	}

	// DnsName
	host.DnsName = genruntime.ClonePointerToString(source.DnsName)

	// EnableFileCopy
	if source.EnableFileCopy != nil {
		enableFileCopy := *source.EnableFileCopy
		host.EnableFileCopy = &enableFileCopy
	} else {
		host.EnableFileCopy = nil
	}

	// EnableIpConnect
	if source.EnableIpConnect != nil {
		enableIpConnect := *source.EnableIpConnect
		host.EnableIpConnect = &enableIpConnect
	} else {
		host.EnableIpConnect = nil
	}

	// EnableKerberos
	if source.EnableKerberos != nil {
		propertyBag.Add("EnableKerberos", *source.EnableKerberos)
	} else {
		propertyBag.Remove("EnableKerberos")
	}

	// EnableSessionRecording
	if source.EnableSessionRecording != nil {
		propertyBag.Add("EnableSessionRecording", *source.EnableSessionRecording)
	} else {
		propertyBag.Remove("EnableSessionRecording")
	}

	// EnableShareableLink
	if source.EnableShareableLink != nil {
		enableShareableLink := *source.EnableShareableLink
		host.EnableShareableLink = &enableShareableLink
	} else {
		host.EnableShareableLink = nil
	}

	// EnableTunneling
	if source.EnableTunneling != nil {
		enableTunneling := *source.EnableTunneling
		host.EnableTunneling = &enableTunneling
	} else {
		host.EnableTunneling = nil
	}

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

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

	// IpConfigurations
	if source.IpConfigurations != nil {
		ipConfigurationList := make([]BastionHostIPConfiguration_STATUS, len(source.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range source.IpConfigurations {
			var ipConfiguration BastionHostIPConfiguration_STATUS
			err := ipConfiguration.AssignProperties_From_BastionHostIPConfiguration_STATUS(&ipConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_BastionHostIPConfiguration_STATUS() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		host.IpConfigurations = ipConfigurationList
	} else {
		host.IpConfigurations = nil
	}

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

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

	// NetworkAcls
	if source.NetworkAcls != nil {
		propertyBag.Add("NetworkAcls", *source.NetworkAcls)
	} else {
		propertyBag.Remove("NetworkAcls")
	}

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

	// ScaleUnits
	host.ScaleUnits = genruntime.ClonePointerToInt(source.ScaleUnits)

	// Sku
	if source.Sku != nil {
		var sku Sku_STATUS
		err := sku.AssignProperties_From_Sku_STATUS(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku")
		}
		host.Sku = &sku
	} else {
		host.Sku = nil
	}

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

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

	// VirtualNetwork
	if source.VirtualNetwork != nil {
		propertyBag.Add("VirtualNetwork", *source.VirtualNetwork)
	} else {
		propertyBag.Remove("VirtualNetwork")
	}

	// Zones
	if len(source.Zones) > 0 {
		propertyBag.Add("Zones", source.Zones)
	} else {
		propertyBag.Remove("Zones")
	}

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

	// Invoke the augmentConversionForBastionHost_STATUS interface (if implemented) to customize the conversion
	var hostAsAny any = host
	if augmentedHost, ok := hostAsAny.(augmentConversionForBastionHost_STATUS); ok {
		err := augmentedHost.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BastionHost_STATUS populates the provided destination BastionHost_STATUS from our BastionHost_STATUS
func (host *BastionHost_STATUS) AssignProperties_To_BastionHost_STATUS(destination *storage.BastionHost_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(host.PropertyBag)

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

	// DisableCopyPaste
	if host.DisableCopyPaste != nil {
		disableCopyPaste := *host.DisableCopyPaste
		destination.DisableCopyPaste = &disableCopyPaste
	} else {
		destination.DisableCopyPaste = nil
	}

	// DnsName
	destination.DnsName = genruntime.ClonePointerToString(host.DnsName)

	// EnableFileCopy
	if host.EnableFileCopy != nil {
		enableFileCopy := *host.EnableFileCopy
		destination.EnableFileCopy = &enableFileCopy
	} else {
		destination.EnableFileCopy = nil
	}

	// EnableIpConnect
	if host.EnableIpConnect != nil {
		enableIpConnect := *host.EnableIpConnect
		destination.EnableIpConnect = &enableIpConnect
	} else {
		destination.EnableIpConnect = nil
	}

	// EnableKerberos
	if propertyBag.Contains("EnableKerberos") {
		var enableKerbero bool
		err := propertyBag.Pull("EnableKerberos", &enableKerbero)
		if err != nil {
			return eris.Wrap(err, "pulling 'EnableKerberos' from propertyBag")
		}

		destination.EnableKerberos = &enableKerbero
	} else {
		destination.EnableKerberos = nil
	}

	// EnableSessionRecording
	if propertyBag.Contains("EnableSessionRecording") {
		var enableSessionRecording bool
		err := propertyBag.Pull("EnableSessionRecording", &enableSessionRecording)
		if err != nil {
			return eris.Wrap(err, "pulling 'EnableSessionRecording' from propertyBag")
		}

		destination.EnableSessionRecording = &enableSessionRecording
	} else {
		destination.EnableSessionRecording = nil
	}

	// EnableShareableLink
	if host.EnableShareableLink != nil {
		enableShareableLink := *host.EnableShareableLink
		destination.EnableShareableLink = &enableShareableLink
	} else {
		destination.EnableShareableLink = nil
	}

	// EnableTunneling
	if host.EnableTunneling != nil {
		enableTunneling := *host.EnableTunneling
		destination.EnableTunneling = &enableTunneling
	} else {
		destination.EnableTunneling = nil
	}

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

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

	// IpConfigurations
	if host.IpConfigurations != nil {
		ipConfigurationList := make([]storage.BastionHostIPConfiguration_STATUS, len(host.IpConfigurations))
		for ipConfigurationIndex, ipConfigurationItem := range host.IpConfigurations {
			var ipConfiguration storage.BastionHostIPConfiguration_STATUS
			err := ipConfigurationItem.AssignProperties_To_BastionHostIPConfiguration_STATUS(&ipConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_BastionHostIPConfiguration_STATUS() to populate field IpConfigurations")
			}
			ipConfigurationList[ipConfigurationIndex] = ipConfiguration
		}
		destination.IpConfigurations = ipConfigurationList
	} else {
		destination.IpConfigurations = nil
	}

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

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

	// NetworkAcls
	if propertyBag.Contains("NetworkAcls") {
		var networkAcl storage.BastionHostPropertiesFormat_NetworkAcls_STATUS
		err := propertyBag.Pull("NetworkAcls", &networkAcl)
		if err != nil {
			return eris.Wrap(err, "pulling 'NetworkAcls' from propertyBag")
		}

		destination.NetworkAcls = &networkAcl
	} else {
		destination.NetworkAcls = nil
	}

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

	// ScaleUnits
	destination.ScaleUnits = genruntime.ClonePointerToInt(host.ScaleUnits)

	// Sku
	if host.Sku != nil {
		var sku storage.Sku_STATUS
		err := host.Sku.AssignProperties_To_Sku_STATUS(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Sku_STATUS() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

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

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

	// VirtualNetwork
	if propertyBag.Contains("VirtualNetwork") {
		var virtualNetwork storage.SubResource_STATUS
		err := propertyBag.Pull("VirtualNetwork", &virtualNetwork)
		if err != nil {
			return eris.Wrap(err, "pulling 'VirtualNetwork' from propertyBag")
		}

		destination.VirtualNetwork = &virtualNetwork
	} else {
		destination.VirtualNetwork = nil
	}

	// Zones
	if propertyBag.Contains("Zones") {
		var zone []string
		err := propertyBag.Pull("Zones", &zone)
		if err != nil {
			return eris.Wrap(err, "pulling 'Zones' from propertyBag")
		}

		destination.Zones = zone
	} else {
		destination.Zones = nil
	}

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

	// Invoke the augmentConversionForBastionHost_STATUS interface (if implemented) to customize the conversion
	var hostAsAny any = host
	if augmentedHost, ok := hostAsAny.(augmentConversionForBastionHost_STATUS); ok {
		err := augmentedHost.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForBastionHost_Spec interface {
	AssignPropertiesFrom(src *storage.BastionHost_Spec) error
	AssignPropertiesTo(dst *storage.BastionHost_Spec) error
}

type augmentConversionForBastionHost_STATUS interface {
	AssignPropertiesFrom(src *storage.BastionHost_STATUS) error
	AssignPropertiesTo(dst *storage.BastionHost_STATUS) error
}

// Storage version of v1api20220701.BastionHostIPConfiguration
// IP configuration of an Bastion Host.
type BastionHostIPConfiguration struct {
	Name                      *string                `json:"name,omitempty"`
	PrivateIPAllocationMethod *string                `json:"privateIPAllocationMethod,omitempty"`
	PropertyBag               genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	PublicIPAddress           *SubResource           `json:"publicIPAddress,omitempty"`
	Subnet                    *SubResource           `json:"subnet,omitempty"`
}

// AssignProperties_From_BastionHostIPConfiguration populates our BastionHostIPConfiguration from the provided source BastionHostIPConfiguration
func (configuration *BastionHostIPConfiguration) AssignProperties_From_BastionHostIPConfiguration(source *storage.BastionHostIPConfiguration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

	// PublicIPAddress
	if source.PublicIPAddress != nil {
		var publicIPAddress SubResource
		err := publicIPAddress.AssignProperties_From_SubResource(source.PublicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field PublicIPAddress")
		}
		configuration.PublicIPAddress = &publicIPAddress
	} else {
		configuration.PublicIPAddress = nil
	}

	// Subnet
	if source.Subnet != nil {
		var subnet SubResource
		err := subnet.AssignProperties_From_SubResource(source.Subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field Subnet")
		}
		configuration.Subnet = &subnet
	} else {
		configuration.Subnet = nil
	}

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

	// Invoke the augmentConversionForBastionHostIPConfiguration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForBastionHostIPConfiguration); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BastionHostIPConfiguration populates the provided destination BastionHostIPConfiguration from our BastionHostIPConfiguration
func (configuration *BastionHostIPConfiguration) AssignProperties_To_BastionHostIPConfiguration(destination *storage.BastionHostIPConfiguration) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

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

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

	// PublicIPAddress
	if configuration.PublicIPAddress != nil {
		var publicIPAddress storage.SubResource
		err := configuration.PublicIPAddress.AssignProperties_To_SubResource(&publicIPAddress)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field PublicIPAddress")
		}
		destination.PublicIPAddress = &publicIPAddress
	} else {
		destination.PublicIPAddress = nil
	}

	// Subnet
	if configuration.Subnet != nil {
		var subnet storage.SubResource
		err := configuration.Subnet.AssignProperties_To_SubResource(&subnet)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field Subnet")
		}
		destination.Subnet = &subnet
	} else {
		destination.Subnet = nil
	}

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

	// Invoke the augmentConversionForBastionHostIPConfiguration interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForBastionHostIPConfiguration); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20220701.BastionHostIPConfiguration_STATUS
// IP configuration of an Bastion Host.
type BastionHostIPConfiguration_STATUS struct {
	Id          *string                `json:"id,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_BastionHostIPConfiguration_STATUS populates our BastionHostIPConfiguration_STATUS from the provided source BastionHostIPConfiguration_STATUS
func (configuration *BastionHostIPConfiguration_STATUS) AssignProperties_From_BastionHostIPConfiguration_STATUS(source *storage.BastionHostIPConfiguration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

	// Invoke the augmentConversionForBastionHostIPConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForBastionHostIPConfiguration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BastionHostIPConfiguration_STATUS populates the provided destination BastionHostIPConfiguration_STATUS from our BastionHostIPConfiguration_STATUS
func (configuration *BastionHostIPConfiguration_STATUS) AssignProperties_To_BastionHostIPConfiguration_STATUS(destination *storage.BastionHostIPConfiguration_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configuration.PropertyBag)

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

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

	// Invoke the augmentConversionForBastionHostIPConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForBastionHostIPConfiguration_STATUS); ok {
		err := augmentedConfiguration.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20220701.BastionHostOperatorSpec
// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type BastionHostOperatorSpec struct {
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`
	PropertyBag          genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	SecretExpressions    []*core.DestinationExpression `json:"secretExpressions,omitempty"`
}

// AssignProperties_From_BastionHostOperatorSpec populates our BastionHostOperatorSpec from the provided source BastionHostOperatorSpec
func (operator *BastionHostOperatorSpec) AssignProperties_From_BastionHostOperatorSpec(source *storage.BastionHostOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

	// Invoke the augmentConversionForBastionHostOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForBastionHostOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_BastionHostOperatorSpec populates the provided destination BastionHostOperatorSpec from our BastionHostOperatorSpec
func (operator *BastionHostOperatorSpec) AssignProperties_To_BastionHostOperatorSpec(destination *storage.BastionHostOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(operator.PropertyBag)

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

	// Invoke the augmentConversionForBastionHostOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForBastionHostOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20220701.Sku
// The sku of this Bastion Host.
type Sku struct {
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_Sku populates our Sku from the provided source Sku
func (sku *Sku) AssignProperties_From_Sku(source *storage.Sku) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

	// Invoke the augmentConversionForSku interface (if implemented) to customize the conversion
	var skuAsAny any = sku
	if augmentedSku, ok := skuAsAny.(augmentConversionForSku); ok {
		err := augmentedSku.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_Sku populates the provided destination Sku from our Sku
func (sku *Sku) AssignProperties_To_Sku(destination *storage.Sku) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(sku.PropertyBag)

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

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

	// Invoke the augmentConversionForSku interface (if implemented) to customize the conversion
	var skuAsAny any = sku
	if augmentedSku, ok := skuAsAny.(augmentConversionForSku); ok {
		err := augmentedSku.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20220701.Sku_STATUS
// The sku of this Bastion Host.
type Sku_STATUS struct {
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_Sku_STATUS populates our Sku_STATUS from the provided source Sku_STATUS
func (sku *Sku_STATUS) AssignProperties_From_Sku_STATUS(source *storage.Sku_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

	// Invoke the augmentConversionForSku_STATUS interface (if implemented) to customize the conversion
	var skuAsAny any = sku
	if augmentedSku, ok := skuAsAny.(augmentConversionForSku_STATUS); ok {
		err := augmentedSku.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_Sku_STATUS populates the provided destination Sku_STATUS from our Sku_STATUS
func (sku *Sku_STATUS) AssignProperties_To_Sku_STATUS(destination *storage.Sku_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(sku.PropertyBag)

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

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

	// Invoke the augmentConversionForSku_STATUS interface (if implemented) to customize the conversion
	var skuAsAny any = sku
	if augmentedSku, ok := skuAsAny.(augmentConversionForSku_STATUS); ok {
		err := augmentedSku.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

type augmentConversionForBastionHostIPConfiguration interface {
	AssignPropertiesFrom(src *storage.BastionHostIPConfiguration) error
	AssignPropertiesTo(dst *storage.BastionHostIPConfiguration) error
}

type augmentConversionForBastionHostIPConfiguration_STATUS interface {
	AssignPropertiesFrom(src *storage.BastionHostIPConfiguration_STATUS) error
	AssignPropertiesTo(dst *storage.BastionHostIPConfiguration_STATUS) error
}

type augmentConversionForBastionHostOperatorSpec interface {
	AssignPropertiesFrom(src *storage.BastionHostOperatorSpec) error
	AssignPropertiesTo(dst *storage.BastionHostOperatorSpec) error
}

type augmentConversionForSku interface {
	AssignPropertiesFrom(src *storage.Sku) error
	AssignPropertiesTo(dst *storage.Sku) error
}

type augmentConversionForSku_STATUS interface {
	AssignPropertiesFrom(src *storage.Sku_STATUS) error
	AssignPropertiesTo(dst *storage.Sku_STATUS) error
}

func init() {
	SchemeBuilder.Register(&BastionHost{}, &BastionHostList{})
}
