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

import (
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

type SmartDetectorAlertRule_Spec struct {
	// Location: The resource location.
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

	// Properties: The properties of the alert rule.
	Properties *AlertRuleProperties `json:"properties,omitempty"`

	// Tags: The resource tags.
	Tags map[string]string `json:"tags,omitempty"`
}

var _ genruntime.ARMResourceSpec = &SmartDetectorAlertRule_Spec{}

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

// GetName returns the Name of the resource
func (rule *SmartDetectorAlertRule_Spec) GetName() string {
	return rule.Name
}

// GetType returns the ARM Type of the resource. This is always "microsoft.alertsManagement/smartDetectorAlertRules"
func (rule *SmartDetectorAlertRule_Spec) GetType() string {
	return "microsoft.alertsManagement/smartDetectorAlertRules"
}

// The alert rule properties.
type AlertRuleProperties struct {
	// ActionGroups: The alert rule actions.
	ActionGroups *ActionGroupsInformation `json:"actionGroups,omitempty"`

	// Description: The alert rule description.
	Description *string `json:"description,omitempty"`

	// Detector: The alert rule's detector.
	Detector *Detector `json:"detector,omitempty"`

	// Frequency: The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1
	// minute, depending on the detector.
	Frequency *string `json:"frequency,omitempty"`

	// Scope: The alert rule resources scope.
	Scope []string `json:"scope,omitempty"`

	// Severity: The alert rule severity.
	Severity *AlertRuleProperties_Severity `json:"severity,omitempty"`

	// State: The alert rule state.
	State *AlertRuleProperties_State `json:"state,omitempty"`

	// Throttling: The alert rule throttling information.
	Throttling *ThrottlingInformation `json:"throttling,omitempty"`
}

// The Action Groups information, used by the alert rule.
type ActionGroupsInformation struct {
	// CustomEmailSubject: An optional custom email subject to use in email notifications.
	CustomEmailSubject *string `json:"customEmailSubject,omitempty"`

	// CustomWebhookPayload: An optional custom web-hook payload to use in web-hook notifications.
	CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"`

	// GroupIds: The Action Group resource IDs.
	GroupIds []string `json:"groupIds,omitempty"`
}

// +kubebuilder:validation:Enum={"Sev0","Sev1","Sev2","Sev3","Sev4"}
type AlertRuleProperties_Severity string

const (
	AlertRuleProperties_Severity_Sev0 = AlertRuleProperties_Severity("Sev0")
	AlertRuleProperties_Severity_Sev1 = AlertRuleProperties_Severity("Sev1")
	AlertRuleProperties_Severity_Sev2 = AlertRuleProperties_Severity("Sev2")
	AlertRuleProperties_Severity_Sev3 = AlertRuleProperties_Severity("Sev3")
	AlertRuleProperties_Severity_Sev4 = AlertRuleProperties_Severity("Sev4")
)

// Mapping from string to AlertRuleProperties_Severity
var alertRuleProperties_Severity_Values = map[string]AlertRuleProperties_Severity{
	"sev0": AlertRuleProperties_Severity_Sev0,
	"sev1": AlertRuleProperties_Severity_Sev1,
	"sev2": AlertRuleProperties_Severity_Sev2,
	"sev3": AlertRuleProperties_Severity_Sev3,
	"sev4": AlertRuleProperties_Severity_Sev4,
}

// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type AlertRuleProperties_State string

const (
	AlertRuleProperties_State_Disabled = AlertRuleProperties_State("Disabled")
	AlertRuleProperties_State_Enabled  = AlertRuleProperties_State("Enabled")
)

// Mapping from string to AlertRuleProperties_State
var alertRuleProperties_State_Values = map[string]AlertRuleProperties_State{
	"disabled": AlertRuleProperties_State_Disabled,
	"enabled":  AlertRuleProperties_State_Enabled,
}

// The detector information. By default this is not populated, unless it's specified in expandDetector
type Detector struct {
	// Id: The detector id.
	Id *string `json:"id,omitempty"`

	// Parameters: The detector's parameters.'
	Parameters map[string]v1.JSON `json:"parameters,omitempty"`
}

// Optional throttling information for the alert rule.
type ThrottlingInformation struct {
	// Duration: The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time
	// granularity must be in minutes and minimum value is 0 minutes
	Duration *string `json:"duration,omitempty"`
}
