// Copyright (c) 2023 Volvo Car Corporation
// SPDX-License-Identifier: Apache-2.0

// Code generated by lingon. EDIT AS MUCH AS YOU LIKE.

package promcrd

import (
	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var PrometheusrulesMonitoringCoreosComCRD = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Annotations: map[string]string{"controller-gen.kubebuilder.io/version": "v0.11.1"},
		Name:        "prometheusrules.monitoring.coreos.com",
	},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Group: "monitoring.coreos.com",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Categories: []string{"prometheus-operator"},
			Kind:       "PrometheusRule",
			ListKind:   "PrometheusRuleList",
			Plural:     "prometheusrules",
			ShortNames: []string{"promrule"},
			Singular:   "prometheusrule",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{{
			Name: "v1",
			Schema: &apiextensionsv1.CustomResourceValidation{OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
				Description: "PrometheusRule defines recording and alerting rules for a Prometheus instance",
				Properties: map[string]apiextensionsv1.JSONSchemaProps{
					"apiVersion": {
						Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
						Type:        "string",
					},
					"kind": {
						Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
						Type:        "string",
					},
					"metadata": {Type: "object"},
					"spec": {
						Description: "Specification of desired alerting rule definitions for Prometheus.",
						Properties: map[string]apiextensionsv1.JSONSchemaProps{"groups": {
							Description: "Content of Prometheus rule file",
							Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{
								Description: "RuleGroup is a list of sequentially evaluated recording and alerting rules.",
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"interval": {
										Description: "Interval determines how often rules in the group are evaluated.",
										Pattern:     "^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$",
										Type:        "string",
									},
									"limit": {
										Description: "Limit the number of alerts an alerting rule and series a recording rule can produce. Limit is supported starting with Prometheus >= 2.31 and Thanos Ruler >= 0.24.",
										Type:        "integer",
									},
									"name": {
										Description: "Name of the rule group.",
										MinLength:   P(int64(1)),
										Type:        "string",
									},
									"partial_response_strategy": {
										Description: "PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. More info: https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response",
										Pattern:     "^(?i)(abort|warn)?$",
										Type:        "string",
									},
									"rules": {
										Description: "List of alerting and recording rules.",
										Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{
											Description: "Rule describes an alerting or recording rule See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) rule",
											Properties: map[string]apiextensionsv1.JSONSchemaProps{
												"alert": {
													Description: "Name of the alert. Must be a valid label value. Only one of `record` and `alert` must be set.",
													Type:        "string",
												},
												"annotations": {
													AdditionalProperties: &apiextensionsv1.JSONSchemaPropsOrBool{
														Allows: true,
														Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"},
													},
													Description: "Annotations to add to each alert. Only valid for alerting rules.",
													Type:        "object",
												},
												"expr": {
													AnyOf:        []apiextensionsv1.JSONSchemaProps{{Type: "integer"}, {Type: "string"}},
													Description:  "PromQL expression to evaluate.",
													XIntOrString: true,
												},
												"for": {
													Description: "Alerts are considered firing once they have been returned for this long.",
													Pattern:     "^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$",
													Type:        "string",
												},
												"labels": {
													AdditionalProperties: &apiextensionsv1.JSONSchemaPropsOrBool{
														Allows: true,
														Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"},
													},
													Description: "Labels to add or overwrite.",
													Type:        "object",
												},
												"record": {
													Description: "Name of the time series to output to. Must be a valid metric name. Only one of `record` and `alert` must be set.",
													Type:        "string",
												},
											},
											Required: []string{"expr"},
											Type:     "object",
										}},
										Type: "array",
									},
								},
								Required: []string{"name"},
								Type:     "object",
							}},
							Type:         "array",
							XListMapKeys: []string{"name"},
							XListType:    P("map"),
						}},
						Type: "object",
					},
				},
				Required: []string{"spec"},
				Type:     "object",
			}},
			Served:  true,
			Storage: true,
		}},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
