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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20230501preview/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/apimanagement/v1api20230501preview/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"
// 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 storage.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 storage.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 *storage.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

	// No error
	return nil
}

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

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

	// Spec
	var spec storage.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 storage.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

	// 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
// 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 Service_Spec struct {
	// AdditionalLocations: Additional datacenter locations of the API Management service.
	AdditionalLocations []AdditionalLocation `json:"additionalLocations,omitempty"`

	// ApiVersionConstraint: Control Plane Apis version constraint for the API Management service.
	ApiVersionConstraint *ApiVersionConstraint `json:"apiVersionConstraint,omitempty"`

	// +kubebuilder:validation:MaxLength=50
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:Pattern="^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$"
	// 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: List of Certificates that need to be installed in the API Management service. Max supported certificates
	// that can be installed is 10.
	Certificates []CertificateConfiguration `json:"certificates,omitempty"`

	// ConfigurationApi: Configuration API configuration of the API Management service.
	ConfigurationApi *ConfigurationApi `json:"configurationApi,omitempty"`

	// CustomProperties: Custom properties of the API Management service.</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher
	// TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API
	// Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be
	// used to disable just TLS 1.1 for communications with backends.</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for
	// communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be
	// used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH
	// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value
	// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is
	// `False`.</br></br>You can disable any of the following ciphers by using settings
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
	// TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
	// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
	// TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example,
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default
	// value is `true` for them.</br> Note: The following ciphers can't be disabled since they are required by internal
	// platform components:
	// TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
	CustomProperties map[string]string `json:"customProperties,omitempty"`

	// DeveloperPortalStatus: Status of developer portal in this API Management service.
	DeveloperPortalStatus *ApiManagementServiceProperties_DeveloperPortalStatus `json:"developerPortalStatus,omitempty"`

	// DisableGateway: Property only valid for an Api Management service deployed in multiple locations. This can be used to
	// disable the gateway in master region.
	DisableGateway *bool `json:"disableGateway,omitempty"`

	// EnableClientCertificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate
	// to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the
	// policy on the gateway.
	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`

	// HostnameConfigurations: Custom hostname configuration of the API Management service.
	HostnameConfigurations []HostnameConfiguration `json:"hostnameConfigurations,omitempty"`

	// Identity: Managed service identity of the Api Management service.
	Identity *ApiManagementServiceIdentity `json:"identity,omitempty"`

	// LegacyPortalStatus: Status of legacy portal in the API Management service.
	LegacyPortalStatus *ApiManagementServiceProperties_LegacyPortalStatus `json:"legacyPortalStatus,omitempty"`

	// +kubebuilder:validation:Required
	// Location: Resource location.
	Location *string `json:"location,omitempty"`

	// NatGatewayState: Property can be used to enable NAT Gateway for this API Management service.
	NatGatewayState *ApiManagementServiceProperties_NatGatewayState `json:"natGatewayState,omitempty"`

	// +kubebuilder:validation:MaxLength=100
	// NotificationSenderEmail: Email address from which the notification will be sent.
	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`

	// OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not
	// passed directly to Azure
	OperatorSpec *ServiceOperatorSpec `json:"operatorSpec,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`

	// 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: Whether or not public endpoint access is allowed for this API Management service.  Value is
	// optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access
	// method. Default value is 'Enabled'
	PublicNetworkAccess *ApiManagementServiceProperties_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=100
	// PublisherEmail: Publisher email.
	PublisherEmail *string `json:"publisherEmail,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=100
	// PublisherName: Publisher name.
	PublisherName *string `json:"publisherName,omitempty"`

	// Restore: Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True
	// all other properties will be ignored.
	Restore *bool `json:"restore,omitempty"`

	// +kubebuilder:validation:Required
	// Sku: SKU properties of the API Management service.
	Sku *ApiManagementServiceSkuProperties `json:"sku,omitempty"`

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

	// VirtualNetworkConfiguration: Virtual network configuration of the API Management service.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`

	// VirtualNetworkType: The type of VPN in which API Management service needs to be configured in. None (Default Value)
	// means the API Management service is not part of any Virtual Network, External means the API Management deployment is set
	// up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is
	// setup inside a Virtual Network having an Intranet Facing Endpoint only.
	VirtualNetworkType *ApiManagementServiceProperties_VirtualNetworkType `json:"virtualNetworkType,omitempty"`

	// Zones: A list of availability zones denoting where the resource needs to come from.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ARMTransformer = &Service_Spec{}

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

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

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

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

	// Set property "Properties":
	if service.AdditionalLocations != nil ||
		service.ApiVersionConstraint != nil ||
		service.Certificates != nil ||
		service.ConfigurationApi != nil ||
		service.CustomProperties != nil ||
		service.DeveloperPortalStatus != nil ||
		service.DisableGateway != nil ||
		service.EnableClientCertificate != nil ||
		service.HostnameConfigurations != nil ||
		service.LegacyPortalStatus != nil ||
		service.NatGatewayState != nil ||
		service.NotificationSenderEmail != nil ||
		service.PublicIpAddressReference != nil ||
		service.PublicNetworkAccess != nil ||
		service.PublisherEmail != nil ||
		service.PublisherName != nil ||
		service.Restore != nil ||
		service.VirtualNetworkConfiguration != nil ||
		service.VirtualNetworkType != nil {
		result.Properties = &arm.ApiManagementServiceProperties{}
	}
	for _, item := range service.AdditionalLocations {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.AdditionalLocations = append(result.Properties.AdditionalLocations, *item_ARM.(*arm.AdditionalLocation))
	}
	if service.ApiVersionConstraint != nil {
		apiVersionConstraint_ARM, err := service.ApiVersionConstraint.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		apiVersionConstraint := *apiVersionConstraint_ARM.(*arm.ApiVersionConstraint)
		result.Properties.ApiVersionConstraint = &apiVersionConstraint
	}
	for _, item := range service.Certificates {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.Certificates = append(result.Properties.Certificates, *item_ARM.(*arm.CertificateConfiguration))
	}
	if service.ConfigurationApi != nil {
		configurationApi_ARM, err := service.ConfigurationApi.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		configurationApi := *configurationApi_ARM.(*arm.ConfigurationApi)
		result.Properties.ConfigurationApi = &configurationApi
	}
	if service.CustomProperties != nil {
		result.Properties.CustomProperties = make(map[string]string, len(service.CustomProperties))
		for key, value := range service.CustomProperties {
			result.Properties.CustomProperties[key] = value
		}
	}
	if service.DeveloperPortalStatus != nil {
		var temp string
		temp = string(*service.DeveloperPortalStatus)
		developerPortalStatus := arm.ApiManagementServiceProperties_DeveloperPortalStatus(temp)
		result.Properties.DeveloperPortalStatus = &developerPortalStatus
	}
	if service.DisableGateway != nil {
		disableGateway := *service.DisableGateway
		result.Properties.DisableGateway = &disableGateway
	}
	if service.EnableClientCertificate != nil {
		enableClientCertificate := *service.EnableClientCertificate
		result.Properties.EnableClientCertificate = &enableClientCertificate
	}
	for _, item := range service.HostnameConfigurations {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.HostnameConfigurations = append(result.Properties.HostnameConfigurations, *item_ARM.(*arm.HostnameConfiguration))
	}
	if service.LegacyPortalStatus != nil {
		var temp string
		temp = string(*service.LegacyPortalStatus)
		legacyPortalStatus := arm.ApiManagementServiceProperties_LegacyPortalStatus(temp)
		result.Properties.LegacyPortalStatus = &legacyPortalStatus
	}
	if service.NatGatewayState != nil {
		var temp string
		temp = string(*service.NatGatewayState)
		natGatewayState := arm.ApiManagementServiceProperties_NatGatewayState(temp)
		result.Properties.NatGatewayState = &natGatewayState
	}
	if service.NotificationSenderEmail != nil {
		notificationSenderEmail := *service.NotificationSenderEmail
		result.Properties.NotificationSenderEmail = &notificationSenderEmail
	}
	if service.PublicIpAddressReference != nil {
		publicIpAddressIdARMID, err := resolved.ResolvedReferences.Lookup(*service.PublicIpAddressReference)
		if err != nil {
			return nil, err
		}
		publicIpAddressId := publicIpAddressIdARMID
		result.Properties.PublicIpAddressId = &publicIpAddressId
	}
	if service.PublicNetworkAccess != nil {
		var temp string
		temp = string(*service.PublicNetworkAccess)
		publicNetworkAccess := arm.ApiManagementServiceProperties_PublicNetworkAccess(temp)
		result.Properties.PublicNetworkAccess = &publicNetworkAccess
	}
	if service.PublisherEmail != nil {
		publisherEmail := *service.PublisherEmail
		result.Properties.PublisherEmail = &publisherEmail
	}
	if service.PublisherName != nil {
		publisherName := *service.PublisherName
		result.Properties.PublisherName = &publisherName
	}
	if service.Restore != nil {
		restore := *service.Restore
		result.Properties.Restore = &restore
	}
	if service.VirtualNetworkConfiguration != nil {
		virtualNetworkConfiguration_ARM, err := service.VirtualNetworkConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		virtualNetworkConfiguration := *virtualNetworkConfiguration_ARM.(*arm.VirtualNetworkConfiguration)
		result.Properties.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	}
	if service.VirtualNetworkType != nil {
		var temp string
		temp = string(*service.VirtualNetworkType)
		virtualNetworkType := arm.ApiManagementServiceProperties_VirtualNetworkType(temp)
		result.Properties.VirtualNetworkType = &virtualNetworkType
	}

	// Set property "Sku":
	if service.Sku != nil {
		sku_ARM, err := service.Sku.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sku := *sku_ARM.(*arm.ApiManagementServiceSkuProperties)
		result.Sku = &sku
	}

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

	// Set property "Zones":
	for _, item := range service.Zones {
		result.Zones = append(result.Zones, item)
	}
	return result, nil
}

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

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

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

	// Set property "ApiVersionConstraint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionConstraint != nil {
			var apiVersionConstraint1 ApiVersionConstraint
			err := apiVersionConstraint1.PopulateFromARM(owner, *typedInput.Properties.ApiVersionConstraint)
			if err != nil {
				return err
			}
			apiVersionConstraint := apiVersionConstraint1
			service.ApiVersionConstraint = &apiVersionConstraint
		}
	}

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

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

	// Set property "ConfigurationApi":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConfigurationApi != nil {
			var configurationApi1 ConfigurationApi
			err := configurationApi1.PopulateFromARM(owner, *typedInput.Properties.ConfigurationApi)
			if err != nil {
				return err
			}
			configurationApi := configurationApi1
			service.ConfigurationApi = &configurationApi
		}
	}

	// Set property "CustomProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomProperties != nil {
			service.CustomProperties = make(map[string]string, len(typedInput.Properties.CustomProperties))
			for key, value := range typedInput.Properties.CustomProperties {
				service.CustomProperties[key] = value
			}
		}
	}

	// Set property "DeveloperPortalStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeveloperPortalStatus != nil {
			var temp string
			temp = string(*typedInput.Properties.DeveloperPortalStatus)
			developerPortalStatus := ApiManagementServiceProperties_DeveloperPortalStatus(temp)
			service.DeveloperPortalStatus = &developerPortalStatus
		}
	}

	// Set property "DisableGateway":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableGateway != nil {
			disableGateway := *typedInput.Properties.DisableGateway
			service.DisableGateway = &disableGateway
		}
	}

	// Set property "EnableClientCertificate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableClientCertificate != nil {
			enableClientCertificate := *typedInput.Properties.EnableClientCertificate
			service.EnableClientCertificate = &enableClientCertificate
		}
	}

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

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

	// Set property "LegacyPortalStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LegacyPortalStatus != nil {
			var temp string
			temp = string(*typedInput.Properties.LegacyPortalStatus)
			legacyPortalStatus := ApiManagementServiceProperties_LegacyPortalStatus(temp)
			service.LegacyPortalStatus = &legacyPortalStatus
		}
	}

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

	// Set property "NatGatewayState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NatGatewayState != nil {
			var temp string
			temp = string(*typedInput.Properties.NatGatewayState)
			natGatewayState := ApiManagementServiceProperties_NatGatewayState(temp)
			service.NatGatewayState = &natGatewayState
		}
	}

	// Set property "NotificationSenderEmail":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NotificationSenderEmail != nil {
			notificationSenderEmail := *typedInput.Properties.NotificationSenderEmail
			service.NotificationSenderEmail = &notificationSenderEmail
		}
	}

	// no assignment for property "OperatorSpec"

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

	// no assignment for property "PublicIpAddressReference"

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := ApiManagementServiceProperties_PublicNetworkAccess(temp)
			service.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "PublisherEmail":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublisherEmail != nil {
			publisherEmail := *typedInput.Properties.PublisherEmail
			service.PublisherEmail = &publisherEmail
		}
	}

	// Set property "PublisherName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublisherName != nil {
			publisherName := *typedInput.Properties.PublisherName
			service.PublisherName = &publisherName
		}
	}

	// Set property "Restore":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Restore != nil {
			restore := *typedInput.Properties.Restore
			service.Restore = &restore
		}
	}

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 ApiManagementServiceSkuProperties
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		service.Sku = &sku
	}

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

	// Set property "VirtualNetworkConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualNetworkConfiguration != nil {
			var virtualNetworkConfiguration1 VirtualNetworkConfiguration
			err := virtualNetworkConfiguration1.PopulateFromARM(owner, *typedInput.Properties.VirtualNetworkConfiguration)
			if err != nil {
				return err
			}
			virtualNetworkConfiguration := virtualNetworkConfiguration1
			service.VirtualNetworkConfiguration = &virtualNetworkConfiguration
		}
	}

	// Set property "VirtualNetworkType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualNetworkType != nil {
			var temp string
			temp = string(*typedInput.Properties.VirtualNetworkType)
			virtualNetworkType := ApiManagementServiceProperties_VirtualNetworkType(temp)
			service.VirtualNetworkType = &virtualNetworkType
		}
	}

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

	// No error
	return nil
}

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.(*storage.Service_Spec)
	if ok {
		// Populate our instance from source
		return service.AssignProperties_From_Service_Spec(src)
	}

	// Convert to an intermediate form
	src = &storage.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.(*storage.Service_Spec)
	if ok {
		// Populate destination from our instance
		return service.AssignProperties_To_Service_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &storage.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 *storage.Service_Spec) error {

	// 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 source.ConfigurationApi != nil {
		var configurationApi ConfigurationApi
		err := configurationApi.AssignProperties_From_ConfigurationApi(source.ConfigurationApi)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConfigurationApi() to populate field ConfigurationApi")
		}
		service.ConfigurationApi = &configurationApi
	} else {
		service.ConfigurationApi = nil
	}

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

	// DeveloperPortalStatus
	if source.DeveloperPortalStatus != nil {
		developerPortalStatus := *source.DeveloperPortalStatus
		developerPortalStatusTemp := genruntime.ToEnum(developerPortalStatus, apiManagementServiceProperties_DeveloperPortalStatus_Values)
		service.DeveloperPortalStatus = &developerPortalStatusTemp
	} 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 source.LegacyPortalStatus != nil {
		legacyPortalStatus := *source.LegacyPortalStatus
		legacyPortalStatusTemp := genruntime.ToEnum(legacyPortalStatus, apiManagementServiceProperties_LegacyPortalStatus_Values)
		service.LegacyPortalStatus = &legacyPortalStatusTemp
	} else {
		service.LegacyPortalStatus = nil
	}

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

	// NatGatewayState
	if source.NatGatewayState != nil {
		natGatewayState := *source.NatGatewayState
		natGatewayStateTemp := genruntime.ToEnum(natGatewayState, apiManagementServiceProperties_NatGatewayState_Values)
		service.NatGatewayState = &natGatewayStateTemp
	} else {
		service.NatGatewayState = nil
	}

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

	// 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
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, apiManagementServiceProperties_PublicNetworkAccess_Values)
		service.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		service.PublicNetworkAccess = nil
	}

	// 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
	if source.VirtualNetworkType != nil {
		virtualNetworkType := *source.VirtualNetworkType
		virtualNetworkTypeTemp := genruntime.ToEnum(virtualNetworkType, apiManagementServiceProperties_VirtualNetworkType_Values)
		service.VirtualNetworkType = &virtualNetworkTypeTemp
	} else {
		service.VirtualNetworkType = nil
	}

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

	// 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 *storage.Service_Spec) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AdditionalLocations
	if service.AdditionalLocations != nil {
		additionalLocationList := make([]storage.AdditionalLocation, len(service.AdditionalLocations))
		for additionalLocationIndex, additionalLocationItem := range service.AdditionalLocations {
			var additionalLocation storage.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 storage.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([]storage.CertificateConfiguration, len(service.Certificates))
		for certificateIndex, certificateItem := range service.Certificates {
			var certificate storage.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 {
		var configurationApi storage.ConfigurationApi
		err := service.ConfigurationApi.AssignProperties_To_ConfigurationApi(&configurationApi)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConfigurationApi() to populate field ConfigurationApi")
		}
		destination.ConfigurationApi = &configurationApi
	} else {
		destination.ConfigurationApi = nil
	}

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

	// DeveloperPortalStatus
	if service.DeveloperPortalStatus != nil {
		developerPortalStatus := string(*service.DeveloperPortalStatus)
		destination.DeveloperPortalStatus = &developerPortalStatus
	} else {
		destination.DeveloperPortalStatus = nil
	}

	// 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([]storage.HostnameConfiguration, len(service.HostnameConfigurations))
		for hostnameConfigurationIndex, hostnameConfigurationItem := range service.HostnameConfigurations {
			var hostnameConfiguration storage.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 storage.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 {
		legacyPortalStatus := string(*service.LegacyPortalStatus)
		destination.LegacyPortalStatus = &legacyPortalStatus
	} else {
		destination.LegacyPortalStatus = nil
	}

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

	// NatGatewayState
	if service.NatGatewayState != nil {
		natGatewayState := string(*service.NatGatewayState)
		destination.NatGatewayState = &natGatewayState
	} else {
		destination.NatGatewayState = nil
	}

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

	// OperatorSpec
	if service.OperatorSpec != nil {
		var operatorSpec storage.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
	if service.PublicNetworkAccess != nil {
		publicNetworkAccess := string(*service.PublicNetworkAccess)
		destination.PublicNetworkAccess = &publicNetworkAccess
	} else {
		destination.PublicNetworkAccess = nil
	}

	// 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 storage.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 storage.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
	if service.VirtualNetworkType != nil {
		virtualNetworkType := string(*service.VirtualNetworkType)
		destination.VirtualNetworkType = &virtualNetworkType
	} else {
		destination.VirtualNetworkType = nil
	}

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

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

	// No error
	return nil
}

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

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

type Service_STATUS struct {
	// AdditionalLocations: Additional datacenter locations of the API Management service.
	AdditionalLocations []AdditionalLocation_STATUS `json:"additionalLocations,omitempty"`

	// ApiVersionConstraint: Control Plane Apis version constraint for the API Management service.
	ApiVersionConstraint *ApiVersionConstraint_STATUS `json:"apiVersionConstraint,omitempty"`

	// Certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates
	// that can be installed is 10.
	Certificates []CertificateConfiguration_STATUS `json:"certificates,omitempty"`

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

	// ConfigurationApi: Configuration API configuration of the API Management service.
	ConfigurationApi *ConfigurationApi_STATUS `json:"configurationApi,omitempty"`

	// CreatedAtUtc: Creation UTC date of the API Management service.The date conforms to the following format:
	// `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
	CreatedAtUtc *string `json:"createdAtUtc,omitempty"`

	// CustomProperties: Custom properties of the API Management service.</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher
	// TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API
	// Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be
	// used to disable just TLS 1.1 for communications with backends.</br>Setting
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for
	// communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be
	// used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH
	// operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value
	// is `True` if the service was created on or before April 1, 2018 and `False` otherwise. Http2 setting's default value is
	// `False`.</br></br>You can disable any of the following ciphers by using settings
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
	// TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
	// TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
	// TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example,
	// `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default
	// value is `true` for them.</br> Note: The following ciphers can't be disabled since they are required by internal
	// platform components:
	// TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
	CustomProperties map[string]string `json:"customProperties,omitempty"`

	// DeveloperPortalStatus: Status of developer portal in this API Management service.
	DeveloperPortalStatus *ApiManagementServiceProperties_DeveloperPortalStatus_STATUS `json:"developerPortalStatus,omitempty"`

	// DeveloperPortalUrl: DEveloper Portal endpoint URL of the API Management service.
	DeveloperPortalUrl *string `json:"developerPortalUrl,omitempty"`

	// DisableGateway: Property only valid for an Api Management service deployed in multiple locations. This can be used to
	// disable the gateway in master region.
	DisableGateway *bool `json:"disableGateway,omitempty"`

	// EnableClientCertificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate
	// to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the
	// policy on the gateway.
	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`

	// Etag: ETag of the resource.
	Etag *string `json:"etag,omitempty"`

	// GatewayRegionalUrl: Gateway URL of the API Management service in the Default Region.
	GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"`

	// GatewayUrl: Gateway URL of the API Management service.
	GatewayUrl *string `json:"gatewayUrl,omitempty"`

	// HostnameConfigurations: Custom hostname configuration of the API Management service.
	HostnameConfigurations []HostnameConfiguration_STATUS `json:"hostnameConfigurations,omitempty"`

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

	// Identity: Managed service identity of the Api Management service.
	Identity *ApiManagementServiceIdentity_STATUS `json:"identity,omitempty"`

	// LegacyPortalStatus: Status of legacy portal in the API Management service.
	LegacyPortalStatus *ApiManagementServiceProperties_LegacyPortalStatus_STATUS `json:"legacyPortalStatus,omitempty"`

	// Location: Resource location.
	Location *string `json:"location,omitempty"`

	// ManagementApiUrl: Management API endpoint URL of the API Management service.
	ManagementApiUrl *string `json:"managementApiUrl,omitempty"`

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

	// NatGatewayState: Property can be used to enable NAT Gateway for this API Management service.
	NatGatewayState *ApiManagementServiceProperties_NatGatewayState_STATUS `json:"natGatewayState,omitempty"`

	// NotificationSenderEmail: Email address from which the notification will be sent.
	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`

	// OutboundPublicIPAddresses: Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available
	// only for Premium SKU on stv2 platform.
	OutboundPublicIPAddresses []string `json:"outboundPublicIPAddresses,omitempty"`

	// PlatformVersion: Compute Platform Version running the service in this location.
	PlatformVersion *ApiManagementServiceProperties_PlatformVersion_STATUS `json:"platformVersion,omitempty"`

	// PortalUrl: Publisher portal endpoint Url of the API Management service.
	PortalUrl *string `json:"portalUrl,omitempty"`

	// PrivateEndpointConnections: List of Private Endpoint Connections of this service.
	PrivateEndpointConnections []RemotePrivateEndpointConnectionWrapper_STATUS `json:"privateEndpointConnections,omitempty"`

	// PrivateIPAddresses: Private Static Load Balanced IP addresses of the API Management service in Primary region which is
	// deployed in an Internal Virtual Network. Available only for Basic, Standard, Premium and Isolated SKU.
	PrivateIPAddresses []string `json:"privateIPAddresses,omitempty"`

	// ProvisioningState: The current provisioning state of the API Management service which can be one of the following:
	// Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// PublicIPAddresses: Public Static Load Balanced IP addresses of the API Management service in Primary region. Available
	// only for Basic, Standard, Premium and Isolated SKU.
	PublicIPAddresses []string `json:"publicIPAddresses,omitempty"`

	// PublicIpAddressId: 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.
	PublicIpAddressId *string `json:"publicIpAddressId,omitempty"`

	// PublicNetworkAccess: Whether or not public endpoint access is allowed for this API Management service.  Value is
	// optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access
	// method. Default value is 'Enabled'
	PublicNetworkAccess *ApiManagementServiceProperties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// PublisherEmail: Publisher email.
	PublisherEmail *string `json:"publisherEmail,omitempty"`

	// PublisherName: Publisher name.
	PublisherName *string `json:"publisherName,omitempty"`

	// Restore: Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True
	// all other properties will be ignored.
	Restore *bool `json:"restore,omitempty"`

	// ScmUrl: SCM endpoint URL of the API Management service.
	ScmUrl *string `json:"scmUrl,omitempty"`

	// Sku: SKU properties of the API Management service.
	Sku *ApiManagementServiceSkuProperties_STATUS `json:"sku,omitempty"`

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

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

	// TargetProvisioningState: The provisioning state of the API Management service, which is targeted by the long running
	// operation started on the service.
	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`

	// Type: Resource type for API Management resource is set to Microsoft.ApiManagement.
	Type *string `json:"type,omitempty"`

	// VirtualNetworkConfiguration: Virtual network configuration of the API Management service.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration_STATUS `json:"virtualNetworkConfiguration,omitempty"`

	// VirtualNetworkType: The type of VPN in which API Management service needs to be configured in. None (Default Value)
	// means the API Management service is not part of any Virtual Network, External means the API Management deployment is set
	// up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is
	// setup inside a Virtual Network having an Intranet Facing Endpoint only.
	VirtualNetworkType *ApiManagementServiceProperties_VirtualNetworkType_STATUS `json:"virtualNetworkType,omitempty"`

	// Zones: A list of availability zones denoting where the resource needs to come from.
	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.(*storage.Service_STATUS)
	if ok {
		// Populate our instance from source
		return service.AssignProperties_From_Service_STATUS(src)
	}

	// Convert to an intermediate form
	src = &storage.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.(*storage.Service_STATUS)
	if ok {
		// Populate destination from our instance
		return service.AssignProperties_To_Service_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &storage.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
}

var _ genruntime.FromARMConverter = &Service_STATUS{}

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

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

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

	// Set property "ApiVersionConstraint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ApiVersionConstraint != nil {
			var apiVersionConstraint1 ApiVersionConstraint_STATUS
			err := apiVersionConstraint1.PopulateFromARM(owner, *typedInput.Properties.ApiVersionConstraint)
			if err != nil {
				return err
			}
			apiVersionConstraint := apiVersionConstraint1
			service.ApiVersionConstraint = &apiVersionConstraint
		}
	}

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

	// no assignment for property "Conditions"

	// Set property "ConfigurationApi":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ConfigurationApi != nil {
			var configurationApi1 ConfigurationApi_STATUS
			err := configurationApi1.PopulateFromARM(owner, *typedInput.Properties.ConfigurationApi)
			if err != nil {
				return err
			}
			configurationApi := configurationApi1
			service.ConfigurationApi = &configurationApi
		}
	}

	// Set property "CreatedAtUtc":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CreatedAtUtc != nil {
			createdAtUtc := *typedInput.Properties.CreatedAtUtc
			service.CreatedAtUtc = &createdAtUtc
		}
	}

	// Set property "CustomProperties":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CustomProperties != nil {
			service.CustomProperties = make(map[string]string, len(typedInput.Properties.CustomProperties))
			for key, value := range typedInput.Properties.CustomProperties {
				service.CustomProperties[key] = value
			}
		}
	}

	// Set property "DeveloperPortalStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeveloperPortalStatus != nil {
			var temp string
			temp = string(*typedInput.Properties.DeveloperPortalStatus)
			developerPortalStatus := ApiManagementServiceProperties_DeveloperPortalStatus_STATUS(temp)
			service.DeveloperPortalStatus = &developerPortalStatus
		}
	}

	// Set property "DeveloperPortalUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DeveloperPortalUrl != nil {
			developerPortalUrl := *typedInput.Properties.DeveloperPortalUrl
			service.DeveloperPortalUrl = &developerPortalUrl
		}
	}

	// Set property "DisableGateway":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.DisableGateway != nil {
			disableGateway := *typedInput.Properties.DisableGateway
			service.DisableGateway = &disableGateway
		}
	}

	// Set property "EnableClientCertificate":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.EnableClientCertificate != nil {
			enableClientCertificate := *typedInput.Properties.EnableClientCertificate
			service.EnableClientCertificate = &enableClientCertificate
		}
	}

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

	// Set property "GatewayRegionalUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GatewayRegionalUrl != nil {
			gatewayRegionalUrl := *typedInput.Properties.GatewayRegionalUrl
			service.GatewayRegionalUrl = &gatewayRegionalUrl
		}
	}

	// Set property "GatewayUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GatewayUrl != nil {
			gatewayUrl := *typedInput.Properties.GatewayUrl
			service.GatewayUrl = &gatewayUrl
		}
	}

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

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

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

	// Set property "LegacyPortalStatus":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.LegacyPortalStatus != nil {
			var temp string
			temp = string(*typedInput.Properties.LegacyPortalStatus)
			legacyPortalStatus := ApiManagementServiceProperties_LegacyPortalStatus_STATUS(temp)
			service.LegacyPortalStatus = &legacyPortalStatus
		}
	}

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

	// Set property "ManagementApiUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ManagementApiUrl != nil {
			managementApiUrl := *typedInput.Properties.ManagementApiUrl
			service.ManagementApiUrl = &managementApiUrl
		}
	}

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

	// Set property "NatGatewayState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NatGatewayState != nil {
			var temp string
			temp = string(*typedInput.Properties.NatGatewayState)
			natGatewayState := ApiManagementServiceProperties_NatGatewayState_STATUS(temp)
			service.NatGatewayState = &natGatewayState
		}
	}

	// Set property "NotificationSenderEmail":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.NotificationSenderEmail != nil {
			notificationSenderEmail := *typedInput.Properties.NotificationSenderEmail
			service.NotificationSenderEmail = &notificationSenderEmail
		}
	}

	// Set property "OutboundPublicIPAddresses":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.OutboundPublicIPAddresses {
			service.OutboundPublicIPAddresses = append(service.OutboundPublicIPAddresses, item)
		}
	}

	// Set property "PlatformVersion":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PlatformVersion != nil {
			var temp string
			temp = string(*typedInput.Properties.PlatformVersion)
			platformVersion := ApiManagementServiceProperties_PlatformVersion_STATUS(temp)
			service.PlatformVersion = &platformVersion
		}
	}

	// Set property "PortalUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PortalUrl != nil {
			portalUrl := *typedInput.Properties.PortalUrl
			service.PortalUrl = &portalUrl
		}
	}

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

	// Set property "PrivateIPAddresses":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.PrivateIPAddresses {
			service.PrivateIPAddresses = append(service.PrivateIPAddresses, item)
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			provisioningState := *typedInput.Properties.ProvisioningState
			service.ProvisioningState = &provisioningState
		}
	}

	// Set property "PublicIPAddresses":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.PublicIPAddresses {
			service.PublicIPAddresses = append(service.PublicIPAddresses, item)
		}
	}

	// Set property "PublicIpAddressId":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicIpAddressId != nil {
			publicIpAddressId := *typedInput.Properties.PublicIpAddressId
			service.PublicIpAddressId = &publicIpAddressId
		}
	}

	// Set property "PublicNetworkAccess":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublicNetworkAccess != nil {
			var temp string
			temp = string(*typedInput.Properties.PublicNetworkAccess)
			publicNetworkAccess := ApiManagementServiceProperties_PublicNetworkAccess_STATUS(temp)
			service.PublicNetworkAccess = &publicNetworkAccess
		}
	}

	// Set property "PublisherEmail":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublisherEmail != nil {
			publisherEmail := *typedInput.Properties.PublisherEmail
			service.PublisherEmail = &publisherEmail
		}
	}

	// Set property "PublisherName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PublisherName != nil {
			publisherName := *typedInput.Properties.PublisherName
			service.PublisherName = &publisherName
		}
	}

	// Set property "Restore":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Restore != nil {
			restore := *typedInput.Properties.Restore
			service.Restore = &restore
		}
	}

	// Set property "ScmUrl":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ScmUrl != nil {
			scmUrl := *typedInput.Properties.ScmUrl
			service.ScmUrl = &scmUrl
		}
	}

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 ApiManagementServiceSkuProperties_STATUS
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		service.Sku = &sku
	}

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

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

	// Set property "TargetProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TargetProvisioningState != nil {
			targetProvisioningState := *typedInput.Properties.TargetProvisioningState
			service.TargetProvisioningState = &targetProvisioningState
		}
	}

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

	// Set property "VirtualNetworkConfiguration":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualNetworkConfiguration != nil {
			var virtualNetworkConfiguration1 VirtualNetworkConfiguration_STATUS
			err := virtualNetworkConfiguration1.PopulateFromARM(owner, *typedInput.Properties.VirtualNetworkConfiguration)
			if err != nil {
				return err
			}
			virtualNetworkConfiguration := virtualNetworkConfiguration1
			service.VirtualNetworkConfiguration = &virtualNetworkConfiguration
		}
	}

	// Set property "VirtualNetworkType":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.VirtualNetworkType != nil {
			var temp string
			temp = string(*typedInput.Properties.VirtualNetworkType)
			virtualNetworkType := ApiManagementServiceProperties_VirtualNetworkType_STATUS(temp)
			service.VirtualNetworkType = &virtualNetworkType
		}
	}

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

	// No error
	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 *storage.Service_STATUS) error {

	// 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 source.ConfigurationApi != nil {
		var configurationApi ConfigurationApi_STATUS
		err := configurationApi.AssignProperties_From_ConfigurationApi_STATUS(source.ConfigurationApi)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ConfigurationApi_STATUS() to populate field ConfigurationApi")
		}
		service.ConfigurationApi = &configurationApi
	} else {
		service.ConfigurationApi = nil
	}

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

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

	// DeveloperPortalStatus
	if source.DeveloperPortalStatus != nil {
		developerPortalStatus := *source.DeveloperPortalStatus
		developerPortalStatusTemp := genruntime.ToEnum(developerPortalStatus, apiManagementServiceProperties_DeveloperPortalStatus_STATUS_Values)
		service.DeveloperPortalStatus = &developerPortalStatusTemp
	} 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 source.LegacyPortalStatus != nil {
		legacyPortalStatus := *source.LegacyPortalStatus
		legacyPortalStatusTemp := genruntime.ToEnum(legacyPortalStatus, apiManagementServiceProperties_LegacyPortalStatus_STATUS_Values)
		service.LegacyPortalStatus = &legacyPortalStatusTemp
	} 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
	if source.NatGatewayState != nil {
		natGatewayState := *source.NatGatewayState
		natGatewayStateTemp := genruntime.ToEnum(natGatewayState, apiManagementServiceProperties_NatGatewayState_STATUS_Values)
		service.NatGatewayState = &natGatewayStateTemp
	} else {
		service.NatGatewayState = nil
	}

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

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

	// PlatformVersion
	if source.PlatformVersion != nil {
		platformVersion := *source.PlatformVersion
		platformVersionTemp := genruntime.ToEnum(platformVersion, apiManagementServiceProperties_PlatformVersion_STATUS_Values)
		service.PlatformVersion = &platformVersionTemp
	} else {
		service.PlatformVersion = nil
	}

	// 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
	if source.PublicNetworkAccess != nil {
		publicNetworkAccess := *source.PublicNetworkAccess
		publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, apiManagementServiceProperties_PublicNetworkAccess_STATUS_Values)
		service.PublicNetworkAccess = &publicNetworkAccessTemp
	} else {
		service.PublicNetworkAccess = nil
	}

	// 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
	if source.VirtualNetworkType != nil {
		virtualNetworkType := *source.VirtualNetworkType
		virtualNetworkTypeTemp := genruntime.ToEnum(virtualNetworkType, apiManagementServiceProperties_VirtualNetworkType_STATUS_Values)
		service.VirtualNetworkType = &virtualNetworkTypeTemp
	} else {
		service.VirtualNetworkType = nil
	}

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

	// 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 *storage.Service_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// AdditionalLocations
	if service.AdditionalLocations != nil {
		additionalLocationList := make([]storage.AdditionalLocation_STATUS, len(service.AdditionalLocations))
		for additionalLocationIndex, additionalLocationItem := range service.AdditionalLocations {
			var additionalLocation storage.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 storage.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([]storage.CertificateConfiguration_STATUS, len(service.Certificates))
		for certificateIndex, certificateItem := range service.Certificates {
			var certificate storage.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 {
		var configurationApi storage.ConfigurationApi_STATUS
		err := service.ConfigurationApi.AssignProperties_To_ConfigurationApi_STATUS(&configurationApi)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ConfigurationApi_STATUS() to populate field ConfigurationApi")
		}
		destination.ConfigurationApi = &configurationApi
	} else {
		destination.ConfigurationApi = nil
	}

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

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

	// DeveloperPortalStatus
	if service.DeveloperPortalStatus != nil {
		developerPortalStatus := string(*service.DeveloperPortalStatus)
		destination.DeveloperPortalStatus = &developerPortalStatus
	} else {
		destination.DeveloperPortalStatus = nil
	}

	// 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([]storage.HostnameConfiguration_STATUS, len(service.HostnameConfigurations))
		for hostnameConfigurationIndex, hostnameConfigurationItem := range service.HostnameConfigurations {
			var hostnameConfiguration storage.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 storage.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 {
		legacyPortalStatus := string(*service.LegacyPortalStatus)
		destination.LegacyPortalStatus = &legacyPortalStatus
	} else {
		destination.LegacyPortalStatus = nil
	}

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

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

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

	// NatGatewayState
	if service.NatGatewayState != nil {
		natGatewayState := string(*service.NatGatewayState)
		destination.NatGatewayState = &natGatewayState
	} else {
		destination.NatGatewayState = nil
	}

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

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

	// PlatformVersion
	if service.PlatformVersion != nil {
		platformVersion := string(*service.PlatformVersion)
		destination.PlatformVersion = &platformVersion
	} else {
		destination.PlatformVersion = nil
	}

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

	// PrivateEndpointConnections
	if service.PrivateEndpointConnections != nil {
		privateEndpointConnectionList := make([]storage.RemotePrivateEndpointConnectionWrapper_STATUS, len(service.PrivateEndpointConnections))
		for privateEndpointConnectionIndex, privateEndpointConnectionItem := range service.PrivateEndpointConnections {
			var privateEndpointConnection storage.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
	if service.PublicNetworkAccess != nil {
		publicNetworkAccess := string(*service.PublicNetworkAccess)
		destination.PublicNetworkAccess = &publicNetworkAccess
	} else {
		destination.PublicNetworkAccess = nil
	}

	// 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 storage.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 storage.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 storage.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
	if service.VirtualNetworkType != nil {
		virtualNetworkType := string(*service.VirtualNetworkType)
		destination.VirtualNetworkType = &virtualNetworkType
	} else {
		destination.VirtualNetworkType = nil
	}

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

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

	// No error
	return nil
}

// Description of an additional API Management resource location.
type AdditionalLocation struct {
	// DisableGateway: Property only valid for an Api Management service deployed in multiple locations. This can be used to
	// disable the gateway in this additional location.
	DisableGateway *bool `json:"disableGateway,omitempty"`

	// +kubebuilder:validation:Required
	// Location: The location name of the additional region among Azure Data center regions.
	Location *string `json:"location,omitempty"`

	// NatGatewayState: Property can be used to enable NAT Gateway for this API Management service.
	NatGatewayState *AdditionalLocation_NatGatewayState `json:"natGatewayState,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"`

	// +kubebuilder:validation:Required
	// Sku: SKU properties of the API Management service.
	Sku *ApiManagementServiceSkuProperties `json:"sku,omitempty"`

	// VirtualNetworkConfiguration: Virtual network configuration for the location.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`

	// Zones: A list of availability zones denoting where the resource needs to come from.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ARMTransformer = &AdditionalLocation{}

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

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

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

	// Set property "NatGatewayState":
	if location.NatGatewayState != nil {
		var temp string
		temp = string(*location.NatGatewayState)
		natGatewayState := arm.AdditionalLocation_NatGatewayState(temp)
		result.NatGatewayState = &natGatewayState
	}

	// Set property "PublicIpAddressId":
	if location.PublicIpAddressReference != nil {
		publicIpAddressReferenceARMID, err := resolved.ResolvedReferences.Lookup(*location.PublicIpAddressReference)
		if err != nil {
			return nil, err
		}
		publicIpAddressReference := publicIpAddressReferenceARMID
		result.PublicIpAddressId = &publicIpAddressReference
	}

	// Set property "Sku":
	if location.Sku != nil {
		sku_ARM, err := location.Sku.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		sku := *sku_ARM.(*arm.ApiManagementServiceSkuProperties)
		result.Sku = &sku
	}

	// Set property "VirtualNetworkConfiguration":
	if location.VirtualNetworkConfiguration != nil {
		virtualNetworkConfiguration_ARM, err := location.VirtualNetworkConfiguration.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		virtualNetworkConfiguration := *virtualNetworkConfiguration_ARM.(*arm.VirtualNetworkConfiguration)
		result.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	}

	// Set property "Zones":
	for _, item := range location.Zones {
		result.Zones = append(result.Zones, item)
	}
	return result, nil
}

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

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

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

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

	// Set property "NatGatewayState":
	if typedInput.NatGatewayState != nil {
		var temp string
		temp = string(*typedInput.NatGatewayState)
		natGatewayState := AdditionalLocation_NatGatewayState(temp)
		location.NatGatewayState = &natGatewayState
	}

	// no assignment for property "PublicIpAddressReference"

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 ApiManagementServiceSkuProperties
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		location.Sku = &sku
	}

	// Set property "VirtualNetworkConfiguration":
	if typedInput.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration1 VirtualNetworkConfiguration
		err := virtualNetworkConfiguration1.PopulateFromARM(owner, *typedInput.VirtualNetworkConfiguration)
		if err != nil {
			return err
		}
		virtualNetworkConfiguration := virtualNetworkConfiguration1
		location.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	}

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

	// No error
	return nil
}

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

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

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

	// NatGatewayState
	if source.NatGatewayState != nil {
		natGatewayState := *source.NatGatewayState
		natGatewayStateTemp := genruntime.ToEnum(natGatewayState, additionalLocation_NatGatewayState_Values)
		location.NatGatewayState = &natGatewayStateTemp
	} else {
		location.NatGatewayState = nil
	}

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

	// No error
	return nil
}

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

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

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

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

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

	// Sku
	if location.Sku != nil {
		var sku storage.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 storage.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
	}

	// No error
	return nil
}

// Description of an additional API Management resource location.
type AdditionalLocation_STATUS struct {
	// DisableGateway: Property only valid for an Api Management service deployed in multiple locations. This can be used to
	// disable the gateway in this additional location.
	DisableGateway *bool `json:"disableGateway,omitempty"`

	// GatewayRegionalUrl: Gateway URL of the API Management service in the Region.
	GatewayRegionalUrl *string `json:"gatewayRegionalUrl,omitempty"`

	// Location: The location name of the additional region among Azure Data center regions.
	Location *string `json:"location,omitempty"`

	// NatGatewayState: Property can be used to enable NAT Gateway for this API Management service.
	NatGatewayState *AdditionalLocation_NatGatewayState_STATUS `json:"natGatewayState,omitempty"`

	// OutboundPublicIPAddresses: Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available
	// only for Premium SKU on stv2 platform.
	OutboundPublicIPAddresses []string `json:"outboundPublicIPAddresses,omitempty"`

	// PlatformVersion: Compute Platform Version running the service.
	PlatformVersion *AdditionalLocation_PlatformVersion_STATUS `json:"platformVersion,omitempty"`

	// PrivateIPAddresses: Private Static Load Balanced IP addresses of the API Management service which is deployed in an
	// Internal Virtual Network in a particular additional location. Available only for Basic, Standard, Premium and Isolated
	// SKU.
	PrivateIPAddresses []string `json:"privateIPAddresses,omitempty"`

	// PublicIPAddresses: Public Static Load Balanced IP addresses of the API Management service in the additional location.
	// Available only for Basic, Standard, Premium and Isolated SKU.
	PublicIPAddresses []string `json:"publicIPAddresses,omitempty"`

	// PublicIpAddressId: 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.
	PublicIpAddressId *string `json:"publicIpAddressId,omitempty"`

	// Sku: SKU properties of the API Management service.
	Sku *ApiManagementServiceSkuProperties_STATUS `json:"sku,omitempty"`

	// VirtualNetworkConfiguration: Virtual network configuration for the location.
	VirtualNetworkConfiguration *VirtualNetworkConfiguration_STATUS `json:"virtualNetworkConfiguration,omitempty"`

	// Zones: A list of availability zones denoting where the resource needs to come from.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.FromARMConverter = &AdditionalLocation_STATUS{}

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

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

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

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

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

	// Set property "NatGatewayState":
	if typedInput.NatGatewayState != nil {
		var temp string
		temp = string(*typedInput.NatGatewayState)
		natGatewayState := AdditionalLocation_NatGatewayState_STATUS(temp)
		location.NatGatewayState = &natGatewayState
	}

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

	// Set property "PlatformVersion":
	if typedInput.PlatformVersion != nil {
		var temp string
		temp = string(*typedInput.PlatformVersion)
		platformVersion := AdditionalLocation_PlatformVersion_STATUS(temp)
		location.PlatformVersion = &platformVersion
	}

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

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

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

	// Set property "Sku":
	if typedInput.Sku != nil {
		var sku1 ApiManagementServiceSkuProperties_STATUS
		err := sku1.PopulateFromARM(owner, *typedInput.Sku)
		if err != nil {
			return err
		}
		sku := sku1
		location.Sku = &sku
	}

	// Set property "VirtualNetworkConfiguration":
	if typedInput.VirtualNetworkConfiguration != nil {
		var virtualNetworkConfiguration1 VirtualNetworkConfiguration_STATUS
		err := virtualNetworkConfiguration1.PopulateFromARM(owner, *typedInput.VirtualNetworkConfiguration)
		if err != nil {
			return err
		}
		virtualNetworkConfiguration := virtualNetworkConfiguration1
		location.VirtualNetworkConfiguration = &virtualNetworkConfiguration
	}

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

	// No error
	return nil
}

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

	// 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
	if source.NatGatewayState != nil {
		natGatewayState := *source.NatGatewayState
		natGatewayStateTemp := genruntime.ToEnum(natGatewayState, additionalLocation_NatGatewayState_STATUS_Values)
		location.NatGatewayState = &natGatewayStateTemp
	} else {
		location.NatGatewayState = nil
	}

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

	// PlatformVersion
	if source.PlatformVersion != nil {
		platformVersion := *source.PlatformVersion
		platformVersionTemp := genruntime.ToEnum(platformVersion, additionalLocation_PlatformVersion_STATUS_Values)
		location.PlatformVersion = &platformVersionTemp
	} else {
		location.PlatformVersion = nil
	}

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

	// 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 *storage.AdditionalLocation_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// 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
	if location.NatGatewayState != nil {
		natGatewayState := string(*location.NatGatewayState)
		destination.NatGatewayState = &natGatewayState
	} else {
		destination.NatGatewayState = nil
	}

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

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

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

	// No error
	return nil
}

// Identity properties of the Api Management service resource.
type ApiManagementServiceIdentity struct {
	// +kubebuilder:validation:Required
	// Type: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly
	// created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.
	Type *ApiManagementServiceIdentity_Type `json:"type,omitempty"`

	// UserAssignedIdentities: The list of user identities associated with the resource. The user identity
	// dictionary key references will be ARM resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
	// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiManagementServiceIdentity{}

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

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

	// Set property "UserAssignedIdentities":
	result.UserAssignedIdentities = make(map[string]arm.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities))
	for _, ident := range identity.UserAssignedIdentities {
		identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference)
		if err != nil {
			return nil, err
		}
		key := identARMID
		result.UserAssignedIdentities[key] = arm.UserAssignedIdentityDetails{}
	}
	return result, nil
}

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

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

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

	// no assignment for property "UserAssignedIdentities"

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Identity properties of the Api Management service resource.
type ApiManagementServiceIdentity_STATUS struct {
	// PrincipalId: The principal id of the identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: The client tenant id of the identity.
	TenantId *string `json:"tenantId,omitempty"`

	// Type: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly
	// created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.
	Type *ApiManagementServiceIdentity_Type_STATUS `json:"type,omitempty"`

	// UserAssignedIdentities: The list of user identities associated with the resource. The user identity
	// dictionary key references will be ARM resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
	// providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]UserIdentityProperties_STATUS `json:"userAssignedIdentities,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiManagementServiceIdentity_STATUS{}

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

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

	// Set property "PrincipalId":
	if typedInput.PrincipalId != nil {
		principalId := *typedInput.PrincipalId
		identity.PrincipalId = &principalId
	}

	// Set property "TenantId":
	if typedInput.TenantId != nil {
		tenantId := *typedInput.TenantId
		identity.TenantId = &tenantId
	}

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

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

	// No error
	return nil
}

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

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

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

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

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

	// 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 *storage.ApiManagementServiceIdentity_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

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

	// UserAssignedIdentities
	if identity.UserAssignedIdentities != nil {
		userAssignedIdentityMap := make(map[string]storage.UserIdentityProperties_STATUS, len(identity.UserAssignedIdentities))
		for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities {
			var userAssignedIdentity storage.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
	}

	// No error
	return nil
}

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

const (
	ApiManagementServiceProperties_DeveloperPortalStatus_Disabled = ApiManagementServiceProperties_DeveloperPortalStatus("Disabled")
	ApiManagementServiceProperties_DeveloperPortalStatus_Enabled  = ApiManagementServiceProperties_DeveloperPortalStatus("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_DeveloperPortalStatus
var apiManagementServiceProperties_DeveloperPortalStatus_Values = map[string]ApiManagementServiceProperties_DeveloperPortalStatus{
	"disabled": ApiManagementServiceProperties_DeveloperPortalStatus_Disabled,
	"enabled":  ApiManagementServiceProperties_DeveloperPortalStatus_Enabled,
}

type ApiManagementServiceProperties_DeveloperPortalStatus_STATUS string

const (
	ApiManagementServiceProperties_DeveloperPortalStatus_STATUS_Disabled = ApiManagementServiceProperties_DeveloperPortalStatus_STATUS("Disabled")
	ApiManagementServiceProperties_DeveloperPortalStatus_STATUS_Enabled  = ApiManagementServiceProperties_DeveloperPortalStatus_STATUS("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_DeveloperPortalStatus_STATUS
var apiManagementServiceProperties_DeveloperPortalStatus_STATUS_Values = map[string]ApiManagementServiceProperties_DeveloperPortalStatus_STATUS{
	"disabled": ApiManagementServiceProperties_DeveloperPortalStatus_STATUS_Disabled,
	"enabled":  ApiManagementServiceProperties_DeveloperPortalStatus_STATUS_Enabled,
}

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

const (
	ApiManagementServiceProperties_LegacyPortalStatus_Disabled = ApiManagementServiceProperties_LegacyPortalStatus("Disabled")
	ApiManagementServiceProperties_LegacyPortalStatus_Enabled  = ApiManagementServiceProperties_LegacyPortalStatus("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_LegacyPortalStatus
var apiManagementServiceProperties_LegacyPortalStatus_Values = map[string]ApiManagementServiceProperties_LegacyPortalStatus{
	"disabled": ApiManagementServiceProperties_LegacyPortalStatus_Disabled,
	"enabled":  ApiManagementServiceProperties_LegacyPortalStatus_Enabled,
}

type ApiManagementServiceProperties_LegacyPortalStatus_STATUS string

const (
	ApiManagementServiceProperties_LegacyPortalStatus_STATUS_Disabled = ApiManagementServiceProperties_LegacyPortalStatus_STATUS("Disabled")
	ApiManagementServiceProperties_LegacyPortalStatus_STATUS_Enabled  = ApiManagementServiceProperties_LegacyPortalStatus_STATUS("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_LegacyPortalStatus_STATUS
var apiManagementServiceProperties_LegacyPortalStatus_STATUS_Values = map[string]ApiManagementServiceProperties_LegacyPortalStatus_STATUS{
	"disabled": ApiManagementServiceProperties_LegacyPortalStatus_STATUS_Disabled,
	"enabled":  ApiManagementServiceProperties_LegacyPortalStatus_STATUS_Enabled,
}

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

const (
	ApiManagementServiceProperties_NatGatewayState_Disabled = ApiManagementServiceProperties_NatGatewayState("Disabled")
	ApiManagementServiceProperties_NatGatewayState_Enabled  = ApiManagementServiceProperties_NatGatewayState("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_NatGatewayState
var apiManagementServiceProperties_NatGatewayState_Values = map[string]ApiManagementServiceProperties_NatGatewayState{
	"disabled": ApiManagementServiceProperties_NatGatewayState_Disabled,
	"enabled":  ApiManagementServiceProperties_NatGatewayState_Enabled,
}

type ApiManagementServiceProperties_NatGatewayState_STATUS string

const (
	ApiManagementServiceProperties_NatGatewayState_STATUS_Disabled = ApiManagementServiceProperties_NatGatewayState_STATUS("Disabled")
	ApiManagementServiceProperties_NatGatewayState_STATUS_Enabled  = ApiManagementServiceProperties_NatGatewayState_STATUS("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_NatGatewayState_STATUS
var apiManagementServiceProperties_NatGatewayState_STATUS_Values = map[string]ApiManagementServiceProperties_NatGatewayState_STATUS{
	"disabled": ApiManagementServiceProperties_NatGatewayState_STATUS_Disabled,
	"enabled":  ApiManagementServiceProperties_NatGatewayState_STATUS_Enabled,
}

type ApiManagementServiceProperties_PlatformVersion_STATUS string

const (
	ApiManagementServiceProperties_PlatformVersion_STATUS_Mtv1         = ApiManagementServiceProperties_PlatformVersion_STATUS("mtv1")
	ApiManagementServiceProperties_PlatformVersion_STATUS_Stv1         = ApiManagementServiceProperties_PlatformVersion_STATUS("stv1")
	ApiManagementServiceProperties_PlatformVersion_STATUS_Stv2         = ApiManagementServiceProperties_PlatformVersion_STATUS("stv2")
	ApiManagementServiceProperties_PlatformVersion_STATUS_Stv21        = ApiManagementServiceProperties_PlatformVersion_STATUS("stv2.1")
	ApiManagementServiceProperties_PlatformVersion_STATUS_Undetermined = ApiManagementServiceProperties_PlatformVersion_STATUS("undetermined")
)

// Mapping from string to ApiManagementServiceProperties_PlatformVersion_STATUS
var apiManagementServiceProperties_PlatformVersion_STATUS_Values = map[string]ApiManagementServiceProperties_PlatformVersion_STATUS{
	"mtv1":         ApiManagementServiceProperties_PlatformVersion_STATUS_Mtv1,
	"stv1":         ApiManagementServiceProperties_PlatformVersion_STATUS_Stv1,
	"stv2":         ApiManagementServiceProperties_PlatformVersion_STATUS_Stv2,
	"stv2.1":       ApiManagementServiceProperties_PlatformVersion_STATUS_Stv21,
	"undetermined": ApiManagementServiceProperties_PlatformVersion_STATUS_Undetermined,
}

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

const (
	ApiManagementServiceProperties_PublicNetworkAccess_Disabled = ApiManagementServiceProperties_PublicNetworkAccess("Disabled")
	ApiManagementServiceProperties_PublicNetworkAccess_Enabled  = ApiManagementServiceProperties_PublicNetworkAccess("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_PublicNetworkAccess
var apiManagementServiceProperties_PublicNetworkAccess_Values = map[string]ApiManagementServiceProperties_PublicNetworkAccess{
	"disabled": ApiManagementServiceProperties_PublicNetworkAccess_Disabled,
	"enabled":  ApiManagementServiceProperties_PublicNetworkAccess_Enabled,
}

type ApiManagementServiceProperties_PublicNetworkAccess_STATUS string

const (
	ApiManagementServiceProperties_PublicNetworkAccess_STATUS_Disabled = ApiManagementServiceProperties_PublicNetworkAccess_STATUS("Disabled")
	ApiManagementServiceProperties_PublicNetworkAccess_STATUS_Enabled  = ApiManagementServiceProperties_PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to ApiManagementServiceProperties_PublicNetworkAccess_STATUS
var apiManagementServiceProperties_PublicNetworkAccess_STATUS_Values = map[string]ApiManagementServiceProperties_PublicNetworkAccess_STATUS{
	"disabled": ApiManagementServiceProperties_PublicNetworkAccess_STATUS_Disabled,
	"enabled":  ApiManagementServiceProperties_PublicNetworkAccess_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"External","Internal","None"}
type ApiManagementServiceProperties_VirtualNetworkType string

const (
	ApiManagementServiceProperties_VirtualNetworkType_External = ApiManagementServiceProperties_VirtualNetworkType("External")
	ApiManagementServiceProperties_VirtualNetworkType_Internal = ApiManagementServiceProperties_VirtualNetworkType("Internal")
	ApiManagementServiceProperties_VirtualNetworkType_None     = ApiManagementServiceProperties_VirtualNetworkType("None")
)

// Mapping from string to ApiManagementServiceProperties_VirtualNetworkType
var apiManagementServiceProperties_VirtualNetworkType_Values = map[string]ApiManagementServiceProperties_VirtualNetworkType{
	"external": ApiManagementServiceProperties_VirtualNetworkType_External,
	"internal": ApiManagementServiceProperties_VirtualNetworkType_Internal,
	"none":     ApiManagementServiceProperties_VirtualNetworkType_None,
}

type ApiManagementServiceProperties_VirtualNetworkType_STATUS string

const (
	ApiManagementServiceProperties_VirtualNetworkType_STATUS_External = ApiManagementServiceProperties_VirtualNetworkType_STATUS("External")
	ApiManagementServiceProperties_VirtualNetworkType_STATUS_Internal = ApiManagementServiceProperties_VirtualNetworkType_STATUS("Internal")
	ApiManagementServiceProperties_VirtualNetworkType_STATUS_None     = ApiManagementServiceProperties_VirtualNetworkType_STATUS("None")
)

// Mapping from string to ApiManagementServiceProperties_VirtualNetworkType_STATUS
var apiManagementServiceProperties_VirtualNetworkType_STATUS_Values = map[string]ApiManagementServiceProperties_VirtualNetworkType_STATUS{
	"external": ApiManagementServiceProperties_VirtualNetworkType_STATUS_External,
	"internal": ApiManagementServiceProperties_VirtualNetworkType_STATUS_Internal,
	"none":     ApiManagementServiceProperties_VirtualNetworkType_STATUS_None,
}

// API Management service resource SKU properties.
type ApiManagementServiceSkuProperties struct {
	// +kubebuilder:validation:Required
	// Capacity: Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.
	Capacity *int `json:"capacity,omitempty"`

	// +kubebuilder:validation:Required
	// Name: Name of the Sku.
	Name *ApiManagementServiceSkuProperties_Name `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiManagementServiceSkuProperties{}

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

	// Set property "Capacity":
	if properties.Capacity != nil {
		capacity := *properties.Capacity
		result.Capacity = &capacity
	}

	// Set property "Name":
	if properties.Name != nil {
		var temp string
		temp = string(*properties.Name)
		name := arm.ApiManagementServiceSkuProperties_Name(temp)
		result.Name = &name
	}
	return result, nil
}

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

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

	// Set property "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		properties.Capacity = &capacity
	}

	// Set property "Name":
	if typedInput.Name != nil {
		var temp string
		temp = string(*typedInput.Name)
		name := ApiManagementServiceSkuProperties_Name(temp)
		properties.Name = &name
	}

	// No error
	return nil
}

// AssignProperties_From_ApiManagementServiceSkuProperties populates our ApiManagementServiceSkuProperties from the provided source ApiManagementServiceSkuProperties
func (properties *ApiManagementServiceSkuProperties) AssignProperties_From_ApiManagementServiceSkuProperties(source *storage.ApiManagementServiceSkuProperties) error {

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

	// Name
	if source.Name != nil {
		name := *source.Name
		nameTemp := genruntime.ToEnum(name, apiManagementServiceSkuProperties_Name_Values)
		properties.Name = &nameTemp
	} else {
		properties.Name = nil
	}

	// No error
	return nil
}

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

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

	// Name
	if properties.Name != nil {
		name := string(*properties.Name)
		destination.Name = &name
	} else {
		destination.Name = nil
	}

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

	// No error
	return nil
}

// API Management service resource SKU properties.
type ApiManagementServiceSkuProperties_STATUS struct {
	// Capacity: Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.
	Capacity *int `json:"capacity,omitempty"`

	// Name: Name of the Sku.
	Name *ApiManagementServiceSkuProperties_Name_STATUS `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiManagementServiceSkuProperties_STATUS{}

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

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

	// Set property "Capacity":
	if typedInput.Capacity != nil {
		capacity := *typedInput.Capacity
		properties.Capacity = &capacity
	}

	// Set property "Name":
	if typedInput.Name != nil {
		var temp string
		temp = string(*typedInput.Name)
		name := ApiManagementServiceSkuProperties_Name_STATUS(temp)
		properties.Name = &name
	}

	// No error
	return nil
}

// AssignProperties_From_ApiManagementServiceSkuProperties_STATUS populates our ApiManagementServiceSkuProperties_STATUS from the provided source ApiManagementServiceSkuProperties_STATUS
func (properties *ApiManagementServiceSkuProperties_STATUS) AssignProperties_From_ApiManagementServiceSkuProperties_STATUS(source *storage.ApiManagementServiceSkuProperties_STATUS) error {

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

	// Name
	if source.Name != nil {
		name := *source.Name
		nameTemp := genruntime.ToEnum(name, apiManagementServiceSkuProperties_Name_STATUS_Values)
		properties.Name = &nameTemp
	} else {
		properties.Name = nil
	}

	// 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 *storage.ApiManagementServiceSkuProperties_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// Name
	if properties.Name != nil {
		name := string(*properties.Name)
		destination.Name = &name
	} else {
		destination.Name = nil
	}

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

	// No error
	return nil
}

// Control Plane Apis version constraint for the API Management service.
type ApiVersionConstraint struct {
	// MinApiVersion: Limit control plane API calls to API Management service with version equal to or newer than this value.
	MinApiVersion *string `json:"minApiVersion,omitempty"`
}

var _ genruntime.ARMTransformer = &ApiVersionConstraint{}

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

	// Set property "MinApiVersion":
	if constraint.MinApiVersion != nil {
		minApiVersion := *constraint.MinApiVersion
		result.MinApiVersion = &minApiVersion
	}
	return result, nil
}

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

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

	// Set property "MinApiVersion":
	if typedInput.MinApiVersion != nil {
		minApiVersion := *typedInput.MinApiVersion
		constraint.MinApiVersion = &minApiVersion
	}

	// No error
	return nil
}

// AssignProperties_From_ApiVersionConstraint populates our ApiVersionConstraint from the provided source ApiVersionConstraint
func (constraint *ApiVersionConstraint) AssignProperties_From_ApiVersionConstraint(source *storage.ApiVersionConstraint) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

// Control Plane Apis version constraint for the API Management service.
type ApiVersionConstraint_STATUS struct {
	// MinApiVersion: Limit control plane API calls to API Management service with version equal to or newer than this value.
	MinApiVersion *string `json:"minApiVersion,omitempty"`
}

var _ genruntime.FromARMConverter = &ApiVersionConstraint_STATUS{}

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

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

	// Set property "MinApiVersion":
	if typedInput.MinApiVersion != nil {
		minApiVersion := *typedInput.MinApiVersion
		constraint.MinApiVersion = &minApiVersion
	}

	// No error
	return nil
}

// AssignProperties_From_ApiVersionConstraint_STATUS populates our ApiVersionConstraint_STATUS from the provided source ApiVersionConstraint_STATUS
func (constraint *ApiVersionConstraint_STATUS) AssignProperties_From_ApiVersionConstraint_STATUS(source *storage.ApiVersionConstraint_STATUS) error {

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

	// 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 *storage.ApiVersionConstraint_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

	// No error
	return nil
}

// Certificate configuration which consist of non-trusted intermediates and root certificates.
type CertificateConfiguration struct {
	// Certificate: Certificate information.
	Certificate *CertificateInformation `json:"certificate,omitempty"`

	// CertificatePassword: Certificate Password.
	CertificatePassword *genruntime.SecretReference `json:"certificatePassword,omitempty"`

	// EncodedCertificate: Base64 Encoded certificate.
	EncodedCertificate *string `json:"encodedCertificate,omitempty"`

	// +kubebuilder:validation:Required
	// StoreName: The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and
	// CertificateAuthority are valid locations.
	StoreName *CertificateConfiguration_StoreName `json:"storeName,omitempty"`
}

var _ genruntime.ARMTransformer = &CertificateConfiguration{}

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

	// Set property "Certificate":
	if configuration.Certificate != nil {
		certificate_ARM, err := configuration.Certificate.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		certificate := *certificate_ARM.(*arm.CertificateInformation)
		result.Certificate = &certificate
	}

	// Set property "CertificatePassword":
	if configuration.CertificatePassword != nil {
		certificatePasswordSecret, err := resolved.ResolvedSecrets.Lookup(*configuration.CertificatePassword)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property CertificatePassword")
		}
		certificatePassword := certificatePasswordSecret
		result.CertificatePassword = &certificatePassword
	}

	// Set property "EncodedCertificate":
	if configuration.EncodedCertificate != nil {
		encodedCertificate := *configuration.EncodedCertificate
		result.EncodedCertificate = &encodedCertificate
	}

	// Set property "StoreName":
	if configuration.StoreName != nil {
		var temp string
		temp = string(*configuration.StoreName)
		storeName := arm.CertificateConfiguration_StoreName(temp)
		result.StoreName = &storeName
	}
	return result, nil
}

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

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

	// Set property "Certificate":
	if typedInput.Certificate != nil {
		var certificate1 CertificateInformation
		err := certificate1.PopulateFromARM(owner, *typedInput.Certificate)
		if err != nil {
			return err
		}
		certificate := certificate1
		configuration.Certificate = &certificate
	}

	// no assignment for property "CertificatePassword"

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

	// Set property "StoreName":
	if typedInput.StoreName != nil {
		var temp string
		temp = string(*typedInput.StoreName)
		storeName := CertificateConfiguration_StoreName(temp)
		configuration.StoreName = &storeName
	}

	// No error
	return nil
}

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

	// 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
	if source.StoreName != nil {
		storeName := *source.StoreName
		storeNameTemp := genruntime.ToEnum(storeName, certificateConfiguration_StoreName_Values)
		configuration.StoreName = &storeNameTemp
	} else {
		configuration.StoreName = nil
	}

	// No error
	return nil
}

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

	// Certificate
	if configuration.Certificate != nil {
		var certificate storage.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
	if configuration.StoreName != nil {
		storeName := string(*configuration.StoreName)
		destination.StoreName = &storeName
	} else {
		destination.StoreName = nil
	}

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

	// No error
	return nil
}

// Certificate configuration which consist of non-trusted intermediates and root certificates.
type CertificateConfiguration_STATUS struct {
	// Certificate: Certificate information.
	Certificate *CertificateInformation_STATUS `json:"certificate,omitempty"`

	// EncodedCertificate: Base64 Encoded certificate.
	EncodedCertificate *string `json:"encodedCertificate,omitempty"`

	// StoreName: The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and
	// CertificateAuthority are valid locations.
	StoreName *CertificateConfiguration_StoreName_STATUS `json:"storeName,omitempty"`
}

var _ genruntime.FromARMConverter = &CertificateConfiguration_STATUS{}

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

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

	// Set property "Certificate":
	if typedInput.Certificate != nil {
		var certificate1 CertificateInformation_STATUS
		err := certificate1.PopulateFromARM(owner, *typedInput.Certificate)
		if err != nil {
			return err
		}
		certificate := certificate1
		configuration.Certificate = &certificate
	}

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

	// Set property "StoreName":
	if typedInput.StoreName != nil {
		var temp string
		temp = string(*typedInput.StoreName)
		storeName := CertificateConfiguration_StoreName_STATUS(temp)
		configuration.StoreName = &storeName
	}

	// No error
	return nil
}

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

	// 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
	if source.StoreName != nil {
		storeName := *source.StoreName
		storeNameTemp := genruntime.ToEnum(storeName, certificateConfiguration_StoreName_STATUS_Values)
		configuration.StoreName = &storeNameTemp
	} else {
		configuration.StoreName = nil
	}

	// 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 *storage.CertificateConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Certificate
	if configuration.Certificate != nil {
		var certificate storage.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
	if configuration.StoreName != nil {
		storeName := string(*configuration.StoreName)
		destination.StoreName = &storeName
	} else {
		destination.StoreName = nil
	}

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

	// No error
	return nil
}

// Information regarding the Configuration API of the API Management service.
type ConfigurationApi struct {
	// LegacyApi: Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service.
	// Value is optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be
	// available for self-hosted gateways. Default value is 'Enabled'
	LegacyApi *ConfigurationApi_LegacyApi `json:"legacyApi,omitempty"`
}

var _ genruntime.ARMTransformer = &ConfigurationApi{}

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

	// Set property "LegacyApi":
	if configurationApi.LegacyApi != nil {
		var temp string
		temp = string(*configurationApi.LegacyApi)
		legacyApi := arm.ConfigurationApi_LegacyApi(temp)
		result.LegacyApi = &legacyApi
	}
	return result, nil
}

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

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

	// Set property "LegacyApi":
	if typedInput.LegacyApi != nil {
		var temp string
		temp = string(*typedInput.LegacyApi)
		legacyApi := ConfigurationApi_LegacyApi(temp)
		configurationApi.LegacyApi = &legacyApi
	}

	// No error
	return nil
}

// AssignProperties_From_ConfigurationApi populates our ConfigurationApi from the provided source ConfigurationApi
func (configurationApi *ConfigurationApi) AssignProperties_From_ConfigurationApi(source *storage.ConfigurationApi) error {

	// LegacyApi
	if source.LegacyApi != nil {
		legacyApi := *source.LegacyApi
		legacyApiTemp := genruntime.ToEnum(legacyApi, configurationApi_LegacyApi_Values)
		configurationApi.LegacyApi = &legacyApiTemp
	} else {
		configurationApi.LegacyApi = nil
	}

	// No error
	return nil
}

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

	// LegacyApi
	if configurationApi.LegacyApi != nil {
		legacyApi := string(*configurationApi.LegacyApi)
		destination.LegacyApi = &legacyApi
	} else {
		destination.LegacyApi = nil
	}

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

	// No error
	return nil
}

// Information regarding the Configuration API of the API Management service.
type ConfigurationApi_STATUS struct {
	// LegacyApi: Indication whether or not the legacy Configuration API (v1) should be exposed on the API Management service.
	// Value is optional but must be 'Enabled' or 'Disabled'. If 'Disabled', legacy Configuration API (v1) will not be
	// available for self-hosted gateways. Default value is 'Enabled'
	LegacyApi *ConfigurationApi_LegacyApi_STATUS `json:"legacyApi,omitempty"`
}

var _ genruntime.FromARMConverter = &ConfigurationApi_STATUS{}

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

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

	// Set property "LegacyApi":
	if typedInput.LegacyApi != nil {
		var temp string
		temp = string(*typedInput.LegacyApi)
		legacyApi := ConfigurationApi_LegacyApi_STATUS(temp)
		configurationApi.LegacyApi = &legacyApi
	}

	// No error
	return nil
}

// AssignProperties_From_ConfigurationApi_STATUS populates our ConfigurationApi_STATUS from the provided source ConfigurationApi_STATUS
func (configurationApi *ConfigurationApi_STATUS) AssignProperties_From_ConfigurationApi_STATUS(source *storage.ConfigurationApi_STATUS) error {

	// LegacyApi
	if source.LegacyApi != nil {
		legacyApi := *source.LegacyApi
		legacyApiTemp := genruntime.ToEnum(legacyApi, configurationApi_LegacyApi_STATUS_Values)
		configurationApi.LegacyApi = &legacyApiTemp
	} else {
		configurationApi.LegacyApi = nil
	}

	// 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 *storage.ConfigurationApi_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// LegacyApi
	if configurationApi.LegacyApi != nil {
		legacyApi := string(*configurationApi.LegacyApi)
		destination.LegacyApi = &legacyApi
	} else {
		destination.LegacyApi = nil
	}

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

	// No error
	return nil
}

// Custom hostname configuration.
type HostnameConfiguration struct {
	// Certificate: Certificate information.
	Certificate *CertificateInformation `json:"certificate,omitempty"`

	// CertificatePassword: Certificate Password.
	CertificatePassword *genruntime.SecretReference `json:"certificatePassword,omitempty"`

	// CertificateSource: Certificate Source.
	CertificateSource *HostnameConfiguration_CertificateSource `json:"certificateSource,omitempty"`

	// CertificateStatus: Certificate Status.
	CertificateStatus *HostnameConfiguration_CertificateStatus `json:"certificateStatus,omitempty"`

	// DefaultSslBinding: Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate.
	// If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is
	// useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The
	// setting only applied to gateway Hostname Type.
	DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"`

	// EncodedCertificate: Base64 Encoded certificate.
	EncodedCertificate *string `json:"encodedCertificate,omitempty"`

	// +kubebuilder:validation:Required
	// HostName: Hostname to configure on the Api Management service.
	HostName *string `json:"hostName,omitempty"`

	// IdentityClientId: System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to
	// the keyVault containing the SSL certificate.
	IdentityClientId *string `json:"identityClientId,omitempty" optionalConfigMapPair:"IdentityClientId"`

	// IdentityClientIdFromConfig: System or User Assigned Managed identity clientId as generated by Azure AD, which has GET
	// access to the keyVault containing the SSL certificate.
	IdentityClientIdFromConfig *genruntime.ConfigMapReference `json:"identityClientIdFromConfig,omitempty" optionalConfigMapPair:"IdentityClientId"`

	// KeyVaultId: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided,
	// auto-update of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi.
	// The secret should be of type *application/x-pkcs12*
	KeyVaultId *string `json:"keyVaultId,omitempty"`

	// NegotiateClientCertificate: Specify true to always negotiate client certificate on the hostname. Default Value is false.
	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`

	// +kubebuilder:validation:Required
	// Type: Hostname type.
	Type *HostnameConfiguration_Type `json:"type,omitempty"`
}

var _ genruntime.ARMTransformer = &HostnameConfiguration{}

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

	// Set property "Certificate":
	if configuration.Certificate != nil {
		certificate_ARM, err := configuration.Certificate.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		certificate := *certificate_ARM.(*arm.CertificateInformation)
		result.Certificate = &certificate
	}

	// Set property "CertificatePassword":
	if configuration.CertificatePassword != nil {
		certificatePasswordSecret, err := resolved.ResolvedSecrets.Lookup(*configuration.CertificatePassword)
		if err != nil {
			return nil, eris.Wrap(err, "looking up secret for property CertificatePassword")
		}
		certificatePassword := certificatePasswordSecret
		result.CertificatePassword = &certificatePassword
	}

	// Set property "CertificateSource":
	if configuration.CertificateSource != nil {
		var temp string
		temp = string(*configuration.CertificateSource)
		certificateSource := arm.HostnameConfiguration_CertificateSource(temp)
		result.CertificateSource = &certificateSource
	}

	// Set property "CertificateStatus":
	if configuration.CertificateStatus != nil {
		var temp string
		temp = string(*configuration.CertificateStatus)
		certificateStatus := arm.HostnameConfiguration_CertificateStatus(temp)
		result.CertificateStatus = &certificateStatus
	}

	// Set property "DefaultSslBinding":
	if configuration.DefaultSslBinding != nil {
		defaultSslBinding := *configuration.DefaultSslBinding
		result.DefaultSslBinding = &defaultSslBinding
	}

	// Set property "EncodedCertificate":
	if configuration.EncodedCertificate != nil {
		encodedCertificate := *configuration.EncodedCertificate
		result.EncodedCertificate = &encodedCertificate
	}

	// Set property "HostName":
	if configuration.HostName != nil {
		hostName := *configuration.HostName
		result.HostName = &hostName
	}

	// Set property "IdentityClientId":
	if configuration.IdentityClientId != nil {
		identityClientId := *configuration.IdentityClientId
		result.IdentityClientId = &identityClientId
	}
	if configuration.IdentityClientIdFromConfig != nil {
		identityClientIdValue, err := resolved.ResolvedConfigMaps.Lookup(*configuration.IdentityClientIdFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property IdentityClientId")
		}
		identityClientId := identityClientIdValue
		result.IdentityClientId = &identityClientId
	}

	// Set property "KeyVaultId":
	if configuration.KeyVaultId != nil {
		keyVaultId := *configuration.KeyVaultId
		result.KeyVaultId = &keyVaultId
	}

	// Set property "NegotiateClientCertificate":
	if configuration.NegotiateClientCertificate != nil {
		negotiateClientCertificate := *configuration.NegotiateClientCertificate
		result.NegotiateClientCertificate = &negotiateClientCertificate
	}

	// Set property "Type":
	if configuration.Type != nil {
		var temp string
		temp = string(*configuration.Type)
		typeVar := arm.HostnameConfiguration_Type(temp)
		result.Type = &typeVar
	}
	return result, nil
}

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

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

	// Set property "Certificate":
	if typedInput.Certificate != nil {
		var certificate1 CertificateInformation
		err := certificate1.PopulateFromARM(owner, *typedInput.Certificate)
		if err != nil {
			return err
		}
		certificate := certificate1
		configuration.Certificate = &certificate
	}

	// no assignment for property "CertificatePassword"

	// Set property "CertificateSource":
	if typedInput.CertificateSource != nil {
		var temp string
		temp = string(*typedInput.CertificateSource)
		certificateSource := HostnameConfiguration_CertificateSource(temp)
		configuration.CertificateSource = &certificateSource
	}

	// Set property "CertificateStatus":
	if typedInput.CertificateStatus != nil {
		var temp string
		temp = string(*typedInput.CertificateStatus)
		certificateStatus := HostnameConfiguration_CertificateStatus(temp)
		configuration.CertificateStatus = &certificateStatus
	}

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

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

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

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

	// no assignment for property "IdentityClientIdFromConfig"

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

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

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

	// No error
	return nil
}

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

	// 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
	if source.CertificateSource != nil {
		certificateSource := *source.CertificateSource
		certificateSourceTemp := genruntime.ToEnum(certificateSource, hostnameConfiguration_CertificateSource_Values)
		configuration.CertificateSource = &certificateSourceTemp
	} else {
		configuration.CertificateSource = nil
	}

	// CertificateStatus
	if source.CertificateStatus != nil {
		certificateStatus := *source.CertificateStatus
		certificateStatusTemp := genruntime.ToEnum(certificateStatus, hostnameConfiguration_CertificateStatus_Values)
		configuration.CertificateStatus = &certificateStatusTemp
	} else {
		configuration.CertificateStatus = nil
	}

	// 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
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, hostnameConfiguration_Type_Values)
		configuration.Type = &typeTemp
	} else {
		configuration.Type = nil
	}

	// No error
	return nil
}

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

	// Certificate
	if configuration.Certificate != nil {
		var certificate storage.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
	if configuration.CertificateSource != nil {
		certificateSource := string(*configuration.CertificateSource)
		destination.CertificateSource = &certificateSource
	} else {
		destination.CertificateSource = nil
	}

	// CertificateStatus
	if configuration.CertificateStatus != nil {
		certificateStatus := string(*configuration.CertificateStatus)
		destination.CertificateStatus = &certificateStatus
	} else {
		destination.CertificateStatus = nil
	}

	// 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
	if configuration.Type != nil {
		typeVar := string(*configuration.Type)
		destination.Type = &typeVar
	} else {
		destination.Type = nil
	}

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

	// No error
	return nil
}

// Custom hostname configuration.
type HostnameConfiguration_STATUS struct {
	// Certificate: Certificate information.
	Certificate *CertificateInformation_STATUS `json:"certificate,omitempty"`

	// CertificateSource: Certificate Source.
	CertificateSource *HostnameConfiguration_CertificateSource_STATUS `json:"certificateSource,omitempty"`

	// CertificateStatus: Certificate Status.
	CertificateStatus *HostnameConfiguration_CertificateStatus_STATUS `json:"certificateStatus,omitempty"`

	// DefaultSslBinding: Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate.
	// If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is
	// useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The
	// setting only applied to gateway Hostname Type.
	DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"`

	// EncodedCertificate: Base64 Encoded certificate.
	EncodedCertificate *string `json:"encodedCertificate,omitempty"`

	// HostName: Hostname to configure on the Api Management service.
	HostName *string `json:"hostName,omitempty"`

	// IdentityClientId: System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to
	// the keyVault containing the SSL certificate.
	IdentityClientId *string `json:"identityClientId,omitempty"`

	// KeyVaultId: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided,
	// auto-update of ssl certificate will not work. This requires Api Management service to be configured with aka.ms/apimmsi.
	// The secret should be of type *application/x-pkcs12*
	KeyVaultId *string `json:"keyVaultId,omitempty"`

	// NegotiateClientCertificate: Specify true to always negotiate client certificate on the hostname. Default Value is false.
	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`

	// Type: Hostname type.
	Type *HostnameConfiguration_Type_STATUS `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &HostnameConfiguration_STATUS{}

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

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

	// Set property "Certificate":
	if typedInput.Certificate != nil {
		var certificate1 CertificateInformation_STATUS
		err := certificate1.PopulateFromARM(owner, *typedInput.Certificate)
		if err != nil {
			return err
		}
		certificate := certificate1
		configuration.Certificate = &certificate
	}

	// Set property "CertificateSource":
	if typedInput.CertificateSource != nil {
		var temp string
		temp = string(*typedInput.CertificateSource)
		certificateSource := HostnameConfiguration_CertificateSource_STATUS(temp)
		configuration.CertificateSource = &certificateSource
	}

	// Set property "CertificateStatus":
	if typedInput.CertificateStatus != nil {
		var temp string
		temp = string(*typedInput.CertificateStatus)
		certificateStatus := HostnameConfiguration_CertificateStatus_STATUS(temp)
		configuration.CertificateStatus = &certificateStatus
	}

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

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

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

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

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

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

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

	// No error
	return nil
}

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

	// 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
	if source.CertificateSource != nil {
		certificateSource := *source.CertificateSource
		certificateSourceTemp := genruntime.ToEnum(certificateSource, hostnameConfiguration_CertificateSource_STATUS_Values)
		configuration.CertificateSource = &certificateSourceTemp
	} else {
		configuration.CertificateSource = nil
	}

	// CertificateStatus
	if source.CertificateStatus != nil {
		certificateStatus := *source.CertificateStatus
		certificateStatusTemp := genruntime.ToEnum(certificateStatus, hostnameConfiguration_CertificateStatus_STATUS_Values)
		configuration.CertificateStatus = &certificateStatusTemp
	} else {
		configuration.CertificateStatus = nil
	}

	// 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
	if source.Type != nil {
		typeVar := *source.Type
		typeTemp := genruntime.ToEnum(typeVar, hostnameConfiguration_Type_STATUS_Values)
		configuration.Type = &typeTemp
	} else {
		configuration.Type = nil
	}

	// 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 *storage.HostnameConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

	// Certificate
	if configuration.Certificate != nil {
		var certificate storage.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
	if configuration.CertificateSource != nil {
		certificateSource := string(*configuration.CertificateSource)
		destination.CertificateSource = &certificateSource
	} else {
		destination.CertificateSource = nil
	}

	// CertificateStatus
	if configuration.CertificateStatus != nil {
		certificateStatus := string(*configuration.CertificateStatus)
		destination.CertificateStatus = &certificateStatus
	} else {
		destination.CertificateStatus = nil
	}

	// 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
	if configuration.Type != nil {
		typeVar := string(*configuration.Type)
		destination.Type = &typeVar
	} else {
		destination.Type = nil
	}

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

	// No error
	return nil
}

// Remote Private Endpoint Connection resource.
type RemotePrivateEndpointConnectionWrapper_STATUS struct {
	// GroupIds: All the Group ids.
	GroupIds []string `json:"groupIds,omitempty"`

	// Id: Private Endpoint connection resource id
	Id *string `json:"id,omitempty"`

	// Name: Private Endpoint Connection Name
	Name *string `json:"name,omitempty"`

	// PrivateEndpoint: The resource of private end point.
	PrivateEndpoint *ArmIdWrapper_STATUS `json:"privateEndpoint,omitempty"`

	// PrivateLinkServiceConnectionState: A collection of information about the state of the connection between service
	// consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState_STATUS `json:"privateLinkServiceConnectionState,omitempty"`

	// ProvisioningState: The provisioning state of the private endpoint connection resource.
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// Type: Private Endpoint Connection Resource Type
	Type *string `json:"type,omitempty"`
}

var _ genruntime.FromARMConverter = &RemotePrivateEndpointConnectionWrapper_STATUS{}

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

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

	// Set property "GroupIds":
	// copying flattened property:
	if typedInput.Properties != nil {
		for _, item := range typedInput.Properties.GroupIds {
			wrapper.GroupIds = append(wrapper.GroupIds, item)
		}
	}

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

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

	// Set property "PrivateEndpoint":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateEndpoint != nil {
			var privateEndpoint1 ArmIdWrapper_STATUS
			err := privateEndpoint1.PopulateFromARM(owner, *typedInput.Properties.PrivateEndpoint)
			if err != nil {
				return err
			}
			privateEndpoint := privateEndpoint1
			wrapper.PrivateEndpoint = &privateEndpoint
		}
	}

	// Set property "PrivateLinkServiceConnectionState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.PrivateLinkServiceConnectionState != nil {
			var privateLinkServiceConnectionState1 PrivateLinkServiceConnectionState_STATUS
			err := privateLinkServiceConnectionState1.PopulateFromARM(owner, *typedInput.Properties.PrivateLinkServiceConnectionState)
			if err != nil {
				return err
			}
			privateLinkServiceConnectionState := privateLinkServiceConnectionState1
			wrapper.PrivateLinkServiceConnectionState = &privateLinkServiceConnectionState
		}
	}

	// Set property "ProvisioningState":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ProvisioningState != nil {
			provisioningState := *typedInput.Properties.ProvisioningState
			wrapper.ProvisioningState = &provisioningState
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_RemotePrivateEndpointConnectionWrapper_STATUS populates our RemotePrivateEndpointConnectionWrapper_STATUS from the provided source RemotePrivateEndpointConnectionWrapper_STATUS
func (wrapper *RemotePrivateEndpointConnectionWrapper_STATUS) AssignProperties_From_RemotePrivateEndpointConnectionWrapper_STATUS(source *storage.RemotePrivateEndpointConnectionWrapper_STATUS) error {

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

	// 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 *storage.RemotePrivateEndpointConnectionWrapper_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// No error
	return nil
}

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type ServiceOperatorSpec struct {
	// ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).
	ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"`

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
	// CreatedAt: The timestamp of resource creation (UTC).
	CreatedAt *string `json:"createdAt,omitempty"`

	// CreatedBy: The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType: The type of identity that created the resource.
	CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"`

	// LastModifiedAt: The timestamp of resource last modification (UTC)
	LastModifiedAt *string `json:"lastModifiedAt,omitempty"`

	// LastModifiedBy: The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// LastModifiedByType: The type of identity that last modified the resource.
	LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"`
}

var _ genruntime.FromARMConverter = &SystemData_STATUS{}

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

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

	// Set property "CreatedAt":
	if typedInput.CreatedAt != nil {
		createdAt := *typedInput.CreatedAt
		data.CreatedAt = &createdAt
	}

	// Set property "CreatedBy":
	if typedInput.CreatedBy != nil {
		createdBy := *typedInput.CreatedBy
		data.CreatedBy = &createdBy
	}

	// Set property "CreatedByType":
	if typedInput.CreatedByType != nil {
		var temp string
		temp = string(*typedInput.CreatedByType)
		createdByType := SystemData_CreatedByType_STATUS(temp)
		data.CreatedByType = &createdByType
	}

	// Set property "LastModifiedAt":
	if typedInput.LastModifiedAt != nil {
		lastModifiedAt := *typedInput.LastModifiedAt
		data.LastModifiedAt = &lastModifiedAt
	}

	// Set property "LastModifiedBy":
	if typedInput.LastModifiedBy != nil {
		lastModifiedBy := *typedInput.LastModifiedBy
		data.LastModifiedBy = &lastModifiedBy
	}

	// Set property "LastModifiedByType":
	if typedInput.LastModifiedByType != nil {
		var temp string
		temp = string(*typedInput.LastModifiedByType)
		lastModifiedByType := SystemData_LastModifiedByType_STATUS(temp)
		data.LastModifiedByType = &lastModifiedByType
	}

	// No error
	return nil
}

// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS
func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *storage.SystemData_STATUS) error {

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

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

	// CreatedByType
	if source.CreatedByType != nil {
		createdByType := *source.CreatedByType
		createdByTypeTemp := genruntime.ToEnum(createdByType, systemData_CreatedByType_STATUS_Values)
		data.CreatedByType = &createdByTypeTemp
	} else {
		data.CreatedByType = nil
	}

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

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

	// LastModifiedByType
	if source.LastModifiedByType != nil {
		lastModifiedByType := *source.LastModifiedByType
		lastModifiedByTypeTemp := genruntime.ToEnum(lastModifiedByType, systemData_LastModifiedByType_STATUS_Values)
		data.LastModifiedByType = &lastModifiedByTypeTemp
	} else {
		data.LastModifiedByType = nil
	}

	// No error
	return nil
}

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

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

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

	// CreatedByType
	if data.CreatedByType != nil {
		createdByType := string(*data.CreatedByType)
		destination.CreatedByType = &createdByType
	} else {
		destination.CreatedByType = nil
	}

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

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

	// LastModifiedByType
	if data.LastModifiedByType != nil {
		lastModifiedByType := string(*data.LastModifiedByType)
		destination.LastModifiedByType = &lastModifiedByType
	} else {
		destination.LastModifiedByType = nil
	}

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

	// No error
	return nil
}

// Configuration of a virtual network to which API Management service is deployed.
type VirtualNetworkConfiguration struct {
	// 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"`
}

var _ genruntime.ARMTransformer = &VirtualNetworkConfiguration{}

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

	// Set property "SubnetResourceId":
	if configuration.SubnetResourceReference != nil {
		subnetResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*configuration.SubnetResourceReference)
		if err != nil {
			return nil, err
		}
		subnetResourceReference := subnetResourceReferenceARMID
		result.SubnetResourceId = &subnetResourceReference
	}
	return result, nil
}

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

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

	// no assignment for property "SubnetResourceReference"

	// No error
	return nil
}

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

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

// Configuration of a virtual network to which API Management service is deployed.
type VirtualNetworkConfiguration_STATUS struct {
	// SubnetResourceId: The full resource ID of a subnet in a virtual network to deploy the API Management service in.
	SubnetResourceId *string `json:"subnetResourceId,omitempty"`

	// Subnetname: The name of the subnet.
	Subnetname *string `json:"subnetname,omitempty"`

	// Vnetid: The virtual network ID. This is typically a GUID. Expect a null GUID by default.
	Vnetid *string `json:"vnetid,omitempty"`
}

var _ genruntime.FromARMConverter = &VirtualNetworkConfiguration_STATUS{}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// 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 *storage.VirtualNetworkConfiguration_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// No error
	return nil
}

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

const (
	AdditionalLocation_NatGatewayState_Disabled = AdditionalLocation_NatGatewayState("Disabled")
	AdditionalLocation_NatGatewayState_Enabled  = AdditionalLocation_NatGatewayState("Enabled")
)

// Mapping from string to AdditionalLocation_NatGatewayState
var additionalLocation_NatGatewayState_Values = map[string]AdditionalLocation_NatGatewayState{
	"disabled": AdditionalLocation_NatGatewayState_Disabled,
	"enabled":  AdditionalLocation_NatGatewayState_Enabled,
}

type AdditionalLocation_NatGatewayState_STATUS string

const (
	AdditionalLocation_NatGatewayState_STATUS_Disabled = AdditionalLocation_NatGatewayState_STATUS("Disabled")
	AdditionalLocation_NatGatewayState_STATUS_Enabled  = AdditionalLocation_NatGatewayState_STATUS("Enabled")
)

// Mapping from string to AdditionalLocation_NatGatewayState_STATUS
var additionalLocation_NatGatewayState_STATUS_Values = map[string]AdditionalLocation_NatGatewayState_STATUS{
	"disabled": AdditionalLocation_NatGatewayState_STATUS_Disabled,
	"enabled":  AdditionalLocation_NatGatewayState_STATUS_Enabled,
}

type AdditionalLocation_PlatformVersion_STATUS string

const (
	AdditionalLocation_PlatformVersion_STATUS_Mtv1         = AdditionalLocation_PlatformVersion_STATUS("mtv1")
	AdditionalLocation_PlatformVersion_STATUS_Stv1         = AdditionalLocation_PlatformVersion_STATUS("stv1")
	AdditionalLocation_PlatformVersion_STATUS_Stv2         = AdditionalLocation_PlatformVersion_STATUS("stv2")
	AdditionalLocation_PlatformVersion_STATUS_Stv21        = AdditionalLocation_PlatformVersion_STATUS("stv2.1")
	AdditionalLocation_PlatformVersion_STATUS_Undetermined = AdditionalLocation_PlatformVersion_STATUS("undetermined")
)

// Mapping from string to AdditionalLocation_PlatformVersion_STATUS
var additionalLocation_PlatformVersion_STATUS_Values = map[string]AdditionalLocation_PlatformVersion_STATUS{
	"mtv1":         AdditionalLocation_PlatformVersion_STATUS_Mtv1,
	"stv1":         AdditionalLocation_PlatformVersion_STATUS_Stv1,
	"stv2":         AdditionalLocation_PlatformVersion_STATUS_Stv2,
	"stv2.1":       AdditionalLocation_PlatformVersion_STATUS_Stv21,
	"undetermined": AdditionalLocation_PlatformVersion_STATUS_Undetermined,
}

// +kubebuilder:validation:Enum={"None","SystemAssigned","SystemAssigned, UserAssigned","UserAssigned"}
type ApiManagementServiceIdentity_Type string

const (
	ApiManagementServiceIdentity_Type_None                       = ApiManagementServiceIdentity_Type("None")
	ApiManagementServiceIdentity_Type_SystemAssigned             = ApiManagementServiceIdentity_Type("SystemAssigned")
	ApiManagementServiceIdentity_Type_SystemAssignedUserAssigned = ApiManagementServiceIdentity_Type("SystemAssigned, UserAssigned")
	ApiManagementServiceIdentity_Type_UserAssigned               = ApiManagementServiceIdentity_Type("UserAssigned")
)

// Mapping from string to ApiManagementServiceIdentity_Type
var apiManagementServiceIdentity_Type_Values = map[string]ApiManagementServiceIdentity_Type{
	"none":                         ApiManagementServiceIdentity_Type_None,
	"systemassigned":               ApiManagementServiceIdentity_Type_SystemAssigned,
	"systemassigned, userassigned": ApiManagementServiceIdentity_Type_SystemAssignedUserAssigned,
	"userassigned":                 ApiManagementServiceIdentity_Type_UserAssigned,
}

type ApiManagementServiceIdentity_Type_STATUS string

const (
	ApiManagementServiceIdentity_Type_STATUS_None                       = ApiManagementServiceIdentity_Type_STATUS("None")
	ApiManagementServiceIdentity_Type_STATUS_SystemAssigned             = ApiManagementServiceIdentity_Type_STATUS("SystemAssigned")
	ApiManagementServiceIdentity_Type_STATUS_SystemAssignedUserAssigned = ApiManagementServiceIdentity_Type_STATUS("SystemAssigned, UserAssigned")
	ApiManagementServiceIdentity_Type_STATUS_UserAssigned               = ApiManagementServiceIdentity_Type_STATUS("UserAssigned")
)

// Mapping from string to ApiManagementServiceIdentity_Type_STATUS
var apiManagementServiceIdentity_Type_STATUS_Values = map[string]ApiManagementServiceIdentity_Type_STATUS{
	"none":                         ApiManagementServiceIdentity_Type_STATUS_None,
	"systemassigned":               ApiManagementServiceIdentity_Type_STATUS_SystemAssigned,
	"systemassigned, userassigned": ApiManagementServiceIdentity_Type_STATUS_SystemAssignedUserAssigned,
	"userassigned":                 ApiManagementServiceIdentity_Type_STATUS_UserAssigned,
}

// +kubebuilder:validation:Enum={"Basic","BasicV2","Consumption","Developer","Isolated","Premium","Standard","StandardV2"}
type ApiManagementServiceSkuProperties_Name string

const (
	ApiManagementServiceSkuProperties_Name_Basic       = ApiManagementServiceSkuProperties_Name("Basic")
	ApiManagementServiceSkuProperties_Name_BasicV2     = ApiManagementServiceSkuProperties_Name("BasicV2")
	ApiManagementServiceSkuProperties_Name_Consumption = ApiManagementServiceSkuProperties_Name("Consumption")
	ApiManagementServiceSkuProperties_Name_Developer   = ApiManagementServiceSkuProperties_Name("Developer")
	ApiManagementServiceSkuProperties_Name_Isolated    = ApiManagementServiceSkuProperties_Name("Isolated")
	ApiManagementServiceSkuProperties_Name_Premium     = ApiManagementServiceSkuProperties_Name("Premium")
	ApiManagementServiceSkuProperties_Name_Standard    = ApiManagementServiceSkuProperties_Name("Standard")
	ApiManagementServiceSkuProperties_Name_StandardV2  = ApiManagementServiceSkuProperties_Name("StandardV2")
)

// Mapping from string to ApiManagementServiceSkuProperties_Name
var apiManagementServiceSkuProperties_Name_Values = map[string]ApiManagementServiceSkuProperties_Name{
	"basic":       ApiManagementServiceSkuProperties_Name_Basic,
	"basicv2":     ApiManagementServiceSkuProperties_Name_BasicV2,
	"consumption": ApiManagementServiceSkuProperties_Name_Consumption,
	"developer":   ApiManagementServiceSkuProperties_Name_Developer,
	"isolated":    ApiManagementServiceSkuProperties_Name_Isolated,
	"premium":     ApiManagementServiceSkuProperties_Name_Premium,
	"standard":    ApiManagementServiceSkuProperties_Name_Standard,
	"standardv2":  ApiManagementServiceSkuProperties_Name_StandardV2,
}

type ApiManagementServiceSkuProperties_Name_STATUS string

const (
	ApiManagementServiceSkuProperties_Name_STATUS_Basic       = ApiManagementServiceSkuProperties_Name_STATUS("Basic")
	ApiManagementServiceSkuProperties_Name_STATUS_BasicV2     = ApiManagementServiceSkuProperties_Name_STATUS("BasicV2")
	ApiManagementServiceSkuProperties_Name_STATUS_Consumption = ApiManagementServiceSkuProperties_Name_STATUS("Consumption")
	ApiManagementServiceSkuProperties_Name_STATUS_Developer   = ApiManagementServiceSkuProperties_Name_STATUS("Developer")
	ApiManagementServiceSkuProperties_Name_STATUS_Isolated    = ApiManagementServiceSkuProperties_Name_STATUS("Isolated")
	ApiManagementServiceSkuProperties_Name_STATUS_Premium     = ApiManagementServiceSkuProperties_Name_STATUS("Premium")
	ApiManagementServiceSkuProperties_Name_STATUS_Standard    = ApiManagementServiceSkuProperties_Name_STATUS("Standard")
	ApiManagementServiceSkuProperties_Name_STATUS_StandardV2  = ApiManagementServiceSkuProperties_Name_STATUS("StandardV2")
)

// Mapping from string to ApiManagementServiceSkuProperties_Name_STATUS
var apiManagementServiceSkuProperties_Name_STATUS_Values = map[string]ApiManagementServiceSkuProperties_Name_STATUS{
	"basic":       ApiManagementServiceSkuProperties_Name_STATUS_Basic,
	"basicv2":     ApiManagementServiceSkuProperties_Name_STATUS_BasicV2,
	"consumption": ApiManagementServiceSkuProperties_Name_STATUS_Consumption,
	"developer":   ApiManagementServiceSkuProperties_Name_STATUS_Developer,
	"isolated":    ApiManagementServiceSkuProperties_Name_STATUS_Isolated,
	"premium":     ApiManagementServiceSkuProperties_Name_STATUS_Premium,
	"standard":    ApiManagementServiceSkuProperties_Name_STATUS_Standard,
	"standardv2":  ApiManagementServiceSkuProperties_Name_STATUS_StandardV2,
}

// A wrapper for an ARM resource id
type ArmIdWrapper_STATUS struct {
	Id *string `json:"id,omitempty"`
}

var _ genruntime.FromARMConverter = &ArmIdWrapper_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ArmIdWrapper_STATUS populates our ArmIdWrapper_STATUS from the provided source ArmIdWrapper_STATUS
func (wrapper *ArmIdWrapper_STATUS) AssignProperties_From_ArmIdWrapper_STATUS(source *storage.ArmIdWrapper_STATUS) error {

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

	// 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 *storage.ArmIdWrapper_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"CertificateAuthority","Root"}
type CertificateConfiguration_StoreName string

const (
	CertificateConfiguration_StoreName_CertificateAuthority = CertificateConfiguration_StoreName("CertificateAuthority")
	CertificateConfiguration_StoreName_Root                 = CertificateConfiguration_StoreName("Root")
)

// Mapping from string to CertificateConfiguration_StoreName
var certificateConfiguration_StoreName_Values = map[string]CertificateConfiguration_StoreName{
	"certificateauthority": CertificateConfiguration_StoreName_CertificateAuthority,
	"root":                 CertificateConfiguration_StoreName_Root,
}

type CertificateConfiguration_StoreName_STATUS string

const (
	CertificateConfiguration_StoreName_STATUS_CertificateAuthority = CertificateConfiguration_StoreName_STATUS("CertificateAuthority")
	CertificateConfiguration_StoreName_STATUS_Root                 = CertificateConfiguration_StoreName_STATUS("Root")
)

// Mapping from string to CertificateConfiguration_StoreName_STATUS
var certificateConfiguration_StoreName_STATUS_Values = map[string]CertificateConfiguration_StoreName_STATUS{
	"certificateauthority": CertificateConfiguration_StoreName_STATUS_CertificateAuthority,
	"root":                 CertificateConfiguration_StoreName_STATUS_Root,
}

// SSL certificate information.
type CertificateInformation struct {
	// Expiry: Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as
	// specified by the ISO 8601 standard.
	Expiry *string `json:"expiry,omitempty" optionalConfigMapPair:"Expiry"`

	// ExpiryFromConfig: Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ`
	// as specified by the ISO 8601 standard.
	ExpiryFromConfig *genruntime.ConfigMapReference `json:"expiryFromConfig,omitempty" optionalConfigMapPair:"Expiry"`

	// Subject: Subject of the certificate.
	Subject *string `json:"subject,omitempty" optionalConfigMapPair:"Subject"`

	// SubjectFromConfig: Subject of the certificate.
	SubjectFromConfig *genruntime.ConfigMapReference `json:"subjectFromConfig,omitempty" optionalConfigMapPair:"Subject"`

	// Thumbprint: Thumbprint of the certificate.
	Thumbprint *string `json:"thumbprint,omitempty" optionalConfigMapPair:"Thumbprint"`

	// ThumbprintFromConfig: Thumbprint of the certificate.
	ThumbprintFromConfig *genruntime.ConfigMapReference `json:"thumbprintFromConfig,omitempty" optionalConfigMapPair:"Thumbprint"`
}

var _ genruntime.ARMTransformer = &CertificateInformation{}

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

	// Set property "Expiry":
	if information.Expiry != nil {
		expiry := *information.Expiry
		result.Expiry = &expiry
	}
	if information.ExpiryFromConfig != nil {
		expiryValue, err := resolved.ResolvedConfigMaps.Lookup(*information.ExpiryFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property Expiry")
		}
		expiry := expiryValue
		result.Expiry = &expiry
	}

	// Set property "Subject":
	if information.Subject != nil {
		subject := *information.Subject
		result.Subject = &subject
	}
	if information.SubjectFromConfig != nil {
		subjectValue, err := resolved.ResolvedConfigMaps.Lookup(*information.SubjectFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property Subject")
		}
		subject := subjectValue
		result.Subject = &subject
	}

	// Set property "Thumbprint":
	if information.Thumbprint != nil {
		thumbprint := *information.Thumbprint
		result.Thumbprint = &thumbprint
	}
	if information.ThumbprintFromConfig != nil {
		thumbprintValue, err := resolved.ResolvedConfigMaps.Lookup(*information.ThumbprintFromConfig)
		if err != nil {
			return nil, eris.Wrap(err, "looking up configmap for property Thumbprint")
		}
		thumbprint := thumbprintValue
		result.Thumbprint = &thumbprint
	}
	return result, nil
}

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

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

	// Set property "Expiry":
	if typedInput.Expiry != nil {
		expiry := *typedInput.Expiry
		information.Expiry = &expiry
	}

	// no assignment for property "ExpiryFromConfig"

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

	// no assignment for property "SubjectFromConfig"

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

	// no assignment for property "ThumbprintFromConfig"

	// No error
	return nil
}

// AssignProperties_From_CertificateInformation populates our CertificateInformation from the provided source CertificateInformation
func (information *CertificateInformation) AssignProperties_From_CertificateInformation(source *storage.CertificateInformation) error {

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

	// No error
	return nil
}

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

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

	// No error
	return nil
}

// SSL certificate information.
type CertificateInformation_STATUS struct {
	// Expiry: Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as
	// specified by the ISO 8601 standard.
	Expiry *string `json:"expiry,omitempty"`

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

	// Thumbprint: Thumbprint of the certificate.
	Thumbprint *string `json:"thumbprint,omitempty"`
}

var _ genruntime.FromARMConverter = &CertificateInformation_STATUS{}

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

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

	// Set property "Expiry":
	if typedInput.Expiry != nil {
		expiry := *typedInput.Expiry
		information.Expiry = &expiry
	}

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

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

	// No error
	return nil
}

// AssignProperties_From_CertificateInformation_STATUS populates our CertificateInformation_STATUS from the provided source CertificateInformation_STATUS
func (information *CertificateInformation_STATUS) AssignProperties_From_CertificateInformation_STATUS(source *storage.CertificateInformation_STATUS) error {

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

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

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

	// 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 *storage.CertificateInformation_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// No error
	return nil
}

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

const (
	ConfigurationApi_LegacyApi_Disabled = ConfigurationApi_LegacyApi("Disabled")
	ConfigurationApi_LegacyApi_Enabled  = ConfigurationApi_LegacyApi("Enabled")
)

// Mapping from string to ConfigurationApi_LegacyApi
var configurationApi_LegacyApi_Values = map[string]ConfigurationApi_LegacyApi{
	"disabled": ConfigurationApi_LegacyApi_Disabled,
	"enabled":  ConfigurationApi_LegacyApi_Enabled,
}

type ConfigurationApi_LegacyApi_STATUS string

const (
	ConfigurationApi_LegacyApi_STATUS_Disabled = ConfigurationApi_LegacyApi_STATUS("Disabled")
	ConfigurationApi_LegacyApi_STATUS_Enabled  = ConfigurationApi_LegacyApi_STATUS("Enabled")
)

// Mapping from string to ConfigurationApi_LegacyApi_STATUS
var configurationApi_LegacyApi_STATUS_Values = map[string]ConfigurationApi_LegacyApi_STATUS{
	"disabled": ConfigurationApi_LegacyApi_STATUS_Disabled,
	"enabled":  ConfigurationApi_LegacyApi_STATUS_Enabled,
}

// +kubebuilder:validation:Enum={"BuiltIn","Custom","KeyVault","Managed"}
type HostnameConfiguration_CertificateSource string

const (
	HostnameConfiguration_CertificateSource_BuiltIn  = HostnameConfiguration_CertificateSource("BuiltIn")
	HostnameConfiguration_CertificateSource_Custom   = HostnameConfiguration_CertificateSource("Custom")
	HostnameConfiguration_CertificateSource_KeyVault = HostnameConfiguration_CertificateSource("KeyVault")
	HostnameConfiguration_CertificateSource_Managed  = HostnameConfiguration_CertificateSource("Managed")
)

// Mapping from string to HostnameConfiguration_CertificateSource
var hostnameConfiguration_CertificateSource_Values = map[string]HostnameConfiguration_CertificateSource{
	"builtin":  HostnameConfiguration_CertificateSource_BuiltIn,
	"custom":   HostnameConfiguration_CertificateSource_Custom,
	"keyvault": HostnameConfiguration_CertificateSource_KeyVault,
	"managed":  HostnameConfiguration_CertificateSource_Managed,
}

type HostnameConfiguration_CertificateSource_STATUS string

const (
	HostnameConfiguration_CertificateSource_STATUS_BuiltIn  = HostnameConfiguration_CertificateSource_STATUS("BuiltIn")
	HostnameConfiguration_CertificateSource_STATUS_Custom   = HostnameConfiguration_CertificateSource_STATUS("Custom")
	HostnameConfiguration_CertificateSource_STATUS_KeyVault = HostnameConfiguration_CertificateSource_STATUS("KeyVault")
	HostnameConfiguration_CertificateSource_STATUS_Managed  = HostnameConfiguration_CertificateSource_STATUS("Managed")
)

// Mapping from string to HostnameConfiguration_CertificateSource_STATUS
var hostnameConfiguration_CertificateSource_STATUS_Values = map[string]HostnameConfiguration_CertificateSource_STATUS{
	"builtin":  HostnameConfiguration_CertificateSource_STATUS_BuiltIn,
	"custom":   HostnameConfiguration_CertificateSource_STATUS_Custom,
	"keyvault": HostnameConfiguration_CertificateSource_STATUS_KeyVault,
	"managed":  HostnameConfiguration_CertificateSource_STATUS_Managed,
}

// +kubebuilder:validation:Enum={"Completed","Failed","InProgress"}
type HostnameConfiguration_CertificateStatus string

const (
	HostnameConfiguration_CertificateStatus_Completed  = HostnameConfiguration_CertificateStatus("Completed")
	HostnameConfiguration_CertificateStatus_Failed     = HostnameConfiguration_CertificateStatus("Failed")
	HostnameConfiguration_CertificateStatus_InProgress = HostnameConfiguration_CertificateStatus("InProgress")
)

// Mapping from string to HostnameConfiguration_CertificateStatus
var hostnameConfiguration_CertificateStatus_Values = map[string]HostnameConfiguration_CertificateStatus{
	"completed":  HostnameConfiguration_CertificateStatus_Completed,
	"failed":     HostnameConfiguration_CertificateStatus_Failed,
	"inprogress": HostnameConfiguration_CertificateStatus_InProgress,
}

type HostnameConfiguration_CertificateStatus_STATUS string

const (
	HostnameConfiguration_CertificateStatus_STATUS_Completed  = HostnameConfiguration_CertificateStatus_STATUS("Completed")
	HostnameConfiguration_CertificateStatus_STATUS_Failed     = HostnameConfiguration_CertificateStatus_STATUS("Failed")
	HostnameConfiguration_CertificateStatus_STATUS_InProgress = HostnameConfiguration_CertificateStatus_STATUS("InProgress")
)

// Mapping from string to HostnameConfiguration_CertificateStatus_STATUS
var hostnameConfiguration_CertificateStatus_STATUS_Values = map[string]HostnameConfiguration_CertificateStatus_STATUS{
	"completed":  HostnameConfiguration_CertificateStatus_STATUS_Completed,
	"failed":     HostnameConfiguration_CertificateStatus_STATUS_Failed,
	"inprogress": HostnameConfiguration_CertificateStatus_STATUS_InProgress,
}

// +kubebuilder:validation:Enum={"ConfigurationApi","DeveloperPortal","Management","Portal","Proxy","Scm"}
type HostnameConfiguration_Type string

const (
	HostnameConfiguration_Type_ConfigurationApi = HostnameConfiguration_Type("ConfigurationApi")
	HostnameConfiguration_Type_DeveloperPortal  = HostnameConfiguration_Type("DeveloperPortal")
	HostnameConfiguration_Type_Management       = HostnameConfiguration_Type("Management")
	HostnameConfiguration_Type_Portal           = HostnameConfiguration_Type("Portal")
	HostnameConfiguration_Type_Proxy            = HostnameConfiguration_Type("Proxy")
	HostnameConfiguration_Type_Scm              = HostnameConfiguration_Type("Scm")
)

// Mapping from string to HostnameConfiguration_Type
var hostnameConfiguration_Type_Values = map[string]HostnameConfiguration_Type{
	"configurationapi": HostnameConfiguration_Type_ConfigurationApi,
	"developerportal":  HostnameConfiguration_Type_DeveloperPortal,
	"management":       HostnameConfiguration_Type_Management,
	"portal":           HostnameConfiguration_Type_Portal,
	"proxy":            HostnameConfiguration_Type_Proxy,
	"scm":              HostnameConfiguration_Type_Scm,
}

type HostnameConfiguration_Type_STATUS string

const (
	HostnameConfiguration_Type_STATUS_ConfigurationApi = HostnameConfiguration_Type_STATUS("ConfigurationApi")
	HostnameConfiguration_Type_STATUS_DeveloperPortal  = HostnameConfiguration_Type_STATUS("DeveloperPortal")
	HostnameConfiguration_Type_STATUS_Management       = HostnameConfiguration_Type_STATUS("Management")
	HostnameConfiguration_Type_STATUS_Portal           = HostnameConfiguration_Type_STATUS("Portal")
	HostnameConfiguration_Type_STATUS_Proxy            = HostnameConfiguration_Type_STATUS("Proxy")
	HostnameConfiguration_Type_STATUS_Scm              = HostnameConfiguration_Type_STATUS("Scm")
)

// Mapping from string to HostnameConfiguration_Type_STATUS
var hostnameConfiguration_Type_STATUS_Values = map[string]HostnameConfiguration_Type_STATUS{
	"configurationapi": HostnameConfiguration_Type_STATUS_ConfigurationApi,
	"developerportal":  HostnameConfiguration_Type_STATUS_DeveloperPortal,
	"management":       HostnameConfiguration_Type_STATUS_Management,
	"portal":           HostnameConfiguration_Type_STATUS_Portal,
	"proxy":            HostnameConfiguration_Type_STATUS_Proxy,
	"scm":              HostnameConfiguration_Type_STATUS_Scm,
}

// A collection of information about the state of the connection between service consumer and provider.
type PrivateLinkServiceConnectionState_STATUS struct {
	// ActionsRequired: A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *string `json:"actionsRequired,omitempty"`

	// Description: The reason for approval/rejection of the connection.
	Description *string `json:"description,omitempty"`

	// Status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.
	Status *PrivateEndpointServiceConnectionStatus_STATUS `json:"status,omitempty"`
}

var _ genruntime.FromARMConverter = &PrivateLinkServiceConnectionState_STATUS{}

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

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

	// Set property "ActionsRequired":
	if typedInput.ActionsRequired != nil {
		actionsRequired := *typedInput.ActionsRequired
		state.ActionsRequired = &actionsRequired
	}

	// Set property "Description":
	if typedInput.Description != nil {
		description := *typedInput.Description
		state.Description = &description
	}

	// Set property "Status":
	if typedInput.Status != nil {
		var temp string
		temp = string(*typedInput.Status)
		status := PrivateEndpointServiceConnectionStatus_STATUS(temp)
		state.Status = &status
	}

	// No error
	return nil
}

// AssignProperties_From_PrivateLinkServiceConnectionState_STATUS populates our PrivateLinkServiceConnectionState_STATUS from the provided source PrivateLinkServiceConnectionState_STATUS
func (state *PrivateLinkServiceConnectionState_STATUS) AssignProperties_From_PrivateLinkServiceConnectionState_STATUS(source *storage.PrivateLinkServiceConnectionState_STATUS) error {

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

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

	// Status
	if source.Status != nil {
		status := *source.Status
		statusTemp := genruntime.ToEnum(status, privateEndpointServiceConnectionStatus_STATUS_Values)
		state.Status = &statusTemp
	} else {
		state.Status = nil
	}

	// 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 *storage.PrivateLinkServiceConnectionState_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

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

	// Status
	if state.Status != nil {
		status := string(*state.Status)
		destination.Status = &status
	} else {
		destination.Status = nil
	}

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

	// No error
	return nil
}

type SystemData_CreatedByType_STATUS string

const (
	SystemData_CreatedByType_STATUS_Application     = SystemData_CreatedByType_STATUS("Application")
	SystemData_CreatedByType_STATUS_Key             = SystemData_CreatedByType_STATUS("Key")
	SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity")
	SystemData_CreatedByType_STATUS_User            = SystemData_CreatedByType_STATUS("User")
)

// Mapping from string to SystemData_CreatedByType_STATUS
var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{
	"application":     SystemData_CreatedByType_STATUS_Application,
	"key":             SystemData_CreatedByType_STATUS_Key,
	"managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity,
	"user":            SystemData_CreatedByType_STATUS_User,
}

type SystemData_LastModifiedByType_STATUS string

const (
	SystemData_LastModifiedByType_STATUS_Application     = SystemData_LastModifiedByType_STATUS("Application")
	SystemData_LastModifiedByType_STATUS_Key             = SystemData_LastModifiedByType_STATUS("Key")
	SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity")
	SystemData_LastModifiedByType_STATUS_User            = SystemData_LastModifiedByType_STATUS("User")
)

// Mapping from string to SystemData_LastModifiedByType_STATUS
var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{
	"application":     SystemData_LastModifiedByType_STATUS_Application,
	"key":             SystemData_LastModifiedByType_STATUS_Key,
	"managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity,
	"user":            SystemData_LastModifiedByType_STATUS_User,
}

// Information about the user assigned identity for the resource
type UserAssignedIdentityDetails struct {
	Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"`
}

// AssignProperties_From_UserAssignedIdentityDetails populates our UserAssignedIdentityDetails from the provided source UserAssignedIdentityDetails
func (details *UserAssignedIdentityDetails) AssignProperties_From_UserAssignedIdentityDetails(source *storage.UserAssignedIdentityDetails) error {

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

	// No error
	return nil
}

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

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

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

	// No error
	return nil
}

type UserIdentityProperties_STATUS struct {
	// ClientId: The client id of user assigned identity.
	ClientId *string `json:"clientId,omitempty"`

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

var _ genruntime.FromARMConverter = &UserIdentityProperties_STATUS{}

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

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

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

	// Set property "PrincipalId":
	if typedInput.PrincipalId != nil {
		principalId := *typedInput.PrincipalId
		properties.PrincipalId = &principalId
	}

	// No error
	return nil
}

// AssignProperties_From_UserIdentityProperties_STATUS populates our UserIdentityProperties_STATUS from the provided source UserIdentityProperties_STATUS
func (properties *UserIdentityProperties_STATUS) AssignProperties_From_UserIdentityProperties_STATUS(source *storage.UserIdentityProperties_STATUS) error {

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

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

	// 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 *storage.UserIdentityProperties_STATUS) error {
	// Create a new property bag
	propertyBag := genruntime.NewPropertyBag()

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

	// No error
	return nil
}

// The private endpoint connection status.
type PrivateEndpointServiceConnectionStatus_STATUS string

const (
	PrivateEndpointServiceConnectionStatus_STATUS_Approved = PrivateEndpointServiceConnectionStatus_STATUS("Approved")
	PrivateEndpointServiceConnectionStatus_STATUS_Pending  = PrivateEndpointServiceConnectionStatus_STATUS("Pending")
	PrivateEndpointServiceConnectionStatus_STATUS_Rejected = PrivateEndpointServiceConnectionStatus_STATUS("Rejected")
)

// Mapping from string to PrivateEndpointServiceConnectionStatus_STATUS
var privateEndpointServiceConnectionStatus_STATUS_Values = map[string]PrivateEndpointServiceConnectionStatus_STATUS{
	"approved": PrivateEndpointServiceConnectionStatus_STATUS_Approved,
	"pending":  PrivateEndpointServiceConnectionStatus_STATUS_Pending,
	"rejected": PrivateEndpointServiceConnectionStatus_STATUS_Rejected,
}

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