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

import (
	"fmt"
	v20220615s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20220615/storage"
	v20221001s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20221001/storage"
	v20230311s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230311/storage"
	v20230601s "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230601/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"
// Storage version of v1api20240101preview.ScheduledQueryRule
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Insights/preview/2024-01-01-preview/scheduledQueryRule_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}
type ScheduledQueryRule struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ScheduledQueryRule_Spec   `json:"spec,omitempty"`
	Status            ScheduledQueryRule_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &ScheduledQueryRule{}

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

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

var _ conversion.Convertible = &ScheduledQueryRule{}

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

	return rule.AssignProperties_From_ScheduledQueryRule(source)
}

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

	return rule.AssignProperties_To_ScheduledQueryRule(destination)
}

var _ configmaps.Exporter = &ScheduledQueryRule{}

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

var _ secrets.Exporter = &ScheduledQueryRule{}

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

var _ genruntime.KubernetesResource = &ScheduledQueryRule{}

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

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01-preview"
func (rule ScheduledQueryRule) GetAPIVersion() string {
	return "2024-01-01-preview"
}

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

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

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

// GetSupportedOperations returns the operations supported by the resource
func (rule *ScheduledQueryRule) 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/scheduledQueryRules"
func (rule *ScheduledQueryRule) GetType() string {
	return "Microsoft.Insights/scheduledQueryRules"
}

// NewEmptyStatus returns a new empty (blank) status
func (rule *ScheduledQueryRule) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &ScheduledQueryRule_STATUS{}
}

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

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

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

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

	rule.Status = st
	return nil
}

// AssignProperties_From_ScheduledQueryRule populates our ScheduledQueryRule from the provided source ScheduledQueryRule
func (rule *ScheduledQueryRule) AssignProperties_From_ScheduledQueryRule(source *v20220615s.ScheduledQueryRule) error {

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ScheduledQueryRule populates the provided destination ScheduledQueryRule from our ScheduledQueryRule
func (rule *ScheduledQueryRule) AssignProperties_To_ScheduledQueryRule(destination *v20220615s.ScheduledQueryRule) error {

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

	// Spec
	var spec v20220615s.ScheduledQueryRule_Spec
	err := rule.Spec.AssignProperties_To_ScheduledQueryRule_Spec(&spec)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRule_Spec() to populate field Spec")
	}
	destination.Spec = spec

	// Status
	var status v20220615s.ScheduledQueryRule_STATUS
	err = rule.Status.AssignProperties_To_ScheduledQueryRule_STATUS(&status)
	if err != nil {
		return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRule_STATUS() to populate field Status")
	}
	destination.Status = status

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

	// No error
	return nil
}

// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (rule *ScheduledQueryRule) OriginalGVK() *schema.GroupVersionKind {
	return &schema.GroupVersionKind{
		Group:   GroupVersion.Group,
		Version: rule.Spec.OriginalVersion,
		Kind:    "ScheduledQueryRule",
	}
}

// +kubebuilder:object:root=true
// Storage version of v1api20240101preview.ScheduledQueryRule
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Insights/preview/2024-01-01-preview/scheduledQueryRule_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}
type ScheduledQueryRuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ScheduledQueryRule `json:"items"`
}

// Storage version of v1api20240101preview.APIVersion
// +kubebuilder:validation:Enum={"2024-01-01-preview"}
type APIVersion string

const APIVersion_Value = APIVersion("2024-01-01-preview")

type augmentConversionForScheduledQueryRule interface {
	AssignPropertiesFrom(src *v20220615s.ScheduledQueryRule) error
	AssignPropertiesTo(dst *v20220615s.ScheduledQueryRule) error
}

// Storage version of v1api20240101preview.ScheduledQueryRule_Spec
type ScheduledQueryRule_Spec struct {
	Actions      *Actions `json:"actions,omitempty"`
	AutoMitigate *bool    `json:"autoMitigate,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"`
	CheckWorkspaceAlertsStorageConfigured *bool                           `json:"checkWorkspaceAlertsStorageConfigured,omitempty"`
	Criteria                              *ScheduledQueryRuleCriteria     `json:"criteria,omitempty"`
	Description                           *string                         `json:"description,omitempty"`
	DisplayName                           *string                         `json:"displayName,omitempty"`
	Enabled                               *bool                           `json:"enabled,omitempty"`
	EvaluationFrequency                   *string                         `json:"evaluationFrequency,omitempty"`
	Identity                              *Identity                       `json:"identity,omitempty"`
	Kind                                  *string                         `json:"kind,omitempty"`
	Location                              *string                         `json:"location,omitempty"`
	MuteActionsDuration                   *string                         `json:"muteActionsDuration,omitempty"`
	OperatorSpec                          *ScheduledQueryRuleOperatorSpec `json:"operatorSpec,omitempty"`
	OriginalVersion                       string                          `json:"originalVersion,omitempty"`
	OverrideQueryTimeRange                *string                         `json:"overrideQueryTimeRange,omitempty"`

	// +kubebuilder:validation:Required
	// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
	// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
	// reference to a resources.azure.com/ResourceGroup resource
	Owner                *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`
	PropertyBag          genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
	ResolveConfiguration *RuleResolveConfiguration          `json:"resolveConfiguration,omitempty"`
	ScopesReferences     []genruntime.ResourceReference     `armReference:"Scopes" json:"scopesReferences,omitempty"`
	Severity             *int                               `json:"severity,omitempty"`
	SkipQueryValidation  *bool                              `json:"skipQueryValidation,omitempty"`
	Tags                 map[string]string                  `json:"tags,omitempty"`
	TargetResourceTypes  []string                           `json:"targetResourceTypes,omitempty"`
	WindowSize           *string                            `json:"windowSize,omitempty"`
}

var _ genruntime.ConvertibleSpec = &ScheduledQueryRule_Spec{}

// ConvertSpecFrom populates our ScheduledQueryRule_Spec from the provided source
func (rule *ScheduledQueryRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	src, ok := source.(*v20220615s.ScheduledQueryRule_Spec)
	if ok {
		// Populate our instance from source
		return rule.AssignProperties_From_ScheduledQueryRule_Spec(src)
	}

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

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

	return nil
}

// ConvertSpecTo populates the provided destination from our ScheduledQueryRule_Spec
func (rule *ScheduledQueryRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	dst, ok := destination.(*v20220615s.ScheduledQueryRule_Spec)
	if ok {
		// Populate destination from our instance
		return rule.AssignProperties_To_ScheduledQueryRule_Spec(dst)
	}

	// Convert to an intermediate form
	dst = &v20220615s.ScheduledQueryRule_Spec{}
	err := rule.AssignProperties_To_ScheduledQueryRule_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_ScheduledQueryRule_Spec populates our ScheduledQueryRule_Spec from the provided source ScheduledQueryRule_Spec
func (rule *ScheduledQueryRule_Spec) AssignProperties_From_ScheduledQueryRule_Spec(source *v20220615s.ScheduledQueryRule_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Actions
	if source.Actions != nil {
		var action Actions
		err := action.AssignProperties_From_Actions(source.Actions)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Actions() to populate field Actions")
		}
		rule.Actions = &action
	} else {
		rule.Actions = nil
	}

	// AutoMitigate
	if source.AutoMitigate != nil {
		autoMitigate := *source.AutoMitigate
		rule.AutoMitigate = &autoMitigate
	} else {
		rule.AutoMitigate = nil
	}

	// AzureName
	rule.AzureName = source.AzureName

	// CheckWorkspaceAlertsStorageConfigured
	if source.CheckWorkspaceAlertsStorageConfigured != nil {
		checkWorkspaceAlertsStorageConfigured := *source.CheckWorkspaceAlertsStorageConfigured
		rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured
	} else {
		rule.CheckWorkspaceAlertsStorageConfigured = nil
	}

	// Criteria
	if source.Criteria != nil {
		var criterion ScheduledQueryRuleCriteria
		err := criterion.AssignProperties_From_ScheduledQueryRuleCriteria(source.Criteria)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleCriteria() to populate field Criteria")
		}
		rule.Criteria = &criterion
	} else {
		rule.Criteria = nil
	}

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

	// DisplayName
	rule.DisplayName = genruntime.ClonePointerToString(source.DisplayName)

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

	// EvaluationFrequency
	rule.EvaluationFrequency = genruntime.ClonePointerToString(source.EvaluationFrequency)

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

		rule.Identity = &identity
	} else {
		rule.Identity = nil
	}

	// Kind
	rule.Kind = genruntime.ClonePointerToString(source.Kind)

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

	// MuteActionsDuration
	rule.MuteActionsDuration = genruntime.ClonePointerToString(source.MuteActionsDuration)

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

	// OriginalVersion
	rule.OriginalVersion = source.OriginalVersion

	// OverrideQueryTimeRange
	rule.OverrideQueryTimeRange = genruntime.ClonePointerToString(source.OverrideQueryTimeRange)

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

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

		rule.ResolveConfiguration = &resolveConfiguration
	} else {
		rule.ResolveConfiguration = nil
	}

	// ScopesReferences
	if source.ScopesReferences != nil {
		scopesReferenceList := make([]genruntime.ResourceReference, len(source.ScopesReferences))
		for scopesReferenceIndex, scopesReferenceItem := range source.ScopesReferences {
			scopesReferenceList[scopesReferenceIndex] = scopesReferenceItem.Copy()
		}
		rule.ScopesReferences = scopesReferenceList
	} else {
		rule.ScopesReferences = nil
	}

	// Severity
	rule.Severity = genruntime.ClonePointerToInt(source.Severity)

	// SkipQueryValidation
	if source.SkipQueryValidation != nil {
		skipQueryValidation := *source.SkipQueryValidation
		rule.SkipQueryValidation = &skipQueryValidation
	} else {
		rule.SkipQueryValidation = nil
	}

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

	// TargetResourceTypes
	rule.TargetResourceTypes = genruntime.CloneSliceOfString(source.TargetResourceTypes)

	// WindowSize
	rule.WindowSize = genruntime.ClonePointerToString(source.WindowSize)

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

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

	// No error
	return nil
}

// AssignProperties_To_ScheduledQueryRule_Spec populates the provided destination ScheduledQueryRule_Spec from our ScheduledQueryRule_Spec
func (rule *ScheduledQueryRule_Spec) AssignProperties_To_ScheduledQueryRule_Spec(destination *v20220615s.ScheduledQueryRule_Spec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(rule.PropertyBag)

	// Actions
	if rule.Actions != nil {
		var action v20220615s.Actions
		err := rule.Actions.AssignProperties_To_Actions(&action)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Actions() to populate field Actions")
		}
		destination.Actions = &action
	} else {
		destination.Actions = nil
	}

	// AutoMitigate
	if rule.AutoMitigate != nil {
		autoMitigate := *rule.AutoMitigate
		destination.AutoMitigate = &autoMitigate
	} else {
		destination.AutoMitigate = nil
	}

	// AzureName
	destination.AzureName = rule.AzureName

	// CheckWorkspaceAlertsStorageConfigured
	if rule.CheckWorkspaceAlertsStorageConfigured != nil {
		checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured
		destination.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured
	} else {
		destination.CheckWorkspaceAlertsStorageConfigured = nil
	}

	// Criteria
	if rule.Criteria != nil {
		var criterion v20220615s.ScheduledQueryRuleCriteria
		err := rule.Criteria.AssignProperties_To_ScheduledQueryRuleCriteria(&criterion)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleCriteria() to populate field Criteria")
		}
		destination.Criteria = &criterion
	} else {
		destination.Criteria = nil
	}

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

	// DisplayName
	destination.DisplayName = genruntime.ClonePointerToString(rule.DisplayName)

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

	// EvaluationFrequency
	destination.EvaluationFrequency = genruntime.ClonePointerToString(rule.EvaluationFrequency)

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

	// Kind
	destination.Kind = genruntime.ClonePointerToString(rule.Kind)

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

	// MuteActionsDuration
	destination.MuteActionsDuration = genruntime.ClonePointerToString(rule.MuteActionsDuration)

	// OperatorSpec
	if rule.OperatorSpec != nil {
		var operatorSpec v20220615s.ScheduledQueryRuleOperatorSpec
		err := rule.OperatorSpec.AssignProperties_To_ScheduledQueryRuleOperatorSpec(&operatorSpec)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleOperatorSpec() to populate field OperatorSpec")
		}
		destination.OperatorSpec = &operatorSpec
	} else {
		destination.OperatorSpec = nil
	}

	// OriginalVersion
	destination.OriginalVersion = rule.OriginalVersion

	// OverrideQueryTimeRange
	destination.OverrideQueryTimeRange = genruntime.ClonePointerToString(rule.OverrideQueryTimeRange)

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

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

	// ScopesReferences
	if rule.ScopesReferences != nil {
		scopesReferenceList := make([]genruntime.ResourceReference, len(rule.ScopesReferences))
		for scopesReferenceIndex, scopesReferenceItem := range rule.ScopesReferences {
			scopesReferenceList[scopesReferenceIndex] = scopesReferenceItem.Copy()
		}
		destination.ScopesReferences = scopesReferenceList
	} else {
		destination.ScopesReferences = nil
	}

	// Severity
	destination.Severity = genruntime.ClonePointerToInt(rule.Severity)

	// SkipQueryValidation
	if rule.SkipQueryValidation != nil {
		skipQueryValidation := *rule.SkipQueryValidation
		destination.SkipQueryValidation = &skipQueryValidation
	} else {
		destination.SkipQueryValidation = nil
	}

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

	// TargetResourceTypes
	destination.TargetResourceTypes = genruntime.CloneSliceOfString(rule.TargetResourceTypes)

	// WindowSize
	destination.WindowSize = genruntime.ClonePointerToString(rule.WindowSize)

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.ScheduledQueryRule_STATUS
type ScheduledQueryRule_STATUS struct {
	Actions                               *Actions_STATUS                    `json:"actions,omitempty"`
	AutoMitigate                          *bool                              `json:"autoMitigate,omitempty"`
	CheckWorkspaceAlertsStorageConfigured *bool                              `json:"checkWorkspaceAlertsStorageConfigured,omitempty"`
	Conditions                            []conditions.Condition             `json:"conditions,omitempty"`
	CreatedWithApiVersion                 *string                            `json:"createdWithApiVersion,omitempty"`
	Criteria                              *ScheduledQueryRuleCriteria_STATUS `json:"criteria,omitempty"`
	Description                           *string                            `json:"description,omitempty"`
	DisplayName                           *string                            `json:"displayName,omitempty"`
	Enabled                               *bool                              `json:"enabled,omitempty"`
	Etag                                  *string                            `json:"etag,omitempty"`
	EvaluationFrequency                   *string                            `json:"evaluationFrequency,omitempty"`
	Id                                    *string                            `json:"id,omitempty"`
	Identity                              *Identity_STATUS                   `json:"identity,omitempty"`
	IsLegacyLogAnalyticsRule              *bool                              `json:"isLegacyLogAnalyticsRule,omitempty"`
	IsWorkspaceAlertsStorageConfigured    *bool                              `json:"isWorkspaceAlertsStorageConfigured,omitempty"`
	Kind                                  *string                            `json:"kind,omitempty"`
	Location                              *string                            `json:"location,omitempty"`
	MuteActionsDuration                   *string                            `json:"muteActionsDuration,omitempty"`
	Name                                  *string                            `json:"name,omitempty"`
	OverrideQueryTimeRange                *string                            `json:"overrideQueryTimeRange,omitempty"`
	PropertyBag                           genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
	ResolveConfiguration                  *RuleResolveConfiguration_STATUS   `json:"resolveConfiguration,omitempty"`
	Scopes                                []string                           `json:"scopes,omitempty"`
	Severity                              *int                               `json:"severity,omitempty"`
	SkipQueryValidation                   *bool                              `json:"skipQueryValidation,omitempty"`
	SystemData                            *SystemData_STATUS                 `json:"systemData,omitempty"`
	Tags                                  map[string]string                  `json:"tags,omitempty"`
	TargetResourceTypes                   []string                           `json:"targetResourceTypes,omitempty"`
	Type                                  *string                            `json:"type,omitempty"`
	WindowSize                            *string                            `json:"windowSize,omitempty"`
}

var _ genruntime.ConvertibleStatus = &ScheduledQueryRule_STATUS{}

// ConvertStatusFrom populates our ScheduledQueryRule_STATUS from the provided source
func (rule *ScheduledQueryRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	src, ok := source.(*v20220615s.ScheduledQueryRule_STATUS)
	if ok {
		// Populate our instance from source
		return rule.AssignProperties_From_ScheduledQueryRule_STATUS(src)
	}

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

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

	return nil
}

// ConvertStatusTo populates the provided destination from our ScheduledQueryRule_STATUS
func (rule *ScheduledQueryRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	dst, ok := destination.(*v20220615s.ScheduledQueryRule_STATUS)
	if ok {
		// Populate destination from our instance
		return rule.AssignProperties_To_ScheduledQueryRule_STATUS(dst)
	}

	// Convert to an intermediate form
	dst = &v20220615s.ScheduledQueryRule_STATUS{}
	err := rule.AssignProperties_To_ScheduledQueryRule_STATUS(dst)
	if err != nil {
		return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()")
	}

	// Update dst from our instance
	err = dst.ConvertStatusTo(destination)
	if err != nil {
		return eris.Wrap(err, "final step of conversion in ConvertStatusTo()")
	}

	return nil
}

// AssignProperties_From_ScheduledQueryRule_STATUS populates our ScheduledQueryRule_STATUS from the provided source ScheduledQueryRule_STATUS
func (rule *ScheduledQueryRule_STATUS) AssignProperties_From_ScheduledQueryRule_STATUS(source *v20220615s.ScheduledQueryRule_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// Actions
	if source.Actions != nil {
		var action Actions_STATUS
		err := action.AssignProperties_From_Actions_STATUS(source.Actions)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Actions_STATUS() to populate field Actions")
		}
		rule.Actions = &action
	} else {
		rule.Actions = nil
	}

	// AutoMitigate
	if source.AutoMitigate != nil {
		autoMitigate := *source.AutoMitigate
		rule.AutoMitigate = &autoMitigate
	} else {
		rule.AutoMitigate = nil
	}

	// CheckWorkspaceAlertsStorageConfigured
	if source.CheckWorkspaceAlertsStorageConfigured != nil {
		checkWorkspaceAlertsStorageConfigured := *source.CheckWorkspaceAlertsStorageConfigured
		rule.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured
	} else {
		rule.CheckWorkspaceAlertsStorageConfigured = nil
	}

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

	// CreatedWithApiVersion
	rule.CreatedWithApiVersion = genruntime.ClonePointerToString(source.CreatedWithApiVersion)

	// Criteria
	if source.Criteria != nil {
		var criterion ScheduledQueryRuleCriteria_STATUS
		err := criterion.AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(source.Criteria)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_ScheduledQueryRuleCriteria_STATUS() to populate field Criteria")
		}
		rule.Criteria = &criterion
	} else {
		rule.Criteria = nil
	}

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

	// DisplayName
	rule.DisplayName = genruntime.ClonePointerToString(source.DisplayName)

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

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

	// EvaluationFrequency
	rule.EvaluationFrequency = genruntime.ClonePointerToString(source.EvaluationFrequency)

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

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

		rule.Identity = &identity
	} else {
		rule.Identity = nil
	}

	// IsLegacyLogAnalyticsRule
	if source.IsLegacyLogAnalyticsRule != nil {
		isLegacyLogAnalyticsRule := *source.IsLegacyLogAnalyticsRule
		rule.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule
	} else {
		rule.IsLegacyLogAnalyticsRule = nil
	}

	// IsWorkspaceAlertsStorageConfigured
	if source.IsWorkspaceAlertsStorageConfigured != nil {
		isWorkspaceAlertsStorageConfigured := *source.IsWorkspaceAlertsStorageConfigured
		rule.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured
	} else {
		rule.IsWorkspaceAlertsStorageConfigured = nil
	}

	// Kind
	rule.Kind = genruntime.ClonePointerToString(source.Kind)

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

	// MuteActionsDuration
	rule.MuteActionsDuration = genruntime.ClonePointerToString(source.MuteActionsDuration)

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

	// OverrideQueryTimeRange
	rule.OverrideQueryTimeRange = genruntime.ClonePointerToString(source.OverrideQueryTimeRange)

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

		rule.ResolveConfiguration = &resolveConfiguration
	} else {
		rule.ResolveConfiguration = nil
	}

	// Scopes
	rule.Scopes = genruntime.CloneSliceOfString(source.Scopes)

	// Severity
	rule.Severity = genruntime.ClonePointerToInt(source.Severity)

	// SkipQueryValidation
	if source.SkipQueryValidation != nil {
		skipQueryValidation := *source.SkipQueryValidation
		rule.SkipQueryValidation = &skipQueryValidation
	} else {
		rule.SkipQueryValidation = nil
	}

	// SystemData
	if source.SystemData != nil {
		var systemDataSTATUSStash v20221001s.SystemData_STATUS
		err := source.SystemData.AssignProperties_To_SystemData_STATUS(&systemDataSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData_STATUSStash from SystemData")
		}
		var systemDataSTATUSStashLocal v20230311s.SystemData_STATUS
		err = systemDataSTATUSStash.AssignProperties_To_SystemData_STATUS(&systemDataSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData_STATUSStash")
		}
		var systemDataSTATUSPivot v20230601s.SystemData_STATUS
		err = systemDataSTATUSStashLocal.AssignProperties_To_SystemData_STATUS(&systemDataSTATUSPivot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData_STATUSPivot from SystemData_STATUSStash")
		}
		var systemDatum SystemData_STATUS
		err = systemDatum.AssignProperties_From_SystemData_STATUS(&systemDataSTATUSPivot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData from SystemData_STATUSPivot")
		}
		rule.SystemData = &systemDatum
	} else {
		rule.SystemData = nil
	}

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

	// TargetResourceTypes
	rule.TargetResourceTypes = genruntime.CloneSliceOfString(source.TargetResourceTypes)

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

	// WindowSize
	rule.WindowSize = genruntime.ClonePointerToString(source.WindowSize)

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

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

	// No error
	return nil
}

// AssignProperties_To_ScheduledQueryRule_STATUS populates the provided destination ScheduledQueryRule_STATUS from our ScheduledQueryRule_STATUS
func (rule *ScheduledQueryRule_STATUS) AssignProperties_To_ScheduledQueryRule_STATUS(destination *v20220615s.ScheduledQueryRule_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(rule.PropertyBag)

	// Actions
	if rule.Actions != nil {
		var action v20220615s.Actions_STATUS
		err := rule.Actions.AssignProperties_To_Actions_STATUS(&action)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Actions_STATUS() to populate field Actions")
		}
		destination.Actions = &action
	} else {
		destination.Actions = nil
	}

	// AutoMitigate
	if rule.AutoMitigate != nil {
		autoMitigate := *rule.AutoMitigate
		destination.AutoMitigate = &autoMitigate
	} else {
		destination.AutoMitigate = nil
	}

	// CheckWorkspaceAlertsStorageConfigured
	if rule.CheckWorkspaceAlertsStorageConfigured != nil {
		checkWorkspaceAlertsStorageConfigured := *rule.CheckWorkspaceAlertsStorageConfigured
		destination.CheckWorkspaceAlertsStorageConfigured = &checkWorkspaceAlertsStorageConfigured
	} else {
		destination.CheckWorkspaceAlertsStorageConfigured = nil
	}

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

	// CreatedWithApiVersion
	destination.CreatedWithApiVersion = genruntime.ClonePointerToString(rule.CreatedWithApiVersion)

	// Criteria
	if rule.Criteria != nil {
		var criterion v20220615s.ScheduledQueryRuleCriteria_STATUS
		err := rule.Criteria.AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(&criterion)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_ScheduledQueryRuleCriteria_STATUS() to populate field Criteria")
		}
		destination.Criteria = &criterion
	} else {
		destination.Criteria = nil
	}

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

	// DisplayName
	destination.DisplayName = genruntime.ClonePointerToString(rule.DisplayName)

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

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

	// EvaluationFrequency
	destination.EvaluationFrequency = genruntime.ClonePointerToString(rule.EvaluationFrequency)

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

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

	// IsLegacyLogAnalyticsRule
	if rule.IsLegacyLogAnalyticsRule != nil {
		isLegacyLogAnalyticsRule := *rule.IsLegacyLogAnalyticsRule
		destination.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule
	} else {
		destination.IsLegacyLogAnalyticsRule = nil
	}

	// IsWorkspaceAlertsStorageConfigured
	if rule.IsWorkspaceAlertsStorageConfigured != nil {
		isWorkspaceAlertsStorageConfigured := *rule.IsWorkspaceAlertsStorageConfigured
		destination.IsWorkspaceAlertsStorageConfigured = &isWorkspaceAlertsStorageConfigured
	} else {
		destination.IsWorkspaceAlertsStorageConfigured = nil
	}

	// Kind
	destination.Kind = genruntime.ClonePointerToString(rule.Kind)

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

	// MuteActionsDuration
	destination.MuteActionsDuration = genruntime.ClonePointerToString(rule.MuteActionsDuration)

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

	// OverrideQueryTimeRange
	destination.OverrideQueryTimeRange = genruntime.ClonePointerToString(rule.OverrideQueryTimeRange)

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

	// Scopes
	destination.Scopes = genruntime.CloneSliceOfString(rule.Scopes)

	// Severity
	destination.Severity = genruntime.ClonePointerToInt(rule.Severity)

	// SkipQueryValidation
	if rule.SkipQueryValidation != nil {
		skipQueryValidation := *rule.SkipQueryValidation
		destination.SkipQueryValidation = &skipQueryValidation
	} else {
		destination.SkipQueryValidation = nil
	}

	// SystemData
	if rule.SystemData != nil {
		var systemDataSTATUSPivot v20230601s.SystemData_STATUS
		err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDataSTATUSPivot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData_STATUSPivot from SystemData")
		}
		var systemDataSTATUSStash v20230311s.SystemData_STATUS
		err = systemDataSTATUSStash.AssignProperties_From_SystemData_STATUS(&systemDataSTATUSPivot)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData_STATUSStash from SystemData_STATUSPivot")
		}
		var systemDataSTATUSStashLocal v20221001s.SystemData_STATUS
		err = systemDataSTATUSStashLocal.AssignProperties_From_SystemData_STATUS(&systemDataSTATUSStash)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData_STATUSStash")
		}
		var systemDatum v20220615s.SystemData_STATUS
		err = systemDatum.AssignProperties_From_SystemData_STATUS(&systemDataSTATUSStashLocal)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData from SystemData_STATUSStash")
		}
		destination.SystemData = &systemDatum
	} else {
		destination.SystemData = nil
	}

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

	// TargetResourceTypes
	destination.TargetResourceTypes = genruntime.CloneSliceOfString(rule.TargetResourceTypes)

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

	// WindowSize
	destination.WindowSize = genruntime.ClonePointerToString(rule.WindowSize)

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.Actions
// Actions to invoke when the alert fires.
type Actions struct {
	ActionGroupsReferences []genruntime.ResourceReference `armReference:"ActionGroups" json:"actionGroupsReferences,omitempty"`
	ActionProperties       map[string]string              `json:"actionProperties,omitempty"`
	CustomProperties       map[string]string              `json:"customProperties,omitempty"`
	PropertyBag            genruntime.PropertyBag         `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_Actions populates our Actions from the provided source Actions
func (actions *Actions) AssignProperties_From_Actions(source *v20220615s.Actions) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ActionGroupsReferences
	if source.ActionGroupsReferences != nil {
		actionGroupsReferenceList := make([]genruntime.ResourceReference, len(source.ActionGroupsReferences))
		for actionGroupsReferenceIndex, actionGroupsReferenceItem := range source.ActionGroupsReferences {
			actionGroupsReferenceList[actionGroupsReferenceIndex] = actionGroupsReferenceItem.Copy()
		}
		actions.ActionGroupsReferences = actionGroupsReferenceList
	} else {
		actions.ActionGroupsReferences = nil
	}

	// ActionProperties
	if propertyBag.Contains("ActionProperties") {
		var actionProperty map[string]string
		err := propertyBag.Pull("ActionProperties", &actionProperty)
		if err != nil {
			return eris.Wrap(err, "pulling 'ActionProperties' from propertyBag")
		}

		actions.ActionProperties = actionProperty
	} else {
		actions.ActionProperties = nil
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Actions populates the provided destination Actions from our Actions
func (actions *Actions) AssignProperties_To_Actions(destination *v20220615s.Actions) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(actions.PropertyBag)

	// ActionGroupsReferences
	if actions.ActionGroupsReferences != nil {
		actionGroupsReferenceList := make([]genruntime.ResourceReference, len(actions.ActionGroupsReferences))
		for actionGroupsReferenceIndex, actionGroupsReferenceItem := range actions.ActionGroupsReferences {
			actionGroupsReferenceList[actionGroupsReferenceIndex] = actionGroupsReferenceItem.Copy()
		}
		destination.ActionGroupsReferences = actionGroupsReferenceList
	} else {
		destination.ActionGroupsReferences = nil
	}

	// ActionProperties
	if len(actions.ActionProperties) > 0 {
		propertyBag.Add("ActionProperties", actions.ActionProperties)
	} else {
		propertyBag.Remove("ActionProperties")
	}

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

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.Actions_STATUS
// Actions to invoke when the alert fires.
type Actions_STATUS struct {
	ActionGroups     []string               `json:"actionGroups,omitempty"`
	ActionProperties map[string]string      `json:"actionProperties,omitempty"`
	CustomProperties map[string]string      `json:"customProperties,omitempty"`
	PropertyBag      genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_Actions_STATUS populates our Actions_STATUS from the provided source Actions_STATUS
func (actions *Actions_STATUS) AssignProperties_From_Actions_STATUS(source *v20220615s.Actions_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// ActionGroups
	actions.ActionGroups = genruntime.CloneSliceOfString(source.ActionGroups)

	// ActionProperties
	if propertyBag.Contains("ActionProperties") {
		var actionProperty map[string]string
		err := propertyBag.Pull("ActionProperties", &actionProperty)
		if err != nil {
			return eris.Wrap(err, "pulling 'ActionProperties' from propertyBag")
		}

		actions.ActionProperties = actionProperty
	} else {
		actions.ActionProperties = nil
	}

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

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

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

	// No error
	return nil
}

// AssignProperties_To_Actions_STATUS populates the provided destination Actions_STATUS from our Actions_STATUS
func (actions *Actions_STATUS) AssignProperties_To_Actions_STATUS(destination *v20220615s.Actions_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(actions.PropertyBag)

	// ActionGroups
	destination.ActionGroups = genruntime.CloneSliceOfString(actions.ActionGroups)

	// ActionProperties
	if len(actions.ActionProperties) > 0 {
		propertyBag.Add("ActionProperties", actions.ActionProperties)
	} else {
		propertyBag.Remove("ActionProperties")
	}

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

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

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

	// No error
	return nil
}

type augmentConversionForScheduledQueryRule_Spec interface {
	AssignPropertiesFrom(src *v20220615s.ScheduledQueryRule_Spec) error
	AssignPropertiesTo(dst *v20220615s.ScheduledQueryRule_Spec) error
}

type augmentConversionForScheduledQueryRule_STATUS interface {
	AssignPropertiesFrom(src *v20220615s.ScheduledQueryRule_STATUS) error
	AssignPropertiesTo(dst *v20220615s.ScheduledQueryRule_STATUS) error
}

// Storage version of v1api20240101preview.Identity
// Identity for the resource.
type Identity struct {
	PropertyBag            genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	Type                   *string                       `json:"type,omitempty"`
	UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

// Storage version of v1api20240101preview.Identity_STATUS
// Identity for the resource.
type Identity_STATUS struct {
	PrincipalId            *string                                  `json:"principalId,omitempty"`
	PropertyBag            genruntime.PropertyBag                   `json:"$propertyBag,omitempty"`
	TenantId               *string                                  `json:"tenantId,omitempty"`
	Type                   *string                                  `json:"type,omitempty"`
	UserAssignedIdentities map[string]UserIdentityProperties_STATUS `json:"userAssignedIdentities,omitempty"`
}

// Storage version of v1api20240101preview.RuleResolveConfiguration
// TBD. Relevant only for rules of the kind LogAlert.
type RuleResolveConfiguration struct {
	AutoResolved  *bool                  `json:"autoResolved,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	TimeToResolve *string                `json:"timeToResolve,omitempty"`
}

// Storage version of v1api20240101preview.RuleResolveConfiguration_STATUS
// TBD. Relevant only for rules of the kind LogAlert.
type RuleResolveConfiguration_STATUS struct {
	AutoResolved  *bool                  `json:"autoResolved,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	TimeToResolve *string                `json:"timeToResolve,omitempty"`
}

// Storage version of v1api20240101preview.ScheduledQueryRuleCriteria
// The rule criteria that defines the conditions of the scheduled query rule.
type ScheduledQueryRuleCriteria struct {
	AllOf       []Condition            `json:"allOf,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ScheduledQueryRuleCriteria populates our ScheduledQueryRuleCriteria from the provided source ScheduledQueryRuleCriteria
func (criteria *ScheduledQueryRuleCriteria) AssignProperties_From_ScheduledQueryRuleCriteria(source *v20220615s.ScheduledQueryRuleCriteria) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AllOf
	if source.AllOf != nil {
		allOfList := make([]Condition, len(source.AllOf))
		for allOfIndex, allOfItem := range source.AllOf {
			var allOf Condition
			err := allOf.AssignProperties_From_Condition(&allOfItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Condition() to populate field AllOf")
			}
			allOfList[allOfIndex] = allOf
		}
		criteria.AllOf = allOfList
	} else {
		criteria.AllOf = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_ScheduledQueryRuleCriteria populates the provided destination ScheduledQueryRuleCriteria from our ScheduledQueryRuleCriteria
func (criteria *ScheduledQueryRuleCriteria) AssignProperties_To_ScheduledQueryRuleCriteria(destination *v20220615s.ScheduledQueryRuleCriteria) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(criteria.PropertyBag)

	// AllOf
	if criteria.AllOf != nil {
		allOfList := make([]v20220615s.Condition, len(criteria.AllOf))
		for allOfIndex, allOfItem := range criteria.AllOf {
			var allOf v20220615s.Condition
			err := allOfItem.AssignProperties_To_Condition(&allOf)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Condition() to populate field AllOf")
			}
			allOfList[allOfIndex] = allOf
		}
		destination.AllOf = allOfList
	} else {
		destination.AllOf = nil
	}

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.ScheduledQueryRuleCriteria_STATUS
// The rule criteria that defines the conditions of the scheduled query rule.
type ScheduledQueryRuleCriteria_STATUS struct {
	AllOf       []Condition_STATUS     `json:"allOf,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_ScheduledQueryRuleCriteria_STATUS populates our ScheduledQueryRuleCriteria_STATUS from the provided source ScheduledQueryRuleCriteria_STATUS
func (criteria *ScheduledQueryRuleCriteria_STATUS) AssignProperties_From_ScheduledQueryRuleCriteria_STATUS(source *v20220615s.ScheduledQueryRuleCriteria_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// AllOf
	if source.AllOf != nil {
		allOfList := make([]Condition_STATUS, len(source.AllOf))
		for allOfIndex, allOfItem := range source.AllOf {
			var allOf Condition_STATUS
			err := allOf.AssignProperties_From_Condition_STATUS(&allOfItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Condition_STATUS() to populate field AllOf")
			}
			allOfList[allOfIndex] = allOf
		}
		criteria.AllOf = allOfList
	} else {
		criteria.AllOf = nil
	}

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

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

	// No error
	return nil
}

// AssignProperties_To_ScheduledQueryRuleCriteria_STATUS populates the provided destination ScheduledQueryRuleCriteria_STATUS from our ScheduledQueryRuleCriteria_STATUS
func (criteria *ScheduledQueryRuleCriteria_STATUS) AssignProperties_To_ScheduledQueryRuleCriteria_STATUS(destination *v20220615s.ScheduledQueryRuleCriteria_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(criteria.PropertyBag)

	// AllOf
	if criteria.AllOf != nil {
		allOfList := make([]v20220615s.Condition_STATUS, len(criteria.AllOf))
		for allOfIndex, allOfItem := range criteria.AllOf {
			var allOf v20220615s.Condition_STATUS
			err := allOfItem.AssignProperties_To_Condition_STATUS(&allOf)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Condition_STATUS() to populate field AllOf")
			}
			allOfList[allOfIndex] = allOf
		}
		destination.AllOf = allOfList
	} else {
		destination.AllOf = nil
	}

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

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

	// No error
	return nil
}

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

// AssignProperties_From_ScheduledQueryRuleOperatorSpec populates our ScheduledQueryRuleOperatorSpec from the provided source ScheduledQueryRuleOperatorSpec
func (operator *ScheduledQueryRuleOperatorSpec) AssignProperties_From_ScheduledQueryRuleOperatorSpec(source *v20220615s.ScheduledQueryRuleOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

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

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

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

	// No error
	return nil
}

// AssignProperties_To_ScheduledQueryRuleOperatorSpec populates the provided destination ScheduledQueryRuleOperatorSpec from our ScheduledQueryRuleOperatorSpec
func (operator *ScheduledQueryRuleOperatorSpec) AssignProperties_To_ScheduledQueryRuleOperatorSpec(destination *v20220615s.ScheduledQueryRuleOperatorSpec) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(operator.PropertyBag)

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

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

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

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

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

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

	// No error
	return nil
}

type augmentConversionForActions interface {
	AssignPropertiesFrom(src *v20220615s.Actions) error
	AssignPropertiesTo(dst *v20220615s.Actions) error
}

type augmentConversionForActions_STATUS interface {
	AssignPropertiesFrom(src *v20220615s.Actions_STATUS) error
	AssignPropertiesTo(dst *v20220615s.Actions_STATUS) error
}

type augmentConversionForScheduledQueryRuleCriteria interface {
	AssignPropertiesFrom(src *v20220615s.ScheduledQueryRuleCriteria) error
	AssignPropertiesTo(dst *v20220615s.ScheduledQueryRuleCriteria) error
}

type augmentConversionForScheduledQueryRuleCriteria_STATUS interface {
	AssignPropertiesFrom(src *v20220615s.ScheduledQueryRuleCriteria_STATUS) error
	AssignPropertiesTo(dst *v20220615s.ScheduledQueryRuleCriteria_STATUS) error
}

type augmentConversionForScheduledQueryRuleOperatorSpec interface {
	AssignPropertiesFrom(src *v20220615s.ScheduledQueryRuleOperatorSpec) error
	AssignPropertiesTo(dst *v20220615s.ScheduledQueryRuleOperatorSpec) error
}

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

// Storage version of v1api20240101preview.Condition
// A condition of the scheduled query rule.
type Condition struct {
	AlertSensitivity    *string                   `json:"alertSensitivity,omitempty"`
	CriterionType       *string                   `json:"criterionType,omitempty"`
	Dimensions          []Dimension               `json:"dimensions,omitempty"`
	FailingPeriods      *Condition_FailingPeriods `json:"failingPeriods,omitempty"`
	IgnoreDataBefore    *string                   `json:"ignoreDataBefore,omitempty"`
	MetricMeasureColumn *string                   `json:"metricMeasureColumn,omitempty"`
	MetricName          *string                   `json:"metricName,omitempty"`
	Operator            *string                   `json:"operator,omitempty"`
	PropertyBag         genruntime.PropertyBag    `json:"$propertyBag,omitempty"`
	Query               *string                   `json:"query,omitempty"`

	// ResourceIdColumnReference: The column containing the resource id. The content of the column must be a uri formatted as
	// resource id. Relevant only for rules of the kind LogAlert.
	ResourceIdColumnReference *genruntime.ResourceReference `armReference:"ResourceIdColumn" json:"resourceIdColumnReference,omitempty"`
	Threshold                 *float64                      `json:"threshold,omitempty"`
	TimeAggregation           *string                       `json:"timeAggregation,omitempty"`
}

// AssignProperties_From_Condition populates our Condition from the provided source Condition
func (condition *Condition) AssignProperties_From_Condition(source *v20220615s.Condition) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

		condition.AlertSensitivity = &alertSensitivity
	} else {
		condition.AlertSensitivity = nil
	}

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

		condition.CriterionType = &criterionType
	} else {
		condition.CriterionType = nil
	}

	// Dimensions
	if source.Dimensions != nil {
		dimensionList := make([]Dimension, len(source.Dimensions))
		for dimensionIndex, dimensionItem := range source.Dimensions {
			var dimension Dimension
			err := dimension.AssignProperties_From_Dimension(&dimensionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Dimension() to populate field Dimensions")
			}
			dimensionList[dimensionIndex] = dimension
		}
		condition.Dimensions = dimensionList
	} else {
		condition.Dimensions = nil
	}

	// FailingPeriods
	if source.FailingPeriods != nil {
		var failingPeriod Condition_FailingPeriods
		err := failingPeriod.AssignProperties_From_Condition_FailingPeriods(source.FailingPeriods)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Condition_FailingPeriods() to populate field FailingPeriods")
		}
		condition.FailingPeriods = &failingPeriod
	} else {
		condition.FailingPeriods = nil
	}

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

		condition.IgnoreDataBefore = &ignoreDataBefore
	} else {
		condition.IgnoreDataBefore = nil
	}

	// MetricMeasureColumn
	condition.MetricMeasureColumn = genruntime.ClonePointerToString(source.MetricMeasureColumn)

	// MetricName
	condition.MetricName = genruntime.ClonePointerToString(source.MetricName)

	// Operator
	condition.Operator = genruntime.ClonePointerToString(source.Operator)

	// Query
	condition.Query = genruntime.ClonePointerToString(source.Query)

	// ResourceIdColumnReference
	if source.ResourceIdColumnReference != nil {
		resourceIdColumnReference := source.ResourceIdColumnReference.Copy()
		condition.ResourceIdColumnReference = &resourceIdColumnReference
	} else {
		condition.ResourceIdColumnReference = nil
	}

	// Threshold
	if source.Threshold != nil {
		threshold := *source.Threshold
		condition.Threshold = &threshold
	} else {
		condition.Threshold = nil
	}

	// TimeAggregation
	condition.TimeAggregation = genruntime.ClonePointerToString(source.TimeAggregation)

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

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

	// No error
	return nil
}

// AssignProperties_To_Condition populates the provided destination Condition from our Condition
func (condition *Condition) AssignProperties_To_Condition(destination *v20220615s.Condition) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(condition.PropertyBag)

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

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

	// Dimensions
	if condition.Dimensions != nil {
		dimensionList := make([]v20220615s.Dimension, len(condition.Dimensions))
		for dimensionIndex, dimensionItem := range condition.Dimensions {
			var dimension v20220615s.Dimension
			err := dimensionItem.AssignProperties_To_Dimension(&dimension)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Dimension() to populate field Dimensions")
			}
			dimensionList[dimensionIndex] = dimension
		}
		destination.Dimensions = dimensionList
	} else {
		destination.Dimensions = nil
	}

	// FailingPeriods
	if condition.FailingPeriods != nil {
		var failingPeriod v20220615s.Condition_FailingPeriods
		err := condition.FailingPeriods.AssignProperties_To_Condition_FailingPeriods(&failingPeriod)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Condition_FailingPeriods() to populate field FailingPeriods")
		}
		destination.FailingPeriods = &failingPeriod
	} else {
		destination.FailingPeriods = nil
	}

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

	// MetricMeasureColumn
	destination.MetricMeasureColumn = genruntime.ClonePointerToString(condition.MetricMeasureColumn)

	// MetricName
	destination.MetricName = genruntime.ClonePointerToString(condition.MetricName)

	// Operator
	destination.Operator = genruntime.ClonePointerToString(condition.Operator)

	// Query
	destination.Query = genruntime.ClonePointerToString(condition.Query)

	// ResourceIdColumnReference
	if condition.ResourceIdColumnReference != nil {
		resourceIdColumnReference := condition.ResourceIdColumnReference.Copy()
		destination.ResourceIdColumnReference = &resourceIdColumnReference
	} else {
		destination.ResourceIdColumnReference = nil
	}

	// Threshold
	if condition.Threshold != nil {
		threshold := *condition.Threshold
		destination.Threshold = &threshold
	} else {
		destination.Threshold = nil
	}

	// TimeAggregation
	destination.TimeAggregation = genruntime.ClonePointerToString(condition.TimeAggregation)

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.Condition_STATUS
// A condition of the scheduled query rule.
type Condition_STATUS struct {
	AlertSensitivity    *string                          `json:"alertSensitivity,omitempty"`
	CriterionType       *string                          `json:"criterionType,omitempty"`
	Dimensions          []Dimension_STATUS               `json:"dimensions,omitempty"`
	FailingPeriods      *Condition_FailingPeriods_STATUS `json:"failingPeriods,omitempty"`
	IgnoreDataBefore    *string                          `json:"ignoreDataBefore,omitempty"`
	MetricMeasureColumn *string                          `json:"metricMeasureColumn,omitempty"`
	MetricName          *string                          `json:"metricName,omitempty"`
	Operator            *string                          `json:"operator,omitempty"`
	PropertyBag         genruntime.PropertyBag           `json:"$propertyBag,omitempty"`
	Query               *string                          `json:"query,omitempty"`
	ResourceIdColumn    *string                          `json:"resourceIdColumn,omitempty"`
	Threshold           *float64                         `json:"threshold,omitempty"`
	TimeAggregation     *string                          `json:"timeAggregation,omitempty"`
}

// AssignProperties_From_Condition_STATUS populates our Condition_STATUS from the provided source Condition_STATUS
func (condition *Condition_STATUS) AssignProperties_From_Condition_STATUS(source *v20220615s.Condition_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

		condition.AlertSensitivity = &alertSensitivity
	} else {
		condition.AlertSensitivity = nil
	}

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

		condition.CriterionType = &criterionType
	} else {
		condition.CriterionType = nil
	}

	// Dimensions
	if source.Dimensions != nil {
		dimensionList := make([]Dimension_STATUS, len(source.Dimensions))
		for dimensionIndex, dimensionItem := range source.Dimensions {
			var dimension Dimension_STATUS
			err := dimension.AssignProperties_From_Dimension_STATUS(&dimensionItem)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_From_Dimension_STATUS() to populate field Dimensions")
			}
			dimensionList[dimensionIndex] = dimension
		}
		condition.Dimensions = dimensionList
	} else {
		condition.Dimensions = nil
	}

	// FailingPeriods
	if source.FailingPeriods != nil {
		var failingPeriod Condition_FailingPeriods_STATUS
		err := failingPeriod.AssignProperties_From_Condition_FailingPeriods_STATUS(source.FailingPeriods)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_From_Condition_FailingPeriods_STATUS() to populate field FailingPeriods")
		}
		condition.FailingPeriods = &failingPeriod
	} else {
		condition.FailingPeriods = nil
	}

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

		condition.IgnoreDataBefore = &ignoreDataBefore
	} else {
		condition.IgnoreDataBefore = nil
	}

	// MetricMeasureColumn
	condition.MetricMeasureColumn = genruntime.ClonePointerToString(source.MetricMeasureColumn)

	// MetricName
	condition.MetricName = genruntime.ClonePointerToString(source.MetricName)

	// Operator
	condition.Operator = genruntime.ClonePointerToString(source.Operator)

	// Query
	condition.Query = genruntime.ClonePointerToString(source.Query)

	// ResourceIdColumn
	condition.ResourceIdColumn = genruntime.ClonePointerToString(source.ResourceIdColumn)

	// Threshold
	if source.Threshold != nil {
		threshold := *source.Threshold
		condition.Threshold = &threshold
	} else {
		condition.Threshold = nil
	}

	// TimeAggregation
	condition.TimeAggregation = genruntime.ClonePointerToString(source.TimeAggregation)

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

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

	// No error
	return nil
}

// AssignProperties_To_Condition_STATUS populates the provided destination Condition_STATUS from our Condition_STATUS
func (condition *Condition_STATUS) AssignProperties_To_Condition_STATUS(destination *v20220615s.Condition_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(condition.PropertyBag)

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

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

	// Dimensions
	if condition.Dimensions != nil {
		dimensionList := make([]v20220615s.Dimension_STATUS, len(condition.Dimensions))
		for dimensionIndex, dimensionItem := range condition.Dimensions {
			var dimension v20220615s.Dimension_STATUS
			err := dimensionItem.AssignProperties_To_Dimension_STATUS(&dimension)
			if err != nil {
				return eris.Wrap(err, "calling AssignProperties_To_Dimension_STATUS() to populate field Dimensions")
			}
			dimensionList[dimensionIndex] = dimension
		}
		destination.Dimensions = dimensionList
	} else {
		destination.Dimensions = nil
	}

	// FailingPeriods
	if condition.FailingPeriods != nil {
		var failingPeriod v20220615s.Condition_FailingPeriods_STATUS
		err := condition.FailingPeriods.AssignProperties_To_Condition_FailingPeriods_STATUS(&failingPeriod)
		if err != nil {
			return eris.Wrap(err, "calling AssignProperties_To_Condition_FailingPeriods_STATUS() to populate field FailingPeriods")
		}
		destination.FailingPeriods = &failingPeriod
	} else {
		destination.FailingPeriods = nil
	}

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

	// MetricMeasureColumn
	destination.MetricMeasureColumn = genruntime.ClonePointerToString(condition.MetricMeasureColumn)

	// MetricName
	destination.MetricName = genruntime.ClonePointerToString(condition.MetricName)

	// Operator
	destination.Operator = genruntime.ClonePointerToString(condition.Operator)

	// Query
	destination.Query = genruntime.ClonePointerToString(condition.Query)

	// ResourceIdColumn
	destination.ResourceIdColumn = genruntime.ClonePointerToString(condition.ResourceIdColumn)

	// Threshold
	if condition.Threshold != nil {
		threshold := *condition.Threshold
		destination.Threshold = &threshold
	} else {
		destination.Threshold = nil
	}

	// TimeAggregation
	destination.TimeAggregation = genruntime.ClonePointerToString(condition.TimeAggregation)

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

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

	// No error
	return nil
}

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

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

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

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

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

	// No error
	return nil
}

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

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

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

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

	// No error
	return nil
}

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

type augmentConversionForCondition interface {
	AssignPropertiesFrom(src *v20220615s.Condition) error
	AssignPropertiesTo(dst *v20220615s.Condition) error
}

type augmentConversionForCondition_STATUS interface {
	AssignPropertiesFrom(src *v20220615s.Condition_STATUS) error
	AssignPropertiesTo(dst *v20220615s.Condition_STATUS) error
}

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

// Storage version of v1api20240101preview.Condition_FailingPeriods
type Condition_FailingPeriods struct {
	MinFailingPeriodsToAlert  *int                   `json:"minFailingPeriodsToAlert,omitempty"`
	NumberOfEvaluationPeriods *int                   `json:"numberOfEvaluationPeriods,omitempty"`
	PropertyBag               genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_Condition_FailingPeriods populates our Condition_FailingPeriods from the provided source Condition_FailingPeriods
func (periods *Condition_FailingPeriods) AssignProperties_From_Condition_FailingPeriods(source *v20220615s.Condition_FailingPeriods) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// MinFailingPeriodsToAlert
	periods.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(source.MinFailingPeriodsToAlert)

	// NumberOfEvaluationPeriods
	periods.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(source.NumberOfEvaluationPeriods)

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

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

	// No error
	return nil
}

// AssignProperties_To_Condition_FailingPeriods populates the provided destination Condition_FailingPeriods from our Condition_FailingPeriods
func (periods *Condition_FailingPeriods) AssignProperties_To_Condition_FailingPeriods(destination *v20220615s.Condition_FailingPeriods) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(periods.PropertyBag)

	// MinFailingPeriodsToAlert
	destination.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(periods.MinFailingPeriodsToAlert)

	// NumberOfEvaluationPeriods
	destination.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(periods.NumberOfEvaluationPeriods)

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.Condition_FailingPeriods_STATUS
type Condition_FailingPeriods_STATUS struct {
	MinFailingPeriodsToAlert  *int                   `json:"minFailingPeriodsToAlert,omitempty"`
	NumberOfEvaluationPeriods *int                   `json:"numberOfEvaluationPeriods,omitempty"`
	PropertyBag               genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// AssignProperties_From_Condition_FailingPeriods_STATUS populates our Condition_FailingPeriods_STATUS from the provided source Condition_FailingPeriods_STATUS
func (periods *Condition_FailingPeriods_STATUS) AssignProperties_From_Condition_FailingPeriods_STATUS(source *v20220615s.Condition_FailingPeriods_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

	// MinFailingPeriodsToAlert
	periods.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(source.MinFailingPeriodsToAlert)

	// NumberOfEvaluationPeriods
	periods.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(source.NumberOfEvaluationPeriods)

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

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

	// No error
	return nil
}

// AssignProperties_To_Condition_FailingPeriods_STATUS populates the provided destination Condition_FailingPeriods_STATUS from our Condition_FailingPeriods_STATUS
func (periods *Condition_FailingPeriods_STATUS) AssignProperties_To_Condition_FailingPeriods_STATUS(destination *v20220615s.Condition_FailingPeriods_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(periods.PropertyBag)

	// MinFailingPeriodsToAlert
	destination.MinFailingPeriodsToAlert = genruntime.ClonePointerToInt(periods.MinFailingPeriodsToAlert)

	// NumberOfEvaluationPeriods
	destination.NumberOfEvaluationPeriods = genruntime.ClonePointerToInt(periods.NumberOfEvaluationPeriods)

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.Dimension
// Dimension splitting and filtering definition
type Dimension struct {
	Name        *string                `json:"name,omitempty"`
	Operator    *string                `json:"operator,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Values      []string               `json:"values,omitempty"`
}

// AssignProperties_From_Dimension populates our Dimension from the provided source Dimension
func (dimension *Dimension) AssignProperties_From_Dimension(source *v20220615s.Dimension) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

	// Operator
	dimension.Operator = genruntime.ClonePointerToString(source.Operator)

	// Values
	dimension.Values = genruntime.CloneSliceOfString(source.Values)

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

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

	// No error
	return nil
}

// AssignProperties_To_Dimension populates the provided destination Dimension from our Dimension
func (dimension *Dimension) AssignProperties_To_Dimension(destination *v20220615s.Dimension) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(dimension.PropertyBag)

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

	// Operator
	destination.Operator = genruntime.ClonePointerToString(dimension.Operator)

	// Values
	destination.Values = genruntime.CloneSliceOfString(dimension.Values)

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

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

	// No error
	return nil
}

// Storage version of v1api20240101preview.Dimension_STATUS
// Dimension splitting and filtering definition
type Dimension_STATUS struct {
	Name        *string                `json:"name,omitempty"`
	Operator    *string                `json:"operator,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Values      []string               `json:"values,omitempty"`
}

// AssignProperties_From_Dimension_STATUS populates our Dimension_STATUS from the provided source Dimension_STATUS
func (dimension *Dimension_STATUS) AssignProperties_From_Dimension_STATUS(source *v20220615s.Dimension_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(source.PropertyBag)

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

	// Operator
	dimension.Operator = genruntime.ClonePointerToString(source.Operator)

	// Values
	dimension.Values = genruntime.CloneSliceOfString(source.Values)

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

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

	// No error
	return nil
}

// AssignProperties_To_Dimension_STATUS populates the provided destination Dimension_STATUS from our Dimension_STATUS
func (dimension *Dimension_STATUS) AssignProperties_To_Dimension_STATUS(destination *v20220615s.Dimension_STATUS) error {
	// Clone the existing property bag
	propertyBag := genruntime.NewPropertyBag(dimension.PropertyBag)

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

	// Operator
	destination.Operator = genruntime.ClonePointerToString(dimension.Operator)

	// Values
	destination.Values = genruntime.CloneSliceOfString(dimension.Values)

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

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

	// No error
	return nil
}

type augmentConversionForCondition_FailingPeriods interface {
	AssignPropertiesFrom(src *v20220615s.Condition_FailingPeriods) error
	AssignPropertiesTo(dst *v20220615s.Condition_FailingPeriods) error
}

type augmentConversionForCondition_FailingPeriods_STATUS interface {
	AssignPropertiesFrom(src *v20220615s.Condition_FailingPeriods_STATUS) error
	AssignPropertiesTo(dst *v20220615s.Condition_FailingPeriods_STATUS) error
}

type augmentConversionForDimension interface {
	AssignPropertiesFrom(src *v20220615s.Dimension) error
	AssignPropertiesTo(dst *v20220615s.Dimension) error
}

type augmentConversionForDimension_STATUS interface {
	AssignPropertiesFrom(src *v20220615s.Dimension_STATUS) error
	AssignPropertiesTo(dst *v20220615s.Dimension_STATUS) error
}

func init() {
	SchemeBuilder.Register(&ScheduledQueryRule{}, &ScheduledQueryRuleList{})
}
