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

import (
	storage "github.com/Azure/azure-service-operator/v2/api/insights/v1api20230311/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"
)

// +kubebuilder:rbac:groups=insights.azure.com,resources=autoscalesettings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=insights.azure.com,resources={autoscalesettings/status,autoscalesettings/finalizers},verbs=get;update;patch

// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={azure,insights}
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +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 v1api20221001.AutoscaleSetting
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/autoscale_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}
type AutoscaleSetting struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AutoscaleSetting_Spec   `json:"spec,omitempty"`
	Status            Autoscalesetting_STATUS `json:"status,omitempty"`
}

var _ conditions.Conditioner = &AutoscaleSetting{}

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

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

var _ configmaps.Exporter = &AutoscaleSetting{}

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

var _ secrets.Exporter = &AutoscaleSetting{}

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

var _ genruntime.KubernetesResource = &AutoscaleSetting{}

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

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

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

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

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

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

// NewEmptyStatus returns a new empty (blank) status
func (setting *AutoscaleSetting) NewEmptyStatus() genruntime.ConvertibleStatus {
	return &Autoscalesetting_STATUS{}
}

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

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

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

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

	setting.Status = st
	return nil
}

// Hub marks that this AutoscaleSetting is the hub type for conversion
func (setting *AutoscaleSetting) Hub() {}

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

// +kubebuilder:object:root=true
// Storage version of v1api20221001.AutoscaleSetting
// Generator information:
// - Generated from: /monitor/resource-manager/Microsoft.Insights/stable/2022-10-01/autoscale_API.json
// - ARM URI: /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}
type AutoscaleSettingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []AutoscaleSetting `json:"items"`
}

// Storage version of v1api20221001.APIVersion
// +kubebuilder:validation:Enum={"2022-10-01"}
type APIVersion string

const APIVersion_Value = APIVersion("2022-10-01")

// Storage version of v1api20221001.AutoscaleSetting_Spec
type AutoscaleSetting_Spec struct {
	// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
	// doesn't have to be.
	AzureName       string                        `json:"azureName,omitempty"`
	Enabled         *bool                         `json:"enabled,omitempty"`
	Location        *string                       `json:"location,omitempty"`
	Name            *string                       `json:"name,omitempty"`
	Notifications   []AutoscaleNotification       `json:"notifications,omitempty"`
	OperatorSpec    *AutoscaleSettingOperatorSpec `json:"operatorSpec,omitempty"`
	OriginalVersion string                        `json:"originalVersion,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"`
	PredictiveAutoscalePolicy *PredictiveAutoscalePolicy         `json:"predictiveAutoscalePolicy,omitempty"`
	Profiles                  []AutoscaleProfile                 `json:"profiles,omitempty"`
	PropertyBag               genruntime.PropertyBag             `json:"$propertyBag,omitempty"`
	Tags                      map[string]string                  `json:"tags,omitempty"`
	TargetResourceLocation    *string                            `json:"targetResourceLocation,omitempty"`

	// TargetResourceUriReference: the resource identifier of the resource that the autoscale setting should be added to.
	TargetResourceUriReference *genruntime.ResourceReference `armReference:"TargetResourceUri" json:"targetResourceUriReference,omitempty"`
}

var _ genruntime.ConvertibleSpec = &AutoscaleSetting_Spec{}

// ConvertSpecFrom populates our AutoscaleSetting_Spec from the provided source
func (setting *AutoscaleSetting_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
	if source == setting {
		return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
	}

	return source.ConvertSpecTo(setting)
}

// ConvertSpecTo populates the provided destination from our AutoscaleSetting_Spec
func (setting *AutoscaleSetting_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
	if destination == setting {
		return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
	}

	return destination.ConvertSpecFrom(setting)
}

// Storage version of v1api20221001.Autoscalesetting_STATUS
type Autoscalesetting_STATUS struct {
	Conditions                []conditions.Condition            `json:"conditions,omitempty"`
	Enabled                   *bool                             `json:"enabled,omitempty"`
	Id                        *string                           `json:"id,omitempty"`
	Location                  *string                           `json:"location,omitempty"`
	Name                      *string                           `json:"name,omitempty"`
	Notifications             []AutoscaleNotification_STATUS    `json:"notifications,omitempty"`
	PredictiveAutoscalePolicy *PredictiveAutoscalePolicy_STATUS `json:"predictiveAutoscalePolicy,omitempty"`
	Profiles                  []AutoscaleProfile_STATUS         `json:"profiles,omitempty"`
	PropertiesName            *string                           `json:"properties_name,omitempty"`
	PropertyBag               genruntime.PropertyBag            `json:"$propertyBag,omitempty"`
	SystemData                *SystemData_STATUS                `json:"systemData,omitempty"`
	Tags                      map[string]string                 `json:"tags,omitempty"`
	TargetResourceLocation    *string                           `json:"targetResourceLocation,omitempty"`
	TargetResourceUri         *string                           `json:"targetResourceUri,omitempty"`
	Type                      *string                           `json:"type,omitempty"`
}

var _ genruntime.ConvertibleStatus = &Autoscalesetting_STATUS{}

// ConvertStatusFrom populates our Autoscalesetting_STATUS from the provided source
func (autoscalesetting *Autoscalesetting_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
	if source == autoscalesetting {
		return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
	}

	return source.ConvertStatusTo(autoscalesetting)
}

// ConvertStatusTo populates the provided destination from our Autoscalesetting_STATUS
func (autoscalesetting *Autoscalesetting_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
	if destination == autoscalesetting {
		return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
	}

	return destination.ConvertStatusFrom(autoscalesetting)
}

// Storage version of v1api20221001.AutoscaleNotification
// Autoscale notification.
type AutoscaleNotification struct {
	Email       *EmailNotification     `json:"email,omitempty"`
	Operation   *string                `json:"operation,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Webhooks    []WebhookNotification  `json:"webhooks,omitempty"`
}

// Storage version of v1api20221001.AutoscaleNotification_STATUS
// Autoscale notification.
type AutoscaleNotification_STATUS struct {
	Email       *EmailNotification_STATUS    `json:"email,omitempty"`
	Operation   *string                      `json:"operation,omitempty"`
	PropertyBag genruntime.PropertyBag       `json:"$propertyBag,omitempty"`
	Webhooks    []WebhookNotification_STATUS `json:"webhooks,omitempty"`
}

// Storage version of v1api20221001.AutoscaleProfile
// Autoscale profile.
type AutoscaleProfile struct {
	Capacity    *ScaleCapacity         `json:"capacity,omitempty"`
	FixedDate   *TimeWindow            `json:"fixedDate,omitempty"`
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Recurrence  *Recurrence            `json:"recurrence,omitempty"`
	Rules       []ScaleRule            `json:"rules,omitempty"`
}

// Storage version of v1api20221001.AutoscaleProfile_STATUS
// Autoscale profile.
type AutoscaleProfile_STATUS struct {
	Capacity    *ScaleCapacity_STATUS  `json:"capacity,omitempty"`
	FixedDate   *TimeWindow_STATUS     `json:"fixedDate,omitempty"`
	Name        *string                `json:"name,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Recurrence  *Recurrence_STATUS     `json:"recurrence,omitempty"`
	Rules       []ScaleRule_STATUS     `json:"rules,omitempty"`
}

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

// Storage version of v1api20221001.PredictiveAutoscalePolicy
// The parameters for enabling predictive autoscale.
type PredictiveAutoscalePolicy struct {
	PropertyBag        genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ScaleLookAheadTime *string                `json:"scaleLookAheadTime,omitempty"`
	ScaleMode          *string                `json:"scaleMode,omitempty"`
}

// Storage version of v1api20221001.PredictiveAutoscalePolicy_STATUS
// The parameters for enabling predictive autoscale.
type PredictiveAutoscalePolicy_STATUS struct {
	PropertyBag        genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ScaleLookAheadTime *string                `json:"scaleLookAheadTime,omitempty"`
	ScaleMode          *string                `json:"scaleMode,omitempty"`
}

// Storage version of v1api20221001.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 *storage.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 *storage.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 augmentConversionForSystemData_STATUS interface {
	AssignPropertiesFrom(src *storage.SystemData_STATUS) error
	AssignPropertiesTo(dst *storage.SystemData_STATUS) error
}

// Storage version of v1api20221001.EmailNotification
// Email notification of an autoscale event.
type EmailNotification struct {
	CustomEmails                       []string               `json:"customEmails,omitempty"`
	PropertyBag                        genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	SendToSubscriptionAdministrator    *bool                  `json:"sendToSubscriptionAdministrator,omitempty"`
	SendToSubscriptionCoAdministrators *bool                  `json:"sendToSubscriptionCoAdministrators,omitempty"`
}

// Storage version of v1api20221001.EmailNotification_STATUS
// Email notification of an autoscale event.
type EmailNotification_STATUS struct {
	CustomEmails                       []string               `json:"customEmails,omitempty"`
	PropertyBag                        genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	SendToSubscriptionAdministrator    *bool                  `json:"sendToSubscriptionAdministrator,omitempty"`
	SendToSubscriptionCoAdministrators *bool                  `json:"sendToSubscriptionCoAdministrators,omitempty"`
}

// Storage version of v1api20221001.Recurrence
// The repeating times at which this profile begins. This element is not used if the FixedDate element is used.
type Recurrence struct {
	Frequency   *string                `json:"frequency,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Schedule    *RecurrentSchedule     `json:"schedule,omitempty"`
}

// Storage version of v1api20221001.Recurrence_STATUS
// The repeating times at which this profile begins. This element is not used if the FixedDate element is used.
type Recurrence_STATUS struct {
	Frequency   *string                   `json:"frequency,omitempty"`
	PropertyBag genruntime.PropertyBag    `json:"$propertyBag,omitempty"`
	Schedule    *RecurrentSchedule_STATUS `json:"schedule,omitempty"`
}

// Storage version of v1api20221001.ScaleCapacity
// The number of instances that can be used during this profile.
type ScaleCapacity struct {
	Default     *string                `json:"default,omitempty"`
	Maximum     *string                `json:"maximum,omitempty"`
	Minimum     *string                `json:"minimum,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// Storage version of v1api20221001.ScaleCapacity_STATUS
// The number of instances that can be used during this profile.
type ScaleCapacity_STATUS struct {
	Default     *string                `json:"default,omitempty"`
	Maximum     *string                `json:"maximum,omitempty"`
	Minimum     *string                `json:"minimum,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}

// Storage version of v1api20221001.ScaleRule
// A rule that provide the triggers and parameters for the scaling action.
type ScaleRule struct {
	MetricTrigger *MetricTrigger         `json:"metricTrigger,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ScaleAction   *ScaleAction           `json:"scaleAction,omitempty"`
}

// Storage version of v1api20221001.ScaleRule_STATUS
// A rule that provide the triggers and parameters for the scaling action.
type ScaleRule_STATUS struct {
	MetricTrigger *MetricTrigger_STATUS  `json:"metricTrigger,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ScaleAction   *ScaleAction_STATUS    `json:"scaleAction,omitempty"`
}

// Storage version of v1api20221001.TimeWindow
// A specific date-time for the profile.
type TimeWindow struct {
	End         *string                `json:"end,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Start       *string                `json:"start,omitempty"`
	TimeZone    *string                `json:"timeZone,omitempty"`
}

// Storage version of v1api20221001.TimeWindow_STATUS
// A specific date-time for the profile.
type TimeWindow_STATUS struct {
	End         *string                `json:"end,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Start       *string                `json:"start,omitempty"`
	TimeZone    *string                `json:"timeZone,omitempty"`
}

// Storage version of v1api20221001.WebhookNotification
// Webhook notification of an autoscale event.
type WebhookNotification struct {
	Properties  map[string]string      `json:"properties,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ServiceUri  *string                `json:"serviceUri,omitempty"`
}

// Storage version of v1api20221001.WebhookNotification_STATUS
// Webhook notification of an autoscale event.
type WebhookNotification_STATUS struct {
	Properties  map[string]string      `json:"properties,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	ServiceUri  *string                `json:"serviceUri,omitempty"`
}

// Storage version of v1api20221001.MetricTrigger
// The trigger that results in a scaling action.
type MetricTrigger struct {
	Dimensions             []ScaleRuleMetricDimension `json:"dimensions,omitempty"`
	DividePerInstance      *bool                      `json:"dividePerInstance,omitempty"`
	MetricName             *string                    `json:"metricName,omitempty"`
	MetricNamespace        *string                    `json:"metricNamespace,omitempty"`
	MetricResourceLocation *string                    `json:"metricResourceLocation,omitempty"`

	// +kubebuilder:validation:Required
	// MetricResourceUriReference: the resource identifier of the resource the rule monitors.
	MetricResourceUriReference *genruntime.ResourceReference `armReference:"MetricResourceUri" json:"metricResourceUriReference,omitempty"`
	Operator                   *string                       `json:"operator,omitempty"`
	PropertyBag                genruntime.PropertyBag        `json:"$propertyBag,omitempty"`
	Statistic                  *string                       `json:"statistic,omitempty"`
	Threshold                  *float64                      `json:"threshold,omitempty"`
	TimeAggregation            *string                       `json:"timeAggregation,omitempty"`
	TimeGrain                  *string                       `json:"timeGrain,omitempty"`
	TimeWindow                 *string                       `json:"timeWindow,omitempty"`
}

// Storage version of v1api20221001.MetricTrigger_STATUS
// The trigger that results in a scaling action.
type MetricTrigger_STATUS struct {
	Dimensions             []ScaleRuleMetricDimension_STATUS `json:"dimensions,omitempty"`
	DividePerInstance      *bool                             `json:"dividePerInstance,omitempty"`
	MetricName             *string                           `json:"metricName,omitempty"`
	MetricNamespace        *string                           `json:"metricNamespace,omitempty"`
	MetricResourceLocation *string                           `json:"metricResourceLocation,omitempty"`
	MetricResourceUri      *string                           `json:"metricResourceUri,omitempty"`
	Operator               *string                           `json:"operator,omitempty"`
	PropertyBag            genruntime.PropertyBag            `json:"$propertyBag,omitempty"`
	Statistic              *string                           `json:"statistic,omitempty"`
	Threshold              *float64                          `json:"threshold,omitempty"`
	TimeAggregation        *string                           `json:"timeAggregation,omitempty"`
	TimeGrain              *string                           `json:"timeGrain,omitempty"`
	TimeWindow             *string                           `json:"timeWindow,omitempty"`
}

// Storage version of v1api20221001.RecurrentSchedule
// The scheduling constraints for when the profile begins.
type RecurrentSchedule struct {
	Days        []string               `json:"days,omitempty"`
	Hours       []int                  `json:"hours,omitempty"`
	Minutes     []int                  `json:"minutes,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	TimeZone    *string                `json:"timeZone,omitempty"`
}

// Storage version of v1api20221001.RecurrentSchedule_STATUS
// The scheduling constraints for when the profile begins.
type RecurrentSchedule_STATUS struct {
	Days        []string               `json:"days,omitempty"`
	Hours       []int                  `json:"hours,omitempty"`
	Minutes     []int                  `json:"minutes,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	TimeZone    *string                `json:"timeZone,omitempty"`
}

// Storage version of v1api20221001.ScaleAction
// The parameters for the scaling action.
type ScaleAction struct {
	Cooldown    *string                `json:"cooldown,omitempty"`
	Direction   *string                `json:"direction,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Value       *string                `json:"value,omitempty"`
}

// Storage version of v1api20221001.ScaleAction_STATUS
// The parameters for the scaling action.
type ScaleAction_STATUS struct {
	Cooldown    *string                `json:"cooldown,omitempty"`
	Direction   *string                `json:"direction,omitempty"`
	PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Type        *string                `json:"type,omitempty"`
	Value       *string                `json:"value,omitempty"`
}

// Storage version of v1api20221001.ScaleRuleMetricDimension
// Specifies an auto scale rule metric dimension.
type ScaleRuleMetricDimension struct {
	DimensionName *string                `json:"DimensionName,omitempty"`
	Operator      *string                `json:"Operator,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Values        []string               `json:"Values,omitempty"`
}

// Storage version of v1api20221001.ScaleRuleMetricDimension_STATUS
// Specifies an auto scale rule metric dimension.
type ScaleRuleMetricDimension_STATUS struct {
	DimensionName *string                `json:"DimensionName,omitempty"`
	Operator      *string                `json:"Operator,omitempty"`
	PropertyBag   genruntime.PropertyBag `json:"$propertyBag,omitempty"`
	Values        []string               `json:"Values,omitempty"`
}

func init() {
	SchemeBuilder.Register(&AutoscaleSetting{}, &AutoscaleSettingList{})
}
