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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/network/v1api20220701/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/network/v1api20220701/storage"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/core"
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets"
	"github.com/rotisserie/eris"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/conversion"
)

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,network}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2022-07-01/natGateway.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}
type NatGateway struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              NatGateway_Spec   `json:"spec,omitempty"`
	Status            NatGateway_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &NatGateway{}

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

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

var _ conversion.Convertible = &NatGateway{}

// ConvertFrom populates our NatGateway from the provided hub NatGateway
func (gateway *NatGateway) ConvertFrom(hub conversion.Hub) error {
	// intermediate variable for conversion
	var source storage.NatGateway

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

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

	return nil
}

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

	return nil
}

var _ configmaps.Exporter = &NatGateway{}

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

var _ secrets.Exporter = &NatGateway{}

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

var _ genruntime.KubernetesResource = &NatGateway{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Network/natGateways"
func (gateway *NatGateway) GetType() string {
	return "Microsoft.Network/natGateways"
}

// NewEmptyStatus returns a new empty (blank) status
func (gateway *NatGateway) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &NatGateway_STATUS{}
}

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

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

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

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

	gateway.Status = st
	return nil
}

// AssignProperties_From_NatGateway populates our NatGateway from the provided source NatGateway
func (gateway *NatGateway) AssignProperties_From_NatGateway(source *storage.NatGateway) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_NatGateway populates the provided destination NatGateway from our NatGateway
func (gateway *NatGateway) AssignProperties_To_NatGateway(destination *storage.NatGateway) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /network/resource-manager/Microsoft.Network/stable/2022-07-01/natGateway.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}
type NatGatewayList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []NatGateway `json:"items"`
}

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

	// IdleTimeoutInMinutes: The idle timeout of the nat gateway.
	IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`

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

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

	// PublicIpAddresses: An array of public ip addresses associated with the nat gateway resource.
	PublicIpAddresses []SubResource `json:"publicIpAddresses,omitempty"`

	// PublicIpPrefixes: An array of public ip prefixes associated with the nat gateway resource.
	PublicIpPrefixes []SubResource `json:"publicIpPrefixes,omitempty"`

	// Sku: The nat gateway SKU.
	Sku *NatGatewaySku `json:"sku,omitempty"`

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

	// Zones: A list of availability zones denoting the zone in which Nat Gateway should be deployed.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ARMTransformer = &NatGateway_Spec{}

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

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

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

	// Set property "Properties":
	if gateway.IdleTimeoutInMinutes != nil ||
		gateway.PublicIpAddresses != nil ||
		gateway.PublicIpPrefixes != nil {
		result.Properties = &arm.NatGatewayPropertiesFormat{}
	}
	if gateway.IdleTimeoutInMinutes != nil {
		idleTimeoutInMinutes := *gateway.IdleTimeoutInMinutes
		result.Properties.IdleTimeoutInMinutes = &idleTimeoutInMinutes
	}
	for _, item := range gateway.PublicIpAddresses {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.PublicIpAddresses = append(result.Properties.PublicIpAddresses, *item_ARM.(*arm.SubResource))
	}
	for _, item := range gateway.PublicIpPrefixes {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.PublicIpPrefixes = append(result.Properties.PublicIpPrefixes, *item_ARM.(*arm.SubResource))
	}

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

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

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

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

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

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

	// Set property "IdleTimeoutInMinutes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IdleTimeoutInMinutes != nil {
			idleTimeoutInMinutes := *typedInput.Properties.IdleTimeoutInMinutes
			gateway.IdleTimeoutInMinutes = &idleTimeoutInMinutes
		}
	}

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

	// no assignment for property "OperatorSpec"

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

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

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

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

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &NatGateway_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.NatGateway_Spec{}
	err := gateway.AssignProperties_To_NatGateway_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_NatGateway_Spec populates our NatGateway_Spec from the provided source NatGateway_Spec
func (gateway *NatGateway_Spec) AssignProperties_From_NatGateway_Spec(source *storage.NatGateway_Spec) error {

	// AzureName
	gateway.AzureName = source.AzureName

	// IdleTimeoutInMinutes
	gateway.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(source.IdleTimeoutInMinutes)

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

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

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

	// PublicIpAddresses
	if source.PublicIpAddresses != nil {
		publicIpAddressList := make([]SubResource, len(source.PublicIpAddresses))
		for publicIpAddressIndex, publicIpAddressItem := range source.PublicIpAddresses {
			var publicIpAddress SubResource
			err := publicIpAddress.AssignProperties_From_SubResource(&publicIpAddressItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field PublicIpAddresses")
			}
			publicIpAddressList[publicIpAddressIndex] = publicIpAddress
		}
		gateway.PublicIpAddresses = publicIpAddressList
	} else {
		gateway.PublicIpAddresses = nil
	}

	// PublicIpPrefixes
	if source.PublicIpPrefixes != nil {
		publicIpPrefixList := make([]SubResource, len(source.PublicIpPrefixes))
		for publicIpPrefixIndex, publicIpPrefixItem := range source.PublicIpPrefixes {
			var publicIpPrefix SubResource
			err := publicIpPrefix.AssignProperties_From_SubResource(&publicIpPrefixItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource() to populate field PublicIpPrefixes")
			}
			publicIpPrefixList[publicIpPrefixIndex] = publicIpPrefix
		}
		gateway.PublicIpPrefixes = publicIpPrefixList
	} else {
		gateway.PublicIpPrefixes = nil
	}

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

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

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

	// No error
	return nil
}

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

	// AzureName
	destination.AzureName = gateway.AzureName

	// IdleTimeoutInMinutes
	destination.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(gateway.IdleTimeoutInMinutes)

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

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

	// OriginalVersion
	destination.OriginalVersion = gateway.OriginalVersion()

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

	// PublicIpAddresses
	if gateway.PublicIpAddresses != nil {
		publicIpAddressList := make([]storage.SubResource, len(gateway.PublicIpAddresses))
		for publicIpAddressIndex, publicIpAddressItem := range gateway.PublicIpAddresses {
			var publicIpAddress storage.SubResource
			err := publicIpAddressItem.AssignProperties_To_SubResource(&publicIpAddress)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field PublicIpAddresses")
			}
			publicIpAddressList[publicIpAddressIndex] = publicIpAddress
		}
		destination.PublicIpAddresses = publicIpAddressList
	} else {
		destination.PublicIpAddresses = nil
	}

	// PublicIpPrefixes
	if gateway.PublicIpPrefixes != nil {
		publicIpPrefixList := make([]storage.SubResource, len(gateway.PublicIpPrefixes))
		for publicIpPrefixIndex, publicIpPrefixItem := range gateway.PublicIpPrefixes {
			var publicIpPrefix storage.SubResource
			err := publicIpPrefixItem.AssignProperties_To_SubResource(&publicIpPrefix)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource() to populate field PublicIpPrefixes")
			}
			publicIpPrefixList[publicIpPrefixIndex] = publicIpPrefix
		}
		destination.PublicIpPrefixes = publicIpPrefixList
	} else {
		destination.PublicIpPrefixes = nil
	}

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

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

	// Zones
	destination.Zones = genruntime.CloneSliceOfString(gateway.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 (gateway *NatGateway_Spec) OriginalVersion() string {
	return GroupVersion.Version
}

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

// Nat Gateway resource.
type NatGateway_STATUS struct {
	// Conditions: The observed state of the resource
	Conditions []conditions.Condition `json:"conditions,omitempty"`

	// Etag: A unique read-only string that changes whenever the resource is updated.
	Etag *string `json:"etag,omitempty"`

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

	// IdleTimeoutInMinutes: The idle timeout of the nat gateway.
	IdleTimeoutInMinutes *int `json:"idleTimeoutInMinutes,omitempty"`

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

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

	// ProvisioningState: The provisioning state of the NAT gateway resource.
	ProvisioningState *ApplicationGatewayProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicIpAddresses: An array of public ip addresses associated with the nat gateway resource.
	PublicIpAddresses []SubResource_STATUS `json:"publicIpAddresses,omitempty"`

	// PublicIpPrefixes: An array of public ip prefixes associated with the nat gateway resource.
	PublicIpPrefixes []SubResource_STATUS `json:"publicIpPrefixes,omitempty"`

	// ResourceGuid: The resource GUID property of the NAT gateway resource.
	ResourceGuid *string `json:"resourceGuid,omitempty"`

	// Sku: The nat gateway SKU.
	Sku *NatGatewaySku_STATUS `json:"sku,omitempty"`

	// Subnets: An array of references to the subnets using this nat gateway resource.
	Subnets []SubResource_STATUS `json:"subnets,omitempty"`

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

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

	// Zones: A list of availability zones denoting the zone in which Nat Gateway should be deployed.
	Zones []string `json:"zones,omitempty"`
}

var _ genruntime.ConvertibleStatus = &NatGateway_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.NatGateway_STATUS{}
	err := gateway.AssignProperties_To_NatGateway_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 = &NatGateway_STATUS{}

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

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

	// no assignment for property "Conditions"

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

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

	// Set property "IdleTimeoutInMinutes":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.IdleTimeoutInMinutes != nil {
			idleTimeoutInMinutes := *typedInput.Properties.IdleTimeoutInMinutes
			gateway.IdleTimeoutInMinutes = &idleTimeoutInMinutes
		}
	}

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

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

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

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

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

	// Set property "ResourceGuid":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.ResourceGuid != nil {
			resourceGuid := *typedInput.Properties.ResourceGuid
			gateway.ResourceGuid = &resourceGuid
		}
	}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NatGateway_STATUS populates our NatGateway_STATUS from the provided source NatGateway_STATUS
func (gateway *NatGateway_STATUS) AssignProperties_From_NatGateway_STATUS(source *storage.NatGateway_STATUS) error {

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

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

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

	// IdleTimeoutInMinutes
	gateway.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(source.IdleTimeoutInMinutes)

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

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

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

	// PublicIpAddresses
	if source.PublicIpAddresses != nil {
		publicIpAddressList := make([]SubResource_STATUS, len(source.PublicIpAddresses))
		for publicIpAddressIndex, publicIpAddressItem := range source.PublicIpAddresses {
			var publicIpAddress SubResource_STATUS
			err := publicIpAddress.AssignProperties_From_SubResource_STATUS(&publicIpAddressItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field PublicIpAddresses")
			}
			publicIpAddressList[publicIpAddressIndex] = publicIpAddress
		}
		gateway.PublicIpAddresses = publicIpAddressList
	} else {
		gateway.PublicIpAddresses = nil
	}

	// PublicIpPrefixes
	if source.PublicIpPrefixes != nil {
		publicIpPrefixList := make([]SubResource_STATUS, len(source.PublicIpPrefixes))
		for publicIpPrefixIndex, publicIpPrefixItem := range source.PublicIpPrefixes {
			var publicIpPrefix SubResource_STATUS
			err := publicIpPrefix.AssignProperties_From_SubResource_STATUS(&publicIpPrefixItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field PublicIpPrefixes")
			}
			publicIpPrefixList[publicIpPrefixIndex] = publicIpPrefix
		}
		gateway.PublicIpPrefixes = publicIpPrefixList
	} else {
		gateway.PublicIpPrefixes = nil
	}

	// ResourceGuid
	gateway.ResourceGuid = genruntime.ClonePointerToString(source.ResourceGuid)

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

	// Subnets
	if source.Subnets != nil {
		subnetList := make([]SubResource_STATUS, len(source.Subnets))
		for subnetIndex, subnetItem := range source.Subnets {
			var subnet SubResource_STATUS
			err := subnet.AssignProperties_From_SubResource_STATUS(&subnetItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field Subnets")
			}
			subnetList[subnetIndex] = subnet
		}
		gateway.Subnets = subnetList
	} else {
		gateway.Subnets = nil
	}

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

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

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

	// No error
	return nil
}

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

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

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

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

	// IdleTimeoutInMinutes
	destination.IdleTimeoutInMinutes = genruntime.ClonePointerToInt(gateway.IdleTimeoutInMinutes)

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

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

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

	// PublicIpAddresses
	if gateway.PublicIpAddresses != nil {
		publicIpAddressList := make([]storage.SubResource_STATUS, len(gateway.PublicIpAddresses))
		for publicIpAddressIndex, publicIpAddressItem := range gateway.PublicIpAddresses {
			var publicIpAddress storage.SubResource_STATUS
			err := publicIpAddressItem.AssignProperties_To_SubResource_STATUS(&publicIpAddress)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field PublicIpAddresses")
			}
			publicIpAddressList[publicIpAddressIndex] = publicIpAddress
		}
		destination.PublicIpAddresses = publicIpAddressList
	} else {
		destination.PublicIpAddresses = nil
	}

	// PublicIpPrefixes
	if gateway.PublicIpPrefixes != nil {
		publicIpPrefixList := make([]storage.SubResource_STATUS, len(gateway.PublicIpPrefixes))
		for publicIpPrefixIndex, publicIpPrefixItem := range gateway.PublicIpPrefixes {
			var publicIpPrefix storage.SubResource_STATUS
			err := publicIpPrefixItem.AssignProperties_To_SubResource_STATUS(&publicIpPrefix)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field PublicIpPrefixes")
			}
			publicIpPrefixList[publicIpPrefixIndex] = publicIpPrefix
		}
		destination.PublicIpPrefixes = publicIpPrefixList
	} else {
		destination.PublicIpPrefixes = nil
	}

	// ResourceGuid
	destination.ResourceGuid = genruntime.ClonePointerToString(gateway.ResourceGuid)

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

	// Subnets
	if gateway.Subnets != nil {
		subnetList := make([]storage.SubResource_STATUS, len(gateway.Subnets))
		for subnetIndex, subnetItem := range gateway.Subnets {
			var subnet storage.SubResource_STATUS
			err := subnetItem.AssignProperties_To_SubResource_STATUS(&subnet)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field Subnets")
			}
			subnetList[subnetIndex] = subnet
		}
		destination.Subnets = subnetList
	} else {
		destination.Subnets = nil
	}

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

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

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

	// 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 NatGatewayOperatorSpec 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_NatGatewayOperatorSpec populates our NatGatewayOperatorSpec from the provided source NatGatewayOperatorSpec
func (operator *NatGatewayOperatorSpec) AssignProperties_From_NatGatewayOperatorSpec(source *storage.NatGatewayOperatorSpec) 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_NatGatewayOperatorSpec populates the provided destination NatGatewayOperatorSpec from our NatGatewayOperatorSpec
func (operator *NatGatewayOperatorSpec) AssignProperties_To_NatGatewayOperatorSpec(destination *storage.NatGatewayOperatorSpec) 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
}

// SKU of nat gateway.
type NatGatewaySku struct {
	// Name: Name of Nat Gateway SKU.
	Name *NatGatewaySku_Name `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &NatGatewaySku{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NatGatewaySku populates our NatGatewaySku from the provided source NatGatewaySku
func (gatewaySku *NatGatewaySku) AssignProperties_From_NatGatewaySku(source *storage.NatGatewaySku) error {

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

	// No error
	return nil
}

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

	// Name
	if gatewaySku.Name != nil {
		name := string(*gatewaySku.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
}

// SKU of nat gateway.
type NatGatewaySku_STATUS struct {
	// Name: Name of Nat Gateway SKU.
	Name *NatGatewaySku_Name_STATUS `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &NatGatewaySku_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_NatGatewaySku_STATUS populates our NatGatewaySku_STATUS from the provided source NatGatewaySku_STATUS
func (gatewaySku *NatGatewaySku_STATUS) AssignProperties_From_NatGatewaySku_STATUS(source *storage.NatGatewaySku_STATUS) error {

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

	// No error
	return nil
}

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

	// Name
	if gatewaySku.Name != nil {
		name := string(*gatewaySku.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
}

// +kubebuilder:validation:Enum={"Standard"}
type NatGatewaySku_Name string

const NatGatewaySku_Name_Standard = NatGatewaySku_Name("Standard")

// Mapping from string to NatGatewaySku_Name
var natGatewaySku_Name_Values = map[string]NatGatewaySku_Name{
	"standard": NatGatewaySku_Name_Standard,
}

type NatGatewaySku_Name_STATUS string

const NatGatewaySku_Name_STATUS_Standard = NatGatewaySku_Name_STATUS("Standard")

// Mapping from string to NatGatewaySku_Name_STATUS
var natGatewaySku_Name_STATUS_Values = map[string]NatGatewaySku_Name_STATUS{
	"standard": NatGatewaySku_Name_STATUS_Standard,
}

func init() {
	SchemeBuilder.Register(&NatGateway{}, &NatGatewayList{})
}
