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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/network/v1api20180501/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/network/v1api20180501/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: /dns/resource-manager/Microsoft.Network/Dns/stable/2018-05-01/dns.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/AAAA/{relativeRecordSetName}
type DnsZonesAAAARecord struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DnsZonesAAAARecord_Spec   `json:"spec,omitempty"`
	Status            DnsZonesAAAARecord_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &DnsZonesAAAARecord{}

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

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

var _ conversion.Convertible = &DnsZonesAAAARecord{}

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

	return record.AssignProperties_From_DnsZonesAAAARecord(source)
}

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

	return record.AssignProperties_To_DnsZonesAAAARecord(destination)
}

var _ configmaps.Exporter = &DnsZonesAAAARecord{}

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

var _ secrets.Exporter = &DnsZonesAAAARecord{}

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

var _ genruntime.ImportableResource = &DnsZonesAAAARecord{}

// InitializeSpec initializes the spec for this resource from the given status
func (record *DnsZonesAAAARecord) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*DnsZonesAAAARecord_STATUS); ok {
		return record.Spec.Initialize_From_DnsZonesAAAARecord_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &DnsZonesAAAARecord{}

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

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

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

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

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

// GetSupportedOperations returns the operations supported by the resource
func (record *DnsZonesAAAARecord) 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/dnsZones/AAAA"
func (record *DnsZonesAAAARecord) GetType() string {
	return "Microsoft.Network/dnsZones/AAAA"
}

// NewEmptyStatus returns a new empty (blank) status
func (record *DnsZonesAAAARecord) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &DnsZonesAAAARecord_STATUS{}
}

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

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

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

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

	record.Status = st
	return nil
}

// AssignProperties_From_DnsZonesAAAARecord populates our DnsZonesAAAARecord from the provided source DnsZonesAAAARecord
func (record *DnsZonesAAAARecord) AssignProperties_From_DnsZonesAAAARecord(source *storage.DnsZonesAAAARecord) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_DnsZonesAAAARecord populates the provided destination DnsZonesAAAARecord from our DnsZonesAAAARecord
func (record *DnsZonesAAAARecord) AssignProperties_To_DnsZonesAAAARecord(destination *storage.DnsZonesAAAARecord) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /dns/resource-manager/Microsoft.Network/Dns/stable/2018-05-01/dns.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsZones/{zoneName}/AAAA/{relativeRecordSetName}
type DnsZonesAAAARecordList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DnsZonesAAAARecord `json:"items"`
}

type DnsZonesAAAARecord_Spec struct {
	// AAAARecords: The list of AAAA records in the record set.
	AAAARecords []AaaaRecord `json:"AAAARecords,omitempty"`

	// ARecords: The list of A records in the record set.
	ARecords []ARecord `json:"ARecords,omitempty"`

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

	// CNAMERecord: The CNAME record in the  record set.
	CNAMERecord *CnameRecord `json:"CNAMERecord,omitempty"`

	// CaaRecords: The list of CAA records in the record set.
	CaaRecords []CaaRecord `json:"caaRecords,omitempty"`

	// MXRecords: The list of MX records in the record set.
	MXRecords []MxRecord `json:"MXRecords,omitempty"`

	// Metadata: The metadata attached to the record set.
	Metadata map[string]string `json:"metadata,omitempty"`

	// NSRecords: The list of NS records in the record set.
	NSRecords []NsRecord `json:"NSRecords,omitempty"`

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

	// PTRRecords: The list of PTR records in the record set.
	PTRRecords []PtrRecord `json:"PTRRecords,omitempty"`

	// SOARecord: The SOA record in the record set.
	SOARecord *SoaRecord `json:"SOARecord,omitempty"`

	// SRVRecords: The list of SRV records in the record set.
	SRVRecords []SrvRecord `json:"SRVRecords,omitempty"`

	// TTL: The TTL (time-to-live) of the records in the record set.
	TTL *int `json:"TTL,omitempty"`

	// TXTRecords: The list of TXT records in the record set.
	TXTRecords []TxtRecord `json:"TXTRecords,omitempty"`

	// TargetResource: A reference to an azure resource from where the dns resource value is taken.
	TargetResource *SubResource `json:"targetResource,omitempty"`
}

var _ genruntime.ARMTransformer = &DnsZonesAAAARecord_Spec{}

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

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

	// Set property "Properties":
	if record.AAAARecords != nil ||
		record.ARecords != nil ||
		record.CNAMERecord != nil ||
		record.CaaRecords != nil ||
		record.MXRecords != nil ||
		record.Metadata != nil ||
		record.NSRecords != nil ||
		record.PTRRecords != nil ||
		record.SOARecord != nil ||
		record.SRVRecords != nil ||
		record.TTL != nil ||
		record.TXTRecords != nil ||
		record.TargetResource != nil {
		result.Properties = &arm.RecordSetProperties{}
	}
	for _, item := range record.AAAARecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.AAAARecords = append(result.Properties.AAAARecords, *item_ARM.(*arm.AaaaRecord))
	}
	for _, item := range record.ARecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.ARecords = append(result.Properties.ARecords, *item_ARM.(*arm.ARecord))
	}
	if record.CNAMERecord != nil {
		cnameRecord_ARM, err := record.CNAMERecord.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		cnameRecord := *cnameRecord_ARM.(*arm.CnameRecord)
		result.Properties.CNAMERecord = &cnameRecord
	}
	for _, item := range record.CaaRecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.CaaRecords = append(result.Properties.CaaRecords, *item_ARM.(*arm.CaaRecord))
	}
	for _, item := range record.MXRecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.MXRecords = append(result.Properties.MXRecords, *item_ARM.(*arm.MxRecord))
	}
	if record.Metadata != nil {
		result.Properties.Metadata = make(map[string]string, len(record.Metadata))
		for key, value := range record.Metadata {
			result.Properties.Metadata[key] = value
		}
	}
	for _, item := range record.NSRecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.NSRecords = append(result.Properties.NSRecords, *item_ARM.(*arm.NsRecord))
	}
	for _, item := range record.PTRRecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.PTRRecords = append(result.Properties.PTRRecords, *item_ARM.(*arm.PtrRecord))
	}
	if record.SOARecord != nil {
		soaRecord_ARM, err := record.SOARecord.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		soaRecord := *soaRecord_ARM.(*arm.SoaRecord)
		result.Properties.SOARecord = &soaRecord
	}
	for _, item := range record.SRVRecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.SRVRecords = append(result.Properties.SRVRecords, *item_ARM.(*arm.SrvRecord))
	}
	if record.TTL != nil {
		ttl := *record.TTL
		result.Properties.TTL = &ttl
	}
	for _, item := range record.TXTRecords {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.TXTRecords = append(result.Properties.TXTRecords, *item_ARM.(*arm.TxtRecord))
	}
	if record.TargetResource != nil {
		targetResource_ARM, err := record.TargetResource.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		targetResource := *targetResource_ARM.(*arm.SubResource)
		result.Properties.TargetResource = &targetResource
	}
	return result, nil
}

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

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

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

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

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

	// Set property "CNAMERecord":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CNAMERecord != nil {
			var cnameRecord1 CnameRecord
			err := cnameRecord1.PopulateFromARM(owner, *typedInput.Properties.CNAMERecord)
			if err != nil {
				return err
			}
			cnameRecord := cnameRecord1
			record.CNAMERecord = &cnameRecord
		}
	}

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

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

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

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

	// no assignment for property "OperatorSpec"

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

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

	// Set property "SOARecord":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SOARecord != nil {
			var soaRecord1 SoaRecord
			err := soaRecord1.PopulateFromARM(owner, *typedInput.Properties.SOARecord)
			if err != nil {
				return err
			}
			soaRecord := soaRecord1
			record.SOARecord = &soaRecord
		}
	}

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

	// Set property "TTL":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TTL != nil {
			ttl := *typedInput.Properties.TTL
			record.TTL = &ttl
		}
	}

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

	// Set property "TargetResource":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TargetResource != nil {
			var targetResource1 SubResource
			err := targetResource1.PopulateFromARM(owner, *typedInput.Properties.TargetResource)
			if err != nil {
				return err
			}
			targetResource := targetResource1
			record.TargetResource = &targetResource
		}
	}

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &DnsZonesAAAARecord_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.DnsZonesAAAARecord_Spec{}
	err := record.AssignProperties_To_DnsZonesAAAARecord_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_DnsZonesAAAARecord_Spec populates our DnsZonesAAAARecord_Spec from the provided source DnsZonesAAAARecord_Spec
func (record *DnsZonesAAAARecord_Spec) AssignProperties_From_DnsZonesAAAARecord_Spec(source *storage.DnsZonesAAAARecord_Spec) error {

	// AAAARecords
	if source.AAAARecords != nil {
		aaaaRecordList := make([]AaaaRecord, len(source.AAAARecords))
		for aaaaRecordIndex, aaaaRecordItem := range source.AAAARecords {
			var aaaaRecord AaaaRecord
			err := aaaaRecord.AssignProperties_From_AaaaRecord(&aaaaRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AaaaRecord() to populate field AAAARecords")
			}
			aaaaRecordList[aaaaRecordIndex] = aaaaRecord
		}
		record.AAAARecords = aaaaRecordList
	} else {
		record.AAAARecords = nil
	}

	// ARecords
	if source.ARecords != nil {
		aRecordList := make([]ARecord, len(source.ARecords))
		for aRecordIndex, aRecordItem := range source.ARecords {
			var aRecord ARecord
			err := aRecord.AssignProperties_From_ARecord(&aRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ARecord() to populate field ARecords")
			}
			aRecordList[aRecordIndex] = aRecord
		}
		record.ARecords = aRecordList
	} else {
		record.ARecords = nil
	}

	// AzureName
	record.AzureName = source.AzureName

	// CNAMERecord
	if source.CNAMERecord != nil {
		var cnameRecord CnameRecord
		err := cnameRecord.AssignProperties_From_CnameRecord(source.CNAMERecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CnameRecord() to populate field CNAMERecord")
		}
		record.CNAMERecord = &cnameRecord
	} else {
		record.CNAMERecord = nil
	}

	// CaaRecords
	if source.CaaRecords != nil {
		caaRecordList := make([]CaaRecord, len(source.CaaRecords))
		for caaRecordIndex, caaRecordItem := range source.CaaRecords {
			var caaRecord CaaRecord
			err := caaRecord.AssignProperties_From_CaaRecord(&caaRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CaaRecord() to populate field CaaRecords")
			}
			caaRecordList[caaRecordIndex] = caaRecord
		}
		record.CaaRecords = caaRecordList
	} else {
		record.CaaRecords = nil
	}

	// MXRecords
	if source.MXRecords != nil {
		mxRecordList := make([]MxRecord, len(source.MXRecords))
		for mxRecordIndex, mxRecordItem := range source.MXRecords {
			var mxRecord MxRecord
			err := mxRecord.AssignProperties_From_MxRecord(&mxRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_MxRecord() to populate field MXRecords")
			}
			mxRecordList[mxRecordIndex] = mxRecord
		}
		record.MXRecords = mxRecordList
	} else {
		record.MXRecords = nil
	}

	// Metadata
	record.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)

	// NSRecords
	if source.NSRecords != nil {
		nsRecordList := make([]NsRecord, len(source.NSRecords))
		for nsRecordIndex, nsRecordItem := range source.NSRecords {
			var nsRecord NsRecord
			err := nsRecord.AssignProperties_From_NsRecord(&nsRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_NsRecord() to populate field NSRecords")
			}
			nsRecordList[nsRecordIndex] = nsRecord
		}
		record.NSRecords = nsRecordList
	} else {
		record.NSRecords = nil
	}

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

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

	// PTRRecords
	if source.PTRRecords != nil {
		ptrRecordList := make([]PtrRecord, len(source.PTRRecords))
		for ptrRecordIndex, ptrRecordItem := range source.PTRRecords {
			var ptrRecord PtrRecord
			err := ptrRecord.AssignProperties_From_PtrRecord(&ptrRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PtrRecord() to populate field PTRRecords")
			}
			ptrRecordList[ptrRecordIndex] = ptrRecord
		}
		record.PTRRecords = ptrRecordList
	} else {
		record.PTRRecords = nil
	}

	// SOARecord
	if source.SOARecord != nil {
		var soaRecord SoaRecord
		err := soaRecord.AssignProperties_From_SoaRecord(source.SOARecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SoaRecord() to populate field SOARecord")
		}
		record.SOARecord = &soaRecord
	} else {
		record.SOARecord = nil
	}

	// SRVRecords
	if source.SRVRecords != nil {
		srvRecordList := make([]SrvRecord, len(source.SRVRecords))
		for srvRecordIndex, srvRecordItem := range source.SRVRecords {
			var srvRecord SrvRecord
			err := srvRecord.AssignProperties_From_SrvRecord(&srvRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SrvRecord() to populate field SRVRecords")
			}
			srvRecordList[srvRecordIndex] = srvRecord
		}
		record.SRVRecords = srvRecordList
	} else {
		record.SRVRecords = nil
	}

	// TTL
	record.TTL = genruntime.ClonePointerToInt(source.TTL)

	// TXTRecords
	if source.TXTRecords != nil {
		txtRecordList := make([]TxtRecord, len(source.TXTRecords))
		for txtRecordIndex, txtRecordItem := range source.TXTRecords {
			var txtRecord TxtRecord
			err := txtRecord.AssignProperties_From_TxtRecord(&txtRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_TxtRecord() to populate field TXTRecords")
			}
			txtRecordList[txtRecordIndex] = txtRecord
		}
		record.TXTRecords = txtRecordList
	} else {
		record.TXTRecords = nil
	}

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

	// No error
	return nil
}

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

	// AAAARecords
	if record.AAAARecords != nil {
		aaaaRecordList := make([]storage.AaaaRecord, len(record.AAAARecords))
		for aaaaRecordIndex, aaaaRecordItem := range record.AAAARecords {
			var aaaaRecord storage.AaaaRecord
			err := aaaaRecordItem.AssignProperties_To_AaaaRecord(&aaaaRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AaaaRecord() to populate field AAAARecords")
			}
			aaaaRecordList[aaaaRecordIndex] = aaaaRecord
		}
		destination.AAAARecords = aaaaRecordList
	} else {
		destination.AAAARecords = nil
	}

	// ARecords
	if record.ARecords != nil {
		aRecordList := make([]storage.ARecord, len(record.ARecords))
		for aRecordIndex, aRecordItem := range record.ARecords {
			var aRecord storage.ARecord
			err := aRecordItem.AssignProperties_To_ARecord(&aRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ARecord() to populate field ARecords")
			}
			aRecordList[aRecordIndex] = aRecord
		}
		destination.ARecords = aRecordList
	} else {
		destination.ARecords = nil
	}

	// AzureName
	destination.AzureName = record.AzureName

	// CNAMERecord
	if record.CNAMERecord != nil {
		var cnameRecord storage.CnameRecord
		err := record.CNAMERecord.AssignProperties_To_CnameRecord(&cnameRecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CnameRecord() to populate field CNAMERecord")
		}
		destination.CNAMERecord = &cnameRecord
	} else {
		destination.CNAMERecord = nil
	}

	// CaaRecords
	if record.CaaRecords != nil {
		caaRecordList := make([]storage.CaaRecord, len(record.CaaRecords))
		for caaRecordIndex, caaRecordItem := range record.CaaRecords {
			var caaRecord storage.CaaRecord
			err := caaRecordItem.AssignProperties_To_CaaRecord(&caaRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CaaRecord() to populate field CaaRecords")
			}
			caaRecordList[caaRecordIndex] = caaRecord
		}
		destination.CaaRecords = caaRecordList
	} else {
		destination.CaaRecords = nil
	}

	// MXRecords
	if record.MXRecords != nil {
		mxRecordList := make([]storage.MxRecord, len(record.MXRecords))
		for mxRecordIndex, mxRecordItem := range record.MXRecords {
			var mxRecord storage.MxRecord
			err := mxRecordItem.AssignProperties_To_MxRecord(&mxRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_MxRecord() to populate field MXRecords")
			}
			mxRecordList[mxRecordIndex] = mxRecord
		}
		destination.MXRecords = mxRecordList
	} else {
		destination.MXRecords = nil
	}

	// Metadata
	destination.Metadata = genruntime.CloneMapOfStringToString(record.Metadata)

	// NSRecords
	if record.NSRecords != nil {
		nsRecordList := make([]storage.NsRecord, len(record.NSRecords))
		for nsRecordIndex, nsRecordItem := range record.NSRecords {
			var nsRecord storage.NsRecord
			err := nsRecordItem.AssignProperties_To_NsRecord(&nsRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_NsRecord() to populate field NSRecords")
			}
			nsRecordList[nsRecordIndex] = nsRecord
		}
		destination.NSRecords = nsRecordList
	} else {
		destination.NSRecords = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = record.OriginalVersion()

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

	// PTRRecords
	if record.PTRRecords != nil {
		ptrRecordList := make([]storage.PtrRecord, len(record.PTRRecords))
		for ptrRecordIndex, ptrRecordItem := range record.PTRRecords {
			var ptrRecord storage.PtrRecord
			err := ptrRecordItem.AssignProperties_To_PtrRecord(&ptrRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PtrRecord() to populate field PTRRecords")
			}
			ptrRecordList[ptrRecordIndex] = ptrRecord
		}
		destination.PTRRecords = ptrRecordList
	} else {
		destination.PTRRecords = nil
	}

	// SOARecord
	if record.SOARecord != nil {
		var soaRecord storage.SoaRecord
		err := record.SOARecord.AssignProperties_To_SoaRecord(&soaRecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SoaRecord() to populate field SOARecord")
		}
		destination.SOARecord = &soaRecord
	} else {
		destination.SOARecord = nil
	}

	// SRVRecords
	if record.SRVRecords != nil {
		srvRecordList := make([]storage.SrvRecord, len(record.SRVRecords))
		for srvRecordIndex, srvRecordItem := range record.SRVRecords {
			var srvRecord storage.SrvRecord
			err := srvRecordItem.AssignProperties_To_SrvRecord(&srvRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SrvRecord() to populate field SRVRecords")
			}
			srvRecordList[srvRecordIndex] = srvRecord
		}
		destination.SRVRecords = srvRecordList
	} else {
		destination.SRVRecords = nil
	}

	// TTL
	destination.TTL = genruntime.ClonePointerToInt(record.TTL)

	// TXTRecords
	if record.TXTRecords != nil {
		txtRecordList := make([]storage.TxtRecord, len(record.TXTRecords))
		for txtRecordIndex, txtRecordItem := range record.TXTRecords {
			var txtRecord storage.TxtRecord
			err := txtRecordItem.AssignProperties_To_TxtRecord(&txtRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_TxtRecord() to populate field TXTRecords")
			}
			txtRecordList[txtRecordIndex] = txtRecord
		}
		destination.TXTRecords = txtRecordList
	} else {
		destination.TXTRecords = nil
	}

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

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

	// No error
	return nil
}

// Initialize_From_DnsZonesAAAARecord_STATUS populates our DnsZonesAAAARecord_Spec from the provided source DnsZonesAAAARecord_STATUS
func (record *DnsZonesAAAARecord_Spec) Initialize_From_DnsZonesAAAARecord_STATUS(source *DnsZonesAAAARecord_STATUS) error {

	// AAAARecords
	if source.AAAARecords != nil {
		aaaaRecordList := make([]AaaaRecord, len(source.AAAARecords))
		for aaaaRecordIndex, aaaaRecordItem := range source.AAAARecords {
			var aaaaRecord AaaaRecord
			err := aaaaRecord.Initialize_From_AaaaRecord_STATUS(&aaaaRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_AaaaRecord_STATUS() to populate field AAAARecords")
			}
			aaaaRecordList[aaaaRecordIndex] = aaaaRecord
		}
		record.AAAARecords = aaaaRecordList
	} else {
		record.AAAARecords = nil
	}

	// ARecords
	if source.ARecords != nil {
		aRecordList := make([]ARecord, len(source.ARecords))
		for aRecordIndex, aRecordItem := range source.ARecords {
			var aRecord ARecord
			err := aRecord.Initialize_From_ARecord_STATUS(&aRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ARecord_STATUS() to populate field ARecords")
			}
			aRecordList[aRecordIndex] = aRecord
		}
		record.ARecords = aRecordList
	} else {
		record.ARecords = nil
	}

	// CNAMERecord
	if source.CNAMERecord != nil {
		var cnameRecord CnameRecord
		err := cnameRecord.Initialize_From_CnameRecord_STATUS(source.CNAMERecord)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_CnameRecord_STATUS() to populate field CNAMERecord")
		}
		record.CNAMERecord = &cnameRecord
	} else {
		record.CNAMERecord = nil
	}

	// CaaRecords
	if source.CaaRecords != nil {
		caaRecordList := make([]CaaRecord, len(source.CaaRecords))
		for caaRecordIndex, caaRecordItem := range source.CaaRecords {
			var caaRecord CaaRecord
			err := caaRecord.Initialize_From_CaaRecord_STATUS(&caaRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_CaaRecord_STATUS() to populate field CaaRecords")
			}
			caaRecordList[caaRecordIndex] = caaRecord
		}
		record.CaaRecords = caaRecordList
	} else {
		record.CaaRecords = nil
	}

	// MXRecords
	if source.MXRecords != nil {
		mxRecordList := make([]MxRecord, len(source.MXRecords))
		for mxRecordIndex, mxRecordItem := range source.MXRecords {
			var mxRecord MxRecord
			err := mxRecord.Initialize_From_MxRecord_STATUS(&mxRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_MxRecord_STATUS() to populate field MXRecords")
			}
			mxRecordList[mxRecordIndex] = mxRecord
		}
		record.MXRecords = mxRecordList
	} else {
		record.MXRecords = nil
	}

	// Metadata
	record.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)

	// NSRecords
	if source.NSRecords != nil {
		nsRecordList := make([]NsRecord, len(source.NSRecords))
		for nsRecordIndex, nsRecordItem := range source.NSRecords {
			var nsRecord NsRecord
			err := nsRecord.Initialize_From_NsRecord_STATUS(&nsRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_NsRecord_STATUS() to populate field NSRecords")
			}
			nsRecordList[nsRecordIndex] = nsRecord
		}
		record.NSRecords = nsRecordList
	} else {
		record.NSRecords = nil
	}

	// PTRRecords
	if source.PTRRecords != nil {
		ptrRecordList := make([]PtrRecord, len(source.PTRRecords))
		for ptrRecordIndex, ptrRecordItem := range source.PTRRecords {
			var ptrRecord PtrRecord
			err := ptrRecord.Initialize_From_PtrRecord_STATUS(&ptrRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_PtrRecord_STATUS() to populate field PTRRecords")
			}
			ptrRecordList[ptrRecordIndex] = ptrRecord
		}
		record.PTRRecords = ptrRecordList
	} else {
		record.PTRRecords = nil
	}

	// SOARecord
	if source.SOARecord != nil {
		var soaRecord SoaRecord
		err := soaRecord.Initialize_From_SoaRecord_STATUS(source.SOARecord)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SoaRecord_STATUS() to populate field SOARecord")
		}
		record.SOARecord = &soaRecord
	} else {
		record.SOARecord = nil
	}

	// SRVRecords
	if source.SRVRecords != nil {
		srvRecordList := make([]SrvRecord, len(source.SRVRecords))
		for srvRecordIndex, srvRecordItem := range source.SRVRecords {
			var srvRecord SrvRecord
			err := srvRecord.Initialize_From_SrvRecord_STATUS(&srvRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_SrvRecord_STATUS() to populate field SRVRecords")
			}
			srvRecordList[srvRecordIndex] = srvRecord
		}
		record.SRVRecords = srvRecordList
	} else {
		record.SRVRecords = nil
	}

	// TTL
	record.TTL = genruntime.ClonePointerToInt(source.TTL)

	// TXTRecords
	if source.TXTRecords != nil {
		txtRecordList := make([]TxtRecord, len(source.TXTRecords))
		for txtRecordIndex, txtRecordItem := range source.TXTRecords {
			var txtRecord TxtRecord
			err := txtRecord.Initialize_From_TxtRecord_STATUS(&txtRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_TxtRecord_STATUS() to populate field TXTRecords")
			}
			txtRecordList[txtRecordIndex] = txtRecord
		}
		record.TXTRecords = txtRecordList
	} else {
		record.TXTRecords = nil
	}

	// TargetResource
	if source.TargetResource != nil {
		var targetResource SubResource
		err := targetResource.Initialize_From_SubResource_STATUS(source.TargetResource)
		if err != nil {
			return eris.Wrap(err, "calling Initialize_From_SubResource_STATUS() to populate field TargetResource")
		}
		record.TargetResource = &targetResource
	} else {
		record.TargetResource = nil
	}

	// No error
	return nil
}

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

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

type DnsZonesAAAARecord_STATUS struct {
	// AAAARecords: The list of AAAA records in the record set.
	AAAARecords []AaaaRecord_STATUS `json:"AAAARecords,omitempty"`

	// ARecords: The list of A records in the record set.
	ARecords []ARecord_STATUS `json:"ARecords,omitempty"`

	// CNAMERecord: The CNAME record in the  record set.
	CNAMERecord *CnameRecord_STATUS `json:"CNAMERecord,omitempty"`

	// CaaRecords: The list of CAA records in the record set.
	CaaRecords []CaaRecord_STATUS `json:"caaRecords,omitempty"`

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

	// Etag: The etag of the record set.
	Etag *string `json:"etag,omitempty"`

	// Fqdn: Fully qualified domain name of the record set.
	Fqdn *string `json:"fqdn,omitempty"`

	// Id: The ID of the record set.
	Id *string `json:"id,omitempty"`

	// MXRecords: The list of MX records in the record set.
	MXRecords []MxRecord_STATUS `json:"MXRecords,omitempty"`

	// Metadata: The metadata attached to the record set.
	Metadata map[string]string `json:"metadata,omitempty"`

	// NSRecords: The list of NS records in the record set.
	NSRecords []NsRecord_STATUS `json:"NSRecords,omitempty"`

	// Name: The name of the record set.
	Name *string `json:"name,omitempty"`

	// PTRRecords: The list of PTR records in the record set.
	PTRRecords []PtrRecord_STATUS `json:"PTRRecords,omitempty"`

	// ProvisioningState: provisioning State of the record set.
	ProvisioningState *string `json:"provisioningState,omitempty"`

	// SOARecord: The SOA record in the record set.
	SOARecord *SoaRecord_STATUS `json:"SOARecord,omitempty"`

	// SRVRecords: The list of SRV records in the record set.
	SRVRecords []SrvRecord_STATUS `json:"SRVRecords,omitempty"`

	// TTL: The TTL (time-to-live) of the records in the record set.
	TTL *int `json:"TTL,omitempty"`

	// TXTRecords: The list of TXT records in the record set.
	TXTRecords []TxtRecord_STATUS `json:"TXTRecords,omitempty"`

	// TargetResource: A reference to an azure resource from where the dns resource value is taken.
	TargetResource *SubResource_STATUS `json:"targetResource,omitempty"`

	// Type: The type of the record set.
	Type *string `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &DnsZonesAAAARecord_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.DnsZonesAAAARecord_STATUS{}
	err := record.AssignProperties_To_DnsZonesAAAARecord_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 = &DnsZonesAAAARecord_STATUS{}

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

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

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

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

	// Set property "CNAMERecord":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.CNAMERecord != nil {
			var cnameRecord1 CnameRecord_STATUS
			err := cnameRecord1.PopulateFromARM(owner, *typedInput.Properties.CNAMERecord)
			if err != nil {
				return err
			}
			cnameRecord := cnameRecord1
			record.CNAMERecord = &cnameRecord
		}
	}

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

	// no assignment for property "Conditions"

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

	// Set property "Fqdn":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Fqdn != nil {
			fqdn := *typedInput.Properties.Fqdn
			record.Fqdn = &fqdn
		}
	}

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

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

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

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

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

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

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

	// Set property "SOARecord":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.SOARecord != nil {
			var soaRecord1 SoaRecord_STATUS
			err := soaRecord1.PopulateFromARM(owner, *typedInput.Properties.SOARecord)
			if err != nil {
				return err
			}
			soaRecord := soaRecord1
			record.SOARecord = &soaRecord
		}
	}

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

	// Set property "TTL":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TTL != nil {
			ttl := *typedInput.Properties.TTL
			record.TTL = &ttl
		}
	}

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

	// Set property "TargetResource":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.TargetResource != nil {
			var targetResource1 SubResource_STATUS
			err := targetResource1.PopulateFromARM(owner, *typedInput.Properties.TargetResource)
			if err != nil {
				return err
			}
			targetResource := targetResource1
			record.TargetResource = &targetResource
		}
	}

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

	// No error
	return nil
}

// AssignProperties_From_DnsZonesAAAARecord_STATUS populates our DnsZonesAAAARecord_STATUS from the provided source DnsZonesAAAARecord_STATUS
func (record *DnsZonesAAAARecord_STATUS) AssignProperties_From_DnsZonesAAAARecord_STATUS(source *storage.DnsZonesAAAARecord_STATUS) error {

	// AAAARecords
	if source.AAAARecords != nil {
		aaaaRecordList := make([]AaaaRecord_STATUS, len(source.AAAARecords))
		for aaaaRecordIndex, aaaaRecordItem := range source.AAAARecords {
			var aaaaRecord AaaaRecord_STATUS
			err := aaaaRecord.AssignProperties_From_AaaaRecord_STATUS(&aaaaRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AaaaRecord_STATUS() to populate field AAAARecords")
			}
			aaaaRecordList[aaaaRecordIndex] = aaaaRecord
		}
		record.AAAARecords = aaaaRecordList
	} else {
		record.AAAARecords = nil
	}

	// ARecords
	if source.ARecords != nil {
		aRecordList := make([]ARecord_STATUS, len(source.ARecords))
		for aRecordIndex, aRecordItem := range source.ARecords {
			var aRecord ARecord_STATUS
			err := aRecord.AssignProperties_From_ARecord_STATUS(&aRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ARecord_STATUS() to populate field ARecords")
			}
			aRecordList[aRecordIndex] = aRecord
		}
		record.ARecords = aRecordList
	} else {
		record.ARecords = nil
	}

	// CNAMERecord
	if source.CNAMERecord != nil {
		var cnameRecord CnameRecord_STATUS
		err := cnameRecord.AssignProperties_From_CnameRecord_STATUS(source.CNAMERecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_CnameRecord_STATUS() to populate field CNAMERecord")
		}
		record.CNAMERecord = &cnameRecord
	} else {
		record.CNAMERecord = nil
	}

	// CaaRecords
	if source.CaaRecords != nil {
		caaRecordList := make([]CaaRecord_STATUS, len(source.CaaRecords))
		for caaRecordIndex, caaRecordItem := range source.CaaRecords {
			var caaRecord CaaRecord_STATUS
			err := caaRecord.AssignProperties_From_CaaRecord_STATUS(&caaRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_CaaRecord_STATUS() to populate field CaaRecords")
			}
			caaRecordList[caaRecordIndex] = caaRecord
		}
		record.CaaRecords = caaRecordList
	} else {
		record.CaaRecords = nil
	}

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

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

	// Fqdn
	record.Fqdn = genruntime.ClonePointerToString(source.Fqdn)

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

	// MXRecords
	if source.MXRecords != nil {
		mxRecordList := make([]MxRecord_STATUS, len(source.MXRecords))
		for mxRecordIndex, mxRecordItem := range source.MXRecords {
			var mxRecord MxRecord_STATUS
			err := mxRecord.AssignProperties_From_MxRecord_STATUS(&mxRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_MxRecord_STATUS() to populate field MXRecords")
			}
			mxRecordList[mxRecordIndex] = mxRecord
		}
		record.MXRecords = mxRecordList
	} else {
		record.MXRecords = nil
	}

	// Metadata
	record.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)

	// NSRecords
	if source.NSRecords != nil {
		nsRecordList := make([]NsRecord_STATUS, len(source.NSRecords))
		for nsRecordIndex, nsRecordItem := range source.NSRecords {
			var nsRecord NsRecord_STATUS
			err := nsRecord.AssignProperties_From_NsRecord_STATUS(&nsRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_NsRecord_STATUS() to populate field NSRecords")
			}
			nsRecordList[nsRecordIndex] = nsRecord
		}
		record.NSRecords = nsRecordList
	} else {
		record.NSRecords = nil
	}

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

	// PTRRecords
	if source.PTRRecords != nil {
		ptrRecordList := make([]PtrRecord_STATUS, len(source.PTRRecords))
		for ptrRecordIndex, ptrRecordItem := range source.PTRRecords {
			var ptrRecord PtrRecord_STATUS
			err := ptrRecord.AssignProperties_From_PtrRecord_STATUS(&ptrRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_PtrRecord_STATUS() to populate field PTRRecords")
			}
			ptrRecordList[ptrRecordIndex] = ptrRecord
		}
		record.PTRRecords = ptrRecordList
	} else {
		record.PTRRecords = nil
	}

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

	// SOARecord
	if source.SOARecord != nil {
		var soaRecord SoaRecord_STATUS
		err := soaRecord.AssignProperties_From_SoaRecord_STATUS(source.SOARecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SoaRecord_STATUS() to populate field SOARecord")
		}
		record.SOARecord = &soaRecord
	} else {
		record.SOARecord = nil
	}

	// SRVRecords
	if source.SRVRecords != nil {
		srvRecordList := make([]SrvRecord_STATUS, len(source.SRVRecords))
		for srvRecordIndex, srvRecordItem := range source.SRVRecords {
			var srvRecord SrvRecord_STATUS
			err := srvRecord.AssignProperties_From_SrvRecord_STATUS(&srvRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SrvRecord_STATUS() to populate field SRVRecords")
			}
			srvRecordList[srvRecordIndex] = srvRecord
		}
		record.SRVRecords = srvRecordList
	} else {
		record.SRVRecords = nil
	}

	// TTL
	record.TTL = genruntime.ClonePointerToInt(source.TTL)

	// TXTRecords
	if source.TXTRecords != nil {
		txtRecordList := make([]TxtRecord_STATUS, len(source.TXTRecords))
		for txtRecordIndex, txtRecordItem := range source.TXTRecords {
			var txtRecord TxtRecord_STATUS
			err := txtRecord.AssignProperties_From_TxtRecord_STATUS(&txtRecordItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_TxtRecord_STATUS() to populate field TXTRecords")
			}
			txtRecordList[txtRecordIndex] = txtRecord
		}
		record.TXTRecords = txtRecordList
	} else {
		record.TXTRecords = nil
	}

	// TargetResource
	if source.TargetResource != nil {
		var targetResource SubResource_STATUS
		err := targetResource.AssignProperties_From_SubResource_STATUS(source.TargetResource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field TargetResource")
		}
		record.TargetResource = &targetResource
	} else {
		record.TargetResource = nil
	}

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

	// No error
	return nil
}

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

	// AAAARecords
	if record.AAAARecords != nil {
		aaaaRecordList := make([]storage.AaaaRecord_STATUS, len(record.AAAARecords))
		for aaaaRecordIndex, aaaaRecordItem := range record.AAAARecords {
			var aaaaRecord storage.AaaaRecord_STATUS
			err := aaaaRecordItem.AssignProperties_To_AaaaRecord_STATUS(&aaaaRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AaaaRecord_STATUS() to populate field AAAARecords")
			}
			aaaaRecordList[aaaaRecordIndex] = aaaaRecord
		}
		destination.AAAARecords = aaaaRecordList
	} else {
		destination.AAAARecords = nil
	}

	// ARecords
	if record.ARecords != nil {
		aRecordList := make([]storage.ARecord_STATUS, len(record.ARecords))
		for aRecordIndex, aRecordItem := range record.ARecords {
			var aRecord storage.ARecord_STATUS
			err := aRecordItem.AssignProperties_To_ARecord_STATUS(&aRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ARecord_STATUS() to populate field ARecords")
			}
			aRecordList[aRecordIndex] = aRecord
		}
		destination.ARecords = aRecordList
	} else {
		destination.ARecords = nil
	}

	// CNAMERecord
	if record.CNAMERecord != nil {
		var cnameRecord storage.CnameRecord_STATUS
		err := record.CNAMERecord.AssignProperties_To_CnameRecord_STATUS(&cnameRecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_CnameRecord_STATUS() to populate field CNAMERecord")
		}
		destination.CNAMERecord = &cnameRecord
	} else {
		destination.CNAMERecord = nil
	}

	// CaaRecords
	if record.CaaRecords != nil {
		caaRecordList := make([]storage.CaaRecord_STATUS, len(record.CaaRecords))
		for caaRecordIndex, caaRecordItem := range record.CaaRecords {
			var caaRecord storage.CaaRecord_STATUS
			err := caaRecordItem.AssignProperties_To_CaaRecord_STATUS(&caaRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_CaaRecord_STATUS() to populate field CaaRecords")
			}
			caaRecordList[caaRecordIndex] = caaRecord
		}
		destination.CaaRecords = caaRecordList
	} else {
		destination.CaaRecords = nil
	}

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

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

	// Fqdn
	destination.Fqdn = genruntime.ClonePointerToString(record.Fqdn)

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

	// MXRecords
	if record.MXRecords != nil {
		mxRecordList := make([]storage.MxRecord_STATUS, len(record.MXRecords))
		for mxRecordIndex, mxRecordItem := range record.MXRecords {
			var mxRecord storage.MxRecord_STATUS
			err := mxRecordItem.AssignProperties_To_MxRecord_STATUS(&mxRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_MxRecord_STATUS() to populate field MXRecords")
			}
			mxRecordList[mxRecordIndex] = mxRecord
		}
		destination.MXRecords = mxRecordList
	} else {
		destination.MXRecords = nil
	}

	// Metadata
	destination.Metadata = genruntime.CloneMapOfStringToString(record.Metadata)

	// NSRecords
	if record.NSRecords != nil {
		nsRecordList := make([]storage.NsRecord_STATUS, len(record.NSRecords))
		for nsRecordIndex, nsRecordItem := range record.NSRecords {
			var nsRecord storage.NsRecord_STATUS
			err := nsRecordItem.AssignProperties_To_NsRecord_STATUS(&nsRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_NsRecord_STATUS() to populate field NSRecords")
			}
			nsRecordList[nsRecordIndex] = nsRecord
		}
		destination.NSRecords = nsRecordList
	} else {
		destination.NSRecords = nil
	}

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

	// PTRRecords
	if record.PTRRecords != nil {
		ptrRecordList := make([]storage.PtrRecord_STATUS, len(record.PTRRecords))
		for ptrRecordIndex, ptrRecordItem := range record.PTRRecords {
			var ptrRecord storage.PtrRecord_STATUS
			err := ptrRecordItem.AssignProperties_To_PtrRecord_STATUS(&ptrRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_PtrRecord_STATUS() to populate field PTRRecords")
			}
			ptrRecordList[ptrRecordIndex] = ptrRecord
		}
		destination.PTRRecords = ptrRecordList
	} else {
		destination.PTRRecords = nil
	}

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

	// SOARecord
	if record.SOARecord != nil {
		var soaRecord storage.SoaRecord_STATUS
		err := record.SOARecord.AssignProperties_To_SoaRecord_STATUS(&soaRecord)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SoaRecord_STATUS() to populate field SOARecord")
		}
		destination.SOARecord = &soaRecord
	} else {
		destination.SOARecord = nil
	}

	// SRVRecords
	if record.SRVRecords != nil {
		srvRecordList := make([]storage.SrvRecord_STATUS, len(record.SRVRecords))
		for srvRecordIndex, srvRecordItem := range record.SRVRecords {
			var srvRecord storage.SrvRecord_STATUS
			err := srvRecordItem.AssignProperties_To_SrvRecord_STATUS(&srvRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SrvRecord_STATUS() to populate field SRVRecords")
			}
			srvRecordList[srvRecordIndex] = srvRecord
		}
		destination.SRVRecords = srvRecordList
	} else {
		destination.SRVRecords = nil
	}

	// TTL
	destination.TTL = genruntime.ClonePointerToInt(record.TTL)

	// TXTRecords
	if record.TXTRecords != nil {
		txtRecordList := make([]storage.TxtRecord_STATUS, len(record.TXTRecords))
		for txtRecordIndex, txtRecordItem := range record.TXTRecords {
			var txtRecord storage.TxtRecord_STATUS
			err := txtRecordItem.AssignProperties_To_TxtRecord_STATUS(&txtRecord)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_TxtRecord_STATUS() to populate field TXTRecords")
			}
			txtRecordList[txtRecordIndex] = txtRecord
		}
		destination.TXTRecords = txtRecordList
	} else {
		destination.TXTRecords = nil
	}

	// TargetResource
	if record.TargetResource != nil {
		var targetResource storage.SubResource_STATUS
		err := record.TargetResource.AssignProperties_To_SubResource_STATUS(&targetResource)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SubResource_STATUS() to populate field TargetResource")
		}
		destination.TargetResource = &targetResource
	} else {
		destination.TargetResource = nil
	}

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

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

	// No error
	return nil
}

// An AAAA record.
type AaaaRecord struct {
	// Ipv6Address: The IPv6 address of this AAAA record.
	Ipv6Address *string `json:"ipv6Address,omitempty"`
}

var _ genruntime.ARMTransformer = &AaaaRecord{}

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

	// Set property "Ipv6Address":
	if record.Ipv6Address != nil {
		ipv6Address := *record.Ipv6Address
		result.Ipv6Address = &ipv6Address
	}
	return result, nil
}

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

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

	// Set property "Ipv6Address":
	if typedInput.Ipv6Address != nil {
		ipv6Address := *typedInput.Ipv6Address
		record.Ipv6Address = &ipv6Address
	}

	// No error
	return nil
}

// AssignProperties_From_AaaaRecord populates our AaaaRecord from the provided source AaaaRecord
func (record *AaaaRecord) AssignProperties_From_AaaaRecord(source *storage.AaaaRecord) error {

	// Ipv6Address
	record.Ipv6Address = genruntime.ClonePointerToString(source.Ipv6Address)

	// No error
	return nil
}

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

	// Ipv6Address
	destination.Ipv6Address = genruntime.ClonePointerToString(record.Ipv6Address)

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

	// No error
	return nil
}

// Initialize_From_AaaaRecord_STATUS populates our AaaaRecord from the provided source AaaaRecord_STATUS
func (record *AaaaRecord) Initialize_From_AaaaRecord_STATUS(source *AaaaRecord_STATUS) error {

	// Ipv6Address
	record.Ipv6Address = genruntime.ClonePointerToString(source.Ipv6Address)

	// No error
	return nil
}

// An AAAA record.
type AaaaRecord_STATUS struct {
	// Ipv6Address: The IPv6 address of this AAAA record.
	Ipv6Address *string `json:"ipv6Address,omitempty"`
}

var _ genruntime.FromARMConverter = &AaaaRecord_STATUS{}

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

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

	// Set property "Ipv6Address":
	if typedInput.Ipv6Address != nil {
		ipv6Address := *typedInput.Ipv6Address
		record.Ipv6Address = &ipv6Address
	}

	// No error
	return nil
}

// AssignProperties_From_AaaaRecord_STATUS populates our AaaaRecord_STATUS from the provided source AaaaRecord_STATUS
func (record *AaaaRecord_STATUS) AssignProperties_From_AaaaRecord_STATUS(source *storage.AaaaRecord_STATUS) error {

	// Ipv6Address
	record.Ipv6Address = genruntime.ClonePointerToString(source.Ipv6Address)

	// No error
	return nil
}

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

	// Ipv6Address
	destination.Ipv6Address = genruntime.ClonePointerToString(record.Ipv6Address)

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

	// No error
	return nil
}

// An A record.
type ARecord struct {
	// Ipv4Address: The IPv4 address of this A record.
	Ipv4Address *string `json:"ipv4Address,omitempty"`
}

var _ genruntime.ARMTransformer = &ARecord{}

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

	// Set property "Ipv4Address":
	if record.Ipv4Address != nil {
		ipv4Address := *record.Ipv4Address
		result.Ipv4Address = &ipv4Address
	}
	return result, nil
}

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

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

	// Set property "Ipv4Address":
	if typedInput.Ipv4Address != nil {
		ipv4Address := *typedInput.Ipv4Address
		record.Ipv4Address = &ipv4Address
	}

	// No error
	return nil
}

// AssignProperties_From_ARecord populates our ARecord from the provided source ARecord
func (record *ARecord) AssignProperties_From_ARecord(source *storage.ARecord) error {

	// Ipv4Address
	record.Ipv4Address = genruntime.ClonePointerToString(source.Ipv4Address)

	// No error
	return nil
}

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

	// Ipv4Address
	destination.Ipv4Address = genruntime.ClonePointerToString(record.Ipv4Address)

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

	// No error
	return nil
}

// Initialize_From_ARecord_STATUS populates our ARecord from the provided source ARecord_STATUS
func (record *ARecord) Initialize_From_ARecord_STATUS(source *ARecord_STATUS) error {

	// Ipv4Address
	record.Ipv4Address = genruntime.ClonePointerToString(source.Ipv4Address)

	// No error
	return nil
}

// An A record.
type ARecord_STATUS struct {
	// Ipv4Address: The IPv4 address of this A record.
	Ipv4Address *string `json:"ipv4Address,omitempty"`
}

var _ genruntime.FromARMConverter = &ARecord_STATUS{}

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

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

	// Set property "Ipv4Address":
	if typedInput.Ipv4Address != nil {
		ipv4Address := *typedInput.Ipv4Address
		record.Ipv4Address = &ipv4Address
	}

	// No error
	return nil
}

// AssignProperties_From_ARecord_STATUS populates our ARecord_STATUS from the provided source ARecord_STATUS
func (record *ARecord_STATUS) AssignProperties_From_ARecord_STATUS(source *storage.ARecord_STATUS) error {

	// Ipv4Address
	record.Ipv4Address = genruntime.ClonePointerToString(source.Ipv4Address)

	// No error
	return nil
}

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

	// Ipv4Address
	destination.Ipv4Address = genruntime.ClonePointerToString(record.Ipv4Address)

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

	// No error
	return nil
}

// A CAA record.
type CaaRecord struct {
	// Flags: The flags for this CAA record as an integer between 0 and 255.
	Flags *int `json:"flags,omitempty"`

	// Tag: The tag for this CAA record.
	Tag *string `json:"tag,omitempty"`

	// Value: The value for this CAA record.
	Value *string `json:"value,omitempty"`
}

var _ genruntime.ARMTransformer = &CaaRecord{}

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

	// Set property "Flags":
	if record.Flags != nil {
		flags := *record.Flags
		result.Flags = &flags
	}

	// Set property "Tag":
	if record.Tag != nil {
		tag := *record.Tag
		result.Tag = &tag
	}

	// Set property "Value":
	if record.Value != nil {
		value := *record.Value
		result.Value = &value
	}
	return result, nil
}

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

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

	// Set property "Flags":
	if typedInput.Flags != nil {
		flags := *typedInput.Flags
		record.Flags = &flags
	}

	// Set property "Tag":
	if typedInput.Tag != nil {
		tag := *typedInput.Tag
		record.Tag = &tag
	}

	// Set property "Value":
	if typedInput.Value != nil {
		value := *typedInput.Value
		record.Value = &value
	}

	// No error
	return nil
}

// AssignProperties_From_CaaRecord populates our CaaRecord from the provided source CaaRecord
func (record *CaaRecord) AssignProperties_From_CaaRecord(source *storage.CaaRecord) error {

	// Flags
	record.Flags = genruntime.ClonePointerToInt(source.Flags)

	// Tag
	record.Tag = genruntime.ClonePointerToString(source.Tag)

	// Value
	record.Value = genruntime.ClonePointerToString(source.Value)

	// No error
	return nil
}

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

	// Flags
	destination.Flags = genruntime.ClonePointerToInt(record.Flags)

	// Tag
	destination.Tag = genruntime.ClonePointerToString(record.Tag)

	// Value
	destination.Value = genruntime.ClonePointerToString(record.Value)

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

	// No error
	return nil
}

// Initialize_From_CaaRecord_STATUS populates our CaaRecord from the provided source CaaRecord_STATUS
func (record *CaaRecord) Initialize_From_CaaRecord_STATUS(source *CaaRecord_STATUS) error {

	// Flags
	record.Flags = genruntime.ClonePointerToInt(source.Flags)

	// Tag
	record.Tag = genruntime.ClonePointerToString(source.Tag)

	// Value
	record.Value = genruntime.ClonePointerToString(source.Value)

	// No error
	return nil
}

// A CAA record.
type CaaRecord_STATUS struct {
	// Flags: The flags for this CAA record as an integer between 0 and 255.
	Flags *int `json:"flags,omitempty"`

	// Tag: The tag for this CAA record.
	Tag *string `json:"tag,omitempty"`

	// Value: The value for this CAA record.
	Value *string `json:"value,omitempty"`
}

var _ genruntime.FromARMConverter = &CaaRecord_STATUS{}

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

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

	// Set property "Flags":
	if typedInput.Flags != nil {
		flags := *typedInput.Flags
		record.Flags = &flags
	}

	// Set property "Tag":
	if typedInput.Tag != nil {
		tag := *typedInput.Tag
		record.Tag = &tag
	}

	// Set property "Value":
	if typedInput.Value != nil {
		value := *typedInput.Value
		record.Value = &value
	}

	// No error
	return nil
}

// AssignProperties_From_CaaRecord_STATUS populates our CaaRecord_STATUS from the provided source CaaRecord_STATUS
func (record *CaaRecord_STATUS) AssignProperties_From_CaaRecord_STATUS(source *storage.CaaRecord_STATUS) error {

	// Flags
	record.Flags = genruntime.ClonePointerToInt(source.Flags)

	// Tag
	record.Tag = genruntime.ClonePointerToString(source.Tag)

	// Value
	record.Value = genruntime.ClonePointerToString(source.Value)

	// No error
	return nil
}

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

	// Flags
	destination.Flags = genruntime.ClonePointerToInt(record.Flags)

	// Tag
	destination.Tag = genruntime.ClonePointerToString(record.Tag)

	// Value
	destination.Value = genruntime.ClonePointerToString(record.Value)

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

	// No error
	return nil
}

// A CNAME record.
type CnameRecord struct {
	// Cname: The canonical name for this CNAME record.
	Cname *string `json:"cname,omitempty"`
}

var _ genruntime.ARMTransformer = &CnameRecord{}

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

	// Set property "Cname":
	if record.Cname != nil {
		cname := *record.Cname
		result.Cname = &cname
	}
	return result, nil
}

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

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

	// Set property "Cname":
	if typedInput.Cname != nil {
		cname := *typedInput.Cname
		record.Cname = &cname
	}

	// No error
	return nil
}

// AssignProperties_From_CnameRecord populates our CnameRecord from the provided source CnameRecord
func (record *CnameRecord) AssignProperties_From_CnameRecord(source *storage.CnameRecord) error {

	// Cname
	record.Cname = genruntime.ClonePointerToString(source.Cname)

	// No error
	return nil
}

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

	// Cname
	destination.Cname = genruntime.ClonePointerToString(record.Cname)

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

	// No error
	return nil
}

// Initialize_From_CnameRecord_STATUS populates our CnameRecord from the provided source CnameRecord_STATUS
func (record *CnameRecord) Initialize_From_CnameRecord_STATUS(source *CnameRecord_STATUS) error {

	// Cname
	record.Cname = genruntime.ClonePointerToString(source.Cname)

	// No error
	return nil
}

// A CNAME record.
type CnameRecord_STATUS struct {
	// Cname: The canonical name for this CNAME record.
	Cname *string `json:"cname,omitempty"`
}

var _ genruntime.FromARMConverter = &CnameRecord_STATUS{}

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

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

	// Set property "Cname":
	if typedInput.Cname != nil {
		cname := *typedInput.Cname
		record.Cname = &cname
	}

	// No error
	return nil
}

// AssignProperties_From_CnameRecord_STATUS populates our CnameRecord_STATUS from the provided source CnameRecord_STATUS
func (record *CnameRecord_STATUS) AssignProperties_From_CnameRecord_STATUS(source *storage.CnameRecord_STATUS) error {

	// Cname
	record.Cname = genruntime.ClonePointerToString(source.Cname)

	// No error
	return nil
}

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

	// Cname
	destination.Cname = genruntime.ClonePointerToString(record.Cname)

	// 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 DnsZonesAAAARecordOperatorSpec 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_DnsZonesAAAARecordOperatorSpec populates our DnsZonesAAAARecordOperatorSpec from the provided source DnsZonesAAAARecordOperatorSpec
func (operator *DnsZonesAAAARecordOperatorSpec) AssignProperties_From_DnsZonesAAAARecordOperatorSpec(source *storage.DnsZonesAAAARecordOperatorSpec) 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_DnsZonesAAAARecordOperatorSpec populates the provided destination DnsZonesAAAARecordOperatorSpec from our DnsZonesAAAARecordOperatorSpec
func (operator *DnsZonesAAAARecordOperatorSpec) AssignProperties_To_DnsZonesAAAARecordOperatorSpec(destination *storage.DnsZonesAAAARecordOperatorSpec) 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
}

// An MX record.
type MxRecord struct {
	// Exchange: The domain name of the mail host for this MX record.
	Exchange *string `json:"exchange,omitempty"`

	// Preference: The preference value for this MX record.
	Preference *int `json:"preference,omitempty"`
}

var _ genruntime.ARMTransformer = &MxRecord{}

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

	// Set property "Exchange":
	if record.Exchange != nil {
		exchange := *record.Exchange
		result.Exchange = &exchange
	}

	// Set property "Preference":
	if record.Preference != nil {
		preference := *record.Preference
		result.Preference = &preference
	}
	return result, nil
}

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

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

	// Set property "Exchange":
	if typedInput.Exchange != nil {
		exchange := *typedInput.Exchange
		record.Exchange = &exchange
	}

	// Set property "Preference":
	if typedInput.Preference != nil {
		preference := *typedInput.Preference
		record.Preference = &preference
	}

	// No error
	return nil
}

// AssignProperties_From_MxRecord populates our MxRecord from the provided source MxRecord
func (record *MxRecord) AssignProperties_From_MxRecord(source *storage.MxRecord) error {

	// Exchange
	record.Exchange = genruntime.ClonePointerToString(source.Exchange)

	// Preference
	record.Preference = genruntime.ClonePointerToInt(source.Preference)

	// No error
	return nil
}

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

	// Exchange
	destination.Exchange = genruntime.ClonePointerToString(record.Exchange)

	// Preference
	destination.Preference = genruntime.ClonePointerToInt(record.Preference)

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

	// No error
	return nil
}

// Initialize_From_MxRecord_STATUS populates our MxRecord from the provided source MxRecord_STATUS
func (record *MxRecord) Initialize_From_MxRecord_STATUS(source *MxRecord_STATUS) error {

	// Exchange
	record.Exchange = genruntime.ClonePointerToString(source.Exchange)

	// Preference
	record.Preference = genruntime.ClonePointerToInt(source.Preference)

	// No error
	return nil
}

// An MX record.
type MxRecord_STATUS struct {
	// Exchange: The domain name of the mail host for this MX record.
	Exchange *string `json:"exchange,omitempty"`

	// Preference: The preference value for this MX record.
	Preference *int `json:"preference,omitempty"`
}

var _ genruntime.FromARMConverter = &MxRecord_STATUS{}

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

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

	// Set property "Exchange":
	if typedInput.Exchange != nil {
		exchange := *typedInput.Exchange
		record.Exchange = &exchange
	}

	// Set property "Preference":
	if typedInput.Preference != nil {
		preference := *typedInput.Preference
		record.Preference = &preference
	}

	// No error
	return nil
}

// AssignProperties_From_MxRecord_STATUS populates our MxRecord_STATUS from the provided source MxRecord_STATUS
func (record *MxRecord_STATUS) AssignProperties_From_MxRecord_STATUS(source *storage.MxRecord_STATUS) error {

	// Exchange
	record.Exchange = genruntime.ClonePointerToString(source.Exchange)

	// Preference
	record.Preference = genruntime.ClonePointerToInt(source.Preference)

	// No error
	return nil
}

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

	// Exchange
	destination.Exchange = genruntime.ClonePointerToString(record.Exchange)

	// Preference
	destination.Preference = genruntime.ClonePointerToInt(record.Preference)

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

	// No error
	return nil
}

// An NS record.
type NsRecord struct {
	// Nsdname: The name server name for this NS record.
	Nsdname *string `json:"nsdname,omitempty"`
}

var _ genruntime.ARMTransformer = &NsRecord{}

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

	// Set property "Nsdname":
	if record.Nsdname != nil {
		nsdname := *record.Nsdname
		result.Nsdname = &nsdname
	}
	return result, nil
}

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

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

	// Set property "Nsdname":
	if typedInput.Nsdname != nil {
		nsdname := *typedInput.Nsdname
		record.Nsdname = &nsdname
	}

	// No error
	return nil
}

// AssignProperties_From_NsRecord populates our NsRecord from the provided source NsRecord
func (record *NsRecord) AssignProperties_From_NsRecord(source *storage.NsRecord) error {

	// Nsdname
	record.Nsdname = genruntime.ClonePointerToString(source.Nsdname)

	// No error
	return nil
}

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

	// Nsdname
	destination.Nsdname = genruntime.ClonePointerToString(record.Nsdname)

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

	// No error
	return nil
}

// Initialize_From_NsRecord_STATUS populates our NsRecord from the provided source NsRecord_STATUS
func (record *NsRecord) Initialize_From_NsRecord_STATUS(source *NsRecord_STATUS) error {

	// Nsdname
	record.Nsdname = genruntime.ClonePointerToString(source.Nsdname)

	// No error
	return nil
}

// An NS record.
type NsRecord_STATUS struct {
	// Nsdname: The name server name for this NS record.
	Nsdname *string `json:"nsdname,omitempty"`
}

var _ genruntime.FromARMConverter = &NsRecord_STATUS{}

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

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

	// Set property "Nsdname":
	if typedInput.Nsdname != nil {
		nsdname := *typedInput.Nsdname
		record.Nsdname = &nsdname
	}

	// No error
	return nil
}

// AssignProperties_From_NsRecord_STATUS populates our NsRecord_STATUS from the provided source NsRecord_STATUS
func (record *NsRecord_STATUS) AssignProperties_From_NsRecord_STATUS(source *storage.NsRecord_STATUS) error {

	// Nsdname
	record.Nsdname = genruntime.ClonePointerToString(source.Nsdname)

	// No error
	return nil
}

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

	// Nsdname
	destination.Nsdname = genruntime.ClonePointerToString(record.Nsdname)

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

	// No error
	return nil
}

// A PTR record.
type PtrRecord struct {
	// Ptrdname: The PTR target domain name for this PTR record.
	Ptrdname *string `json:"ptrdname,omitempty"`
}

var _ genruntime.ARMTransformer = &PtrRecord{}

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

	// Set property "Ptrdname":
	if record.Ptrdname != nil {
		ptrdname := *record.Ptrdname
		result.Ptrdname = &ptrdname
	}
	return result, nil
}

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

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

	// Set property "Ptrdname":
	if typedInput.Ptrdname != nil {
		ptrdname := *typedInput.Ptrdname
		record.Ptrdname = &ptrdname
	}

	// No error
	return nil
}

// AssignProperties_From_PtrRecord populates our PtrRecord from the provided source PtrRecord
func (record *PtrRecord) AssignProperties_From_PtrRecord(source *storage.PtrRecord) error {

	// Ptrdname
	record.Ptrdname = genruntime.ClonePointerToString(source.Ptrdname)

	// No error
	return nil
}

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

	// Ptrdname
	destination.Ptrdname = genruntime.ClonePointerToString(record.Ptrdname)

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

	// No error
	return nil
}

// Initialize_From_PtrRecord_STATUS populates our PtrRecord from the provided source PtrRecord_STATUS
func (record *PtrRecord) Initialize_From_PtrRecord_STATUS(source *PtrRecord_STATUS) error {

	// Ptrdname
	record.Ptrdname = genruntime.ClonePointerToString(source.Ptrdname)

	// No error
	return nil
}

// A PTR record.
type PtrRecord_STATUS struct {
	// Ptrdname: The PTR target domain name for this PTR record.
	Ptrdname *string `json:"ptrdname,omitempty"`
}

var _ genruntime.FromARMConverter = &PtrRecord_STATUS{}

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

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

	// Set property "Ptrdname":
	if typedInput.Ptrdname != nil {
		ptrdname := *typedInput.Ptrdname
		record.Ptrdname = &ptrdname
	}

	// No error
	return nil
}

// AssignProperties_From_PtrRecord_STATUS populates our PtrRecord_STATUS from the provided source PtrRecord_STATUS
func (record *PtrRecord_STATUS) AssignProperties_From_PtrRecord_STATUS(source *storage.PtrRecord_STATUS) error {

	// Ptrdname
	record.Ptrdname = genruntime.ClonePointerToString(source.Ptrdname)

	// No error
	return nil
}

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

	// Ptrdname
	destination.Ptrdname = genruntime.ClonePointerToString(record.Ptrdname)

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

	// No error
	return nil
}

// An SOA record.
type SoaRecord struct {
	// Email: The email contact for this SOA record.
	Email *string `json:"email,omitempty"`

	// ExpireTime: The expire time for this SOA record.
	ExpireTime *int `json:"expireTime,omitempty"`

	// Host: The domain name of the authoritative name server for this SOA record.
	Host *string `json:"host,omitempty"`

	// MinimumTTL: The minimum value for this SOA record. By convention this is used to determine the negative caching duration.
	MinimumTTL *int `json:"minimumTTL,omitempty"`

	// RefreshTime: The refresh value for this SOA record.
	RefreshTime *int `json:"refreshTime,omitempty"`

	// RetryTime: The retry time for this SOA record.
	RetryTime *int `json:"retryTime,omitempty"`

	// SerialNumber: The serial number for this SOA record.
	SerialNumber *int `json:"serialNumber,omitempty"`
}

var _ genruntime.ARMTransformer = &SoaRecord{}

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

	// Set property "Email":
	if record.Email != nil {
		email := *record.Email
		result.Email = &email
	}

	// Set property "ExpireTime":
	if record.ExpireTime != nil {
		expireTime := *record.ExpireTime
		result.ExpireTime = &expireTime
	}

	// Set property "Host":
	if record.Host != nil {
		host := *record.Host
		result.Host = &host
	}

	// Set property "MinimumTTL":
	if record.MinimumTTL != nil {
		minimumTTL := *record.MinimumTTL
		result.MinimumTTL = &minimumTTL
	}

	// Set property "RefreshTime":
	if record.RefreshTime != nil {
		refreshTime := *record.RefreshTime
		result.RefreshTime = &refreshTime
	}

	// Set property "RetryTime":
	if record.RetryTime != nil {
		retryTime := *record.RetryTime
		result.RetryTime = &retryTime
	}

	// Set property "SerialNumber":
	if record.SerialNumber != nil {
		serialNumber := *record.SerialNumber
		result.SerialNumber = &serialNumber
	}
	return result, nil
}

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

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

	// Set property "Email":
	if typedInput.Email != nil {
		email := *typedInput.Email
		record.Email = &email
	}

	// Set property "ExpireTime":
	if typedInput.ExpireTime != nil {
		expireTime := *typedInput.ExpireTime
		record.ExpireTime = &expireTime
	}

	// Set property "Host":
	if typedInput.Host != nil {
		host := *typedInput.Host
		record.Host = &host
	}

	// Set property "MinimumTTL":
	if typedInput.MinimumTTL != nil {
		minimumTTL := *typedInput.MinimumTTL
		record.MinimumTTL = &minimumTTL
	}

	// Set property "RefreshTime":
	if typedInput.RefreshTime != nil {
		refreshTime := *typedInput.RefreshTime
		record.RefreshTime = &refreshTime
	}

	// Set property "RetryTime":
	if typedInput.RetryTime != nil {
		retryTime := *typedInput.RetryTime
		record.RetryTime = &retryTime
	}

	// Set property "SerialNumber":
	if typedInput.SerialNumber != nil {
		serialNumber := *typedInput.SerialNumber
		record.SerialNumber = &serialNumber
	}

	// No error
	return nil
}

// AssignProperties_From_SoaRecord populates our SoaRecord from the provided source SoaRecord
func (record *SoaRecord) AssignProperties_From_SoaRecord(source *storage.SoaRecord) error {

	// Email
	record.Email = genruntime.ClonePointerToString(source.Email)

	// ExpireTime
	record.ExpireTime = genruntime.ClonePointerToInt(source.ExpireTime)

	// Host
	record.Host = genruntime.ClonePointerToString(source.Host)

	// MinimumTTL
	record.MinimumTTL = genruntime.ClonePointerToInt(source.MinimumTTL)

	// RefreshTime
	record.RefreshTime = genruntime.ClonePointerToInt(source.RefreshTime)

	// RetryTime
	record.RetryTime = genruntime.ClonePointerToInt(source.RetryTime)

	// SerialNumber
	record.SerialNumber = genruntime.ClonePointerToInt(source.SerialNumber)

	// No error
	return nil
}

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

	// Email
	destination.Email = genruntime.ClonePointerToString(record.Email)

	// ExpireTime
	destination.ExpireTime = genruntime.ClonePointerToInt(record.ExpireTime)

	// Host
	destination.Host = genruntime.ClonePointerToString(record.Host)

	// MinimumTTL
	destination.MinimumTTL = genruntime.ClonePointerToInt(record.MinimumTTL)

	// RefreshTime
	destination.RefreshTime = genruntime.ClonePointerToInt(record.RefreshTime)

	// RetryTime
	destination.RetryTime = genruntime.ClonePointerToInt(record.RetryTime)

	// SerialNumber
	destination.SerialNumber = genruntime.ClonePointerToInt(record.SerialNumber)

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

	// No error
	return nil
}

// Initialize_From_SoaRecord_STATUS populates our SoaRecord from the provided source SoaRecord_STATUS
func (record *SoaRecord) Initialize_From_SoaRecord_STATUS(source *SoaRecord_STATUS) error {

	// Email
	record.Email = genruntime.ClonePointerToString(source.Email)

	// ExpireTime
	record.ExpireTime = genruntime.ClonePointerToInt(source.ExpireTime)

	// Host
	record.Host = genruntime.ClonePointerToString(source.Host)

	// MinimumTTL
	record.MinimumTTL = genruntime.ClonePointerToInt(source.MinimumTTL)

	// RefreshTime
	record.RefreshTime = genruntime.ClonePointerToInt(source.RefreshTime)

	// RetryTime
	record.RetryTime = genruntime.ClonePointerToInt(source.RetryTime)

	// SerialNumber
	record.SerialNumber = genruntime.ClonePointerToInt(source.SerialNumber)

	// No error
	return nil
}

// An SOA record.
type SoaRecord_STATUS struct {
	// Email: The email contact for this SOA record.
	Email *string `json:"email,omitempty"`

	// ExpireTime: The expire time for this SOA record.
	ExpireTime *int `json:"expireTime,omitempty"`

	// Host: The domain name of the authoritative name server for this SOA record.
	Host *string `json:"host,omitempty"`

	// MinimumTTL: The minimum value for this SOA record. By convention this is used to determine the negative caching duration.
	MinimumTTL *int `json:"minimumTTL,omitempty"`

	// RefreshTime: The refresh value for this SOA record.
	RefreshTime *int `json:"refreshTime,omitempty"`

	// RetryTime: The retry time for this SOA record.
	RetryTime *int `json:"retryTime,omitempty"`

	// SerialNumber: The serial number for this SOA record.
	SerialNumber *int `json:"serialNumber,omitempty"`
}

var _ genruntime.FromARMConverter = &SoaRecord_STATUS{}

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

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

	// Set property "Email":
	if typedInput.Email != nil {
		email := *typedInput.Email
		record.Email = &email
	}

	// Set property "ExpireTime":
	if typedInput.ExpireTime != nil {
		expireTime := *typedInput.ExpireTime
		record.ExpireTime = &expireTime
	}

	// Set property "Host":
	if typedInput.Host != nil {
		host := *typedInput.Host
		record.Host = &host
	}

	// Set property "MinimumTTL":
	if typedInput.MinimumTTL != nil {
		minimumTTL := *typedInput.MinimumTTL
		record.MinimumTTL = &minimumTTL
	}

	// Set property "RefreshTime":
	if typedInput.RefreshTime != nil {
		refreshTime := *typedInput.RefreshTime
		record.RefreshTime = &refreshTime
	}

	// Set property "RetryTime":
	if typedInput.RetryTime != nil {
		retryTime := *typedInput.RetryTime
		record.RetryTime = &retryTime
	}

	// Set property "SerialNumber":
	if typedInput.SerialNumber != nil {
		serialNumber := *typedInput.SerialNumber
		record.SerialNumber = &serialNumber
	}

	// No error
	return nil
}

// AssignProperties_From_SoaRecord_STATUS populates our SoaRecord_STATUS from the provided source SoaRecord_STATUS
func (record *SoaRecord_STATUS) AssignProperties_From_SoaRecord_STATUS(source *storage.SoaRecord_STATUS) error {

	// Email
	record.Email = genruntime.ClonePointerToString(source.Email)

	// ExpireTime
	record.ExpireTime = genruntime.ClonePointerToInt(source.ExpireTime)

	// Host
	record.Host = genruntime.ClonePointerToString(source.Host)

	// MinimumTTL
	record.MinimumTTL = genruntime.ClonePointerToInt(source.MinimumTTL)

	// RefreshTime
	record.RefreshTime = genruntime.ClonePointerToInt(source.RefreshTime)

	// RetryTime
	record.RetryTime = genruntime.ClonePointerToInt(source.RetryTime)

	// SerialNumber
	record.SerialNumber = genruntime.ClonePointerToInt(source.SerialNumber)

	// No error
	return nil
}

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

	// Email
	destination.Email = genruntime.ClonePointerToString(record.Email)

	// ExpireTime
	destination.ExpireTime = genruntime.ClonePointerToInt(record.ExpireTime)

	// Host
	destination.Host = genruntime.ClonePointerToString(record.Host)

	// MinimumTTL
	destination.MinimumTTL = genruntime.ClonePointerToInt(record.MinimumTTL)

	// RefreshTime
	destination.RefreshTime = genruntime.ClonePointerToInt(record.RefreshTime)

	// RetryTime
	destination.RetryTime = genruntime.ClonePointerToInt(record.RetryTime)

	// SerialNumber
	destination.SerialNumber = genruntime.ClonePointerToInt(record.SerialNumber)

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

	// No error
	return nil
}

// An SRV record.
type SrvRecord struct {
	// Port: The port value for this SRV record.
	Port *int `json:"port,omitempty"`

	// Priority: The priority value for this SRV record.
	Priority *int `json:"priority,omitempty"`

	// Target: The target domain name for this SRV record.
	Target *string `json:"target,omitempty"`

	// Weight: The weight value for this SRV record.
	Weight *int `json:"weight,omitempty"`
}

var _ genruntime.ARMTransformer = &SrvRecord{}

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

	// Set property "Port":
	if record.Port != nil {
		port := *record.Port
		result.Port = &port
	}

	// Set property "Priority":
	if record.Priority != nil {
		priority := *record.Priority
		result.Priority = &priority
	}

	// Set property "Target":
	if record.Target != nil {
		target := *record.Target
		result.Target = &target
	}

	// Set property "Weight":
	if record.Weight != nil {
		weight := *record.Weight
		result.Weight = &weight
	}
	return result, nil
}

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

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

	// Set property "Port":
	if typedInput.Port != nil {
		port := *typedInput.Port
		record.Port = &port
	}

	// Set property "Priority":
	if typedInput.Priority != nil {
		priority := *typedInput.Priority
		record.Priority = &priority
	}

	// Set property "Target":
	if typedInput.Target != nil {
		target := *typedInput.Target
		record.Target = &target
	}

	// Set property "Weight":
	if typedInput.Weight != nil {
		weight := *typedInput.Weight
		record.Weight = &weight
	}

	// No error
	return nil
}

// AssignProperties_From_SrvRecord populates our SrvRecord from the provided source SrvRecord
func (record *SrvRecord) AssignProperties_From_SrvRecord(source *storage.SrvRecord) error {

	// Port
	record.Port = genruntime.ClonePointerToInt(source.Port)

	// Priority
	record.Priority = genruntime.ClonePointerToInt(source.Priority)

	// Target
	record.Target = genruntime.ClonePointerToString(source.Target)

	// Weight
	record.Weight = genruntime.ClonePointerToInt(source.Weight)

	// No error
	return nil
}

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

	// Port
	destination.Port = genruntime.ClonePointerToInt(record.Port)

	// Priority
	destination.Priority = genruntime.ClonePointerToInt(record.Priority)

	// Target
	destination.Target = genruntime.ClonePointerToString(record.Target)

	// Weight
	destination.Weight = genruntime.ClonePointerToInt(record.Weight)

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

	// No error
	return nil
}

// Initialize_From_SrvRecord_STATUS populates our SrvRecord from the provided source SrvRecord_STATUS
func (record *SrvRecord) Initialize_From_SrvRecord_STATUS(source *SrvRecord_STATUS) error {

	// Port
	record.Port = genruntime.ClonePointerToInt(source.Port)

	// Priority
	record.Priority = genruntime.ClonePointerToInt(source.Priority)

	// Target
	record.Target = genruntime.ClonePointerToString(source.Target)

	// Weight
	record.Weight = genruntime.ClonePointerToInt(source.Weight)

	// No error
	return nil
}

// An SRV record.
type SrvRecord_STATUS struct {
	// Port: The port value for this SRV record.
	Port *int `json:"port,omitempty"`

	// Priority: The priority value for this SRV record.
	Priority *int `json:"priority,omitempty"`

	// Target: The target domain name for this SRV record.
	Target *string `json:"target,omitempty"`

	// Weight: The weight value for this SRV record.
	Weight *int `json:"weight,omitempty"`
}

var _ genruntime.FromARMConverter = &SrvRecord_STATUS{}

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

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

	// Set property "Port":
	if typedInput.Port != nil {
		port := *typedInput.Port
		record.Port = &port
	}

	// Set property "Priority":
	if typedInput.Priority != nil {
		priority := *typedInput.Priority
		record.Priority = &priority
	}

	// Set property "Target":
	if typedInput.Target != nil {
		target := *typedInput.Target
		record.Target = &target
	}

	// Set property "Weight":
	if typedInput.Weight != nil {
		weight := *typedInput.Weight
		record.Weight = &weight
	}

	// No error
	return nil
}

// AssignProperties_From_SrvRecord_STATUS populates our SrvRecord_STATUS from the provided source SrvRecord_STATUS
func (record *SrvRecord_STATUS) AssignProperties_From_SrvRecord_STATUS(source *storage.SrvRecord_STATUS) error {

	// Port
	record.Port = genruntime.ClonePointerToInt(source.Port)

	// Priority
	record.Priority = genruntime.ClonePointerToInt(source.Priority)

	// Target
	record.Target = genruntime.ClonePointerToString(source.Target)

	// Weight
	record.Weight = genruntime.ClonePointerToInt(source.Weight)

	// No error
	return nil
}

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

	// Port
	destination.Port = genruntime.ClonePointerToInt(record.Port)

	// Priority
	destination.Priority = genruntime.ClonePointerToInt(record.Priority)

	// Target
	destination.Target = genruntime.ClonePointerToString(record.Target)

	// Weight
	destination.Weight = genruntime.ClonePointerToInt(record.Weight)

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

	// No error
	return nil
}

// A TXT record.
type TxtRecord struct {
	// Value: The text value of this TXT record.
	Value []string `json:"value,omitempty"`
}

var _ genruntime.ARMTransformer = &TxtRecord{}

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_TxtRecord populates our TxtRecord from the provided source TxtRecord
func (record *TxtRecord) AssignProperties_From_TxtRecord(source *storage.TxtRecord) error {

	// Value
	record.Value = genruntime.CloneSliceOfString(source.Value)

	// No error
	return nil
}

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

	// Value
	destination.Value = genruntime.CloneSliceOfString(record.Value)

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

	// No error
	return nil
}

// Initialize_From_TxtRecord_STATUS populates our TxtRecord from the provided source TxtRecord_STATUS
func (record *TxtRecord) Initialize_From_TxtRecord_STATUS(source *TxtRecord_STATUS) error {

	// Value
	record.Value = genruntime.CloneSliceOfString(source.Value)

	// No error
	return nil
}

// A TXT record.
type TxtRecord_STATUS struct {
	// Value: The text value of this TXT record.
	Value []string `json:"value,omitempty"`
}

var _ genruntime.FromARMConverter = &TxtRecord_STATUS{}

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

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

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

	// No error
	return nil
}

// AssignProperties_From_TxtRecord_STATUS populates our TxtRecord_STATUS from the provided source TxtRecord_STATUS
func (record *TxtRecord_STATUS) AssignProperties_From_TxtRecord_STATUS(source *storage.TxtRecord_STATUS) error {

	// Value
	record.Value = genruntime.CloneSliceOfString(source.Value)

	// No error
	return nil
}

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

	// Value
	destination.Value = genruntime.CloneSliceOfString(record.Value)

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

	// No error
	return nil
}

func init() {
	SchemeBuilder.Register(&DnsZonesAAAARecord{}, &DnsZonesAAAARecordList{})
}
