// 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"

type PrometheusRuleGroup_Spec struct {
	// Location: The geo-location where the resource lives
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

	// Properties: The Prometheus rule group properties of the resource.
	Properties *PrometheusRuleGroupProperties `json:"properties,omitempty"`

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

var _ genruntime.ARMResourceSpec = &PrometheusRuleGroup_Spec{}

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

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.AlertsManagement/prometheusRuleGroups"
func (group *PrometheusRuleGroup_Spec) GetType() string {
	return "Microsoft.AlertsManagement/prometheusRuleGroups"
}

// An Azure Prometheus rule group.
type PrometheusRuleGroupProperties struct {
	// ClusterName: Apply rule to data from a specific cluster.
	ClusterName *string `json:"clusterName,omitempty"`

	// Description: Rule group description.
	Description *string `json:"description,omitempty"`

	// Enabled: Enable/disable rule group.
	Enabled *bool `json:"enabled,omitempty"`

	// Interval: The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be
	// between 1 and 15 minutes
	Interval *string `json:"interval,omitempty"`

	// Rules: Defines the rules in the Prometheus rule group.
	Rules []PrometheusRule `json:"rules,omitempty"`

	// Scopes: Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope.
	// This may change in future.
	Scopes []string `json:"scopes,omitempty"`
}

// An Azure Prometheus alerting or recording rule.
type PrometheusRule struct {
	// Actions: Actions that are performed when the alert rule becomes active, and when an alert condition is resolved.
	Actions []PrometheusRuleGroupAction `json:"actions,omitempty"`

	// Alert: Alert rule name.
	Alert *string `json:"alert,omitempty"`

	// Annotations: The annotations clause specifies a set of informational labels that can be used to store longer additional
	// information such as alert descriptions or runbook links. The annotation values can be templated.
	Annotations map[string]string `json:"annotations,omitempty"`

	// Enabled: Enable/disable rule.
	Enabled *bool `json:"enabled,omitempty"`

	// Expression: The PromQL expression to evaluate. https://prometheus.io/docs/prometheus/latest/querying/basics/. Evaluated
	// periodically as given by 'interval', and the result recorded as a new set of time series with the metric name as given
	// by 'record'.
	Expression *string `json:"expression,omitempty"`

	// For: The amount of time alert must be active before firing.
	For *string `json:"for,omitempty"`

	// Labels: Labels to add or overwrite before storing the result.
	Labels map[string]string `json:"labels,omitempty"`

	// Record: Recorded metrics name.
	Record *string `json:"record,omitempty"`

	// ResolveConfiguration: Defines the configuration for resolving fired alerts. Only relevant for alerts.
	ResolveConfiguration *PrometheusRuleResolveConfiguration `json:"resolveConfiguration,omitempty"`

	// Severity: The severity of the alerts fired by the rule. Must be between 0 and 4.
	Severity *int `json:"severity,omitempty"`
}

// An alert action. Only relevant for alerts.
type PrometheusRuleGroupAction struct {
	// ActionGroupId: The resource id of the action group to use.
	ActionGroupId *string `json:"actionGroupId,omitempty"`

	// ActionProperties: The properties of an action group object.
	ActionProperties map[string]string `json:"actionProperties,omitempty"`
}

// Specifies the Prometheus alert rule configuration.
type PrometheusRuleResolveConfiguration struct {
	// AutoResolved: Enable alert auto-resolution.
	AutoResolved *bool `json:"autoResolved,omitempty"`

	// TimeToResolve: Alert auto-resolution timeout.
	TimeToResolve *string `json:"timeToResolve,omitempty"`
}
