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

import (
	"fmt"
	arm "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230101/arm"
	storage "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230101/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,insights}
// +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: /monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/actionGroups_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}
type ActionGroup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ActionGroup_Spec           `json:"spec,omitempty"`
	Status            ActionGroupResource_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &ActionGroup{}

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

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

var _ conversion.Convertible = &ActionGroup{}

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

	return group.AssignProperties_From_ActionGroup(source)
}

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

	return group.AssignProperties_To_ActionGroup(destination)
}

var _ configmaps.Exporter = &ActionGroup{}

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

var _ secrets.Exporter = &ActionGroup{}

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

var _ genruntime.ImportableResource = &ActionGroup{}

// InitializeSpec initializes the spec for this resource from the given status
func (group *ActionGroup) InitializeSpec(status genruntime.ConvertibleStatus) error {
	if s, ok := status.(*ActionGroupResource_STATUS); ok {
		return group.Spec.Initialize_From_ActionGroupResource_STATUS(s)
	}

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

var _ genruntime.KubernetesResource = &ActionGroup{}

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

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

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

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

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Insights/actionGroups"
func (group *ActionGroup) GetType() string {
	return "Microsoft.Insights/actionGroups"
}

// NewEmptyStatus returns a new empty (blank) status
func (group *ActionGroup) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &ActionGroupResource_STATUS{}
}

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

	ownerGroup, ownerKind := genruntime.LookupOwnerGroupKind(group.Spec)
	return group.Spec.Owner.AsResourceReference(ownerGroup, ownerKind)
}

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

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

	group.Status = st
	return nil
}

// AssignProperties_From_ActionGroup populates our ActionGroup from the provided source ActionGroup
func (group *ActionGroup) AssignProperties_From_ActionGroup(source *storage.ActionGroup) error {

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ActionGroup populates the provided destination ActionGroup from our ActionGroup
func (group *ActionGroup) AssignProperties_To_ActionGroup(destination *storage.ActionGroup) error {

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

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

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

// +kubebuilder:object:root=true
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Insights/stable/2023-01-01/actionGroups_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}
type ActionGroupList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ActionGroup `json:"items"`
}

type ActionGroup_Spec struct {
	// ArmRoleReceivers: The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only
	// built-in roles are supported.
	ArmRoleReceivers []ArmRoleReceiver `json:"armRoleReceivers,omitempty"`

	// AutomationRunbookReceivers: The list of AutomationRunbook receivers that are part of this action group.
	AutomationRunbookReceivers []AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`

	// AzureAppPushReceivers: The list of AzureAppPush receivers that are part of this action group.
	AzureAppPushReceivers []AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"`

	// AzureFunctionReceivers: The list of azure function receivers that are part of this action group.
	AzureFunctionReceivers []AzureFunctionReceiver `json:"azureFunctionReceivers,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"`

	// EmailReceivers: The list of email receivers that are part of this action group.
	EmailReceivers []EmailReceiver `json:"emailReceivers,omitempty"`

	// +kubebuilder:validation:Required
	// Enabled: Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers
	// will receive communications.
	Enabled *bool `json:"enabled,omitempty"`

	// EventHubReceivers: The list of event hub receivers that are part of this action group.
	EventHubReceivers []EventHubReceiver `json:"eventHubReceivers,omitempty"`

	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MaxLength=12
	// GroupShortName: The short name of the action group. This will be used in SMS messages.
	GroupShortName *string `json:"groupShortName,omitempty"`

	// ItsmReceivers: The list of ITSM receivers that are part of this action group.
	ItsmReceivers []ItsmReceiver `json:"itsmReceivers,omitempty"`

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

	// LogicAppReceivers: The list of logic app receivers that are part of this action group.
	LogicAppReceivers []LogicAppReceiver `json:"logicAppReceivers,omitempty"`

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

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

	// SmsReceivers: The list of SMS receivers that are part of this action group.
	SmsReceivers []SmsReceiver `json:"smsReceivers,omitempty"`

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

	// VoiceReceivers: The list of voice receivers that are part of this action group.
	VoiceReceivers []VoiceReceiver `json:"voiceReceivers,omitempty"`

	// WebhookReceivers: The list of webhook receivers that are part of this action group.
	WebhookReceivers []WebhookReceiver `json:"webhookReceivers,omitempty"`
}

var _ genruntime.ARMTransformer = &ActionGroup_Spec{}

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

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

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

	// Set property "Properties":
	if group.ArmRoleReceivers != nil ||
		group.AutomationRunbookReceivers != nil ||
		group.AzureAppPushReceivers != nil ||
		group.AzureFunctionReceivers != nil ||
		group.EmailReceivers != nil ||
		group.Enabled != nil ||
		group.EventHubReceivers != nil ||
		group.GroupShortName != nil ||
		group.ItsmReceivers != nil ||
		group.LogicAppReceivers != nil ||
		group.SmsReceivers != nil ||
		group.VoiceReceivers != nil ||
		group.WebhookReceivers != nil {
		result.Properties = &arm.ActionGroupSpec{}
	}
	for _, item := range group.ArmRoleReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.ArmRoleReceivers = append(result.Properties.ArmRoleReceivers, *item_ARM.(*arm.ArmRoleReceiver))
	}
	for _, item := range group.AutomationRunbookReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.AutomationRunbookReceivers = append(result.Properties.AutomationRunbookReceivers, *item_ARM.(*arm.AutomationRunbookReceiver))
	}
	for _, item := range group.AzureAppPushReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.AzureAppPushReceivers = append(result.Properties.AzureAppPushReceivers, *item_ARM.(*arm.AzureAppPushReceiver))
	}
	for _, item := range group.AzureFunctionReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.AzureFunctionReceivers = append(result.Properties.AzureFunctionReceivers, *item_ARM.(*arm.AzureFunctionReceiver))
	}
	for _, item := range group.EmailReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.EmailReceivers = append(result.Properties.EmailReceivers, *item_ARM.(*arm.EmailReceiver))
	}
	if group.Enabled != nil {
		enabled := *group.Enabled
		result.Properties.Enabled = &enabled
	}
	for _, item := range group.EventHubReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.EventHubReceivers = append(result.Properties.EventHubReceivers, *item_ARM.(*arm.EventHubReceiver))
	}
	if group.GroupShortName != nil {
		groupShortName := *group.GroupShortName
		result.Properties.GroupShortName = &groupShortName
	}
	for _, item := range group.ItsmReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.ItsmReceivers = append(result.Properties.ItsmReceivers, *item_ARM.(*arm.ItsmReceiver))
	}
	for _, item := range group.LogicAppReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.LogicAppReceivers = append(result.Properties.LogicAppReceivers, *item_ARM.(*arm.LogicAppReceiver))
	}
	for _, item := range group.SmsReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.SmsReceivers = append(result.Properties.SmsReceivers, *item_ARM.(*arm.SmsReceiver))
	}
	for _, item := range group.VoiceReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.VoiceReceivers = append(result.Properties.VoiceReceivers, *item_ARM.(*arm.VoiceReceiver))
	}
	for _, item := range group.WebhookReceivers {
		item_ARM, err := item.ConvertToARM(resolved)
		if err != nil {
			return nil, err
		}
		result.Properties.WebhookReceivers = append(result.Properties.WebhookReceivers, *item_ARM.(*arm.WebhookReceiver))
	}

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

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

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

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

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

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

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

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

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

	// Set property "Enabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Enabled != nil {
			enabled := *typedInput.Properties.Enabled
			group.Enabled = &enabled
		}
	}

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

	// Set property "GroupShortName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GroupShortName != nil {
			groupShortName := *typedInput.Properties.GroupShortName
			group.GroupShortName = &groupShortName
		}
	}

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

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

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

	// no assignment for property "OperatorSpec"

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

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

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

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

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

	// No error
	return nil
}

var _ genruntime.ConvertibleSpec = &ActionGroup_Spec{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.ActionGroup_Spec{}
	err := group.AssignProperties_To_ActionGroup_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_ActionGroup_Spec populates our ActionGroup_Spec from the provided source ActionGroup_Spec
func (group *ActionGroup_Spec) AssignProperties_From_ActionGroup_Spec(source *storage.ActionGroup_Spec) error {

	// ArmRoleReceivers
	if source.ArmRoleReceivers != nil {
		armRoleReceiverList := make([]ArmRoleReceiver, len(source.ArmRoleReceivers))
		for armRoleReceiverIndex, armRoleReceiverItem := range source.ArmRoleReceivers {
			var armRoleReceiver ArmRoleReceiver
			err := armRoleReceiver.AssignProperties_From_ArmRoleReceiver(&armRoleReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ArmRoleReceiver() to populate field ArmRoleReceivers")
			}
			armRoleReceiverList[armRoleReceiverIndex] = armRoleReceiver
		}
		group.ArmRoleReceivers = armRoleReceiverList
	} else {
		group.ArmRoleReceivers = nil
	}

	// AutomationRunbookReceivers
	if source.AutomationRunbookReceivers != nil {
		automationRunbookReceiverList := make([]AutomationRunbookReceiver, len(source.AutomationRunbookReceivers))
		for automationRunbookReceiverIndex, automationRunbookReceiverItem := range source.AutomationRunbookReceivers {
			var automationRunbookReceiver AutomationRunbookReceiver
			err := automationRunbookReceiver.AssignProperties_From_AutomationRunbookReceiver(&automationRunbookReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AutomationRunbookReceiver() to populate field AutomationRunbookReceivers")
			}
			automationRunbookReceiverList[automationRunbookReceiverIndex] = automationRunbookReceiver
		}
		group.AutomationRunbookReceivers = automationRunbookReceiverList
	} else {
		group.AutomationRunbookReceivers = nil
	}

	// AzureAppPushReceivers
	if source.AzureAppPushReceivers != nil {
		azureAppPushReceiverList := make([]AzureAppPushReceiver, len(source.AzureAppPushReceivers))
		for azureAppPushReceiverIndex, azureAppPushReceiverItem := range source.AzureAppPushReceivers {
			var azureAppPushReceiver AzureAppPushReceiver
			err := azureAppPushReceiver.AssignProperties_From_AzureAppPushReceiver(&azureAppPushReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AzureAppPushReceiver() to populate field AzureAppPushReceivers")
			}
			azureAppPushReceiverList[azureAppPushReceiverIndex] = azureAppPushReceiver
		}
		group.AzureAppPushReceivers = azureAppPushReceiverList
	} else {
		group.AzureAppPushReceivers = nil
	}

	// AzureFunctionReceivers
	if source.AzureFunctionReceivers != nil {
		azureFunctionReceiverList := make([]AzureFunctionReceiver, len(source.AzureFunctionReceivers))
		for azureFunctionReceiverIndex, azureFunctionReceiverItem := range source.AzureFunctionReceivers {
			var azureFunctionReceiver AzureFunctionReceiver
			err := azureFunctionReceiver.AssignProperties_From_AzureFunctionReceiver(&azureFunctionReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AzureFunctionReceiver() to populate field AzureFunctionReceivers")
			}
			azureFunctionReceiverList[azureFunctionReceiverIndex] = azureFunctionReceiver
		}
		group.AzureFunctionReceivers = azureFunctionReceiverList
	} else {
		group.AzureFunctionReceivers = nil
	}

	// AzureName
	group.AzureName = source.AzureName

	// EmailReceivers
	if source.EmailReceivers != nil {
		emailReceiverList := make([]EmailReceiver, len(source.EmailReceivers))
		for emailReceiverIndex, emailReceiverItem := range source.EmailReceivers {
			var emailReceiver EmailReceiver
			err := emailReceiver.AssignProperties_From_EmailReceiver(&emailReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EmailReceiver() to populate field EmailReceivers")
			}
			emailReceiverList[emailReceiverIndex] = emailReceiver
		}
		group.EmailReceivers = emailReceiverList
	} else {
		group.EmailReceivers = nil
	}

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		group.Enabled = &enabled
	} else {
		group.Enabled = nil
	}

	// EventHubReceivers
	if source.EventHubReceivers != nil {
		eventHubReceiverList := make([]EventHubReceiver, len(source.EventHubReceivers))
		for eventHubReceiverIndex, eventHubReceiverItem := range source.EventHubReceivers {
			var eventHubReceiver EventHubReceiver
			err := eventHubReceiver.AssignProperties_From_EventHubReceiver(&eventHubReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EventHubReceiver() to populate field EventHubReceivers")
			}
			eventHubReceiverList[eventHubReceiverIndex] = eventHubReceiver
		}
		group.EventHubReceivers = eventHubReceiverList
	} else {
		group.EventHubReceivers = nil
	}

	// GroupShortName
	group.GroupShortName = genruntime.ClonePointerToString(source.GroupShortName)

	// ItsmReceivers
	if source.ItsmReceivers != nil {
		itsmReceiverList := make([]ItsmReceiver, len(source.ItsmReceivers))
		for itsmReceiverIndex, itsmReceiverItem := range source.ItsmReceivers {
			var itsmReceiver ItsmReceiver
			err := itsmReceiver.AssignProperties_From_ItsmReceiver(&itsmReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ItsmReceiver() to populate field ItsmReceivers")
			}
			itsmReceiverList[itsmReceiverIndex] = itsmReceiver
		}
		group.ItsmReceivers = itsmReceiverList
	} else {
		group.ItsmReceivers = nil
	}

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

	// LogicAppReceivers
	if source.LogicAppReceivers != nil {
		logicAppReceiverList := make([]LogicAppReceiver, len(source.LogicAppReceivers))
		for logicAppReceiverIndex, logicAppReceiverItem := range source.LogicAppReceivers {
			var logicAppReceiver LogicAppReceiver
			err := logicAppReceiver.AssignProperties_From_LogicAppReceiver(&logicAppReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_LogicAppReceiver() to populate field LogicAppReceivers")
			}
			logicAppReceiverList[logicAppReceiverIndex] = logicAppReceiver
		}
		group.LogicAppReceivers = logicAppReceiverList
	} else {
		group.LogicAppReceivers = nil
	}

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

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

	// SmsReceivers
	if source.SmsReceivers != nil {
		smsReceiverList := make([]SmsReceiver, len(source.SmsReceivers))
		for smsReceiverIndex, smsReceiverItem := range source.SmsReceivers {
			var smsReceiver SmsReceiver
			err := smsReceiver.AssignProperties_From_SmsReceiver(&smsReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SmsReceiver() to populate field SmsReceivers")
			}
			smsReceiverList[smsReceiverIndex] = smsReceiver
		}
		group.SmsReceivers = smsReceiverList
	} else {
		group.SmsReceivers = nil
	}

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

	// VoiceReceivers
	if source.VoiceReceivers != nil {
		voiceReceiverList := make([]VoiceReceiver, len(source.VoiceReceivers))
		for voiceReceiverIndex, voiceReceiverItem := range source.VoiceReceivers {
			var voiceReceiver VoiceReceiver
			err := voiceReceiver.AssignProperties_From_VoiceReceiver(&voiceReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VoiceReceiver() to populate field VoiceReceivers")
			}
			voiceReceiverList[voiceReceiverIndex] = voiceReceiver
		}
		group.VoiceReceivers = voiceReceiverList
	} else {
		group.VoiceReceivers = nil
	}

	// WebhookReceivers
	if source.WebhookReceivers != nil {
		webhookReceiverList := make([]WebhookReceiver, len(source.WebhookReceivers))
		for webhookReceiverIndex, webhookReceiverItem := range source.WebhookReceivers {
			var webhookReceiver WebhookReceiver
			err := webhookReceiver.AssignProperties_From_WebhookReceiver(&webhookReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WebhookReceiver() to populate field WebhookReceivers")
			}
			webhookReceiverList[webhookReceiverIndex] = webhookReceiver
		}
		group.WebhookReceivers = webhookReceiverList
	} else {
		group.WebhookReceivers = nil
	}

	// No error
	return nil
}

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

	// ArmRoleReceivers
	if group.ArmRoleReceivers != nil {
		armRoleReceiverList := make([]storage.ArmRoleReceiver, len(group.ArmRoleReceivers))
		for armRoleReceiverIndex, armRoleReceiverItem := range group.ArmRoleReceivers {
			var armRoleReceiver storage.ArmRoleReceiver
			err := armRoleReceiverItem.AssignProperties_To_ArmRoleReceiver(&armRoleReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ArmRoleReceiver() to populate field ArmRoleReceivers")
			}
			armRoleReceiverList[armRoleReceiverIndex] = armRoleReceiver
		}
		destination.ArmRoleReceivers = armRoleReceiverList
	} else {
		destination.ArmRoleReceivers = nil
	}

	// AutomationRunbookReceivers
	if group.AutomationRunbookReceivers != nil {
		automationRunbookReceiverList := make([]storage.AutomationRunbookReceiver, len(group.AutomationRunbookReceivers))
		for automationRunbookReceiverIndex, automationRunbookReceiverItem := range group.AutomationRunbookReceivers {
			var automationRunbookReceiver storage.AutomationRunbookReceiver
			err := automationRunbookReceiverItem.AssignProperties_To_AutomationRunbookReceiver(&automationRunbookReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AutomationRunbookReceiver() to populate field AutomationRunbookReceivers")
			}
			automationRunbookReceiverList[automationRunbookReceiverIndex] = automationRunbookReceiver
		}
		destination.AutomationRunbookReceivers = automationRunbookReceiverList
	} else {
		destination.AutomationRunbookReceivers = nil
	}

	// AzureAppPushReceivers
	if group.AzureAppPushReceivers != nil {
		azureAppPushReceiverList := make([]storage.AzureAppPushReceiver, len(group.AzureAppPushReceivers))
		for azureAppPushReceiverIndex, azureAppPushReceiverItem := range group.AzureAppPushReceivers {
			var azureAppPushReceiver storage.AzureAppPushReceiver
			err := azureAppPushReceiverItem.AssignProperties_To_AzureAppPushReceiver(&azureAppPushReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AzureAppPushReceiver() to populate field AzureAppPushReceivers")
			}
			azureAppPushReceiverList[azureAppPushReceiverIndex] = azureAppPushReceiver
		}
		destination.AzureAppPushReceivers = azureAppPushReceiverList
	} else {
		destination.AzureAppPushReceivers = nil
	}

	// AzureFunctionReceivers
	if group.AzureFunctionReceivers != nil {
		azureFunctionReceiverList := make([]storage.AzureFunctionReceiver, len(group.AzureFunctionReceivers))
		for azureFunctionReceiverIndex, azureFunctionReceiverItem := range group.AzureFunctionReceivers {
			var azureFunctionReceiver storage.AzureFunctionReceiver
			err := azureFunctionReceiverItem.AssignProperties_To_AzureFunctionReceiver(&azureFunctionReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AzureFunctionReceiver() to populate field AzureFunctionReceivers")
			}
			azureFunctionReceiverList[azureFunctionReceiverIndex] = azureFunctionReceiver
		}
		destination.AzureFunctionReceivers = azureFunctionReceiverList
	} else {
		destination.AzureFunctionReceivers = nil
	}

	// AzureName
	destination.AzureName = group.AzureName

	// EmailReceivers
	if group.EmailReceivers != nil {
		emailReceiverList := make([]storage.EmailReceiver, len(group.EmailReceivers))
		for emailReceiverIndex, emailReceiverItem := range group.EmailReceivers {
			var emailReceiver storage.EmailReceiver
			err := emailReceiverItem.AssignProperties_To_EmailReceiver(&emailReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EmailReceiver() to populate field EmailReceivers")
			}
			emailReceiverList[emailReceiverIndex] = emailReceiver
		}
		destination.EmailReceivers = emailReceiverList
	} else {
		destination.EmailReceivers = nil
	}

	// Enabled
	if group.Enabled != nil {
		enabled := *group.Enabled
		destination.Enabled = &enabled
	} else {
		destination.Enabled = nil
	}

	// EventHubReceivers
	if group.EventHubReceivers != nil {
		eventHubReceiverList := make([]storage.EventHubReceiver, len(group.EventHubReceivers))
		for eventHubReceiverIndex, eventHubReceiverItem := range group.EventHubReceivers {
			var eventHubReceiver storage.EventHubReceiver
			err := eventHubReceiverItem.AssignProperties_To_EventHubReceiver(&eventHubReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EventHubReceiver() to populate field EventHubReceivers")
			}
			eventHubReceiverList[eventHubReceiverIndex] = eventHubReceiver
		}
		destination.EventHubReceivers = eventHubReceiverList
	} else {
		destination.EventHubReceivers = nil
	}

	// GroupShortName
	destination.GroupShortName = genruntime.ClonePointerToString(group.GroupShortName)

	// ItsmReceivers
	if group.ItsmReceivers != nil {
		itsmReceiverList := make([]storage.ItsmReceiver, len(group.ItsmReceivers))
		for itsmReceiverIndex, itsmReceiverItem := range group.ItsmReceivers {
			var itsmReceiver storage.ItsmReceiver
			err := itsmReceiverItem.AssignProperties_To_ItsmReceiver(&itsmReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ItsmReceiver() to populate field ItsmReceivers")
			}
			itsmReceiverList[itsmReceiverIndex] = itsmReceiver
		}
		destination.ItsmReceivers = itsmReceiverList
	} else {
		destination.ItsmReceivers = nil
	}

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

	// LogicAppReceivers
	if group.LogicAppReceivers != nil {
		logicAppReceiverList := make([]storage.LogicAppReceiver, len(group.LogicAppReceivers))
		for logicAppReceiverIndex, logicAppReceiverItem := range group.LogicAppReceivers {
			var logicAppReceiver storage.LogicAppReceiver
			err := logicAppReceiverItem.AssignProperties_To_LogicAppReceiver(&logicAppReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_LogicAppReceiver() to populate field LogicAppReceivers")
			}
			logicAppReceiverList[logicAppReceiverIndex] = logicAppReceiver
		}
		destination.LogicAppReceivers = logicAppReceiverList
	} else {
		destination.LogicAppReceivers = nil
	}

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

	// OriginalVersion
	destination.OriginalVersion = group.OriginalVersion()

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

	// SmsReceivers
	if group.SmsReceivers != nil {
		smsReceiverList := make([]storage.SmsReceiver, len(group.SmsReceivers))
		for smsReceiverIndex, smsReceiverItem := range group.SmsReceivers {
			var smsReceiver storage.SmsReceiver
			err := smsReceiverItem.AssignProperties_To_SmsReceiver(&smsReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SmsReceiver() to populate field SmsReceivers")
			}
			smsReceiverList[smsReceiverIndex] = smsReceiver
		}
		destination.SmsReceivers = smsReceiverList
	} else {
		destination.SmsReceivers = nil
	}

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

	// VoiceReceivers
	if group.VoiceReceivers != nil {
		voiceReceiverList := make([]storage.VoiceReceiver, len(group.VoiceReceivers))
		for voiceReceiverIndex, voiceReceiverItem := range group.VoiceReceivers {
			var voiceReceiver storage.VoiceReceiver
			err := voiceReceiverItem.AssignProperties_To_VoiceReceiver(&voiceReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VoiceReceiver() to populate field VoiceReceivers")
			}
			voiceReceiverList[voiceReceiverIndex] = voiceReceiver
		}
		destination.VoiceReceivers = voiceReceiverList
	} else {
		destination.VoiceReceivers = nil
	}

	// WebhookReceivers
	if group.WebhookReceivers != nil {
		webhookReceiverList := make([]storage.WebhookReceiver, len(group.WebhookReceivers))
		for webhookReceiverIndex, webhookReceiverItem := range group.WebhookReceivers {
			var webhookReceiver storage.WebhookReceiver
			err := webhookReceiverItem.AssignProperties_To_WebhookReceiver(&webhookReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WebhookReceiver() to populate field WebhookReceivers")
			}
			webhookReceiverList[webhookReceiverIndex] = webhookReceiver
		}
		destination.WebhookReceivers = webhookReceiverList
	} else {
		destination.WebhookReceivers = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ActionGroupResource_STATUS populates our ActionGroup_Spec from the provided source ActionGroupResource_STATUS
func (group *ActionGroup_Spec) Initialize_From_ActionGroupResource_STATUS(source *ActionGroupResource_STATUS) error {

	// ArmRoleReceivers
	if source.ArmRoleReceivers != nil {
		armRoleReceiverList := make([]ArmRoleReceiver, len(source.ArmRoleReceivers))
		for armRoleReceiverIndex, armRoleReceiverItem := range source.ArmRoleReceivers {
			var armRoleReceiver ArmRoleReceiver
			err := armRoleReceiver.Initialize_From_ArmRoleReceiver_STATUS(&armRoleReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ArmRoleReceiver_STATUS() to populate field ArmRoleReceivers")
			}
			armRoleReceiverList[armRoleReceiverIndex] = armRoleReceiver
		}
		group.ArmRoleReceivers = armRoleReceiverList
	} else {
		group.ArmRoleReceivers = nil
	}

	// AutomationRunbookReceivers
	if source.AutomationRunbookReceivers != nil {
		automationRunbookReceiverList := make([]AutomationRunbookReceiver, len(source.AutomationRunbookReceivers))
		for automationRunbookReceiverIndex, automationRunbookReceiverItem := range source.AutomationRunbookReceivers {
			var automationRunbookReceiver AutomationRunbookReceiver
			err := automationRunbookReceiver.Initialize_From_AutomationRunbookReceiver_STATUS(&automationRunbookReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_AutomationRunbookReceiver_STATUS() to populate field AutomationRunbookReceivers")
			}
			automationRunbookReceiverList[automationRunbookReceiverIndex] = automationRunbookReceiver
		}
		group.AutomationRunbookReceivers = automationRunbookReceiverList
	} else {
		group.AutomationRunbookReceivers = nil
	}

	// AzureAppPushReceivers
	if source.AzureAppPushReceivers != nil {
		azureAppPushReceiverList := make([]AzureAppPushReceiver, len(source.AzureAppPushReceivers))
		for azureAppPushReceiverIndex, azureAppPushReceiverItem := range source.AzureAppPushReceivers {
			var azureAppPushReceiver AzureAppPushReceiver
			err := azureAppPushReceiver.Initialize_From_AzureAppPushReceiver_STATUS(&azureAppPushReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_AzureAppPushReceiver_STATUS() to populate field AzureAppPushReceivers")
			}
			azureAppPushReceiverList[azureAppPushReceiverIndex] = azureAppPushReceiver
		}
		group.AzureAppPushReceivers = azureAppPushReceiverList
	} else {
		group.AzureAppPushReceivers = nil
	}

	// AzureFunctionReceivers
	if source.AzureFunctionReceivers != nil {
		azureFunctionReceiverList := make([]AzureFunctionReceiver, len(source.AzureFunctionReceivers))
		for azureFunctionReceiverIndex, azureFunctionReceiverItem := range source.AzureFunctionReceivers {
			var azureFunctionReceiver AzureFunctionReceiver
			err := azureFunctionReceiver.Initialize_From_AzureFunctionReceiver_STATUS(&azureFunctionReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_AzureFunctionReceiver_STATUS() to populate field AzureFunctionReceivers")
			}
			azureFunctionReceiverList[azureFunctionReceiverIndex] = azureFunctionReceiver
		}
		group.AzureFunctionReceivers = azureFunctionReceiverList
	} else {
		group.AzureFunctionReceivers = nil
	}

	// EmailReceivers
	if source.EmailReceivers != nil {
		emailReceiverList := make([]EmailReceiver, len(source.EmailReceivers))
		for emailReceiverIndex, emailReceiverItem := range source.EmailReceivers {
			var emailReceiver EmailReceiver
			err := emailReceiver.Initialize_From_EmailReceiver_STATUS(&emailReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_EmailReceiver_STATUS() to populate field EmailReceivers")
			}
			emailReceiverList[emailReceiverIndex] = emailReceiver
		}
		group.EmailReceivers = emailReceiverList
	} else {
		group.EmailReceivers = nil
	}

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		group.Enabled = &enabled
	} else {
		group.Enabled = nil
	}

	// EventHubReceivers
	if source.EventHubReceivers != nil {
		eventHubReceiverList := make([]EventHubReceiver, len(source.EventHubReceivers))
		for eventHubReceiverIndex, eventHubReceiverItem := range source.EventHubReceivers {
			var eventHubReceiver EventHubReceiver
			err := eventHubReceiver.Initialize_From_EventHubReceiver_STATUS(&eventHubReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_EventHubReceiver_STATUS() to populate field EventHubReceivers")
			}
			eventHubReceiverList[eventHubReceiverIndex] = eventHubReceiver
		}
		group.EventHubReceivers = eventHubReceiverList
	} else {
		group.EventHubReceivers = nil
	}

	// GroupShortName
	group.GroupShortName = genruntime.ClonePointerToString(source.GroupShortName)

	// ItsmReceivers
	if source.ItsmReceivers != nil {
		itsmReceiverList := make([]ItsmReceiver, len(source.ItsmReceivers))
		for itsmReceiverIndex, itsmReceiverItem := range source.ItsmReceivers {
			var itsmReceiver ItsmReceiver
			err := itsmReceiver.Initialize_From_ItsmReceiver_STATUS(&itsmReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_ItsmReceiver_STATUS() to populate field ItsmReceivers")
			}
			itsmReceiverList[itsmReceiverIndex] = itsmReceiver
		}
		group.ItsmReceivers = itsmReceiverList
	} else {
		group.ItsmReceivers = nil
	}

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

	// LogicAppReceivers
	if source.LogicAppReceivers != nil {
		logicAppReceiverList := make([]LogicAppReceiver, len(source.LogicAppReceivers))
		for logicAppReceiverIndex, logicAppReceiverItem := range source.LogicAppReceivers {
			var logicAppReceiver LogicAppReceiver
			err := logicAppReceiver.Initialize_From_LogicAppReceiver_STATUS(&logicAppReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_LogicAppReceiver_STATUS() to populate field LogicAppReceivers")
			}
			logicAppReceiverList[logicAppReceiverIndex] = logicAppReceiver
		}
		group.LogicAppReceivers = logicAppReceiverList
	} else {
		group.LogicAppReceivers = nil
	}

	// SmsReceivers
	if source.SmsReceivers != nil {
		smsReceiverList := make([]SmsReceiver, len(source.SmsReceivers))
		for smsReceiverIndex, smsReceiverItem := range source.SmsReceivers {
			var smsReceiver SmsReceiver
			err := smsReceiver.Initialize_From_SmsReceiver_STATUS(&smsReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_SmsReceiver_STATUS() to populate field SmsReceivers")
			}
			smsReceiverList[smsReceiverIndex] = smsReceiver
		}
		group.SmsReceivers = smsReceiverList
	} else {
		group.SmsReceivers = nil
	}

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

	// VoiceReceivers
	if source.VoiceReceivers != nil {
		voiceReceiverList := make([]VoiceReceiver, len(source.VoiceReceivers))
		for voiceReceiverIndex, voiceReceiverItem := range source.VoiceReceivers {
			var voiceReceiver VoiceReceiver
			err := voiceReceiver.Initialize_From_VoiceReceiver_STATUS(&voiceReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_VoiceReceiver_STATUS() to populate field VoiceReceivers")
			}
			voiceReceiverList[voiceReceiverIndex] = voiceReceiver
		}
		group.VoiceReceivers = voiceReceiverList
	} else {
		group.VoiceReceivers = nil
	}

	// WebhookReceivers
	if source.WebhookReceivers != nil {
		webhookReceiverList := make([]WebhookReceiver, len(source.WebhookReceivers))
		for webhookReceiverIndex, webhookReceiverItem := range source.WebhookReceivers {
			var webhookReceiver WebhookReceiver
			err := webhookReceiver.Initialize_From_WebhookReceiver_STATUS(&webhookReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling Initialize_From_WebhookReceiver_STATUS() to populate field WebhookReceivers")
			}
			webhookReceiverList[webhookReceiverIndex] = webhookReceiver
		}
		group.WebhookReceivers = webhookReceiverList
	} else {
		group.WebhookReceivers = nil
	}

	// No error
	return nil
}

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

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

// An action group resource.
type ActionGroupResource_STATUS struct {
	// ArmRoleReceivers: The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only
	// built-in roles are supported.
	ArmRoleReceivers []ArmRoleReceiver_STATUS `json:"armRoleReceivers,omitempty"`

	// AutomationRunbookReceivers: The list of AutomationRunbook receivers that are part of this action group.
	AutomationRunbookReceivers []AutomationRunbookReceiver_STATUS `json:"automationRunbookReceivers,omitempty"`

	// AzureAppPushReceivers: The list of AzureAppPush receivers that are part of this action group.
	AzureAppPushReceivers []AzureAppPushReceiver_STATUS `json:"azureAppPushReceivers,omitempty"`

	// AzureFunctionReceivers: The list of azure function receivers that are part of this action group.
	AzureFunctionReceivers []AzureFunctionReceiver_STATUS `json:"azureFunctionReceivers,omitempty"`

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

	// EmailReceivers: The list of email receivers that are part of this action group.
	EmailReceivers []EmailReceiver_STATUS `json:"emailReceivers,omitempty"`

	// Enabled: Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers
	// will receive communications.
	Enabled *bool `json:"enabled,omitempty"`

	// EventHubReceivers: The list of event hub receivers that are part of this action group.
	EventHubReceivers []EventHubReceiver_STATUS `json:"eventHubReceivers,omitempty"`

	// GroupShortName: The short name of the action group. This will be used in SMS messages.
	GroupShortName *string `json:"groupShortName,omitempty"`

	// Id: Azure resource Id
	Id *string `json:"id,omitempty"`

	// ItsmReceivers: The list of ITSM receivers that are part of this action group.
	ItsmReceivers []ItsmReceiver_STATUS `json:"itsmReceivers,omitempty"`

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

	// LogicAppReceivers: The list of logic app receivers that are part of this action group.
	LogicAppReceivers []LogicAppReceiver_STATUS `json:"logicAppReceivers,omitempty"`

	// Name: Azure resource name
	Name *string `json:"name,omitempty"`

	// SmsReceivers: The list of SMS receivers that are part of this action group.
	SmsReceivers []SmsReceiver_STATUS `json:"smsReceivers,omitempty"`

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

	// Type: Azure resource type
	Type *string `json:"type,omitempty"`

	// VoiceReceivers: The list of voice receivers that are part of this action group.
	VoiceReceivers []VoiceReceiver_STATUS `json:"voiceReceivers,omitempty"`

	// WebhookReceivers: The list of webhook receivers that are part of this action group.
	WebhookReceivers []WebhookReceiver_STATUS `json:"webhookReceivers,omitempty"`
}

var _ genruntime.ConvertibleStatus = &ActionGroupResource_STATUS{}

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

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

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

	return nil
}

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

	// Convert to an intermediate form
	dst = &storage.ActionGroupResource_STATUS{}
	err := resource.AssignProperties_To_ActionGroupResource_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 = &ActionGroupResource_STATUS{}

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

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

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

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

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

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

	// no assignment for property "Conditions"

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

	// Set property "Enabled":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.Enabled != nil {
			enabled := *typedInput.Properties.Enabled
			resource.Enabled = &enabled
		}
	}

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

	// Set property "GroupShortName":
	// copying flattened property:
	if typedInput.Properties != nil {
		if typedInput.Properties.GroupShortName != nil {
			groupShortName := *typedInput.Properties.GroupShortName
			resource.GroupShortName = &groupShortName
		}
	}

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

// AssignProperties_From_ActionGroupResource_STATUS populates our ActionGroupResource_STATUS from the provided source ActionGroupResource_STATUS
func (resource *ActionGroupResource_STATUS) AssignProperties_From_ActionGroupResource_STATUS(source *storage.ActionGroupResource_STATUS) error {

	// ArmRoleReceivers
	if source.ArmRoleReceivers != nil {
		armRoleReceiverList := make([]ArmRoleReceiver_STATUS, len(source.ArmRoleReceivers))
		for armRoleReceiverIndex, armRoleReceiverItem := range source.ArmRoleReceivers {
			var armRoleReceiver ArmRoleReceiver_STATUS
			err := armRoleReceiver.AssignProperties_From_ArmRoleReceiver_STATUS(&armRoleReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ArmRoleReceiver_STATUS() to populate field ArmRoleReceivers")
			}
			armRoleReceiverList[armRoleReceiverIndex] = armRoleReceiver
		}
		resource.ArmRoleReceivers = armRoleReceiverList
	} else {
		resource.ArmRoleReceivers = nil
	}

	// AutomationRunbookReceivers
	if source.AutomationRunbookReceivers != nil {
		automationRunbookReceiverList := make([]AutomationRunbookReceiver_STATUS, len(source.AutomationRunbookReceivers))
		for automationRunbookReceiverIndex, automationRunbookReceiverItem := range source.AutomationRunbookReceivers {
			var automationRunbookReceiver AutomationRunbookReceiver_STATUS
			err := automationRunbookReceiver.AssignProperties_From_AutomationRunbookReceiver_STATUS(&automationRunbookReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AutomationRunbookReceiver_STATUS() to populate field AutomationRunbookReceivers")
			}
			automationRunbookReceiverList[automationRunbookReceiverIndex] = automationRunbookReceiver
		}
		resource.AutomationRunbookReceivers = automationRunbookReceiverList
	} else {
		resource.AutomationRunbookReceivers = nil
	}

	// AzureAppPushReceivers
	if source.AzureAppPushReceivers != nil {
		azureAppPushReceiverList := make([]AzureAppPushReceiver_STATUS, len(source.AzureAppPushReceivers))
		for azureAppPushReceiverIndex, azureAppPushReceiverItem := range source.AzureAppPushReceivers {
			var azureAppPushReceiver AzureAppPushReceiver_STATUS
			err := azureAppPushReceiver.AssignProperties_From_AzureAppPushReceiver_STATUS(&azureAppPushReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AzureAppPushReceiver_STATUS() to populate field AzureAppPushReceivers")
			}
			azureAppPushReceiverList[azureAppPushReceiverIndex] = azureAppPushReceiver
		}
		resource.AzureAppPushReceivers = azureAppPushReceiverList
	} else {
		resource.AzureAppPushReceivers = nil
	}

	// AzureFunctionReceivers
	if source.AzureFunctionReceivers != nil {
		azureFunctionReceiverList := make([]AzureFunctionReceiver_STATUS, len(source.AzureFunctionReceivers))
		for azureFunctionReceiverIndex, azureFunctionReceiverItem := range source.AzureFunctionReceivers {
			var azureFunctionReceiver AzureFunctionReceiver_STATUS
			err := azureFunctionReceiver.AssignProperties_From_AzureFunctionReceiver_STATUS(&azureFunctionReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_AzureFunctionReceiver_STATUS() to populate field AzureFunctionReceivers")
			}
			azureFunctionReceiverList[azureFunctionReceiverIndex] = azureFunctionReceiver
		}
		resource.AzureFunctionReceivers = azureFunctionReceiverList
	} else {
		resource.AzureFunctionReceivers = nil
	}

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

	// EmailReceivers
	if source.EmailReceivers != nil {
		emailReceiverList := make([]EmailReceiver_STATUS, len(source.EmailReceivers))
		for emailReceiverIndex, emailReceiverItem := range source.EmailReceivers {
			var emailReceiver EmailReceiver_STATUS
			err := emailReceiver.AssignProperties_From_EmailReceiver_STATUS(&emailReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EmailReceiver_STATUS() to populate field EmailReceivers")
			}
			emailReceiverList[emailReceiverIndex] = emailReceiver
		}
		resource.EmailReceivers = emailReceiverList
	} else {
		resource.EmailReceivers = nil
	}

	// Enabled
	if source.Enabled != nil {
		enabled := *source.Enabled
		resource.Enabled = &enabled
	} else {
		resource.Enabled = nil
	}

	// EventHubReceivers
	if source.EventHubReceivers != nil {
		eventHubReceiverList := make([]EventHubReceiver_STATUS, len(source.EventHubReceivers))
		for eventHubReceiverIndex, eventHubReceiverItem := range source.EventHubReceivers {
			var eventHubReceiver EventHubReceiver_STATUS
			err := eventHubReceiver.AssignProperties_From_EventHubReceiver_STATUS(&eventHubReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_EventHubReceiver_STATUS() to populate field EventHubReceivers")
			}
			eventHubReceiverList[eventHubReceiverIndex] = eventHubReceiver
		}
		resource.EventHubReceivers = eventHubReceiverList
	} else {
		resource.EventHubReceivers = nil
	}

	// GroupShortName
	resource.GroupShortName = genruntime.ClonePointerToString(source.GroupShortName)

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

	// ItsmReceivers
	if source.ItsmReceivers != nil {
		itsmReceiverList := make([]ItsmReceiver_STATUS, len(source.ItsmReceivers))
		for itsmReceiverIndex, itsmReceiverItem := range source.ItsmReceivers {
			var itsmReceiver ItsmReceiver_STATUS
			err := itsmReceiver.AssignProperties_From_ItsmReceiver_STATUS(&itsmReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_ItsmReceiver_STATUS() to populate field ItsmReceivers")
			}
			itsmReceiverList[itsmReceiverIndex] = itsmReceiver
		}
		resource.ItsmReceivers = itsmReceiverList
	} else {
		resource.ItsmReceivers = nil
	}

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

	// LogicAppReceivers
	if source.LogicAppReceivers != nil {
		logicAppReceiverList := make([]LogicAppReceiver_STATUS, len(source.LogicAppReceivers))
		for logicAppReceiverIndex, logicAppReceiverItem := range source.LogicAppReceivers {
			var logicAppReceiver LogicAppReceiver_STATUS
			err := logicAppReceiver.AssignProperties_From_LogicAppReceiver_STATUS(&logicAppReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_LogicAppReceiver_STATUS() to populate field LogicAppReceivers")
			}
			logicAppReceiverList[logicAppReceiverIndex] = logicAppReceiver
		}
		resource.LogicAppReceivers = logicAppReceiverList
	} else {
		resource.LogicAppReceivers = nil
	}

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

	// SmsReceivers
	if source.SmsReceivers != nil {
		smsReceiverList := make([]SmsReceiver_STATUS, len(source.SmsReceivers))
		for smsReceiverIndex, smsReceiverItem := range source.SmsReceivers {
			var smsReceiver SmsReceiver_STATUS
			err := smsReceiver.AssignProperties_From_SmsReceiver_STATUS(&smsReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_SmsReceiver_STATUS() to populate field SmsReceivers")
			}
			smsReceiverList[smsReceiverIndex] = smsReceiver
		}
		resource.SmsReceivers = smsReceiverList
	} else {
		resource.SmsReceivers = nil
	}

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

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

	// VoiceReceivers
	if source.VoiceReceivers != nil {
		voiceReceiverList := make([]VoiceReceiver_STATUS, len(source.VoiceReceivers))
		for voiceReceiverIndex, voiceReceiverItem := range source.VoiceReceivers {
			var voiceReceiver VoiceReceiver_STATUS
			err := voiceReceiver.AssignProperties_From_VoiceReceiver_STATUS(&voiceReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_VoiceReceiver_STATUS() to populate field VoiceReceivers")
			}
			voiceReceiverList[voiceReceiverIndex] = voiceReceiver
		}
		resource.VoiceReceivers = voiceReceiverList
	} else {
		resource.VoiceReceivers = nil
	}

	// WebhookReceivers
	if source.WebhookReceivers != nil {
		webhookReceiverList := make([]WebhookReceiver_STATUS, len(source.WebhookReceivers))
		for webhookReceiverIndex, webhookReceiverItem := range source.WebhookReceivers {
			var webhookReceiver WebhookReceiver_STATUS
			err := webhookReceiver.AssignProperties_From_WebhookReceiver_STATUS(&webhookReceiverItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_WebhookReceiver_STATUS() to populate field WebhookReceivers")
			}
			webhookReceiverList[webhookReceiverIndex] = webhookReceiver
		}
		resource.WebhookReceivers = webhookReceiverList
	} else {
		resource.WebhookReceivers = nil
	}

	// No error
	return nil
}

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

	// ArmRoleReceivers
	if resource.ArmRoleReceivers != nil {
		armRoleReceiverList := make([]storage.ArmRoleReceiver_STATUS, len(resource.ArmRoleReceivers))
		for armRoleReceiverIndex, armRoleReceiverItem := range resource.ArmRoleReceivers {
			var armRoleReceiver storage.ArmRoleReceiver_STATUS
			err := armRoleReceiverItem.AssignProperties_To_ArmRoleReceiver_STATUS(&armRoleReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ArmRoleReceiver_STATUS() to populate field ArmRoleReceivers")
			}
			armRoleReceiverList[armRoleReceiverIndex] = armRoleReceiver
		}
		destination.ArmRoleReceivers = armRoleReceiverList
	} else {
		destination.ArmRoleReceivers = nil
	}

	// AutomationRunbookReceivers
	if resource.AutomationRunbookReceivers != nil {
		automationRunbookReceiverList := make([]storage.AutomationRunbookReceiver_STATUS, len(resource.AutomationRunbookReceivers))
		for automationRunbookReceiverIndex, automationRunbookReceiverItem := range resource.AutomationRunbookReceivers {
			var automationRunbookReceiver storage.AutomationRunbookReceiver_STATUS
			err := automationRunbookReceiverItem.AssignProperties_To_AutomationRunbookReceiver_STATUS(&automationRunbookReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AutomationRunbookReceiver_STATUS() to populate field AutomationRunbookReceivers")
			}
			automationRunbookReceiverList[automationRunbookReceiverIndex] = automationRunbookReceiver
		}
		destination.AutomationRunbookReceivers = automationRunbookReceiverList
	} else {
		destination.AutomationRunbookReceivers = nil
	}

	// AzureAppPushReceivers
	if resource.AzureAppPushReceivers != nil {
		azureAppPushReceiverList := make([]storage.AzureAppPushReceiver_STATUS, len(resource.AzureAppPushReceivers))
		for azureAppPushReceiverIndex, azureAppPushReceiverItem := range resource.AzureAppPushReceivers {
			var azureAppPushReceiver storage.AzureAppPushReceiver_STATUS
			err := azureAppPushReceiverItem.AssignProperties_To_AzureAppPushReceiver_STATUS(&azureAppPushReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AzureAppPushReceiver_STATUS() to populate field AzureAppPushReceivers")
			}
			azureAppPushReceiverList[azureAppPushReceiverIndex] = azureAppPushReceiver
		}
		destination.AzureAppPushReceivers = azureAppPushReceiverList
	} else {
		destination.AzureAppPushReceivers = nil
	}

	// AzureFunctionReceivers
	if resource.AzureFunctionReceivers != nil {
		azureFunctionReceiverList := make([]storage.AzureFunctionReceiver_STATUS, len(resource.AzureFunctionReceivers))
		for azureFunctionReceiverIndex, azureFunctionReceiverItem := range resource.AzureFunctionReceivers {
			var azureFunctionReceiver storage.AzureFunctionReceiver_STATUS
			err := azureFunctionReceiverItem.AssignProperties_To_AzureFunctionReceiver_STATUS(&azureFunctionReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_AzureFunctionReceiver_STATUS() to populate field AzureFunctionReceivers")
			}
			azureFunctionReceiverList[azureFunctionReceiverIndex] = azureFunctionReceiver
		}
		destination.AzureFunctionReceivers = azureFunctionReceiverList
	} else {
		destination.AzureFunctionReceivers = nil
	}

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

	// EmailReceivers
	if resource.EmailReceivers != nil {
		emailReceiverList := make([]storage.EmailReceiver_STATUS, len(resource.EmailReceivers))
		for emailReceiverIndex, emailReceiverItem := range resource.EmailReceivers {
			var emailReceiver storage.EmailReceiver_STATUS
			err := emailReceiverItem.AssignProperties_To_EmailReceiver_STATUS(&emailReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EmailReceiver_STATUS() to populate field EmailReceivers")
			}
			emailReceiverList[emailReceiverIndex] = emailReceiver
		}
		destination.EmailReceivers = emailReceiverList
	} else {
		destination.EmailReceivers = nil
	}

	// Enabled
	if resource.Enabled != nil {
		enabled := *resource.Enabled
		destination.Enabled = &enabled
	} else {
		destination.Enabled = nil
	}

	// EventHubReceivers
	if resource.EventHubReceivers != nil {
		eventHubReceiverList := make([]storage.EventHubReceiver_STATUS, len(resource.EventHubReceivers))
		for eventHubReceiverIndex, eventHubReceiverItem := range resource.EventHubReceivers {
			var eventHubReceiver storage.EventHubReceiver_STATUS
			err := eventHubReceiverItem.AssignProperties_To_EventHubReceiver_STATUS(&eventHubReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_EventHubReceiver_STATUS() to populate field EventHubReceivers")
			}
			eventHubReceiverList[eventHubReceiverIndex] = eventHubReceiver
		}
		destination.EventHubReceivers = eventHubReceiverList
	} else {
		destination.EventHubReceivers = nil
	}

	// GroupShortName
	destination.GroupShortName = genruntime.ClonePointerToString(resource.GroupShortName)

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

	// ItsmReceivers
	if resource.ItsmReceivers != nil {
		itsmReceiverList := make([]storage.ItsmReceiver_STATUS, len(resource.ItsmReceivers))
		for itsmReceiverIndex, itsmReceiverItem := range resource.ItsmReceivers {
			var itsmReceiver storage.ItsmReceiver_STATUS
			err := itsmReceiverItem.AssignProperties_To_ItsmReceiver_STATUS(&itsmReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_ItsmReceiver_STATUS() to populate field ItsmReceivers")
			}
			itsmReceiverList[itsmReceiverIndex] = itsmReceiver
		}
		destination.ItsmReceivers = itsmReceiverList
	} else {
		destination.ItsmReceivers = nil
	}

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

	// LogicAppReceivers
	if resource.LogicAppReceivers != nil {
		logicAppReceiverList := make([]storage.LogicAppReceiver_STATUS, len(resource.LogicAppReceivers))
		for logicAppReceiverIndex, logicAppReceiverItem := range resource.LogicAppReceivers {
			var logicAppReceiver storage.LogicAppReceiver_STATUS
			err := logicAppReceiverItem.AssignProperties_To_LogicAppReceiver_STATUS(&logicAppReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_LogicAppReceiver_STATUS() to populate field LogicAppReceivers")
			}
			logicAppReceiverList[logicAppReceiverIndex] = logicAppReceiver
		}
		destination.LogicAppReceivers = logicAppReceiverList
	} else {
		destination.LogicAppReceivers = nil
	}

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

	// SmsReceivers
	if resource.SmsReceivers != nil {
		smsReceiverList := make([]storage.SmsReceiver_STATUS, len(resource.SmsReceivers))
		for smsReceiverIndex, smsReceiverItem := range resource.SmsReceivers {
			var smsReceiver storage.SmsReceiver_STATUS
			err := smsReceiverItem.AssignProperties_To_SmsReceiver_STATUS(&smsReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_SmsReceiver_STATUS() to populate field SmsReceivers")
			}
			smsReceiverList[smsReceiverIndex] = smsReceiver
		}
		destination.SmsReceivers = smsReceiverList
	} else {
		destination.SmsReceivers = nil
	}

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

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

	// VoiceReceivers
	if resource.VoiceReceivers != nil {
		voiceReceiverList := make([]storage.VoiceReceiver_STATUS, len(resource.VoiceReceivers))
		for voiceReceiverIndex, voiceReceiverItem := range resource.VoiceReceivers {
			var voiceReceiver storage.VoiceReceiver_STATUS
			err := voiceReceiverItem.AssignProperties_To_VoiceReceiver_STATUS(&voiceReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_VoiceReceiver_STATUS() to populate field VoiceReceivers")
			}
			voiceReceiverList[voiceReceiverIndex] = voiceReceiver
		}
		destination.VoiceReceivers = voiceReceiverList
	} else {
		destination.VoiceReceivers = nil
	}

	// WebhookReceivers
	if resource.WebhookReceivers != nil {
		webhookReceiverList := make([]storage.WebhookReceiver_STATUS, len(resource.WebhookReceivers))
		for webhookReceiverIndex, webhookReceiverItem := range resource.WebhookReceivers {
			var webhookReceiver storage.WebhookReceiver_STATUS
			err := webhookReceiverItem.AssignProperties_To_WebhookReceiver_STATUS(&webhookReceiver)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_WebhookReceiver_STATUS() to populate field WebhookReceivers")
			}
			webhookReceiverList[webhookReceiverIndex] = webhookReceiver
		}
		destination.WebhookReceivers = webhookReceiverList
	} else {
		destination.WebhookReceivers = nil
	}

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

	// No error
	return nil
}

// +kubebuilder:validation:Enum={"2023-01-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2023-01-01")

// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type ActionGroupOperatorSpec 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_ActionGroupOperatorSpec populates our ActionGroupOperatorSpec from the provided source ActionGroupOperatorSpec
func (operator *ActionGroupOperatorSpec) AssignProperties_From_ActionGroupOperatorSpec(source *storage.ActionGroupOperatorSpec) 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_ActionGroupOperatorSpec populates the provided destination ActionGroupOperatorSpec from our ActionGroupOperatorSpec
func (operator *ActionGroupOperatorSpec) AssignProperties_To_ActionGroupOperatorSpec(destination *storage.ActionGroupOperatorSpec) 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 arm role receiver.
type ArmRoleReceiver struct {
	// +kubebuilder:validation:Required
	// Name: The name of the arm role receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// RoleId: The arm role id.
	RoleId *string `json:"roleId,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.ARMTransformer = &ArmRoleReceiver{}

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

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

	// Set property "RoleId":
	if receiver.RoleId != nil {
		roleId := *receiver.RoleId
		result.RoleId = &roleId
	}

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}
	return result, nil
}

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

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

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

	// Set property "RoleId":
	if typedInput.RoleId != nil {
		roleId := *typedInput.RoleId
		receiver.RoleId = &roleId
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_ArmRoleReceiver populates our ArmRoleReceiver from the provided source ArmRoleReceiver
func (receiver *ArmRoleReceiver) AssignProperties_From_ArmRoleReceiver(source *storage.ArmRoleReceiver) error {

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

	// RoleId
	receiver.RoleId = genruntime.ClonePointerToString(source.RoleId)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

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

	// RoleId
	destination.RoleId = genruntime.ClonePointerToString(receiver.RoleId)

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Initialize_From_ArmRoleReceiver_STATUS populates our ArmRoleReceiver from the provided source ArmRoleReceiver_STATUS
func (receiver *ArmRoleReceiver) Initialize_From_ArmRoleReceiver_STATUS(source *ArmRoleReceiver_STATUS) error {

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

	// RoleId
	receiver.RoleId = genruntime.ClonePointerToString(source.RoleId)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

// An arm role receiver.
type ArmRoleReceiver_STATUS struct {
	// Name: The name of the arm role receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// RoleId: The arm role id.
	RoleId *string `json:"roleId,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.FromARMConverter = &ArmRoleReceiver_STATUS{}

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

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

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

	// Set property "RoleId":
	if typedInput.RoleId != nil {
		roleId := *typedInput.RoleId
		receiver.RoleId = &roleId
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_ArmRoleReceiver_STATUS populates our ArmRoleReceiver_STATUS from the provided source ArmRoleReceiver_STATUS
func (receiver *ArmRoleReceiver_STATUS) AssignProperties_From_ArmRoleReceiver_STATUS(source *storage.ArmRoleReceiver_STATUS) error {

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

	// RoleId
	receiver.RoleId = genruntime.ClonePointerToString(source.RoleId)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

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

	// RoleId
	destination.RoleId = genruntime.ClonePointerToString(receiver.RoleId)

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// The Azure Automation Runbook notification receiver.
type AutomationRunbookReceiver struct {
	// +kubebuilder:validation:Required
	// AutomationAccountId: The Azure automation account Id which holds this runbook and authenticate to Azure resource.
	AutomationAccountId *string `json:"automationAccountId,omitempty"`

	// +kubebuilder:validation:Required
	// IsGlobalRunbook: Indicates whether this instance is global runbook.
	IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"`

	// Name: Indicates name of the webhook.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// RunbookName: The name for this runbook.
	RunbookName *string `json:"runbookName,omitempty"`

	// ServiceUri: The URI where webhooks should be sent.
	ServiceUri *string `json:"serviceUri,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`

	// +kubebuilder:validation:Required
	// WebhookResourceReference: The resource id for webhook linked to this runbook.
	WebhookResourceReference *genruntime.ResourceReference `armReference:"WebhookResourceId" json:"webhookResourceReference,omitempty"`
}

var _ genruntime.ARMTransformer = &AutomationRunbookReceiver{}

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

	// Set property "AutomationAccountId":
	if receiver.AutomationAccountId != nil {
		automationAccountId := *receiver.AutomationAccountId
		result.AutomationAccountId = &automationAccountId
	}

	// Set property "IsGlobalRunbook":
	if receiver.IsGlobalRunbook != nil {
		isGlobalRunbook := *receiver.IsGlobalRunbook
		result.IsGlobalRunbook = &isGlobalRunbook
	}

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

	// Set property "RunbookName":
	if receiver.RunbookName != nil {
		runbookName := *receiver.RunbookName
		result.RunbookName = &runbookName
	}

	// Set property "ServiceUri":
	if receiver.ServiceUri != nil {
		serviceUri := *receiver.ServiceUri
		result.ServiceUri = &serviceUri
	}

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// Set property "WebhookResourceId":
	if receiver.WebhookResourceReference != nil {
		webhookResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*receiver.WebhookResourceReference)
		if err != nil {
			return nil, err
		}
		webhookResourceReference := webhookResourceReferenceARMID
		result.WebhookResourceId = &webhookResourceReference
	}
	return result, nil
}

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

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

	// Set property "AutomationAccountId":
	if typedInput.AutomationAccountId != nil {
		automationAccountId := *typedInput.AutomationAccountId
		receiver.AutomationAccountId = &automationAccountId
	}

	// Set property "IsGlobalRunbook":
	if typedInput.IsGlobalRunbook != nil {
		isGlobalRunbook := *typedInput.IsGlobalRunbook
		receiver.IsGlobalRunbook = &isGlobalRunbook
	}

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

	// Set property "RunbookName":
	if typedInput.RunbookName != nil {
		runbookName := *typedInput.RunbookName
		receiver.RunbookName = &runbookName
	}

	// Set property "ServiceUri":
	if typedInput.ServiceUri != nil {
		serviceUri := *typedInput.ServiceUri
		receiver.ServiceUri = &serviceUri
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// no assignment for property "WebhookResourceReference"

	// No error
	return nil
}

// AssignProperties_From_AutomationRunbookReceiver populates our AutomationRunbookReceiver from the provided source AutomationRunbookReceiver
func (receiver *AutomationRunbookReceiver) AssignProperties_From_AutomationRunbookReceiver(source *storage.AutomationRunbookReceiver) error {

	// AutomationAccountId
	receiver.AutomationAccountId = genruntime.ClonePointerToString(source.AutomationAccountId)

	// IsGlobalRunbook
	if source.IsGlobalRunbook != nil {
		isGlobalRunbook := *source.IsGlobalRunbook
		receiver.IsGlobalRunbook = &isGlobalRunbook
	} else {
		receiver.IsGlobalRunbook = nil
	}

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

	// RunbookName
	receiver.RunbookName = genruntime.ClonePointerToString(source.RunbookName)

	// ServiceUri
	receiver.ServiceUri = genruntime.ClonePointerToString(source.ServiceUri)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// WebhookResourceReference
	if source.WebhookResourceReference != nil {
		webhookResourceReference := source.WebhookResourceReference.Copy()
		receiver.WebhookResourceReference = &webhookResourceReference
	} else {
		receiver.WebhookResourceReference = nil
	}

	// No error
	return nil
}

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

	// AutomationAccountId
	destination.AutomationAccountId = genruntime.ClonePointerToString(receiver.AutomationAccountId)

	// IsGlobalRunbook
	if receiver.IsGlobalRunbook != nil {
		isGlobalRunbook := *receiver.IsGlobalRunbook
		destination.IsGlobalRunbook = &isGlobalRunbook
	} else {
		destination.IsGlobalRunbook = nil
	}

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

	// RunbookName
	destination.RunbookName = genruntime.ClonePointerToString(receiver.RunbookName)

	// ServiceUri
	destination.ServiceUri = genruntime.ClonePointerToString(receiver.ServiceUri)

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

	// WebhookResourceReference
	if receiver.WebhookResourceReference != nil {
		webhookResourceReference := receiver.WebhookResourceReference.Copy()
		destination.WebhookResourceReference = &webhookResourceReference
	} else {
		destination.WebhookResourceReference = nil
	}

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

	// No error
	return nil
}

// Initialize_From_AutomationRunbookReceiver_STATUS populates our AutomationRunbookReceiver from the provided source AutomationRunbookReceiver_STATUS
func (receiver *AutomationRunbookReceiver) Initialize_From_AutomationRunbookReceiver_STATUS(source *AutomationRunbookReceiver_STATUS) error {

	// AutomationAccountId
	receiver.AutomationAccountId = genruntime.ClonePointerToString(source.AutomationAccountId)

	// IsGlobalRunbook
	if source.IsGlobalRunbook != nil {
		isGlobalRunbook := *source.IsGlobalRunbook
		receiver.IsGlobalRunbook = &isGlobalRunbook
	} else {
		receiver.IsGlobalRunbook = nil
	}

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

	// RunbookName
	receiver.RunbookName = genruntime.ClonePointerToString(source.RunbookName)

	// ServiceUri
	receiver.ServiceUri = genruntime.ClonePointerToString(source.ServiceUri)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// WebhookResourceReference
	if source.WebhookResourceId != nil {
		webhookResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.WebhookResourceId)
		receiver.WebhookResourceReference = &webhookResourceReference
	} else {
		receiver.WebhookResourceReference = nil
	}

	// No error
	return nil
}

// The Azure Automation Runbook notification receiver.
type AutomationRunbookReceiver_STATUS struct {
	// AutomationAccountId: The Azure automation account Id which holds this runbook and authenticate to Azure resource.
	AutomationAccountId *string `json:"automationAccountId,omitempty"`

	// IsGlobalRunbook: Indicates whether this instance is global runbook.
	IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"`

	// Name: Indicates name of the webhook.
	Name *string `json:"name,omitempty"`

	// RunbookName: The name for this runbook.
	RunbookName *string `json:"runbookName,omitempty"`

	// ServiceUri: The URI where webhooks should be sent.
	ServiceUri *string `json:"serviceUri,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`

	// WebhookResourceId: The resource id for webhook linked to this runbook.
	WebhookResourceId *string `json:"webhookResourceId,omitempty"`
}

var _ genruntime.FromARMConverter = &AutomationRunbookReceiver_STATUS{}

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

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

	// Set property "AutomationAccountId":
	if typedInput.AutomationAccountId != nil {
		automationAccountId := *typedInput.AutomationAccountId
		receiver.AutomationAccountId = &automationAccountId
	}

	// Set property "IsGlobalRunbook":
	if typedInput.IsGlobalRunbook != nil {
		isGlobalRunbook := *typedInput.IsGlobalRunbook
		receiver.IsGlobalRunbook = &isGlobalRunbook
	}

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

	// Set property "RunbookName":
	if typedInput.RunbookName != nil {
		runbookName := *typedInput.RunbookName
		receiver.RunbookName = &runbookName
	}

	// Set property "ServiceUri":
	if typedInput.ServiceUri != nil {
		serviceUri := *typedInput.ServiceUri
		receiver.ServiceUri = &serviceUri
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// Set property "WebhookResourceId":
	if typedInput.WebhookResourceId != nil {
		webhookResourceId := *typedInput.WebhookResourceId
		receiver.WebhookResourceId = &webhookResourceId
	}

	// No error
	return nil
}

// AssignProperties_From_AutomationRunbookReceiver_STATUS populates our AutomationRunbookReceiver_STATUS from the provided source AutomationRunbookReceiver_STATUS
func (receiver *AutomationRunbookReceiver_STATUS) AssignProperties_From_AutomationRunbookReceiver_STATUS(source *storage.AutomationRunbookReceiver_STATUS) error {

	// AutomationAccountId
	receiver.AutomationAccountId = genruntime.ClonePointerToString(source.AutomationAccountId)

	// IsGlobalRunbook
	if source.IsGlobalRunbook != nil {
		isGlobalRunbook := *source.IsGlobalRunbook
		receiver.IsGlobalRunbook = &isGlobalRunbook
	} else {
		receiver.IsGlobalRunbook = nil
	}

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

	// RunbookName
	receiver.RunbookName = genruntime.ClonePointerToString(source.RunbookName)

	// ServiceUri
	receiver.ServiceUri = genruntime.ClonePointerToString(source.ServiceUri)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// WebhookResourceId
	receiver.WebhookResourceId = genruntime.ClonePointerToString(source.WebhookResourceId)

	// No error
	return nil
}

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

	// AutomationAccountId
	destination.AutomationAccountId = genruntime.ClonePointerToString(receiver.AutomationAccountId)

	// IsGlobalRunbook
	if receiver.IsGlobalRunbook != nil {
		isGlobalRunbook := *receiver.IsGlobalRunbook
		destination.IsGlobalRunbook = &isGlobalRunbook
	} else {
		destination.IsGlobalRunbook = nil
	}

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

	// RunbookName
	destination.RunbookName = genruntime.ClonePointerToString(receiver.RunbookName)

	// ServiceUri
	destination.ServiceUri = genruntime.ClonePointerToString(receiver.ServiceUri)

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

	// WebhookResourceId
	destination.WebhookResourceId = genruntime.ClonePointerToString(receiver.WebhookResourceId)

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

	// No error
	return nil
}

// The Azure mobile App push notification receiver.
type AzureAppPushReceiver struct {
	// +kubebuilder:validation:Required
	// EmailAddress: The email address registered for the Azure mobile app.
	EmailAddress *string `json:"emailAddress,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`
}

var _ genruntime.ARMTransformer = &AzureAppPushReceiver{}

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

	// Set property "EmailAddress":
	if receiver.EmailAddress != nil {
		emailAddress := *receiver.EmailAddress
		result.EmailAddress = &emailAddress
	}

	// Set property "Name":
	if receiver.Name != nil {
		name := *receiver.Name
		result.Name = &name
	}
	return result, nil
}

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

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

	// Set property "EmailAddress":
	if typedInput.EmailAddress != nil {
		emailAddress := *typedInput.EmailAddress
		receiver.EmailAddress = &emailAddress
	}

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

	// No error
	return nil
}

// AssignProperties_From_AzureAppPushReceiver populates our AzureAppPushReceiver from the provided source AzureAppPushReceiver
func (receiver *AzureAppPushReceiver) AssignProperties_From_AzureAppPushReceiver(source *storage.AzureAppPushReceiver) error {

	// EmailAddress
	receiver.EmailAddress = genruntime.ClonePointerToString(source.EmailAddress)

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

	// No error
	return nil
}

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

	// EmailAddress
	destination.EmailAddress = genruntime.ClonePointerToString(receiver.EmailAddress)

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

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

	// No error
	return nil
}

// Initialize_From_AzureAppPushReceiver_STATUS populates our AzureAppPushReceiver from the provided source AzureAppPushReceiver_STATUS
func (receiver *AzureAppPushReceiver) Initialize_From_AzureAppPushReceiver_STATUS(source *AzureAppPushReceiver_STATUS) error {

	// EmailAddress
	receiver.EmailAddress = genruntime.ClonePointerToString(source.EmailAddress)

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

	// No error
	return nil
}

// The Azure mobile App push notification receiver.
type AzureAppPushReceiver_STATUS struct {
	// EmailAddress: The email address registered for the Azure mobile app.
	EmailAddress *string `json:"emailAddress,omitempty"`

	// Name: The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`
}

var _ genruntime.FromARMConverter = &AzureAppPushReceiver_STATUS{}

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

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

	// Set property "EmailAddress":
	if typedInput.EmailAddress != nil {
		emailAddress := *typedInput.EmailAddress
		receiver.EmailAddress = &emailAddress
	}

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

	// No error
	return nil
}

// AssignProperties_From_AzureAppPushReceiver_STATUS populates our AzureAppPushReceiver_STATUS from the provided source AzureAppPushReceiver_STATUS
func (receiver *AzureAppPushReceiver_STATUS) AssignProperties_From_AzureAppPushReceiver_STATUS(source *storage.AzureAppPushReceiver_STATUS) error {

	// EmailAddress
	receiver.EmailAddress = genruntime.ClonePointerToString(source.EmailAddress)

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

	// No error
	return nil
}

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

	// EmailAddress
	destination.EmailAddress = genruntime.ClonePointerToString(receiver.EmailAddress)

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

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

	// No error
	return nil
}

// An azure function receiver.
type AzureFunctionReceiver struct {
	// +kubebuilder:validation:Required
	// FunctionAppResourceReference: The azure resource id of the function app.
	FunctionAppResourceReference *genruntime.ResourceReference `armReference:"FunctionAppResourceId" json:"functionAppResourceReference,omitempty"`

	// +kubebuilder:validation:Required
	// FunctionName: The function name in the function app.
	FunctionName *string `json:"functionName,omitempty"`

	// +kubebuilder:validation:Required
	// HttpTriggerUrl: The http trigger url where http request sent to.
	HttpTriggerUrl *string `json:"httpTriggerUrl,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the azure function receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.ARMTransformer = &AzureFunctionReceiver{}

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

	// Set property "FunctionAppResourceId":
	if receiver.FunctionAppResourceReference != nil {
		functionAppResourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*receiver.FunctionAppResourceReference)
		if err != nil {
			return nil, err
		}
		functionAppResourceReference := functionAppResourceReferenceARMID
		result.FunctionAppResourceId = &functionAppResourceReference
	}

	// Set property "FunctionName":
	if receiver.FunctionName != nil {
		functionName := *receiver.FunctionName
		result.FunctionName = &functionName
	}

	// Set property "HttpTriggerUrl":
	if receiver.HttpTriggerUrl != nil {
		httpTriggerUrl := *receiver.HttpTriggerUrl
		result.HttpTriggerUrl = &httpTriggerUrl
	}

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

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}
	return result, nil
}

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

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

	// no assignment for property "FunctionAppResourceReference"

	// Set property "FunctionName":
	if typedInput.FunctionName != nil {
		functionName := *typedInput.FunctionName
		receiver.FunctionName = &functionName
	}

	// Set property "HttpTriggerUrl":
	if typedInput.HttpTriggerUrl != nil {
		httpTriggerUrl := *typedInput.HttpTriggerUrl
		receiver.HttpTriggerUrl = &httpTriggerUrl
	}

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

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_AzureFunctionReceiver populates our AzureFunctionReceiver from the provided source AzureFunctionReceiver
func (receiver *AzureFunctionReceiver) AssignProperties_From_AzureFunctionReceiver(source *storage.AzureFunctionReceiver) error {

	// FunctionAppResourceReference
	if source.FunctionAppResourceReference != nil {
		functionAppResourceReference := source.FunctionAppResourceReference.Copy()
		receiver.FunctionAppResourceReference = &functionAppResourceReference
	} else {
		receiver.FunctionAppResourceReference = nil
	}

	// FunctionName
	receiver.FunctionName = genruntime.ClonePointerToString(source.FunctionName)

	// HttpTriggerUrl
	receiver.HttpTriggerUrl = genruntime.ClonePointerToString(source.HttpTriggerUrl)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// FunctionAppResourceReference
	if receiver.FunctionAppResourceReference != nil {
		functionAppResourceReference := receiver.FunctionAppResourceReference.Copy()
		destination.FunctionAppResourceReference = &functionAppResourceReference
	} else {
		destination.FunctionAppResourceReference = nil
	}

	// FunctionName
	destination.FunctionName = genruntime.ClonePointerToString(receiver.FunctionName)

	// HttpTriggerUrl
	destination.HttpTriggerUrl = genruntime.ClonePointerToString(receiver.HttpTriggerUrl)

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

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Initialize_From_AzureFunctionReceiver_STATUS populates our AzureFunctionReceiver from the provided source AzureFunctionReceiver_STATUS
func (receiver *AzureFunctionReceiver) Initialize_From_AzureFunctionReceiver_STATUS(source *AzureFunctionReceiver_STATUS) error {

	// FunctionAppResourceReference
	if source.FunctionAppResourceId != nil {
		functionAppResourceReference := genruntime.CreateResourceReferenceFromARMID(*source.FunctionAppResourceId)
		receiver.FunctionAppResourceReference = &functionAppResourceReference
	} else {
		receiver.FunctionAppResourceReference = nil
	}

	// FunctionName
	receiver.FunctionName = genruntime.ClonePointerToString(source.FunctionName)

	// HttpTriggerUrl
	receiver.HttpTriggerUrl = genruntime.ClonePointerToString(source.HttpTriggerUrl)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

// An azure function receiver.
type AzureFunctionReceiver_STATUS struct {
	// FunctionAppResourceId: The azure resource id of the function app.
	FunctionAppResourceId *string `json:"functionAppResourceId,omitempty"`

	// FunctionName: The function name in the function app.
	FunctionName *string `json:"functionName,omitempty"`

	// HttpTriggerUrl: The http trigger url where http request sent to.
	HttpTriggerUrl *string `json:"httpTriggerUrl,omitempty"`

	// Name: The name of the azure function receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.FromARMConverter = &AzureFunctionReceiver_STATUS{}

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

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

	// Set property "FunctionAppResourceId":
	if typedInput.FunctionAppResourceId != nil {
		functionAppResourceId := *typedInput.FunctionAppResourceId
		receiver.FunctionAppResourceId = &functionAppResourceId
	}

	// Set property "FunctionName":
	if typedInput.FunctionName != nil {
		functionName := *typedInput.FunctionName
		receiver.FunctionName = &functionName
	}

	// Set property "HttpTriggerUrl":
	if typedInput.HttpTriggerUrl != nil {
		httpTriggerUrl := *typedInput.HttpTriggerUrl
		receiver.HttpTriggerUrl = &httpTriggerUrl
	}

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

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_AzureFunctionReceiver_STATUS populates our AzureFunctionReceiver_STATUS from the provided source AzureFunctionReceiver_STATUS
func (receiver *AzureFunctionReceiver_STATUS) AssignProperties_From_AzureFunctionReceiver_STATUS(source *storage.AzureFunctionReceiver_STATUS) error {

	// FunctionAppResourceId
	receiver.FunctionAppResourceId = genruntime.ClonePointerToString(source.FunctionAppResourceId)

	// FunctionName
	receiver.FunctionName = genruntime.ClonePointerToString(source.FunctionName)

	// HttpTriggerUrl
	receiver.HttpTriggerUrl = genruntime.ClonePointerToString(source.HttpTriggerUrl)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// FunctionAppResourceId
	destination.FunctionAppResourceId = genruntime.ClonePointerToString(receiver.FunctionAppResourceId)

	// FunctionName
	destination.FunctionName = genruntime.ClonePointerToString(receiver.FunctionName)

	// HttpTriggerUrl
	destination.HttpTriggerUrl = genruntime.ClonePointerToString(receiver.HttpTriggerUrl)

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

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// An email receiver.
type EmailReceiver struct {
	// +kubebuilder:validation:Required
	// EmailAddress: The email address of this receiver.
	EmailAddress *string `json:"emailAddress,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the email receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.ARMTransformer = &EmailReceiver{}

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

	// Set property "EmailAddress":
	if receiver.EmailAddress != nil {
		emailAddress := *receiver.EmailAddress
		result.EmailAddress = &emailAddress
	}

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

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}
	return result, nil
}

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

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

	// Set property "EmailAddress":
	if typedInput.EmailAddress != nil {
		emailAddress := *typedInput.EmailAddress
		receiver.EmailAddress = &emailAddress
	}

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

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_EmailReceiver populates our EmailReceiver from the provided source EmailReceiver
func (receiver *EmailReceiver) AssignProperties_From_EmailReceiver(source *storage.EmailReceiver) error {

	// EmailAddress
	receiver.EmailAddress = genruntime.ClonePointerToString(source.EmailAddress)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// EmailAddress
	destination.EmailAddress = genruntime.ClonePointerToString(receiver.EmailAddress)

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

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Initialize_From_EmailReceiver_STATUS populates our EmailReceiver from the provided source EmailReceiver_STATUS
func (receiver *EmailReceiver) Initialize_From_EmailReceiver_STATUS(source *EmailReceiver_STATUS) error {

	// EmailAddress
	receiver.EmailAddress = genruntime.ClonePointerToString(source.EmailAddress)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

// An email receiver.
type EmailReceiver_STATUS struct {
	// EmailAddress: The email address of this receiver.
	EmailAddress *string `json:"emailAddress,omitempty"`

	// Name: The name of the email receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// Status: The receiver status of the e-mail.
	Status *ReceiverStatus_STATUS `json:"status,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.FromARMConverter = &EmailReceiver_STATUS{}

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

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

	// Set property "EmailAddress":
	if typedInput.EmailAddress != nil {
		emailAddress := *typedInput.EmailAddress
		receiver.EmailAddress = &emailAddress
	}

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

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

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_EmailReceiver_STATUS populates our EmailReceiver_STATUS from the provided source EmailReceiver_STATUS
func (receiver *EmailReceiver_STATUS) AssignProperties_From_EmailReceiver_STATUS(source *storage.EmailReceiver_STATUS) error {

	// EmailAddress
	receiver.EmailAddress = genruntime.ClonePointerToString(source.EmailAddress)

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

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// EmailAddress
	destination.EmailAddress = genruntime.ClonePointerToString(receiver.EmailAddress)

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

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

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// An Event hub receiver.
type EventHubReceiver struct {
	// +kubebuilder:validation:Required
	// EventHubName: The name of the specific Event Hub queue
	EventHubName *string `json:"eventHubName,omitempty"`

	// +kubebuilder:validation:Required
	// EventHubNameSpace: The Event Hub namespace
	EventHubNameSpace *string `json:"eventHubNameSpace,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the Event hub receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// SubscriptionId: The Id for the subscription containing this event hub
	SubscriptionId *string `json:"subscriptionId,omitempty"`

	// TenantId: The tenant Id for the subscription containing this event hub
	TenantId *string `json:"tenantId,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.ARMTransformer = &EventHubReceiver{}

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

	// Set property "EventHubName":
	if receiver.EventHubName != nil {
		eventHubName := *receiver.EventHubName
		result.EventHubName = &eventHubName
	}

	// Set property "EventHubNameSpace":
	if receiver.EventHubNameSpace != nil {
		eventHubNameSpace := *receiver.EventHubNameSpace
		result.EventHubNameSpace = &eventHubNameSpace
	}

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

	// Set property "SubscriptionId":
	if receiver.SubscriptionId != nil {
		subscriptionId := *receiver.SubscriptionId
		result.SubscriptionId = &subscriptionId
	}

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

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}
	return result, nil
}

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

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

	// Set property "EventHubName":
	if typedInput.EventHubName != nil {
		eventHubName := *typedInput.EventHubName
		receiver.EventHubName = &eventHubName
	}

	// Set property "EventHubNameSpace":
	if typedInput.EventHubNameSpace != nil {
		eventHubNameSpace := *typedInput.EventHubNameSpace
		receiver.EventHubNameSpace = &eventHubNameSpace
	}

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

	// Set property "SubscriptionId":
	if typedInput.SubscriptionId != nil {
		subscriptionId := *typedInput.SubscriptionId
		receiver.SubscriptionId = &subscriptionId
	}

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

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_EventHubReceiver populates our EventHubReceiver from the provided source EventHubReceiver
func (receiver *EventHubReceiver) AssignProperties_From_EventHubReceiver(source *storage.EventHubReceiver) error {

	// EventHubName
	receiver.EventHubName = genruntime.ClonePointerToString(source.EventHubName)

	// EventHubNameSpace
	receiver.EventHubNameSpace = genruntime.ClonePointerToString(source.EventHubNameSpace)

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

	// SubscriptionId
	receiver.SubscriptionId = genruntime.ClonePointerToString(source.SubscriptionId)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// EventHubName
	destination.EventHubName = genruntime.ClonePointerToString(receiver.EventHubName)

	// EventHubNameSpace
	destination.EventHubNameSpace = genruntime.ClonePointerToString(receiver.EventHubNameSpace)

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

	// SubscriptionId
	destination.SubscriptionId = genruntime.ClonePointerToString(receiver.SubscriptionId)

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

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Initialize_From_EventHubReceiver_STATUS populates our EventHubReceiver from the provided source EventHubReceiver_STATUS
func (receiver *EventHubReceiver) Initialize_From_EventHubReceiver_STATUS(source *EventHubReceiver_STATUS) error {

	// EventHubName
	receiver.EventHubName = genruntime.ClonePointerToString(source.EventHubName)

	// EventHubNameSpace
	receiver.EventHubNameSpace = genruntime.ClonePointerToString(source.EventHubNameSpace)

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

	// SubscriptionId
	receiver.SubscriptionId = genruntime.ClonePointerToString(source.SubscriptionId)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

// An Event hub receiver.
type EventHubReceiver_STATUS struct {
	// EventHubName: The name of the specific Event Hub queue
	EventHubName *string `json:"eventHubName,omitempty"`

	// EventHubNameSpace: The Event Hub namespace
	EventHubNameSpace *string `json:"eventHubNameSpace,omitempty"`

	// Name: The name of the Event hub receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// SubscriptionId: The Id for the subscription containing this event hub
	SubscriptionId *string `json:"subscriptionId,omitempty"`

	// TenantId: The tenant Id for the subscription containing this event hub
	TenantId *string `json:"tenantId,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.FromARMConverter = &EventHubReceiver_STATUS{}

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

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

	// Set property "EventHubName":
	if typedInput.EventHubName != nil {
		eventHubName := *typedInput.EventHubName
		receiver.EventHubName = &eventHubName
	}

	// Set property "EventHubNameSpace":
	if typedInput.EventHubNameSpace != nil {
		eventHubNameSpace := *typedInput.EventHubNameSpace
		receiver.EventHubNameSpace = &eventHubNameSpace
	}

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

	// Set property "SubscriptionId":
	if typedInput.SubscriptionId != nil {
		subscriptionId := *typedInput.SubscriptionId
		receiver.SubscriptionId = &subscriptionId
	}

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

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_EventHubReceiver_STATUS populates our EventHubReceiver_STATUS from the provided source EventHubReceiver_STATUS
func (receiver *EventHubReceiver_STATUS) AssignProperties_From_EventHubReceiver_STATUS(source *storage.EventHubReceiver_STATUS) error {

	// EventHubName
	receiver.EventHubName = genruntime.ClonePointerToString(source.EventHubName)

	// EventHubNameSpace
	receiver.EventHubNameSpace = genruntime.ClonePointerToString(source.EventHubNameSpace)

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

	// SubscriptionId
	receiver.SubscriptionId = genruntime.ClonePointerToString(source.SubscriptionId)

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

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// EventHubName
	destination.EventHubName = genruntime.ClonePointerToString(receiver.EventHubName)

	// EventHubNameSpace
	destination.EventHubNameSpace = genruntime.ClonePointerToString(receiver.EventHubNameSpace)

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

	// SubscriptionId
	destination.SubscriptionId = genruntime.ClonePointerToString(receiver.SubscriptionId)

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

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// An Itsm receiver.
type ItsmReceiver struct {
	// +kubebuilder:validation:Required
	// ConnectionId: Unique identification of ITSM connection among multiple defined in above workspace.
	ConnectionId *string `json:"connectionId,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the Itsm receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// Region: Region in which workspace resides. Supported
	// values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'
	Region *string `json:"region,omitempty"`

	// +kubebuilder:validation:Required
	// TicketConfiguration: JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of
	// this blob as well.
	TicketConfiguration *string `json:"ticketConfiguration,omitempty"`

	// +kubebuilder:validation:Required
	// WorkspaceId: OMS LA instance identifier.
	WorkspaceId *string `json:"workspaceId,omitempty"`
}

var _ genruntime.ARMTransformer = &ItsmReceiver{}

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

	// Set property "ConnectionId":
	if receiver.ConnectionId != nil {
		connectionId := *receiver.ConnectionId
		result.ConnectionId = &connectionId
	}

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

	// Set property "Region":
	if receiver.Region != nil {
		region := *receiver.Region
		result.Region = &region
	}

	// Set property "TicketConfiguration":
	if receiver.TicketConfiguration != nil {
		ticketConfiguration := *receiver.TicketConfiguration
		result.TicketConfiguration = &ticketConfiguration
	}

	// Set property "WorkspaceId":
	if receiver.WorkspaceId != nil {
		workspaceId := *receiver.WorkspaceId
		result.WorkspaceId = &workspaceId
	}
	return result, nil
}

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

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

	// Set property "ConnectionId":
	if typedInput.ConnectionId != nil {
		connectionId := *typedInput.ConnectionId
		receiver.ConnectionId = &connectionId
	}

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

	// Set property "Region":
	if typedInput.Region != nil {
		region := *typedInput.Region
		receiver.Region = &region
	}

	// Set property "TicketConfiguration":
	if typedInput.TicketConfiguration != nil {
		ticketConfiguration := *typedInput.TicketConfiguration
		receiver.TicketConfiguration = &ticketConfiguration
	}

	// Set property "WorkspaceId":
	if typedInput.WorkspaceId != nil {
		workspaceId := *typedInput.WorkspaceId
		receiver.WorkspaceId = &workspaceId
	}

	// No error
	return nil
}

// AssignProperties_From_ItsmReceiver populates our ItsmReceiver from the provided source ItsmReceiver
func (receiver *ItsmReceiver) AssignProperties_From_ItsmReceiver(source *storage.ItsmReceiver) error {

	// ConnectionId
	receiver.ConnectionId = genruntime.ClonePointerToString(source.ConnectionId)

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

	// Region
	receiver.Region = genruntime.ClonePointerToString(source.Region)

	// TicketConfiguration
	receiver.TicketConfiguration = genruntime.ClonePointerToString(source.TicketConfiguration)

	// WorkspaceId
	receiver.WorkspaceId = genruntime.ClonePointerToString(source.WorkspaceId)

	// No error
	return nil
}

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

	// ConnectionId
	destination.ConnectionId = genruntime.ClonePointerToString(receiver.ConnectionId)

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

	// Region
	destination.Region = genruntime.ClonePointerToString(receiver.Region)

	// TicketConfiguration
	destination.TicketConfiguration = genruntime.ClonePointerToString(receiver.TicketConfiguration)

	// WorkspaceId
	destination.WorkspaceId = genruntime.ClonePointerToString(receiver.WorkspaceId)

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

	// No error
	return nil
}

// Initialize_From_ItsmReceiver_STATUS populates our ItsmReceiver from the provided source ItsmReceiver_STATUS
func (receiver *ItsmReceiver) Initialize_From_ItsmReceiver_STATUS(source *ItsmReceiver_STATUS) error {

	// ConnectionId
	receiver.ConnectionId = genruntime.ClonePointerToString(source.ConnectionId)

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

	// Region
	receiver.Region = genruntime.ClonePointerToString(source.Region)

	// TicketConfiguration
	receiver.TicketConfiguration = genruntime.ClonePointerToString(source.TicketConfiguration)

	// WorkspaceId
	receiver.WorkspaceId = genruntime.ClonePointerToString(source.WorkspaceId)

	// No error
	return nil
}

// An Itsm receiver.
type ItsmReceiver_STATUS struct {
	// ConnectionId: Unique identification of ITSM connection among multiple defined in above workspace.
	ConnectionId *string `json:"connectionId,omitempty"`

	// Name: The name of the Itsm receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// Region: Region in which workspace resides. Supported
	// values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'
	Region *string `json:"region,omitempty"`

	// TicketConfiguration: JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of
	// this blob as well.
	TicketConfiguration *string `json:"ticketConfiguration,omitempty"`

	// WorkspaceId: OMS LA instance identifier.
	WorkspaceId *string `json:"workspaceId,omitempty"`
}

var _ genruntime.FromARMConverter = &ItsmReceiver_STATUS{}

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

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

	// Set property "ConnectionId":
	if typedInput.ConnectionId != nil {
		connectionId := *typedInput.ConnectionId
		receiver.ConnectionId = &connectionId
	}

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

	// Set property "Region":
	if typedInput.Region != nil {
		region := *typedInput.Region
		receiver.Region = &region
	}

	// Set property "TicketConfiguration":
	if typedInput.TicketConfiguration != nil {
		ticketConfiguration := *typedInput.TicketConfiguration
		receiver.TicketConfiguration = &ticketConfiguration
	}

	// Set property "WorkspaceId":
	if typedInput.WorkspaceId != nil {
		workspaceId := *typedInput.WorkspaceId
		receiver.WorkspaceId = &workspaceId
	}

	// No error
	return nil
}

// AssignProperties_From_ItsmReceiver_STATUS populates our ItsmReceiver_STATUS from the provided source ItsmReceiver_STATUS
func (receiver *ItsmReceiver_STATUS) AssignProperties_From_ItsmReceiver_STATUS(source *storage.ItsmReceiver_STATUS) error {

	// ConnectionId
	receiver.ConnectionId = genruntime.ClonePointerToString(source.ConnectionId)

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

	// Region
	receiver.Region = genruntime.ClonePointerToString(source.Region)

	// TicketConfiguration
	receiver.TicketConfiguration = genruntime.ClonePointerToString(source.TicketConfiguration)

	// WorkspaceId
	receiver.WorkspaceId = genruntime.ClonePointerToString(source.WorkspaceId)

	// No error
	return nil
}

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

	// ConnectionId
	destination.ConnectionId = genruntime.ClonePointerToString(receiver.ConnectionId)

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

	// Region
	destination.Region = genruntime.ClonePointerToString(receiver.Region)

	// TicketConfiguration
	destination.TicketConfiguration = genruntime.ClonePointerToString(receiver.TicketConfiguration)

	// WorkspaceId
	destination.WorkspaceId = genruntime.ClonePointerToString(receiver.WorkspaceId)

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

	// No error
	return nil
}

// A logic app receiver.
type LogicAppReceiver struct {
	// +kubebuilder:validation:Required
	// CallbackUrl: The callback url where http request sent to.
	CallbackUrl *string `json:"callbackUrl,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the logic app receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// ResourceReference: The azure resource id of the logic app receiver.
	ResourceReference *genruntime.ResourceReference `armReference:"ResourceId" json:"resourceReference,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.ARMTransformer = &LogicAppReceiver{}

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

	// Set property "CallbackUrl":
	if receiver.CallbackUrl != nil {
		callbackUrl := *receiver.CallbackUrl
		result.CallbackUrl = &callbackUrl
	}

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

	// Set property "ResourceId":
	if receiver.ResourceReference != nil {
		resourceReferenceARMID, err := resolved.ResolvedReferences.Lookup(*receiver.ResourceReference)
		if err != nil {
			return nil, err
		}
		resourceReference := resourceReferenceARMID
		result.ResourceId = &resourceReference
	}

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}
	return result, nil
}

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

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

	// Set property "CallbackUrl":
	if typedInput.CallbackUrl != nil {
		callbackUrl := *typedInput.CallbackUrl
		receiver.CallbackUrl = &callbackUrl
	}

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

	// no assignment for property "ResourceReference"

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_LogicAppReceiver populates our LogicAppReceiver from the provided source LogicAppReceiver
func (receiver *LogicAppReceiver) AssignProperties_From_LogicAppReceiver(source *storage.LogicAppReceiver) error {

	// CallbackUrl
	receiver.CallbackUrl = genruntime.ClonePointerToString(source.CallbackUrl)

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

	// ResourceReference
	if source.ResourceReference != nil {
		resourceReference := source.ResourceReference.Copy()
		receiver.ResourceReference = &resourceReference
	} else {
		receiver.ResourceReference = nil
	}

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// CallbackUrl
	destination.CallbackUrl = genruntime.ClonePointerToString(receiver.CallbackUrl)

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

	// ResourceReference
	if receiver.ResourceReference != nil {
		resourceReference := receiver.ResourceReference.Copy()
		destination.ResourceReference = &resourceReference
	} else {
		destination.ResourceReference = nil
	}

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Initialize_From_LogicAppReceiver_STATUS populates our LogicAppReceiver from the provided source LogicAppReceiver_STATUS
func (receiver *LogicAppReceiver) Initialize_From_LogicAppReceiver_STATUS(source *LogicAppReceiver_STATUS) error {

	// CallbackUrl
	receiver.CallbackUrl = genruntime.ClonePointerToString(source.CallbackUrl)

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

	// ResourceReference
	if source.ResourceId != nil {
		resourceReference := genruntime.CreateResourceReferenceFromARMID(*source.ResourceId)
		receiver.ResourceReference = &resourceReference
	} else {
		receiver.ResourceReference = nil
	}

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

// A logic app receiver.
type LogicAppReceiver_STATUS struct {
	// CallbackUrl: The callback url where http request sent to.
	CallbackUrl *string `json:"callbackUrl,omitempty"`

	// Name: The name of the logic app receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// ResourceId: The azure resource id of the logic app receiver.
	ResourceId *string `json:"resourceId,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.FromARMConverter = &LogicAppReceiver_STATUS{}

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

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

	// Set property "CallbackUrl":
	if typedInput.CallbackUrl != nil {
		callbackUrl := *typedInput.CallbackUrl
		receiver.CallbackUrl = &callbackUrl
	}

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

	// Set property "ResourceId":
	if typedInput.ResourceId != nil {
		resourceId := *typedInput.ResourceId
		receiver.ResourceId = &resourceId
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_LogicAppReceiver_STATUS populates our LogicAppReceiver_STATUS from the provided source LogicAppReceiver_STATUS
func (receiver *LogicAppReceiver_STATUS) AssignProperties_From_LogicAppReceiver_STATUS(source *storage.LogicAppReceiver_STATUS) error {

	// CallbackUrl
	receiver.CallbackUrl = genruntime.ClonePointerToString(source.CallbackUrl)

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

	// ResourceId
	receiver.ResourceId = genruntime.ClonePointerToString(source.ResourceId)

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// CallbackUrl
	destination.CallbackUrl = genruntime.ClonePointerToString(receiver.CallbackUrl)

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

	// ResourceId
	destination.ResourceId = genruntime.ClonePointerToString(receiver.ResourceId)

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// An SMS receiver.
type SmsReceiver struct {
	// +kubebuilder:validation:Required
	// CountryCode: The country code of the SMS receiver.
	CountryCode *string `json:"countryCode,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the SMS receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// PhoneNumber: The phone number of the SMS receiver.
	PhoneNumber *string `json:"phoneNumber,omitempty"`
}

var _ genruntime.ARMTransformer = &SmsReceiver{}

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

	// Set property "CountryCode":
	if receiver.CountryCode != nil {
		countryCode := *receiver.CountryCode
		result.CountryCode = &countryCode
	}

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

	// Set property "PhoneNumber":
	if receiver.PhoneNumber != nil {
		phoneNumber := *receiver.PhoneNumber
		result.PhoneNumber = &phoneNumber
	}
	return result, nil
}

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

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

	// Set property "CountryCode":
	if typedInput.CountryCode != nil {
		countryCode := *typedInput.CountryCode
		receiver.CountryCode = &countryCode
	}

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

	// Set property "PhoneNumber":
	if typedInput.PhoneNumber != nil {
		phoneNumber := *typedInput.PhoneNumber
		receiver.PhoneNumber = &phoneNumber
	}

	// No error
	return nil
}

// AssignProperties_From_SmsReceiver populates our SmsReceiver from the provided source SmsReceiver
func (receiver *SmsReceiver) AssignProperties_From_SmsReceiver(source *storage.SmsReceiver) error {

	// CountryCode
	receiver.CountryCode = genruntime.ClonePointerToString(source.CountryCode)

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

	// PhoneNumber
	receiver.PhoneNumber = genruntime.ClonePointerToString(source.PhoneNumber)

	// No error
	return nil
}

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

	// CountryCode
	destination.CountryCode = genruntime.ClonePointerToString(receiver.CountryCode)

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

	// PhoneNumber
	destination.PhoneNumber = genruntime.ClonePointerToString(receiver.PhoneNumber)

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

	// No error
	return nil
}

// Initialize_From_SmsReceiver_STATUS populates our SmsReceiver from the provided source SmsReceiver_STATUS
func (receiver *SmsReceiver) Initialize_From_SmsReceiver_STATUS(source *SmsReceiver_STATUS) error {

	// CountryCode
	receiver.CountryCode = genruntime.ClonePointerToString(source.CountryCode)

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

	// PhoneNumber
	receiver.PhoneNumber = genruntime.ClonePointerToString(source.PhoneNumber)

	// No error
	return nil
}

// An SMS receiver.
type SmsReceiver_STATUS struct {
	// CountryCode: The country code of the SMS receiver.
	CountryCode *string `json:"countryCode,omitempty"`

	// Name: The name of the SMS receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// PhoneNumber: The phone number of the SMS receiver.
	PhoneNumber *string `json:"phoneNumber,omitempty"`

	// Status: The status of the receiver.
	Status *ReceiverStatus_STATUS `json:"status,omitempty"`
}

var _ genruntime.FromARMConverter = &SmsReceiver_STATUS{}

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

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

	// Set property "CountryCode":
	if typedInput.CountryCode != nil {
		countryCode := *typedInput.CountryCode
		receiver.CountryCode = &countryCode
	}

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

	// Set property "PhoneNumber":
	if typedInput.PhoneNumber != nil {
		phoneNumber := *typedInput.PhoneNumber
		receiver.PhoneNumber = &phoneNumber
	}

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

	// No error
	return nil
}

// AssignProperties_From_SmsReceiver_STATUS populates our SmsReceiver_STATUS from the provided source SmsReceiver_STATUS
func (receiver *SmsReceiver_STATUS) AssignProperties_From_SmsReceiver_STATUS(source *storage.SmsReceiver_STATUS) error {

	// CountryCode
	receiver.CountryCode = genruntime.ClonePointerToString(source.CountryCode)

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

	// PhoneNumber
	receiver.PhoneNumber = genruntime.ClonePointerToString(source.PhoneNumber)

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

	// No error
	return nil
}

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

	// CountryCode
	destination.CountryCode = genruntime.ClonePointerToString(receiver.CountryCode)

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

	// PhoneNumber
	destination.PhoneNumber = genruntime.ClonePointerToString(receiver.PhoneNumber)

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

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

	// No error
	return nil
}

// A voice receiver.
type VoiceReceiver struct {
	// +kubebuilder:validation:Required
	// CountryCode: The country code of the voice receiver.
	CountryCode *string `json:"countryCode,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the voice receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// +kubebuilder:validation:Required
	// PhoneNumber: The phone number of the voice receiver.
	PhoneNumber *string `json:"phoneNumber,omitempty"`
}

var _ genruntime.ARMTransformer = &VoiceReceiver{}

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

	// Set property "CountryCode":
	if receiver.CountryCode != nil {
		countryCode := *receiver.CountryCode
		result.CountryCode = &countryCode
	}

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

	// Set property "PhoneNumber":
	if receiver.PhoneNumber != nil {
		phoneNumber := *receiver.PhoneNumber
		result.PhoneNumber = &phoneNumber
	}
	return result, nil
}

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

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

	// Set property "CountryCode":
	if typedInput.CountryCode != nil {
		countryCode := *typedInput.CountryCode
		receiver.CountryCode = &countryCode
	}

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

	// Set property "PhoneNumber":
	if typedInput.PhoneNumber != nil {
		phoneNumber := *typedInput.PhoneNumber
		receiver.PhoneNumber = &phoneNumber
	}

	// No error
	return nil
}

// AssignProperties_From_VoiceReceiver populates our VoiceReceiver from the provided source VoiceReceiver
func (receiver *VoiceReceiver) AssignProperties_From_VoiceReceiver(source *storage.VoiceReceiver) error {

	// CountryCode
	receiver.CountryCode = genruntime.ClonePointerToString(source.CountryCode)

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

	// PhoneNumber
	receiver.PhoneNumber = genruntime.ClonePointerToString(source.PhoneNumber)

	// No error
	return nil
}

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

	// CountryCode
	destination.CountryCode = genruntime.ClonePointerToString(receiver.CountryCode)

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

	// PhoneNumber
	destination.PhoneNumber = genruntime.ClonePointerToString(receiver.PhoneNumber)

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

	// No error
	return nil
}

// Initialize_From_VoiceReceiver_STATUS populates our VoiceReceiver from the provided source VoiceReceiver_STATUS
func (receiver *VoiceReceiver) Initialize_From_VoiceReceiver_STATUS(source *VoiceReceiver_STATUS) error {

	// CountryCode
	receiver.CountryCode = genruntime.ClonePointerToString(source.CountryCode)

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

	// PhoneNumber
	receiver.PhoneNumber = genruntime.ClonePointerToString(source.PhoneNumber)

	// No error
	return nil
}

// A voice receiver.
type VoiceReceiver_STATUS struct {
	// CountryCode: The country code of the voice receiver.
	CountryCode *string `json:"countryCode,omitempty"`

	// Name: The name of the voice receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// PhoneNumber: The phone number of the voice receiver.
	PhoneNumber *string `json:"phoneNumber,omitempty"`
}

var _ genruntime.FromARMConverter = &VoiceReceiver_STATUS{}

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

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

	// Set property "CountryCode":
	if typedInput.CountryCode != nil {
		countryCode := *typedInput.CountryCode
		receiver.CountryCode = &countryCode
	}

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

	// Set property "PhoneNumber":
	if typedInput.PhoneNumber != nil {
		phoneNumber := *typedInput.PhoneNumber
		receiver.PhoneNumber = &phoneNumber
	}

	// No error
	return nil
}

// AssignProperties_From_VoiceReceiver_STATUS populates our VoiceReceiver_STATUS from the provided source VoiceReceiver_STATUS
func (receiver *VoiceReceiver_STATUS) AssignProperties_From_VoiceReceiver_STATUS(source *storage.VoiceReceiver_STATUS) error {

	// CountryCode
	receiver.CountryCode = genruntime.ClonePointerToString(source.CountryCode)

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

	// PhoneNumber
	receiver.PhoneNumber = genruntime.ClonePointerToString(source.PhoneNumber)

	// No error
	return nil
}

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

	// CountryCode
	destination.CountryCode = genruntime.ClonePointerToString(receiver.CountryCode)

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

	// PhoneNumber
	destination.PhoneNumber = genruntime.ClonePointerToString(receiver.PhoneNumber)

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

	// No error
	return nil
}

// A webhook receiver.
type WebhookReceiver struct {
	// IdentifierUri: Indicates the identifier uri for aad auth.
	IdentifierUri *string `json:"identifierUri,omitempty"`

	// +kubebuilder:validation:Required
	// Name: The name of the webhook receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// ObjectId: Indicates the webhook app object Id for aad auth.
	ObjectId *string `json:"objectId,omitempty"`

	// +kubebuilder:validation:Required
	// ServiceUri: The URI where webhooks should be sent.
	ServiceUri *string `json:"serviceUri,omitempty"`

	// TenantId: Indicates the tenant id for aad auth.
	TenantId *string `json:"tenantId,omitempty"`

	// UseAadAuth: Indicates whether or not use AAD authentication.
	UseAadAuth *bool `json:"useAadAuth,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.ARMTransformer = &WebhookReceiver{}

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

	// Set property "IdentifierUri":
	if receiver.IdentifierUri != nil {
		identifierUri := *receiver.IdentifierUri
		result.IdentifierUri = &identifierUri
	}

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

	// Set property "ObjectId":
	if receiver.ObjectId != nil {
		objectId := *receiver.ObjectId
		result.ObjectId = &objectId
	}

	// Set property "ServiceUri":
	if receiver.ServiceUri != nil {
		serviceUri := *receiver.ServiceUri
		result.ServiceUri = &serviceUri
	}

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

	// Set property "UseAadAuth":
	if receiver.UseAadAuth != nil {
		useAadAuth := *receiver.UseAadAuth
		result.UseAadAuth = &useAadAuth
	}

	// Set property "UseCommonAlertSchema":
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		result.UseCommonAlertSchema = &useCommonAlertSchema
	}
	return result, nil
}

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

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

	// Set property "IdentifierUri":
	if typedInput.IdentifierUri != nil {
		identifierUri := *typedInput.IdentifierUri
		receiver.IdentifierUri = &identifierUri
	}

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

	// Set property "ObjectId":
	if typedInput.ObjectId != nil {
		objectId := *typedInput.ObjectId
		receiver.ObjectId = &objectId
	}

	// Set property "ServiceUri":
	if typedInput.ServiceUri != nil {
		serviceUri := *typedInput.ServiceUri
		receiver.ServiceUri = &serviceUri
	}

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

	// Set property "UseAadAuth":
	if typedInput.UseAadAuth != nil {
		useAadAuth := *typedInput.UseAadAuth
		receiver.UseAadAuth = &useAadAuth
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_WebhookReceiver populates our WebhookReceiver from the provided source WebhookReceiver
func (receiver *WebhookReceiver) AssignProperties_From_WebhookReceiver(source *storage.WebhookReceiver) error {

	// IdentifierUri
	receiver.IdentifierUri = genruntime.ClonePointerToString(source.IdentifierUri)

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

	// ObjectId
	receiver.ObjectId = genruntime.ClonePointerToString(source.ObjectId)

	// ServiceUri
	receiver.ServiceUri = genruntime.ClonePointerToString(source.ServiceUri)

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

	// UseAadAuth
	if source.UseAadAuth != nil {
		useAadAuth := *source.UseAadAuth
		receiver.UseAadAuth = &useAadAuth
	} else {
		receiver.UseAadAuth = nil
	}

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// IdentifierUri
	destination.IdentifierUri = genruntime.ClonePointerToString(receiver.IdentifierUri)

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

	// ObjectId
	destination.ObjectId = genruntime.ClonePointerToString(receiver.ObjectId)

	// ServiceUri
	destination.ServiceUri = genruntime.ClonePointerToString(receiver.ServiceUri)

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

	// UseAadAuth
	if receiver.UseAadAuth != nil {
		useAadAuth := *receiver.UseAadAuth
		destination.UseAadAuth = &useAadAuth
	} else {
		destination.UseAadAuth = nil
	}

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Initialize_From_WebhookReceiver_STATUS populates our WebhookReceiver from the provided source WebhookReceiver_STATUS
func (receiver *WebhookReceiver) Initialize_From_WebhookReceiver_STATUS(source *WebhookReceiver_STATUS) error {

	// IdentifierUri
	receiver.IdentifierUri = genruntime.ClonePointerToString(source.IdentifierUri)

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

	// ObjectId
	receiver.ObjectId = genruntime.ClonePointerToString(source.ObjectId)

	// ServiceUri
	receiver.ServiceUri = genruntime.ClonePointerToString(source.ServiceUri)

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

	// UseAadAuth
	if source.UseAadAuth != nil {
		useAadAuth := *source.UseAadAuth
		receiver.UseAadAuth = &useAadAuth
	} else {
		receiver.UseAadAuth = nil
	}

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

// A webhook receiver.
type WebhookReceiver_STATUS struct {
	// IdentifierUri: Indicates the identifier uri for aad auth.
	IdentifierUri *string `json:"identifierUri,omitempty"`

	// Name: The name of the webhook receiver. Names must be unique across all receivers within an action group.
	Name *string `json:"name,omitempty"`

	// ObjectId: Indicates the webhook app object Id for aad auth.
	ObjectId *string `json:"objectId,omitempty"`

	// ServiceUri: The URI where webhooks should be sent.
	ServiceUri *string `json:"serviceUri,omitempty"`

	// TenantId: Indicates the tenant id for aad auth.
	TenantId *string `json:"tenantId,omitempty"`

	// UseAadAuth: Indicates whether or not use AAD authentication.
	UseAadAuth *bool `json:"useAadAuth,omitempty"`

	// UseCommonAlertSchema: Indicates whether to use common alert schema.
	UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"`
}

var _ genruntime.FromARMConverter = &WebhookReceiver_STATUS{}

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

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

	// Set property "IdentifierUri":
	if typedInput.IdentifierUri != nil {
		identifierUri := *typedInput.IdentifierUri
		receiver.IdentifierUri = &identifierUri
	}

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

	// Set property "ObjectId":
	if typedInput.ObjectId != nil {
		objectId := *typedInput.ObjectId
		receiver.ObjectId = &objectId
	}

	// Set property "ServiceUri":
	if typedInput.ServiceUri != nil {
		serviceUri := *typedInput.ServiceUri
		receiver.ServiceUri = &serviceUri
	}

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

	// Set property "UseAadAuth":
	if typedInput.UseAadAuth != nil {
		useAadAuth := *typedInput.UseAadAuth
		receiver.UseAadAuth = &useAadAuth
	}

	// Set property "UseCommonAlertSchema":
	if typedInput.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *typedInput.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	}

	// No error
	return nil
}

// AssignProperties_From_WebhookReceiver_STATUS populates our WebhookReceiver_STATUS from the provided source WebhookReceiver_STATUS
func (receiver *WebhookReceiver_STATUS) AssignProperties_From_WebhookReceiver_STATUS(source *storage.WebhookReceiver_STATUS) error {

	// IdentifierUri
	receiver.IdentifierUri = genruntime.ClonePointerToString(source.IdentifierUri)

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

	// ObjectId
	receiver.ObjectId = genruntime.ClonePointerToString(source.ObjectId)

	// ServiceUri
	receiver.ServiceUri = genruntime.ClonePointerToString(source.ServiceUri)

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

	// UseAadAuth
	if source.UseAadAuth != nil {
		useAadAuth := *source.UseAadAuth
		receiver.UseAadAuth = &useAadAuth
	} else {
		receiver.UseAadAuth = nil
	}

	// UseCommonAlertSchema
	if source.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *source.UseCommonAlertSchema
		receiver.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		receiver.UseCommonAlertSchema = nil
	}

	// No error
	return nil
}

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

	// IdentifierUri
	destination.IdentifierUri = genruntime.ClonePointerToString(receiver.IdentifierUri)

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

	// ObjectId
	destination.ObjectId = genruntime.ClonePointerToString(receiver.ObjectId)

	// ServiceUri
	destination.ServiceUri = genruntime.ClonePointerToString(receiver.ServiceUri)

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

	// UseAadAuth
	if receiver.UseAadAuth != nil {
		useAadAuth := *receiver.UseAadAuth
		destination.UseAadAuth = &useAadAuth
	} else {
		destination.UseAadAuth = nil
	}

	// UseCommonAlertSchema
	if receiver.UseCommonAlertSchema != nil {
		useCommonAlertSchema := *receiver.UseCommonAlertSchema
		destination.UseCommonAlertSchema = &useCommonAlertSchema
	} else {
		destination.UseCommonAlertSchema = nil
	}

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

	// No error
	return nil
}

// Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications.
type ReceiverStatus_STATUS string

const (
	ReceiverStatus_STATUS_Disabled     = ReceiverStatus_STATUS("Disabled")
	ReceiverStatus_STATUS_Enabled      = ReceiverStatus_STATUS("Enabled")
	ReceiverStatus_STATUS_NotSpecified = ReceiverStatus_STATUS("NotSpecified")
)

// Mapping from string to ReceiverStatus_STATUS
var receiverStatus_STATUS_Values = map[string]ReceiverStatus_STATUS{
	"disabled":     ReceiverStatus_STATUS_Disabled,
	"enabled":      ReceiverStatus_STATUS_Enabled,
	"notspecified": ReceiverStatus_STATUS_NotSpecified,
}

func init() {
	SchemeBuilder.Register(&ActionGroup{}, &ActionGroupList{})
}
