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

import (
	v20220801s "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20220801/storage"
	v20240501s "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20240501/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,apimanagement}
// +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 v1api20230501preview.Service
// Generator information:
// - Generated from: /apimanagement/resource-manager/Microsoft.ApiManagement/preview/2023-05-01-preview/apimdeployment.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}
type Service struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              Service_Spec   `json:"spec,omitempty"`
	Status            Service_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &Service{}

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

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

var _ conversion.Convertible = &Service{}

// ConvertFrom populates our Service from the provided hub Service
func (service *Service) ConvertFrom(hub conversion.Hub) error {
	// intermediate variable for conversion
	var source v20220801s.Service

	err := source.ConvertFrom(hub)
	if err != nil {
		return eris.Wrap(err, "converting from hub to source")
	}

	err = service.AssignProperties_From_Service(&source)
	if err != nil {
		return eris.Wrap(err, "converting from source to service")
	}

	return nil
}

// ConvertTo populates the provided hub Service from our Service
func (service *Service) ConvertTo(hub conversion.Hub) error {
	// intermediate variable for conversion
	var destination v20220801s.Service
	err := service.AssignProperties_To_Service(&destination)
	if err != nil {
		return eris.Wrap(err, "converting to destination from service")
	}
	err = destination.ConvertTo(hub)
	if err != nil {
		return eris.Wrap(err, "converting from destination to hub")
	}

	return nil
}

var _ configmaps.Exporter = &Service{}

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

var _ secrets.Exporter = &Service{}

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

var _ genruntime.KubernetesResource = &Service{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.ApiManagement/service"
func (service *Service) GetType() string {
	return "Microsoft.ApiManagement/service"
}

// NewEmptyStatus returns a new empty (blank) status
func (service *Service) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Service_STATUS{}
}

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

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

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

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

	service.Status = st
	return nil
}

// AssignProperties_From_Service populates our Service from the provided source Service
func (service *Service) AssignProperties_From_Service(source *v20220801s.Service) error {

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Service populates the provided destination Service from our Service
func (service *Service) AssignProperties_To_Service(destination *v20220801s.Service) error {

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

	// Spec
	var spec v20220801s.Service_Spec
	err := service.Spec.AssignProperties_To_Service_Spec(&spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_Service_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status v20220801s.Service_STATUS
	err = service.Status.AssignProperties_To_Service_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_Service_STATUS() to populate field Status")
	}
	destination.Status = status

	// Invoke the augmentConversionForService interface (if implemented) to customize the conversion
	var serviceAsAny any = service
	if augmentedService, ok := serviceAsAny.(augmentConversionForService); ok {
		err := augmentedService.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 (service *Service) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: service.Spec.OriginalVersion,
		Kind:    "Service",
	}
}

// +kubebuilder:object:root=true
// Storage version of v1api20230501preview.Service
// Generator information:
// - Generated from: /apimanagement/resource-manager/Microsoft.ApiManagement/preview/2023-05-01-preview/apimdeployment.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}
type ServiceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Service `json:"items"`
}

type augmentConversionForService interface {
	AssignPropertiesFrom(src *v20220801s.Service) error
	AssignPropertiesTo(dst *v20220801s.Service) error
}

// Storage version of v1api20230501preview.Service_Spec
type Service_Spec struct {
	AdditionalLocations  []AdditionalLocation  `json:"additionalLocations,omitempty"`
	ApiVersionConstraint *ApiVersionConstraint `json:"apiVersionConstraint,omitempty"`

	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName               string                        `json:"azureName,omitempty"`
	Certificates            []CertificateConfiguration    `json:"certificates,omitempty"`
	ConfigurationApi        *ConfigurationApi             `json:"configurationApi,omitempty"`
	CustomProperties        map[string]string             `json:"customProperties,omitempty"`
	DeveloperPortalStatus   *string                       `json:"developerPortalStatus,omitempty"`
	DisableGateway          *bool                         `json:"disableGateway,omitempty"`
	EnableClientCertificate *bool                         `json:"enableClientCertificate,omitempty"`
	HostnameConfigurations  []HostnameConfiguration       `json:"hostnameConfigurations,omitempty"`
	Identity                *ApiManagementServiceIdentity `json:"identity,omitempty"`
	LegacyPortalStatus      *string                       `json:"legacyPortalStatus,omitempty"`
	Location                *string                       `json:"location,omitempty"`
	NatGatewayState         *string                       `json:"natGatewayState,omitempty"`
	NotificationSenderEmail *string                       `json:"notificationSenderEmail,omitempty"`
	OperatorSpec            *ServiceOperatorSpec          `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"`

	// PublicIpAddressReference: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed
	// service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.
	PublicIpAddressReference    *genruntime.ResourceReference      `armReference:"PublicIpAddressId" json:"publicIpAddressReference,omitempty"`
	PublicNetworkAccess         *string                            `json:"publicNetworkAccess,omitempty"`
	PublisherEmail              *string                            `json:"publisherEmail,omitempty"`
	PublisherName               *string                            `json:"publisherName,omitempty"`
	Restore                     *bool                              `json:"restore,omitempty"`
	Sku                         *ApiManagementServiceSkuProperties `json:"sku,omitempty"`
	Tags                        map[string]string                  `json:"tags,omitempty"`
	VirtualNetworkConfiguration *VirtualNetworkConfiguration       `json:"virtualNetworkConfiguration,omitempty"`
	VirtualNetworkType          *string                            `json:"virtualNetworkType,omitempty"`
	Zones                       []string                           `json:"zones,omitempty"`
}

var _ genruntime.ConvertibleSpec = &Service_Spec{}

// ConvertSpecFrom populates our Service_Spec from the provided source
func (service *Service_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*v20220801s.Service_Spec)
	if ok {
		// Populate our instance from source
		return service.AssignProperties_From_Service_Spec(src)
	}

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

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

	return nil
}

// ConvertSpecTo populates the provided destination from our Service_Spec
func (service *Service_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*v20220801s.Service_Spec)
	if ok {
		// Populate destination from our instance
		return service.AssignProperties_To_Service_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &v20220801s.Service_Spec{}
	err := service.AssignProperties_To_Service_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_Service_Spec populates our Service_Spec from the provided source Service_Spec
func (service *Service_Spec) AssignProperties_From_Service_Spec(source *v20220801s.Service_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AdditionalLocations
	if source.AdditionalLocations != nil {
		additionalLocationList := make([]AdditionalLocation, len(source.AdditionalLocations))
		for additionalLocationIndex, additionalLocationItem := range source.AdditionalLocations {
			var additionalLocation AdditionalLocation
			err := additionalLocation.AssignProperties_From_AdditionalLocation(&additionalLocationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AdditionalLocation() to populate field AdditionalLocations")
			}
			additionalLocationList[additionalLocationIndex] = additionalLocation
		}
		service.AdditionalLocations = additionalLocationList
	} else {
		service.AdditionalLocations = nil
	}

	// ApiVersionConstraint
	if source.ApiVersionConstraint != nil {
		var apiVersionConstraint ApiVersionConstraint
		err := apiVersionConstraint.AssignProperties_From_ApiVersionConstraint(source.ApiVersionConstraint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiVersionConstraint() to populate field ApiVersionConstraint")
		}
		service.ApiVersionConstraint = &apiVersionConstraint
	} else {
		service.ApiVersionConstraint = nil
	}

	// AzureName
	service.AzureName = source.AzureName

	// Certificates
	if source.Certificates != nil {
		certificateList := make([]CertificateConfiguration, len(source.Certificates))
		for certificateIndex, certificateItem := range source.Certificates {
			var certificate CertificateConfiguration
			err := certificate.AssignProperties_From_CertificateConfiguration(&certificateItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CertificateConfiguration() to populate field Certificates")
			}
			certificateList[certificateIndex] = certificate
		}
		service.Certificates = certificateList
	} else {
		service.Certificates = nil
	}

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

		service.ConfigurationApi = &configurationApi
	} else {
		service.ConfigurationApi = nil
	}

	// CustomProperties
	service.CustomProperties = genruntime.CloneMapOfStringToString(source.CustomProperties)

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

		service.DeveloperPortalStatus = &developerPortalStatus
	} else {
		service.DeveloperPortalStatus = nil
	}

	// DisableGateway
	if source.DisableGateway != nil {
		disableGateway := *source.DisableGateway
		service.DisableGateway = &disableGateway
	} else {
		service.DisableGateway = nil
	}

	// EnableClientCertificate
	if source.EnableClientCertificate != nil {
		enableClientCertificate := *source.EnableClientCertificate
		service.EnableClientCertificate = &enableClientCertificate
	} else {
		service.EnableClientCertificate = nil
	}

	// HostnameConfigurations
	if source.HostnameConfigurations != nil {
		hostnameConfigurationList := make([]HostnameConfiguration, len(source.HostnameConfigurations))
		for hostnameConfigurationIndex, hostnameConfigurationItem := range source.HostnameConfigurations {
			var hostnameConfiguration HostnameConfiguration
			err := hostnameConfiguration.AssignProperties_From_HostnameConfiguration(&hostnameConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_HostnameConfiguration() to populate field HostnameConfigurations")
			}
			hostnameConfigurationList[hostnameConfigurationIndex] = hostnameConfiguration
		}
		service.HostnameConfigurations = hostnameConfigurationList
	} else {
		service.HostnameConfigurations = nil
	}

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

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

		service.LegacyPortalStatus = &legacyPortalStatus
	} else {
		service.LegacyPortalStatus = nil
	}

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

	// NatGatewayState
	service.NatGatewayState = genruntime.ClonePointerToString(source.NatGatewayState)

	// NotificationSenderEmail
	service.NotificationSenderEmail = genruntime.ClonePointerToString(source.NotificationSenderEmail)

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

	// OriginalVersion
	service.OriginalVersion = source.OriginalVersion

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

	// PublicIpAddressReference
	if source.PublicIpAddressReference != nil {
		publicIpAddressReference := source.PublicIpAddressReference.Copy()
		service.PublicIpAddressReference = &publicIpAddressReference
	} else {
		service.PublicIpAddressReference = nil
	}

	// PublicNetworkAccess
	service.PublicNetworkAccess = genruntime.ClonePointerToString(source.PublicNetworkAccess)

	// PublisherEmail
	service.PublisherEmail = genruntime.ClonePointerToString(source.PublisherEmail)

	// PublisherName
	service.PublisherName = genruntime.ClonePointerToString(source.PublisherName)

	// Restore
	if source.Restore != nil {
		restore := *source.Restore
		service.Restore = &restore
	} else {
		service.Restore = nil
	}

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

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

	// VirtualNetworkConfiguration
	if source.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration VirtualNetworkConfiguration
		err := virtualNetworkConfiguration.AssignProperties_From_VirtualNetworkConfiguration(source.VirtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkConfiguration() to populate field VirtualNetworkConfiguration")
		}
		service.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		service.VirtualNetworkConfiguration = nil
	}

	// VirtualNetworkType
	service.VirtualNetworkType = genruntime.ClonePointerToString(source.VirtualNetworkType)

	// Zones
	service.Zones = genruntime.CloneSliceOfString(source.Zones)

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

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

	// No error
	return nil
}

// AssignProperties_To_Service_Spec populates the provided destination Service_Spec from our Service_Spec
func (service *Service_Spec) AssignProperties_To_Service_Spec(destination *v20220801s.Service_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(service.PropertyBag)

	// AdditionalLocations
	if service.AdditionalLocations != nil {
		additionalLocationList := make([]v20220801s.AdditionalLocation, len(service.AdditionalLocations))
		for additionalLocationIndex, additionalLocationItem := range service.AdditionalLocations {
			var additionalLocation v20220801s.AdditionalLocation
			err := additionalLocationItem.AssignProperties_To_AdditionalLocation(&additionalLocation)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AdditionalLocation() to populate field AdditionalLocations")
			}
			additionalLocationList[additionalLocationIndex] = additionalLocation
		}
		destination.AdditionalLocations = additionalLocationList
	} else {
		destination.AdditionalLocations = nil
	}

	// ApiVersionConstraint
	if service.ApiVersionConstraint != nil {
		var apiVersionConstraint v20220801s.ApiVersionConstraint
		err := service.ApiVersionConstraint.AssignProperties_To_ApiVersionConstraint(&apiVersionConstraint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiVersionConstraint() to populate field ApiVersionConstraint")
		}
		destination.ApiVersionConstraint = &apiVersionConstraint
	} else {
		destination.ApiVersionConstraint = nil
	}

	// AzureName
	destination.AzureName = service.AzureName

	// Certificates
	if service.Certificates != nil {
		certificateList := make([]v20220801s.CertificateConfiguration, len(service.Certificates))
		for certificateIndex, certificateItem := range service.Certificates {
			var certificate v20220801s.CertificateConfiguration
			err := certificateItem.AssignProperties_To_CertificateConfiguration(&certificate)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CertificateConfiguration() to populate field Certificates")
			}
			certificateList[certificateIndex] = certificate
		}
		destination.Certificates = certificateList
	} else {
		destination.Certificates = nil
	}

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

	// CustomProperties
	destination.CustomProperties = genruntime.CloneMapOfStringToString(service.CustomProperties)

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

	// DisableGateway
	if service.DisableGateway != nil {
		disableGateway := *service.DisableGateway
		destination.DisableGateway = &disableGateway
	} else {
		destination.DisableGateway = nil
	}

	// EnableClientCertificate
	if service.EnableClientCertificate != nil {
		enableClientCertificate := *service.EnableClientCertificate
		destination.EnableClientCertificate = &enableClientCertificate
	} else {
		destination.EnableClientCertificate = nil
	}

	// HostnameConfigurations
	if service.HostnameConfigurations != nil {
		hostnameConfigurationList := make([]v20220801s.HostnameConfiguration, len(service.HostnameConfigurations))
		for hostnameConfigurationIndex, hostnameConfigurationItem := range service.HostnameConfigurations {
			var hostnameConfiguration v20220801s.HostnameConfiguration
			err := hostnameConfigurationItem.AssignProperties_To_HostnameConfiguration(&hostnameConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_HostnameConfiguration() to populate field HostnameConfigurations")
			}
			hostnameConfigurationList[hostnameConfigurationIndex] = hostnameConfiguration
		}
		destination.HostnameConfigurations = hostnameConfigurationList
	} else {
		destination.HostnameConfigurations = nil
	}

	// Identity
	if service.Identity != nil {
		var identity v20220801s.ApiManagementServiceIdentity
		err := service.Identity.AssignProperties_To_ApiManagementServiceIdentity(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiManagementServiceIdentity() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

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

	// NatGatewayState
	destination.NatGatewayState = genruntime.ClonePointerToString(service.NatGatewayState)

	// NotificationSenderEmail
	destination.NotificationSenderEmail = genruntime.ClonePointerToString(service.NotificationSenderEmail)

	// OperatorSpec
	if service.OperatorSpec != nil {
		var operatorSpec v20220801s.ServiceOperatorSpec
		err := service.OperatorSpec.AssignProperties_To_ServiceOperatorSpec(&operatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ServiceOperatorSpec() to populate field OperatorSpec")
		}
		destination.OperatorSpec = &operatorSpec
	} else {
		destination.OperatorSpec = nil
	}

	// OriginalVersion
	destination.OriginalVersion = service.OriginalVersion

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

	// PublicIpAddressReference
	if service.PublicIpAddressReference != nil {
		publicIpAddressReference := service.PublicIpAddressReference.Copy()
		destination.PublicIpAddressReference = &publicIpAddressReference
	} else {
		destination.PublicIpAddressReference = nil
	}

	// PublicNetworkAccess
	destination.PublicNetworkAccess = genruntime.ClonePointerToString(service.PublicNetworkAccess)

	// PublisherEmail
	destination.PublisherEmail = genruntime.ClonePointerToString(service.PublisherEmail)

	// PublisherName
	destination.PublisherName = genruntime.ClonePointerToString(service.PublisherName)

	// Restore
	if service.Restore != nil {
		restore := *service.Restore
		destination.Restore = &restore
	} else {
		destination.Restore = nil
	}

	// Sku
	if service.Sku != nil {
		var sku v20220801s.ApiManagementServiceSkuProperties
		err := service.Sku.AssignProperties_To_ApiManagementServiceSkuProperties(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiManagementServiceSkuProperties() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

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

	// VirtualNetworkConfiguration
	if service.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration v20220801s.VirtualNetworkConfiguration
		err := service.VirtualNetworkConfiguration.AssignProperties_To_VirtualNetworkConfiguration(&virtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkConfiguration() to populate field VirtualNetworkConfiguration")
		}
		destination.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		destination.VirtualNetworkConfiguration = nil
	}

	// VirtualNetworkType
	destination.VirtualNetworkType = genruntime.ClonePointerToString(service.VirtualNetworkType)

	// Zones
	destination.Zones = genruntime.CloneSliceOfString(service.Zones)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.Service_STATUS
type Service_STATUS struct {
	AdditionalLocations         []AdditionalLocation_STATUS                     `json:"additionalLocations,omitempty"`
	ApiVersionConstraint        *ApiVersionConstraint_STATUS                    `json:"apiVersionConstraint,omitempty"`
	Certificates                []CertificateConfiguration_STATUS               `json:"certificates,omitempty"`
	Conditions                  []conditions.Condition                          `json:"conditions,omitempty"`
	ConfigurationApi            *ConfigurationApi_STATUS                        `json:"configurationApi,omitempty"`
	CreatedAtUtc                *string                                         `json:"createdAtUtc,omitempty"`
	CustomProperties            map[string]string                               `json:"customProperties,omitempty"`
	DeveloperPortalStatus       *string                                         `json:"developerPortalStatus,omitempty"`
	DeveloperPortalUrl          *string                                         `json:"developerPortalUrl,omitempty"`
	DisableGateway              *bool                                           `json:"disableGateway,omitempty"`
	EnableClientCertificate     *bool                                           `json:"enableClientCertificate,omitempty"`
	Etag                        *string                                         `json:"etag,omitempty"`
	GatewayRegionalUrl          *string                                         `json:"gatewayRegionalUrl,omitempty"`
	GatewayUrl                  *string                                         `json:"gatewayUrl,omitempty"`
	HostnameConfigurations      []HostnameConfiguration_STATUS                  `json:"hostnameConfigurations,omitempty"`
	Id                          *string                                         `json:"id,omitempty"`
	Identity                    *ApiManagementServiceIdentity_STATUS            `json:"identity,omitempty"`
	LegacyPortalStatus          *string                                         `json:"legacyPortalStatus,omitempty"`
	Location                    *string                                         `json:"location,omitempty"`
	ManagementApiUrl            *string                                         `json:"managementApiUrl,omitempty"`
	Name                        *string                                         `json:"name,omitempty"`
	NatGatewayState             *string                                         `json:"natGatewayState,omitempty"`
	NotificationSenderEmail     *string                                         `json:"notificationSenderEmail,omitempty"`
	OutboundPublicIPAddresses   []string                                        `json:"outboundPublicIPAddresses,omitempty"`
	PlatformVersion             *string                                         `json:"platformVersion,omitempty"`
	PortalUrl                   *string                                         `json:"portalUrl,omitempty"`
	PrivateEndpointConnections  []RemotePrivateEndpointConnectionWrapper_STATUS `json:"privateEndpointConnections,omitempty"`
	PrivateIPAddresses          []string                                        `json:"privateIPAddresses,omitempty"`
	PropertyBag                 genruntime.PropertyBag                          `json:"$propertyBag,omitempty"`
	ProvisioningState           *string                                         `json:"provisioningState,omitempty"`
	PublicIPAddresses           []string                                        `json:"publicIPAddresses,omitempty"`
	PublicIpAddressId           *string                                         `json:"publicIpAddressId,omitempty"`
	PublicNetworkAccess         *string                                         `json:"publicNetworkAccess,omitempty"`
	PublisherEmail              *string                                         `json:"publisherEmail,omitempty"`
	PublisherName               *string                                         `json:"publisherName,omitempty"`
	Restore                     *bool                                           `json:"restore,omitempty"`
	ScmUrl                      *string                                         `json:"scmUrl,omitempty"`
	Sku                         *ApiManagementServiceSkuProperties_STATUS       `json:"sku,omitempty"`
	SystemData                  *SystemData_STATUS                              `json:"systemData,omitempty"`
	Tags                        map[string]string                               `json:"tags,omitempty"`
	TargetProvisioningState     *string                                         `json:"targetProvisioningState,omitempty"`
	Type                        *string                                         `json:"type,omitempty"`
	VirtualNetworkConfiguration *VirtualNetworkConfiguration_STATUS             `json:"virtualNetworkConfiguration,omitempty"`
	VirtualNetworkType          *string                                         `json:"virtualNetworkType,omitempty"`
	Zones                       []string                                        `json:"zones,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Service_STATUS{}

// ConvertStatusFrom populates our Service_STATUS from the provided source
func (service *Service_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*v20220801s.Service_STATUS)
	if ok {
		// Populate our instance from source
		return service.AssignProperties_From_Service_STATUS(src)
	}

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

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

	return nil
}

// ConvertStatusTo populates the provided destination from our Service_STATUS
func (service *Service_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*v20220801s.Service_STATUS)
	if ok {
		// Populate destination from our instance
		return service.AssignProperties_To_Service_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &v20220801s.Service_STATUS{}
	err := service.AssignProperties_To_Service_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_Service_STATUS populates our Service_STATUS from the provided source Service_STATUS
func (service *Service_STATUS) AssignProperties_From_Service_STATUS(source *v20220801s.Service_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AdditionalLocations
	if source.AdditionalLocations != nil {
		additionalLocationList := make([]AdditionalLocation_STATUS, len(source.AdditionalLocations))
		for additionalLocationIndex, additionalLocationItem := range source.AdditionalLocations {
			var additionalLocation AdditionalLocation_STATUS
			err := additionalLocation.AssignProperties_From_AdditionalLocation_STATUS(&additionalLocationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AdditionalLocation_STATUS() to populate field AdditionalLocations")
			}
			additionalLocationList[additionalLocationIndex] = additionalLocation
		}
		service.AdditionalLocations = additionalLocationList
	} else {
		service.AdditionalLocations = nil
	}

	// ApiVersionConstraint
	if source.ApiVersionConstraint != nil {
		var apiVersionConstraint ApiVersionConstraint_STATUS
		err := apiVersionConstraint.AssignProperties_From_ApiVersionConstraint_STATUS(source.ApiVersionConstraint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiVersionConstraint_STATUS() to populate field ApiVersionConstraint")
		}
		service.ApiVersionConstraint = &apiVersionConstraint
	} else {
		service.ApiVersionConstraint = nil
	}

	// Certificates
	if source.Certificates != nil {
		certificateList := make([]CertificateConfiguration_STATUS, len(source.Certificates))
		for certificateIndex, certificateItem := range source.Certificates {
			var certificate CertificateConfiguration_STATUS
			err := certificate.AssignProperties_From_CertificateConfiguration_STATUS(&certificateItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CertificateConfiguration_STATUS() to populate field Certificates")
			}
			certificateList[certificateIndex] = certificate
		}
		service.Certificates = certificateList
	} else {
		service.Certificates = nil
	}

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

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

		service.ConfigurationApi = &configurationApi
	} else {
		service.ConfigurationApi = nil
	}

	// CreatedAtUtc
	service.CreatedAtUtc = genruntime.ClonePointerToString(source.CreatedAtUtc)

	// CustomProperties
	service.CustomProperties = genruntime.CloneMapOfStringToString(source.CustomProperties)

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

		service.DeveloperPortalStatus = &developerPortalStatus
	} else {
		service.DeveloperPortalStatus = nil
	}

	// DeveloperPortalUrl
	service.DeveloperPortalUrl = genruntime.ClonePointerToString(source.DeveloperPortalUrl)

	// DisableGateway
	if source.DisableGateway != nil {
		disableGateway := *source.DisableGateway
		service.DisableGateway = &disableGateway
	} else {
		service.DisableGateway = nil
	}

	// EnableClientCertificate
	if source.EnableClientCertificate != nil {
		enableClientCertificate := *source.EnableClientCertificate
		service.EnableClientCertificate = &enableClientCertificate
	} else {
		service.EnableClientCertificate = nil
	}

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

	// GatewayRegionalUrl
	service.GatewayRegionalUrl = genruntime.ClonePointerToString(source.GatewayRegionalUrl)

	// GatewayUrl
	service.GatewayUrl = genruntime.ClonePointerToString(source.GatewayUrl)

	// HostnameConfigurations
	if source.HostnameConfigurations != nil {
		hostnameConfigurationList := make([]HostnameConfiguration_STATUS, len(source.HostnameConfigurations))
		for hostnameConfigurationIndex, hostnameConfigurationItem := range source.HostnameConfigurations {
			var hostnameConfiguration HostnameConfiguration_STATUS
			err := hostnameConfiguration.AssignProperties_From_HostnameConfiguration_STATUS(&hostnameConfigurationItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_HostnameConfiguration_STATUS() to populate field HostnameConfigurations")
			}
			hostnameConfigurationList[hostnameConfigurationIndex] = hostnameConfiguration
		}
		service.HostnameConfigurations = hostnameConfigurationList
	} else {
		service.HostnameConfigurations = nil
	}

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

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

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

		service.LegacyPortalStatus = &legacyPortalStatus
	} else {
		service.LegacyPortalStatus = nil
	}

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

	// ManagementApiUrl
	service.ManagementApiUrl = genruntime.ClonePointerToString(source.ManagementApiUrl)

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

	// NatGatewayState
	service.NatGatewayState = genruntime.ClonePointerToString(source.NatGatewayState)

	// NotificationSenderEmail
	service.NotificationSenderEmail = genruntime.ClonePointerToString(source.NotificationSenderEmail)

	// OutboundPublicIPAddresses
	service.OutboundPublicIPAddresses = genruntime.CloneSliceOfString(source.OutboundPublicIPAddresses)

	// PlatformVersion
	service.PlatformVersion = genruntime.ClonePointerToString(source.PlatformVersion)

	// PortalUrl
	service.PortalUrl = genruntime.ClonePointerToString(source.PortalUrl)

	// PrivateEndpointConnections
	if source.PrivateEndpointConnections != nil {
		privateEndpointConnectionList := make([]RemotePrivateEndpointConnectionWrapper_STATUS, len(source.PrivateEndpointConnections))
		for privateEndpointConnectionIndex, privateEndpointConnectionItem := range source.PrivateEndpointConnections {
			var privateEndpointConnection RemotePrivateEndpointConnectionWrapper_STATUS
			err := privateEndpointConnection.AssignProperties_From_RemotePrivateEndpointConnectionWrapper_STATUS(&privateEndpointConnectionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_RemotePrivateEndpointConnectionWrapper_STATUS() to populate field PrivateEndpointConnections")
			}
			privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection
		}
		service.PrivateEndpointConnections = privateEndpointConnectionList
	} else {
		service.PrivateEndpointConnections = nil
	}

	// PrivateIPAddresses
	service.PrivateIPAddresses = genruntime.CloneSliceOfString(source.PrivateIPAddresses)

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

	// PublicIPAddresses
	service.PublicIPAddresses = genruntime.CloneSliceOfString(source.PublicIPAddresses)

	// PublicIpAddressId
	service.PublicIpAddressId = genruntime.ClonePointerToString(source.PublicIpAddressId)

	// PublicNetworkAccess
	service.PublicNetworkAccess = genruntime.ClonePointerToString(source.PublicNetworkAccess)

	// PublisherEmail
	service.PublisherEmail = genruntime.ClonePointerToString(source.PublisherEmail)

	// PublisherName
	service.PublisherName = genruntime.ClonePointerToString(source.PublisherName)

	// Restore
	if source.Restore != nil {
		restore := *source.Restore
		service.Restore = &restore
	} else {
		service.Restore = nil
	}

	// ScmUrl
	service.ScmUrl = genruntime.ClonePointerToString(source.ScmUrl)

	// Sku
	if source.Sku != nil {
		var sku ApiManagementServiceSkuProperties_STATUS
		err := sku.AssignProperties_From_ApiManagementServiceSkuProperties_STATUS(source.Sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ApiManagementServiceSkuProperties_STATUS() to populate field Sku")
		}
		service.Sku = &sku
	} else {
		service.Sku = 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")
		}
		service.SystemData = &systemDatum
	} else {
		service.SystemData = nil
	}

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

	// TargetProvisioningState
	service.TargetProvisioningState = genruntime.ClonePointerToString(source.TargetProvisioningState)

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

	// VirtualNetworkConfiguration
	if source.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration VirtualNetworkConfiguration_STATUS
		err := virtualNetworkConfiguration.AssignProperties_From_VirtualNetworkConfiguration_STATUS(source.VirtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkConfiguration_STATUS() to populate field VirtualNetworkConfiguration")
		}
		service.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		service.VirtualNetworkConfiguration = nil
	}

	// VirtualNetworkType
	service.VirtualNetworkType = genruntime.ClonePointerToString(source.VirtualNetworkType)

	// Zones
	service.Zones = genruntime.CloneSliceOfString(source.Zones)

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

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

	// No error
	return nil
}

// AssignProperties_To_Service_STATUS populates the provided destination Service_STATUS from our Service_STATUS
func (service *Service_STATUS) AssignProperties_To_Service_STATUS(destination *v20220801s.Service_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(service.PropertyBag)

	// AdditionalLocations
	if service.AdditionalLocations != nil {
		additionalLocationList := make([]v20220801s.AdditionalLocation_STATUS, len(service.AdditionalLocations))
		for additionalLocationIndex, additionalLocationItem := range service.AdditionalLocations {
			var additionalLocation v20220801s.AdditionalLocation_STATUS
			err := additionalLocationItem.AssignProperties_To_AdditionalLocation_STATUS(&additionalLocation)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AdditionalLocation_STATUS() to populate field AdditionalLocations")
			}
			additionalLocationList[additionalLocationIndex] = additionalLocation
		}
		destination.AdditionalLocations = additionalLocationList
	} else {
		destination.AdditionalLocations = nil
	}

	// ApiVersionConstraint
	if service.ApiVersionConstraint != nil {
		var apiVersionConstraint v20220801s.ApiVersionConstraint_STATUS
		err := service.ApiVersionConstraint.AssignProperties_To_ApiVersionConstraint_STATUS(&apiVersionConstraint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiVersionConstraint_STATUS() to populate field ApiVersionConstraint")
		}
		destination.ApiVersionConstraint = &apiVersionConstraint
	} else {
		destination.ApiVersionConstraint = nil
	}

	// Certificates
	if service.Certificates != nil {
		certificateList := make([]v20220801s.CertificateConfiguration_STATUS, len(service.Certificates))
		for certificateIndex, certificateItem := range service.Certificates {
			var certificate v20220801s.CertificateConfiguration_STATUS
			err := certificateItem.AssignProperties_To_CertificateConfiguration_STATUS(&certificate)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CertificateConfiguration_STATUS() to populate field Certificates")
			}
			certificateList[certificateIndex] = certificate
		}
		destination.Certificates = certificateList
	} else {
		destination.Certificates = nil
	}

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

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

	// CreatedAtUtc
	destination.CreatedAtUtc = genruntime.ClonePointerToString(service.CreatedAtUtc)

	// CustomProperties
	destination.CustomProperties = genruntime.CloneMapOfStringToString(service.CustomProperties)

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

	// DeveloperPortalUrl
	destination.DeveloperPortalUrl = genruntime.ClonePointerToString(service.DeveloperPortalUrl)

	// DisableGateway
	if service.DisableGateway != nil {
		disableGateway := *service.DisableGateway
		destination.DisableGateway = &disableGateway
	} else {
		destination.DisableGateway = nil
	}

	// EnableClientCertificate
	if service.EnableClientCertificate != nil {
		enableClientCertificate := *service.EnableClientCertificate
		destination.EnableClientCertificate = &enableClientCertificate
	} else {
		destination.EnableClientCertificate = nil
	}

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

	// GatewayRegionalUrl
	destination.GatewayRegionalUrl = genruntime.ClonePointerToString(service.GatewayRegionalUrl)

	// GatewayUrl
	destination.GatewayUrl = genruntime.ClonePointerToString(service.GatewayUrl)

	// HostnameConfigurations
	if service.HostnameConfigurations != nil {
		hostnameConfigurationList := make([]v20220801s.HostnameConfiguration_STATUS, len(service.HostnameConfigurations))
		for hostnameConfigurationIndex, hostnameConfigurationItem := range service.HostnameConfigurations {
			var hostnameConfiguration v20220801s.HostnameConfiguration_STATUS
			err := hostnameConfigurationItem.AssignProperties_To_HostnameConfiguration_STATUS(&hostnameConfiguration)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_HostnameConfiguration_STATUS() to populate field HostnameConfigurations")
			}
			hostnameConfigurationList[hostnameConfigurationIndex] = hostnameConfiguration
		}
		destination.HostnameConfigurations = hostnameConfigurationList
	} else {
		destination.HostnameConfigurations = nil
	}

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

	// Identity
	if service.Identity != nil {
		var identity v20220801s.ApiManagementServiceIdentity_STATUS
		err := service.Identity.AssignProperties_To_ApiManagementServiceIdentity_STATUS(&identity)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiManagementServiceIdentity_STATUS() to populate field Identity")
		}
		destination.Identity = &identity
	} else {
		destination.Identity = nil
	}

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

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

	// ManagementApiUrl
	destination.ManagementApiUrl = genruntime.ClonePointerToString(service.ManagementApiUrl)

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

	// NatGatewayState
	destination.NatGatewayState = genruntime.ClonePointerToString(service.NatGatewayState)

	// NotificationSenderEmail
	destination.NotificationSenderEmail = genruntime.ClonePointerToString(service.NotificationSenderEmail)

	// OutboundPublicIPAddresses
	destination.OutboundPublicIPAddresses = genruntime.CloneSliceOfString(service.OutboundPublicIPAddresses)

	// PlatformVersion
	destination.PlatformVersion = genruntime.ClonePointerToString(service.PlatformVersion)

	// PortalUrl
	destination.PortalUrl = genruntime.ClonePointerToString(service.PortalUrl)

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

	// PrivateIPAddresses
	destination.PrivateIPAddresses = genruntime.CloneSliceOfString(service.PrivateIPAddresses)

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

	// PublicIPAddresses
	destination.PublicIPAddresses = genruntime.CloneSliceOfString(service.PublicIPAddresses)

	// PublicIpAddressId
	destination.PublicIpAddressId = genruntime.ClonePointerToString(service.PublicIpAddressId)

	// PublicNetworkAccess
	destination.PublicNetworkAccess = genruntime.ClonePointerToString(service.PublicNetworkAccess)

	// PublisherEmail
	destination.PublisherEmail = genruntime.ClonePointerToString(service.PublisherEmail)

	// PublisherName
	destination.PublisherName = genruntime.ClonePointerToString(service.PublisherName)

	// Restore
	if service.Restore != nil {
		restore := *service.Restore
		destination.Restore = &restore
	} else {
		destination.Restore = nil
	}

	// ScmUrl
	destination.ScmUrl = genruntime.ClonePointerToString(service.ScmUrl)

	// Sku
	if service.Sku != nil {
		var sku v20220801s.ApiManagementServiceSkuProperties_STATUS
		err := service.Sku.AssignProperties_To_ApiManagementServiceSkuProperties_STATUS(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiManagementServiceSkuProperties_STATUS() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

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

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

	// TargetProvisioningState
	destination.TargetProvisioningState = genruntime.ClonePointerToString(service.TargetProvisioningState)

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

	// VirtualNetworkConfiguration
	if service.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration v20220801s.VirtualNetworkConfiguration_STATUS
		err := service.VirtualNetworkConfiguration.AssignProperties_To_VirtualNetworkConfiguration_STATUS(&virtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkConfiguration_STATUS() to populate field VirtualNetworkConfiguration")
		}
		destination.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		destination.VirtualNetworkConfiguration = nil
	}

	// VirtualNetworkType
	destination.VirtualNetworkType = genruntime.ClonePointerToString(service.VirtualNetworkType)

	// Zones
	destination.Zones = genruntime.CloneSliceOfString(service.Zones)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.AdditionalLocation
// Description of an additional API Management resource location.
type AdditionalLocation struct {
	DisableGateway  *bool                  `json:"disableGateway,omitempty"`
	Location        *string                `json:"location,omitempty"`
	NatGatewayState *string                `json:"natGatewayState,omitempty"`
	PropertyBag     genruntime.PropertyBag `json:"$propertyBag,omitempty"`

	// PublicIpAddressReference: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed
	// service in the location. Supported only for Premium SKU being deployed in Virtual Network.
	PublicIpAddressReference    *genruntime.ResourceReference      `armReference:"PublicIpAddressId" json:"publicIpAddressReference,omitempty"`
	Sku                         *ApiManagementServiceSkuProperties `json:"sku,omitempty"`
	VirtualNetworkConfiguration *VirtualNetworkConfiguration       `json:"virtualNetworkConfiguration,omitempty"`
	Zones                       []string                           `json:"zones,omitempty"`
}

// AssignProperties_From_AdditionalLocation populates our AdditionalLocation from the provided source AdditionalLocation
func (location *AdditionalLocation) AssignProperties_From_AdditionalLocation(source *v20220801s.AdditionalLocation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// DisableGateway
	if source.DisableGateway != nil {
		disableGateway := *source.DisableGateway
		location.DisableGateway = &disableGateway
	} else {
		location.DisableGateway = nil
	}

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

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

	// PublicIpAddressReference
	if source.PublicIpAddressReference != nil {
		publicIpAddressReference := source.PublicIpAddressReference.Copy()
		location.PublicIpAddressReference = &publicIpAddressReference
	} else {
		location.PublicIpAddressReference = nil
	}

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

	// VirtualNetworkConfiguration
	if source.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration VirtualNetworkConfiguration
		err := virtualNetworkConfiguration.AssignProperties_From_VirtualNetworkConfiguration(source.VirtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkConfiguration() to populate field VirtualNetworkConfiguration")
		}
		location.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		location.VirtualNetworkConfiguration = nil
	}

	// Zones
	location.Zones = genruntime.CloneSliceOfString(source.Zones)

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

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

	// No error
	return nil
}

// AssignProperties_To_AdditionalLocation populates the provided destination AdditionalLocation from our AdditionalLocation
func (location *AdditionalLocation) AssignProperties_To_AdditionalLocation(destination *v20220801s.AdditionalLocation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(location.PropertyBag)

	// DisableGateway
	if location.DisableGateway != nil {
		disableGateway := *location.DisableGateway
		destination.DisableGateway = &disableGateway
	} else {
		destination.DisableGateway = nil
	}

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

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

	// PublicIpAddressReference
	if location.PublicIpAddressReference != nil {
		publicIpAddressReference := location.PublicIpAddressReference.Copy()
		destination.PublicIpAddressReference = &publicIpAddressReference
	} else {
		destination.PublicIpAddressReference = nil
	}

	// Sku
	if location.Sku != nil {
		var sku v20220801s.ApiManagementServiceSkuProperties
		err := location.Sku.AssignProperties_To_ApiManagementServiceSkuProperties(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiManagementServiceSkuProperties() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

	// VirtualNetworkConfiguration
	if location.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration v20220801s.VirtualNetworkConfiguration
		err := location.VirtualNetworkConfiguration.AssignProperties_To_VirtualNetworkConfiguration(&virtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkConfiguration() to populate field VirtualNetworkConfiguration")
		}
		destination.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		destination.VirtualNetworkConfiguration = nil
	}

	// Zones
	destination.Zones = genruntime.CloneSliceOfString(location.Zones)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.AdditionalLocation_STATUS
// Description of an additional API Management resource location.
type AdditionalLocation_STATUS struct {
	DisableGateway              *bool                                     `json:"disableGateway,omitempty"`
	GatewayRegionalUrl          *string                                   `json:"gatewayRegionalUrl,omitempty"`
	Location                    *string                                   `json:"location,omitempty"`
	NatGatewayState             *string                                   `json:"natGatewayState,omitempty"`
	OutboundPublicIPAddresses   []string                                  `json:"outboundPublicIPAddresses,omitempty"`
	PlatformVersion             *string                                   `json:"platformVersion,omitempty"`
	PrivateIPAddresses          []string                                  `json:"privateIPAddresses,omitempty"`
	PropertyBag                 genruntime.PropertyBag                    `json:"$propertyBag,omitempty"`
	PublicIPAddresses           []string                                  `json:"publicIPAddresses,omitempty"`
	PublicIpAddressId           *string                                   `json:"publicIpAddressId,omitempty"`
	Sku                         *ApiManagementServiceSkuProperties_STATUS `json:"sku,omitempty"`
	VirtualNetworkConfiguration *VirtualNetworkConfiguration_STATUS       `json:"virtualNetworkConfiguration,omitempty"`
	Zones                       []string                                  `json:"zones,omitempty"`
}

// AssignProperties_From_AdditionalLocation_STATUS populates our AdditionalLocation_STATUS from the provided source AdditionalLocation_STATUS
func (location *AdditionalLocation_STATUS) AssignProperties_From_AdditionalLocation_STATUS(source *v20220801s.AdditionalLocation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// DisableGateway
	if source.DisableGateway != nil {
		disableGateway := *source.DisableGateway
		location.DisableGateway = &disableGateway
	} else {
		location.DisableGateway = nil
	}

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

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

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

	// OutboundPublicIPAddresses
	location.OutboundPublicIPAddresses = genruntime.CloneSliceOfString(source.OutboundPublicIPAddresses)

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

	// PrivateIPAddresses
	location.PrivateIPAddresses = genruntime.CloneSliceOfString(source.PrivateIPAddresses)

	// PublicIPAddresses
	location.PublicIPAddresses = genruntime.CloneSliceOfString(source.PublicIPAddresses)

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

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

	// VirtualNetworkConfiguration
	if source.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration VirtualNetworkConfiguration_STATUS
		err := virtualNetworkConfiguration.AssignProperties_From_VirtualNetworkConfiguration_STATUS(source.VirtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_VirtualNetworkConfiguration_STATUS() to populate field VirtualNetworkConfiguration")
		}
		location.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		location.VirtualNetworkConfiguration = nil
	}

	// Zones
	location.Zones = genruntime.CloneSliceOfString(source.Zones)

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

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

	// No error
	return nil
}

// AssignProperties_To_AdditionalLocation_STATUS populates the provided destination AdditionalLocation_STATUS from our AdditionalLocation_STATUS
func (location *AdditionalLocation_STATUS) AssignProperties_To_AdditionalLocation_STATUS(destination *v20220801s.AdditionalLocation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(location.PropertyBag)

	// DisableGateway
	if location.DisableGateway != nil {
		disableGateway := *location.DisableGateway
		destination.DisableGateway = &disableGateway
	} else {
		destination.DisableGateway = nil
	}

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

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

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

	// OutboundPublicIPAddresses
	destination.OutboundPublicIPAddresses = genruntime.CloneSliceOfString(location.OutboundPublicIPAddresses)

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

	// PrivateIPAddresses
	destination.PrivateIPAddresses = genruntime.CloneSliceOfString(location.PrivateIPAddresses)

	// PublicIPAddresses
	destination.PublicIPAddresses = genruntime.CloneSliceOfString(location.PublicIPAddresses)

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

	// Sku
	if location.Sku != nil {
		var sku v20220801s.ApiManagementServiceSkuProperties_STATUS
		err := location.Sku.AssignProperties_To_ApiManagementServiceSkuProperties_STATUS(&sku)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ApiManagementServiceSkuProperties_STATUS() to populate field Sku")
		}
		destination.Sku = &sku
	} else {
		destination.Sku = nil
	}

	// VirtualNetworkConfiguration
	if location.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration v20220801s.VirtualNetworkConfiguration_STATUS
		err := location.VirtualNetworkConfiguration.AssignProperties_To_VirtualNetworkConfiguration_STATUS(&virtualNetworkConfiguration)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_VirtualNetworkConfiguration_STATUS() to populate field VirtualNetworkConfiguration")
		}
		destination.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	} else {
		destination.VirtualNetworkConfiguration = nil
	}

	// Zones
	destination.Zones = genruntime.CloneSliceOfString(location.Zones)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ApiManagementServiceIdentity
// Identity properties of the Api Management service resource.
type ApiManagementServiceIdentity struct {
	PropertyBag            genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	Type                   *string                       `json:"type,omitempty"`
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

// AssignProperties_From_ApiManagementServiceIdentity populates our ApiManagementServiceIdentity from the provided source ApiManagementServiceIdentity
func (identity *ApiManagementServiceIdentity) AssignProperties_From_ApiManagementServiceIdentity(source *v20220801s.ApiManagementServiceIdentity) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

	// UserAssignedIdentities
	if source.UserAssignedIdentities != nil {
		userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities))
		for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities {
			var userAssignedIdentity UserAssignedIdentityDetails
			err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities")
			}
			userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity
		}
		identity.UserAssignedIdentities = userAssignedIdentityList
	} else {
		identity.UserAssignedIdentities = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_ApiManagementServiceIdentity populates the provided destination ApiManagementServiceIdentity from our ApiManagementServiceIdentity
func (identity *ApiManagementServiceIdentity) AssignProperties_To_ApiManagementServiceIdentity(destination *v20220801s.ApiManagementServiceIdentity) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(identity.PropertyBag)

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

	// UserAssignedIdentities
	if identity.UserAssignedIdentities != nil {
		userAssignedIdentityList := make([]v20220801s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities))
		for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities {
			var userAssignedIdentity v20220801s.UserAssignedIdentityDetails
			err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities")
			}
			userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity
		}
		destination.UserAssignedIdentities = userAssignedIdentityList
	} else {
		destination.UserAssignedIdentities = nil
	}

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ApiManagementServiceIdentity_STATUS
// Identity properties of the Api Management service resource.
type ApiManagementServiceIdentity_STATUS struct {
	PrincipalId            *string                                  `json:"principalId,omitempty"`
	PropertyBag            genruntime.PropertyBag                   `json:"$propertyBag,omitempty"`
	TenantId               *string                                  `json:"tenantId,omitempty"`
	Type                   *string                                  `json:"type,omitempty"`
	UserAssignedIdentities map[string]UserIdentityProperties_STATUS `json:"userAssignedIdentities,omitempty"`
}

// AssignProperties_From_ApiManagementServiceIdentity_STATUS populates our ApiManagementServiceIdentity_STATUS from the provided source ApiManagementServiceIdentity_STATUS
func (identity *ApiManagementServiceIdentity_STATUS) AssignProperties_From_ApiManagementServiceIdentity_STATUS(source *v20220801s.ApiManagementServiceIdentity_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ApiManagementServiceIdentity_STATUS populates the provided destination ApiManagementServiceIdentity_STATUS from our ApiManagementServiceIdentity_STATUS
func (identity *ApiManagementServiceIdentity_STATUS) AssignProperties_To_ApiManagementServiceIdentity_STATUS(destination *v20220801s.ApiManagementServiceIdentity_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(identity.PropertyBag)

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

	// TenantId
	destination.TenantId = genruntime.ClonePointerToString(identity.TenantId)

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

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ApiManagementServiceSkuProperties
// API Management service resource SKU properties.
type ApiManagementServiceSkuProperties struct {
	Capacity    *int                   `json:"capacity,omitempty"`
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ApiManagementServiceSkuProperties populates our ApiManagementServiceSkuProperties from the provided source ApiManagementServiceSkuProperties
func (properties *ApiManagementServiceSkuProperties) AssignProperties_From_ApiManagementServiceSkuProperties(source *v20220801s.ApiManagementServiceSkuProperties) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Capacity
	properties.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ApiManagementServiceSkuProperties populates the provided destination ApiManagementServiceSkuProperties from our ApiManagementServiceSkuProperties
func (properties *ApiManagementServiceSkuProperties) AssignProperties_To_ApiManagementServiceSkuProperties(destination *v20220801s.ApiManagementServiceSkuProperties) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(properties.PropertyBag)

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(properties.Capacity)

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ApiManagementServiceSkuProperties_STATUS
// API Management service resource SKU properties.
type ApiManagementServiceSkuProperties_STATUS struct {
	Capacity    *int                   `json:"capacity,omitempty"`
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ApiManagementServiceSkuProperties_STATUS populates our ApiManagementServiceSkuProperties_STATUS from the provided source ApiManagementServiceSkuProperties_STATUS
func (properties *ApiManagementServiceSkuProperties_STATUS) AssignProperties_From_ApiManagementServiceSkuProperties_STATUS(source *v20220801s.ApiManagementServiceSkuProperties_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Capacity
	properties.Capacity = genruntime.ClonePointerToInt(source.Capacity)

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ApiManagementServiceSkuProperties_STATUS populates the provided destination ApiManagementServiceSkuProperties_STATUS from our ApiManagementServiceSkuProperties_STATUS
func (properties *ApiManagementServiceSkuProperties_STATUS) AssignProperties_To_ApiManagementServiceSkuProperties_STATUS(destination *v20220801s.ApiManagementServiceSkuProperties_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(properties.PropertyBag)

	// Capacity
	destination.Capacity = genruntime.ClonePointerToInt(properties.Capacity)

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ApiVersionConstraint
// Control Plane Apis version constraint for the API Management service.
type ApiVersionConstraint struct {
	MinApiVersion *string                `json:"minApiVersion,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ApiVersionConstraint populates our ApiVersionConstraint from the provided source ApiVersionConstraint
func (constraint *ApiVersionConstraint) AssignProperties_From_ApiVersionConstraint(source *v20220801s.ApiVersionConstraint) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// MinApiVersion
	constraint.MinApiVersion = genruntime.ClonePointerToString(source.MinApiVersion)

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

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

	// No error
	return nil
}

// AssignProperties_To_ApiVersionConstraint populates the provided destination ApiVersionConstraint from our ApiVersionConstraint
func (constraint *ApiVersionConstraint) AssignProperties_To_ApiVersionConstraint(destination *v20220801s.ApiVersionConstraint) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(constraint.PropertyBag)

	// MinApiVersion
	destination.MinApiVersion = genruntime.ClonePointerToString(constraint.MinApiVersion)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ApiVersionConstraint_STATUS
// Control Plane Apis version constraint for the API Management service.
type ApiVersionConstraint_STATUS struct {
	MinApiVersion *string                `json:"minApiVersion,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ApiVersionConstraint_STATUS populates our ApiVersionConstraint_STATUS from the provided source ApiVersionConstraint_STATUS
func (constraint *ApiVersionConstraint_STATUS) AssignProperties_From_ApiVersionConstraint_STATUS(source *v20220801s.ApiVersionConstraint_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// MinApiVersion
	constraint.MinApiVersion = genruntime.ClonePointerToString(source.MinApiVersion)

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

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

	// No error
	return nil
}

// AssignProperties_To_ApiVersionConstraint_STATUS populates the provided destination ApiVersionConstraint_STATUS from our ApiVersionConstraint_STATUS
func (constraint *ApiVersionConstraint_STATUS) AssignProperties_To_ApiVersionConstraint_STATUS(destination *v20220801s.ApiVersionConstraint_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(constraint.PropertyBag)

	// MinApiVersion
	destination.MinApiVersion = genruntime.ClonePointerToString(constraint.MinApiVersion)

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

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

	// No error
	return nil
}

type augmentConversionForService_Spec interface {
	AssignPropertiesFrom(src *v20220801s.Service_Spec) error
	AssignPropertiesTo(dst *v20220801s.Service_Spec) error
}

type augmentConversionForService_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.Service_STATUS) error
	AssignPropertiesTo(dst *v20220801s.Service_STATUS) error
}

// Storage version of v1api20230501preview.CertificateConfiguration
// Certificate configuration which consist of non-trusted intermediates and root certificates.
type CertificateConfiguration struct {
	Certificate         *CertificateInformation     `json:"certificate,omitempty"`
	CertificatePassword *genruntime.SecretReference `json:"certificatePassword,omitempty"`
	EncodedCertificate  *string                     `json:"encodedCertificate,omitempty"`
	PropertyBag         genruntime.PropertyBag      `json:"$propertyBag,omitempty"`
	StoreName           *string                     `json:"storeName,omitempty"`
}

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

	// Certificate
	if source.Certificate != nil {
		var certificate CertificateInformation
		err := certificate.AssignProperties_From_CertificateInformation(source.Certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CertificateInformation() to populate field Certificate")
		}
		configuration.Certificate = &certificate
	} else {
		configuration.Certificate = nil
	}

	// CertificatePassword
	if source.CertificatePassword != nil {
		certificatePassword := source.CertificatePassword.Copy()
		configuration.CertificatePassword = &certificatePassword
	} else {
		configuration.CertificatePassword = nil
	}

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

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

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

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

	// No error
	return nil
}

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

	// Certificate
	if configuration.Certificate != nil {
		var certificate v20220801s.CertificateInformation
		err := configuration.Certificate.AssignProperties_To_CertificateInformation(&certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CertificateInformation() to populate field Certificate")
		}
		destination.Certificate = &certificate
	} else {
		destination.Certificate = nil
	}

	// CertificatePassword
	if configuration.CertificatePassword != nil {
		certificatePassword := configuration.CertificatePassword.Copy()
		destination.CertificatePassword = &certificatePassword
	} else {
		destination.CertificatePassword = nil
	}

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

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.CertificateConfiguration_STATUS
// Certificate configuration which consist of non-trusted intermediates and root certificates.
type CertificateConfiguration_STATUS struct {
	Certificate        *CertificateInformation_STATUS `json:"certificate,omitempty"`
	EncodedCertificate *string                        `json:"encodedCertificate,omitempty"`
	PropertyBag        genruntime.PropertyBag         `json:"$propertyBag,omitempty"`
	StoreName          *string                        `json:"storeName,omitempty"`
}

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

	// Certificate
	if source.Certificate != nil {
		var certificate CertificateInformation_STATUS
		err := certificate.AssignProperties_From_CertificateInformation_STATUS(source.Certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CertificateInformation_STATUS() to populate field Certificate")
		}
		configuration.Certificate = &certificate
	} else {
		configuration.Certificate = nil
	}

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

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

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

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

	// No error
	return nil
}

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

	// Certificate
	if configuration.Certificate != nil {
		var certificate v20220801s.CertificateInformation_STATUS
		err := configuration.Certificate.AssignProperties_To_CertificateInformation_STATUS(&certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CertificateInformation_STATUS() to populate field Certificate")
		}
		destination.Certificate = &certificate
	} else {
		destination.Certificate = nil
	}

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

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

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

	// Invoke the augmentConversionForCertificateConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForCertificateConfiguration_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 v1api20230501preview.ConfigurationApi
// Information regarding the Configuration API of the API Management service.
type ConfigurationApi struct {
	LegacyApi   *string                `json:"legacyApi,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ConfigurationApi populates our ConfigurationApi from the provided source ConfigurationApi
func (configurationApi *ConfigurationApi) AssignProperties_From_ConfigurationApi(source *v20240501s.ConfigurationApi) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// LegacyApi
	configurationApi.LegacyApi = genruntime.ClonePointerToString(source.LegacyApi)

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

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

	// No error
	return nil
}

// AssignProperties_To_ConfigurationApi populates the provided destination ConfigurationApi from our ConfigurationApi
func (configurationApi *ConfigurationApi) AssignProperties_To_ConfigurationApi(destination *v20240501s.ConfigurationApi) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configurationApi.PropertyBag)

	// LegacyApi
	destination.LegacyApi = genruntime.ClonePointerToString(configurationApi.LegacyApi)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.ConfigurationApi_STATUS
// Information regarding the Configuration API of the API Management service.
type ConfigurationApi_STATUS struct {
	LegacyApi   *string                `json:"legacyApi,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ConfigurationApi_STATUS populates our ConfigurationApi_STATUS from the provided source ConfigurationApi_STATUS
func (configurationApi *ConfigurationApi_STATUS) AssignProperties_From_ConfigurationApi_STATUS(source *v20240501s.ConfigurationApi_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// LegacyApi
	configurationApi.LegacyApi = genruntime.ClonePointerToString(source.LegacyApi)

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

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

	// No error
	return nil
}

// AssignProperties_To_ConfigurationApi_STATUS populates the provided destination ConfigurationApi_STATUS from our ConfigurationApi_STATUS
func (configurationApi *ConfigurationApi_STATUS) AssignProperties_To_ConfigurationApi_STATUS(destination *v20240501s.ConfigurationApi_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(configurationApi.PropertyBag)

	// LegacyApi
	destination.LegacyApi = genruntime.ClonePointerToString(configurationApi.LegacyApi)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.HostnameConfiguration
// Custom hostname configuration.
type HostnameConfiguration struct {
	Certificate                *CertificateInformation        `json:"certificate,omitempty"`
	CertificatePassword        *genruntime.SecretReference    `json:"certificatePassword,omitempty"`
	CertificateSource          *string                        `json:"certificateSource,omitempty"`
	CertificateStatus          *string                        `json:"certificateStatus,omitempty"`
	DefaultSslBinding          *bool                          `json:"defaultSslBinding,omitempty"`
	EncodedCertificate         *string                        `json:"encodedCertificate,omitempty"`
	HostName                   *string                        `json:"hostName,omitempty"`
	IdentityClientId           *string                        `json:"identityClientId,omitempty" optionalConfigMapPair:"IdentityClientId"`
	IdentityClientIdFromConfig *genruntime.ConfigMapReference `json:"identityClientIdFromConfig,omitempty" optionalConfigMapPair:"IdentityClientId"`
	KeyVaultId                 *string                        `json:"keyVaultId,omitempty"`
	NegotiateClientCertificate *bool                          `json:"negotiateClientCertificate,omitempty"`
	PropertyBag                genruntime.PropertyBag         `json:"$propertyBag,omitempty"`
	Type                       *string                        `json:"type,omitempty"`
}

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

	// Certificate
	if source.Certificate != nil {
		var certificate CertificateInformation
		err := certificate.AssignProperties_From_CertificateInformation(source.Certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CertificateInformation() to populate field Certificate")
		}
		configuration.Certificate = &certificate
	} else {
		configuration.Certificate = nil
	}

	// CertificatePassword
	if source.CertificatePassword != nil {
		certificatePassword := source.CertificatePassword.Copy()
		configuration.CertificatePassword = &certificatePassword
	} else {
		configuration.CertificatePassword = nil
	}

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

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

	// DefaultSslBinding
	if source.DefaultSslBinding != nil {
		defaultSslBinding := *source.DefaultSslBinding
		configuration.DefaultSslBinding = &defaultSslBinding
	} else {
		configuration.DefaultSslBinding = nil
	}

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

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

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

	// IdentityClientIdFromConfig
	if source.IdentityClientIdFromConfig != nil {
		identityClientIdFromConfig := source.IdentityClientIdFromConfig.Copy()
		configuration.IdentityClientIdFromConfig = &identityClientIdFromConfig
	} else {
		configuration.IdentityClientIdFromConfig = nil
	}

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

	// NegotiateClientCertificate
	if source.NegotiateClientCertificate != nil {
		negotiateClientCertificate := *source.NegotiateClientCertificate
		configuration.NegotiateClientCertificate = &negotiateClientCertificate
	} else {
		configuration.NegotiateClientCertificate = nil
	}

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

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

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

	// No error
	return nil
}

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

	// Certificate
	if configuration.Certificate != nil {
		var certificate v20220801s.CertificateInformation
		err := configuration.Certificate.AssignProperties_To_CertificateInformation(&certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CertificateInformation() to populate field Certificate")
		}
		destination.Certificate = &certificate
	} else {
		destination.Certificate = nil
	}

	// CertificatePassword
	if configuration.CertificatePassword != nil {
		certificatePassword := configuration.CertificatePassword.Copy()
		destination.CertificatePassword = &certificatePassword
	} else {
		destination.CertificatePassword = nil
	}

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

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

	// DefaultSslBinding
	if configuration.DefaultSslBinding != nil {
		defaultSslBinding := *configuration.DefaultSslBinding
		destination.DefaultSslBinding = &defaultSslBinding
	} else {
		destination.DefaultSslBinding = nil
	}

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

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

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

	// IdentityClientIdFromConfig
	if configuration.IdentityClientIdFromConfig != nil {
		identityClientIdFromConfig := configuration.IdentityClientIdFromConfig.Copy()
		destination.IdentityClientIdFromConfig = &identityClientIdFromConfig
	} else {
		destination.IdentityClientIdFromConfig = nil
	}

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

	// NegotiateClientCertificate
	if configuration.NegotiateClientCertificate != nil {
		negotiateClientCertificate := *configuration.NegotiateClientCertificate
		destination.NegotiateClientCertificate = &negotiateClientCertificate
	} else {
		destination.NegotiateClientCertificate = nil
	}

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.HostnameConfiguration_STATUS
// Custom hostname configuration.
type HostnameConfiguration_STATUS struct {
	Certificate                *CertificateInformation_STATUS `json:"certificate,omitempty"`
	CertificateSource          *string                        `json:"certificateSource,omitempty"`
	CertificateStatus          *string                        `json:"certificateStatus,omitempty"`
	DefaultSslBinding          *bool                          `json:"defaultSslBinding,omitempty"`
	EncodedCertificate         *string                        `json:"encodedCertificate,omitempty"`
	HostName                   *string                        `json:"hostName,omitempty"`
	IdentityClientId           *string                        `json:"identityClientId,omitempty"`
	KeyVaultId                 *string                        `json:"keyVaultId,omitempty"`
	NegotiateClientCertificate *bool                          `json:"negotiateClientCertificate,omitempty"`
	PropertyBag                genruntime.PropertyBag         `json:"$propertyBag,omitempty"`
	Type                       *string                        `json:"type,omitempty"`
}

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

	// Certificate
	if source.Certificate != nil {
		var certificate CertificateInformation_STATUS
		err := certificate.AssignProperties_From_CertificateInformation_STATUS(source.Certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CertificateInformation_STATUS() to populate field Certificate")
		}
		configuration.Certificate = &certificate
	} else {
		configuration.Certificate = nil
	}

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

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

	// DefaultSslBinding
	if source.DefaultSslBinding != nil {
		defaultSslBinding := *source.DefaultSslBinding
		configuration.DefaultSslBinding = &defaultSslBinding
	} else {
		configuration.DefaultSslBinding = nil
	}

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

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

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

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

	// NegotiateClientCertificate
	if source.NegotiateClientCertificate != nil {
		negotiateClientCertificate := *source.NegotiateClientCertificate
		configuration.NegotiateClientCertificate = &negotiateClientCertificate
	} else {
		configuration.NegotiateClientCertificate = nil
	}

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

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

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

	// No error
	return nil
}

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

	// Certificate
	if configuration.Certificate != nil {
		var certificate v20220801s.CertificateInformation_STATUS
		err := configuration.Certificate.AssignProperties_To_CertificateInformation_STATUS(&certificate)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CertificateInformation_STATUS() to populate field Certificate")
		}
		destination.Certificate = &certificate
	} else {
		destination.Certificate = nil
	}

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

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

	// DefaultSslBinding
	if configuration.DefaultSslBinding != nil {
		defaultSslBinding := *configuration.DefaultSslBinding
		destination.DefaultSslBinding = &defaultSslBinding
	} else {
		destination.DefaultSslBinding = nil
	}

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

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

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

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

	// NegotiateClientCertificate
	if configuration.NegotiateClientCertificate != nil {
		negotiateClientCertificate := *configuration.NegotiateClientCertificate
		destination.NegotiateClientCertificate = &negotiateClientCertificate
	} else {
		destination.NegotiateClientCertificate = nil
	}

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

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

	// Invoke the augmentConversionForHostnameConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForHostnameConfiguration_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 v1api20230501preview.RemotePrivateEndpointConnectionWrapper_STATUS
// Remote Private Endpoint Connection resource.
type RemotePrivateEndpointConnectionWrapper_STATUS struct {
	GroupIds                          []string                                  `json:"groupIds,omitempty"`
	Id                                *string                                   `json:"id,omitempty"`
	Name                              *string                                   `json:"name,omitempty"`
	PrivateEndpoint                   *ArmIdWrapper_STATUS                      `json:"privateEndpoint,omitempty"`
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState_STATUS `json:"privateLinkServiceConnectionState,omitempty"`
	PropertyBag                       genruntime.PropertyBag                    `json:"$propertyBag,omitempty"`
	ProvisioningState                 *string                                   `json:"provisioningState,omitempty"`
	Type                              *string                                   `json:"type,omitempty"`
}

// AssignProperties_From_RemotePrivateEndpointConnectionWrapper_STATUS populates our RemotePrivateEndpointConnectionWrapper_STATUS from the provided source RemotePrivateEndpointConnectionWrapper_STATUS
func (wrapper *RemotePrivateEndpointConnectionWrapper_STATUS) AssignProperties_From_RemotePrivateEndpointConnectionWrapper_STATUS(source *v20220801s.RemotePrivateEndpointConnectionWrapper_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// GroupIds
	wrapper.GroupIds = genruntime.CloneSliceOfString(source.GroupIds)

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

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

	// PrivateEndpoint
	if source.PrivateEndpoint != nil {
		var privateEndpoint ArmIdWrapper_STATUS
		err := privateEndpoint.AssignProperties_From_ArmIdWrapper_STATUS(source.PrivateEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ArmIdWrapper_STATUS() to populate field PrivateEndpoint")
		}
		wrapper.PrivateEndpoint = &privateEndpoint
	} else {
		wrapper.PrivateEndpoint = nil
	}

	// PrivateLinkServiceConnectionState
	if source.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState PrivateLinkServiceConnectionState_STATUS
		err := privateLinkServiceConnectionState.AssignProperties_From_PrivateLinkServiceConnectionState_STATUS(source.PrivateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_PrivateLinkServiceConnectionState_STATUS() to populate field PrivateLinkServiceConnectionState")
		}
		wrapper.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		wrapper.PrivateLinkServiceConnectionState = nil
	}

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_RemotePrivateEndpointConnectionWrapper_STATUS populates the provided destination RemotePrivateEndpointConnectionWrapper_STATUS from our RemotePrivateEndpointConnectionWrapper_STATUS
func (wrapper *RemotePrivateEndpointConnectionWrapper_STATUS) AssignProperties_To_RemotePrivateEndpointConnectionWrapper_STATUS(destination *v20220801s.RemotePrivateEndpointConnectionWrapper_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(wrapper.PropertyBag)

	// GroupIds
	destination.GroupIds = genruntime.CloneSliceOfString(wrapper.GroupIds)

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

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

	// PrivateEndpoint
	if wrapper.PrivateEndpoint != nil {
		var privateEndpoint v20220801s.ArmIdWrapper_STATUS
		err := wrapper.PrivateEndpoint.AssignProperties_To_ArmIdWrapper_STATUS(&privateEndpoint)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ArmIdWrapper_STATUS() to populate field PrivateEndpoint")
		}
		destination.PrivateEndpoint = &privateEndpoint
	} else {
		destination.PrivateEndpoint = nil
	}

	// PrivateLinkServiceConnectionState
	if wrapper.PrivateLinkServiceConnectionState != nil {
		var privateLinkServiceConnectionState v20220801s.PrivateLinkServiceConnectionState_STATUS
		err := wrapper.PrivateLinkServiceConnectionState.AssignProperties_To_PrivateLinkServiceConnectionState_STATUS(&privateLinkServiceConnectionState)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_PrivateLinkServiceConnectionState_STATUS() to populate field PrivateLinkServiceConnectionState")
		}
		destination.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
	} else {
		destination.PrivateLinkServiceConnectionState = nil
	}

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

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

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

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

	// No error
	return nil
}

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

// AssignProperties_From_ServiceOperatorSpec populates our ServiceOperatorSpec from the provided source ServiceOperatorSpec
func (operator *ServiceOperatorSpec) AssignProperties_From_ServiceOperatorSpec(source *v20220801s.ServiceOperatorSpec) 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 augmentConversionForServiceOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForServiceOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesFrom(source)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
		}
	}

	// No error
	return nil
}

// AssignProperties_To_ServiceOperatorSpec populates the provided destination ServiceOperatorSpec from our ServiceOperatorSpec
func (operator *ServiceOperatorSpec) AssignProperties_To_ServiceOperatorSpec(destination *v20220801s.ServiceOperatorSpec) 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 augmentConversionForServiceOperatorSpec interface (if implemented) to customize the conversion
	var operatorAsAny any = operator
	if augmentedOperator, ok := operatorAsAny.(augmentConversionForServiceOperatorSpec); ok {
		err := augmentedOperator.AssignPropertiesTo(destination)
		if err != nil {
			return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
		}
	}

	// No error
	return nil
}

// Storage version of v1api20230501preview.SystemData_STATUS
// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
	CreatedAt          *string                `json:"createdAt,omitempty"`
	CreatedBy          *string                `json:"createdBy,omitempty"`
	CreatedByType      *string                `json:"createdByType,omitempty"`
	LastModifiedAt     *string                `json:"lastModifiedAt,omitempty"`
	LastModifiedBy     *string                `json:"lastModifiedBy,omitempty"`
	LastModifiedByType *string                `json:"lastModifiedByType,omitempty"`
	PropertyBag        genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS
func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *v20220801s.SystemData_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS
func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *v20220801s.SystemData_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(data.PropertyBag)

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.VirtualNetworkConfiguration
// Configuration of a virtual network to which API Management service is deployed.
type VirtualNetworkConfiguration struct {
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`

	// SubnetResourceReference: The full resource ID of a subnet in a virtual network to deploy the API Management service in.
	SubnetResourceReference *genruntime.ResourceReference `armReference:"SubnetResourceId" json:"subnetResourceReference,omitempty"`
}

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

	// SubnetResourceReference
	if source.SubnetResourceReference != nil {
		subnetResourceReference := source.SubnetResourceReference.Copy()
		configuration.SubnetResourceReference = &subnetResourceReference
	} else {
		configuration.SubnetResourceReference = nil
	}

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

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

	// No error
	return nil
}

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

	// SubnetResourceReference
	if configuration.SubnetResourceReference != nil {
		subnetResourceReference := configuration.SubnetResourceReference.Copy()
		destination.SubnetResourceReference = &subnetResourceReference
	} else {
		destination.SubnetResourceReference = nil
	}

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.VirtualNetworkConfiguration_STATUS
// Configuration of a virtual network to which API Management service is deployed.
type VirtualNetworkConfiguration_STATUS struct {
	PropertyBag      genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	SubnetResourceId *string                `json:"subnetResourceId,omitempty"`
	Subnetname       *string                `json:"subnetname,omitempty"`
	Vnetid           *string                `json:"vnetid,omitempty"`
}

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

	// Invoke the augmentConversionForVirtualNetworkConfiguration_STATUS interface (if implemented) to customize the conversion
	var configurationAsAny any = configuration
	if augmentedConfiguration, ok := configurationAsAny.(augmentConversionForVirtualNetworkConfiguration_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 v1api20230501preview.ArmIdWrapper_STATUS
// A wrapper for an ARM resource id
type ArmIdWrapper_STATUS struct {
	Id          *string                `json:"id,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ArmIdWrapper_STATUS populates our ArmIdWrapper_STATUS from the provided source ArmIdWrapper_STATUS
func (wrapper *ArmIdWrapper_STATUS) AssignProperties_From_ArmIdWrapper_STATUS(source *v20220801s.ArmIdWrapper_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ArmIdWrapper_STATUS populates the provided destination ArmIdWrapper_STATUS from our ArmIdWrapper_STATUS
func (wrapper *ArmIdWrapper_STATUS) AssignProperties_To_ArmIdWrapper_STATUS(destination *v20220801s.ArmIdWrapper_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(wrapper.PropertyBag)

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

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

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

	// No error
	return nil
}

type augmentConversionForAdditionalLocation interface {
	AssignPropertiesFrom(src *v20220801s.AdditionalLocation) error
	AssignPropertiesTo(dst *v20220801s.AdditionalLocation) error
}

type augmentConversionForAdditionalLocation_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.AdditionalLocation_STATUS) error
	AssignPropertiesTo(dst *v20220801s.AdditionalLocation_STATUS) error
}

type augmentConversionForApiManagementServiceIdentity interface {
	AssignPropertiesFrom(src *v20220801s.ApiManagementServiceIdentity) error
	AssignPropertiesTo(dst *v20220801s.ApiManagementServiceIdentity) error
}

type augmentConversionForApiManagementServiceIdentity_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.ApiManagementServiceIdentity_STATUS) error
	AssignPropertiesTo(dst *v20220801s.ApiManagementServiceIdentity_STATUS) error
}

type augmentConversionForApiManagementServiceSkuProperties interface {
	AssignPropertiesFrom(src *v20220801s.ApiManagementServiceSkuProperties) error
	AssignPropertiesTo(dst *v20220801s.ApiManagementServiceSkuProperties) error
}

type augmentConversionForApiManagementServiceSkuProperties_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.ApiManagementServiceSkuProperties_STATUS) error
	AssignPropertiesTo(dst *v20220801s.ApiManagementServiceSkuProperties_STATUS) error
}

type augmentConversionForApiVersionConstraint interface {
	AssignPropertiesFrom(src *v20220801s.ApiVersionConstraint) error
	AssignPropertiesTo(dst *v20220801s.ApiVersionConstraint) error
}

type augmentConversionForApiVersionConstraint_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.ApiVersionConstraint_STATUS) error
	AssignPropertiesTo(dst *v20220801s.ApiVersionConstraint_STATUS) error
}

type augmentConversionForCertificateConfiguration interface {
	AssignPropertiesFrom(src *v20220801s.CertificateConfiguration) error
	AssignPropertiesTo(dst *v20220801s.CertificateConfiguration) error
}

type augmentConversionForCertificateConfiguration_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.CertificateConfiguration_STATUS) error
	AssignPropertiesTo(dst *v20220801s.CertificateConfiguration_STATUS) error
}

type augmentConversionForConfigurationApi interface {
	AssignPropertiesFrom(src *v20240501s.ConfigurationApi) error
	AssignPropertiesTo(dst *v20240501s.ConfigurationApi) error
}

type augmentConversionForConfigurationApi_STATUS interface {
	AssignPropertiesFrom(src *v20240501s.ConfigurationApi_STATUS) error
	AssignPropertiesTo(dst *v20240501s.ConfigurationApi_STATUS) error
}

type augmentConversionForHostnameConfiguration interface {
	AssignPropertiesFrom(src *v20220801s.HostnameConfiguration) error
	AssignPropertiesTo(dst *v20220801s.HostnameConfiguration) error
}

type augmentConversionForHostnameConfiguration_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.HostnameConfiguration_STATUS) error
	AssignPropertiesTo(dst *v20220801s.HostnameConfiguration_STATUS) error
}

type augmentConversionForRemotePrivateEndpointConnectionWrapper_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.RemotePrivateEndpointConnectionWrapper_STATUS) error
	AssignPropertiesTo(dst *v20220801s.RemotePrivateEndpointConnectionWrapper_STATUS) error
}

type augmentConversionForServiceOperatorSpec interface {
	AssignPropertiesFrom(src *v20220801s.ServiceOperatorSpec) error
	AssignPropertiesTo(dst *v20220801s.ServiceOperatorSpec) error
}

type augmentConversionForSystemData_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.SystemData_STATUS) error
	AssignPropertiesTo(dst *v20220801s.SystemData_STATUS) error
}

type augmentConversionForVirtualNetworkConfiguration interface {
	AssignPropertiesFrom(src *v20220801s.VirtualNetworkConfiguration) error
	AssignPropertiesTo(dst *v20220801s.VirtualNetworkConfiguration) error
}

type augmentConversionForVirtualNetworkConfiguration_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.VirtualNetworkConfiguration_STATUS) error
	AssignPropertiesTo(dst *v20220801s.VirtualNetworkConfiguration_STATUS) error
}

// Storage version of v1api20230501preview.CertificateInformation
// SSL certificate information.
type CertificateInformation struct {
	Expiry               *string                        `json:"expiry,omitempty" optionalConfigMapPair:"Expiry"`
	ExpiryFromConfig     *genruntime.ConfigMapReference `json:"expiryFromConfig,omitempty" optionalConfigMapPair:"Expiry"`
	PropertyBag          genruntime.PropertyBag         `json:"$propertyBag,omitempty"`
	Subject              *string                        `json:"subject,omitempty" optionalConfigMapPair:"Subject"`
	SubjectFromConfig    *genruntime.ConfigMapReference `json:"subjectFromConfig,omitempty" optionalConfigMapPair:"Subject"`
	Thumbprint           *string                        `json:"thumbprint,omitempty" optionalConfigMapPair:"Thumbprint"`
	ThumbprintFromConfig *genruntime.ConfigMapReference `json:"thumbprintFromConfig,omitempty" optionalConfigMapPair:"Thumbprint"`
}

// AssignProperties_From_CertificateInformation populates our CertificateInformation from the provided source CertificateInformation
func (information *CertificateInformation) AssignProperties_From_CertificateInformation(source *v20220801s.CertificateInformation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Expiry
	information.Expiry = genruntime.ClonePointerToString(source.Expiry)

	// ExpiryFromConfig
	if source.ExpiryFromConfig != nil {
		expiryFromConfig := source.ExpiryFromConfig.Copy()
		information.ExpiryFromConfig = &expiryFromConfig
	} else {
		information.ExpiryFromConfig = nil
	}

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

	// SubjectFromConfig
	if source.SubjectFromConfig != nil {
		subjectFromConfig := source.SubjectFromConfig.Copy()
		information.SubjectFromConfig = &subjectFromConfig
	} else {
		information.SubjectFromConfig = nil
	}

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

	// ThumbprintFromConfig
	if source.ThumbprintFromConfig != nil {
		thumbprintFromConfig := source.ThumbprintFromConfig.Copy()
		information.ThumbprintFromConfig = &thumbprintFromConfig
	} else {
		information.ThumbprintFromConfig = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_CertificateInformation populates the provided destination CertificateInformation from our CertificateInformation
func (information *CertificateInformation) AssignProperties_To_CertificateInformation(destination *v20220801s.CertificateInformation) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(information.PropertyBag)

	// Expiry
	destination.Expiry = genruntime.ClonePointerToString(information.Expiry)

	// ExpiryFromConfig
	if information.ExpiryFromConfig != nil {
		expiryFromConfig := information.ExpiryFromConfig.Copy()
		destination.ExpiryFromConfig = &expiryFromConfig
	} else {
		destination.ExpiryFromConfig = nil
	}

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

	// SubjectFromConfig
	if information.SubjectFromConfig != nil {
		subjectFromConfig := information.SubjectFromConfig.Copy()
		destination.SubjectFromConfig = &subjectFromConfig
	} else {
		destination.SubjectFromConfig = nil
	}

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

	// ThumbprintFromConfig
	if information.ThumbprintFromConfig != nil {
		thumbprintFromConfig := information.ThumbprintFromConfig.Copy()
		destination.ThumbprintFromConfig = &thumbprintFromConfig
	} else {
		destination.ThumbprintFromConfig = nil
	}

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.CertificateInformation_STATUS
// SSL certificate information.
type CertificateInformation_STATUS struct {
	Expiry      *string                `json:"expiry,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Subject     *string                `json:"subject,omitempty"`
	Thumbprint  *string                `json:"thumbprint,omitempty"`
}

// AssignProperties_From_CertificateInformation_STATUS populates our CertificateInformation_STATUS from the provided source CertificateInformation_STATUS
func (information *CertificateInformation_STATUS) AssignProperties_From_CertificateInformation_STATUS(source *v20220801s.CertificateInformation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Expiry
	information.Expiry = genruntime.ClonePointerToString(source.Expiry)

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_CertificateInformation_STATUS populates the provided destination CertificateInformation_STATUS from our CertificateInformation_STATUS
func (information *CertificateInformation_STATUS) AssignProperties_To_CertificateInformation_STATUS(destination *v20220801s.CertificateInformation_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(information.PropertyBag)

	// Expiry
	destination.Expiry = genruntime.ClonePointerToString(information.Expiry)

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

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

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.PrivateLinkServiceConnectionState_STATUS
// A collection of information about the state of the connection between service consumer and provider.
type PrivateLinkServiceConnectionState_STATUS struct {
	ActionsRequired *string                `json:"actionsRequired,omitempty"`
	Description     *string                `json:"description,omitempty"`
	PropertyBag     genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Status          *string                `json:"status,omitempty"`
}

// AssignProperties_From_PrivateLinkServiceConnectionState_STATUS populates our PrivateLinkServiceConnectionState_STATUS from the provided source PrivateLinkServiceConnectionState_STATUS
func (state *PrivateLinkServiceConnectionState_STATUS) AssignProperties_From_PrivateLinkServiceConnectionState_STATUS(source *v20220801s.PrivateLinkServiceConnectionState_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ActionsRequired
	state.ActionsRequired = genruntime.ClonePointerToString(source.ActionsRequired)

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

	// Status
	state.Status = genruntime.ClonePointerToString(source.Status)

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

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

	// No error
	return nil
}

// AssignProperties_To_PrivateLinkServiceConnectionState_STATUS populates the provided destination PrivateLinkServiceConnectionState_STATUS from our PrivateLinkServiceConnectionState_STATUS
func (state *PrivateLinkServiceConnectionState_STATUS) AssignProperties_To_PrivateLinkServiceConnectionState_STATUS(destination *v20220801s.PrivateLinkServiceConnectionState_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(state.PropertyBag)

	// ActionsRequired
	destination.ActionsRequired = genruntime.ClonePointerToString(state.ActionsRequired)

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

	// Status
	destination.Status = genruntime.ClonePointerToString(state.Status)

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.UserAssignedIdentityDetails
// Information about the user assigned identity for the resource
type UserAssignedIdentityDetails struct {
	PropertyBag genruntime.PropertyBag       `json:"$propertyBag,omitempty"`
	Reference   genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"`
}

// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails
func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *v20220801s.UserAssignedIdentityDetails) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Reference
	details.Reference = source.Reference.Copy()

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

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

	// No error
	return nil
}

// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails
func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *v20220801s.UserAssignedIdentityDetails) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(details.PropertyBag)

	// Reference
	destination.Reference = details.Reference.Copy()

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

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

	// No error
	return nil
}

// Storage version of v1api20230501preview.UserIdentityProperties_STATUS
type UserIdentityProperties_STATUS struct {
	ClientId    *string                `json:"clientId,omitempty"`
	PrincipalId *string                `json:"principalId,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_UserIdentityProperties_STATUS populates our UserIdentityProperties_STATUS from the provided source UserIdentityProperties_STATUS
func (properties *UserIdentityProperties_STATUS) AssignProperties_From_UserIdentityProperties_STATUS(source *v20220801s.UserIdentityProperties_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_UserIdentityProperties_STATUS populates the provided destination UserIdentityProperties_STATUS from our UserIdentityProperties_STATUS
func (properties *UserIdentityProperties_STATUS) AssignProperties_To_UserIdentityProperties_STATUS(destination *v20220801s.UserIdentityProperties_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(properties.PropertyBag)

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

	// PrincipalId
	destination.PrincipalId = genruntime.ClonePointerToString(properties.PrincipalId)

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

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

	// No error
	return nil
}

type augmentConversionForArmIdWrapper_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.ArmIdWrapper_STATUS) error
	AssignPropertiesTo(dst *v20220801s.ArmIdWrapper_STATUS) error
}

type augmentConversionForCertificateInformation interface {
	AssignPropertiesFrom(src *v20220801s.CertificateInformation) error
	AssignPropertiesTo(dst *v20220801s.CertificateInformation) error
}

type augmentConversionForCertificateInformation_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.CertificateInformation_STATUS) error
	AssignPropertiesTo(dst *v20220801s.CertificateInformation_STATUS) error
}

type augmentConversionForPrivateLinkServiceConnectionState_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.PrivateLinkServiceConnectionState_STATUS) error
	AssignPropertiesTo(dst *v20220801s.PrivateLinkServiceConnectionState_STATUS) error
}

type augmentConversionForUserAssignedIdentityDetails interface {
	AssignPropertiesFrom(src *v20220801s.UserAssignedIdentityDetails) error
	AssignPropertiesTo(dst *v20220801s.UserAssignedIdentityDetails) error
}

type augmentConversionForUserIdentityProperties_STATUS interface {
	AssignPropertiesFrom(src *v20220801s.UserIdentityProperties_STATUS) error
	AssignPropertiesTo(dst *v20220801s.UserIdentityProperties_STATUS) error
}

func init() {
	SchemeBuilder.Register(&Service{}, &ServiceList{})
}
