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

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

package vmcrd

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

var VmusersOperatorVictoriametricsComCRD = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Annotations: map[string]string{"controller-gen.kubebuilder.io/version": "v0.10.0"},
		Name:        "vmusers.operator.victoriametrics.com",
	},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Group: "operator.victoriametrics.com",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Kind:     "VMUser",
			ListKind: "VMUserList",
			Plural:   "vmusers",
			Singular: "vmuser",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{{
			Name: "v1beta1",
			Schema: &apiextensionsv1.CustomResourceValidation{OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
				Description: "VMUser is the Schema for the vmusers API",
				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: "VMUserSpec defines the desired state of VMUser",
						Properties: map[string]apiextensionsv1.JSONSchemaProps{
							"bearerToken": {
								Description: "BearerToken Authorization header value for accessing protected endpoint.",
								Type:        "string",
							},
							"default_url": {
								Description: "DefaultURLs backend url for non-matching paths filter usually used for default backend with error message",
								Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
								Type:        "array",
							},
							"generatePassword": {
								Description: "GeneratePassword instructs operator to generate password for user if spec.password if empty.",
								Type:        "boolean",
							},
							"name": {
								Description: "Name of the VMUser object.",
								Type:        "string",
							},
							"password": {
								Description: "Password basic auth password for accessing protected endpoint.",
								Type:        "string",
							},
							"passwordRef": {
								Description: "PasswordRef allows fetching password from user-create secret by its name and key.",
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"key": {
										Description: "The key of the secret to select from.  Must be a valid secret key.",
										Type:        "string",
									},
									"name": {
										Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
										Type:        "string",
									},
									"optional": {
										Description: "Specify whether the Secret or its key must be defined",
										Type:        "boolean",
									},
								},
								Required: []string{"key"},
								Type:     "object",
								XMapType: P("atomic"),
							},
							"targetRefs": {
								Description: "TargetRefs - reference to endpoints, which user may access.",
								Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{
									Description: "TargetRef describes target for user traffic forwarding. one of target types can be chosen: crd or static per targetRef. user can define multiple targetRefs with different ref Types.",
									Properties: map[string]apiextensionsv1.JSONSchemaProps{
										"crd": {
											Description: "CRD describes exist operator's CRD object, operator generates access url based on CRD params.",
											Properties: map[string]apiextensionsv1.JSONSchemaProps{
												"kind": {
													Description: "Kind one of: VMAgent VMAlert VMCluster VMSingle or VMAlertManager",
													Type:        "string",
												},
												"name": {
													Description: "Name target CRD object name",
													Type:        "string",
												},
												"namespace": {
													Description: "Namespace target CRD object namespace.",
													Type:        "string",
												},
											},
											Required: []string{"kind", "name", "namespace"},
											Type:     "object",
										},
										"headers": {
											Description: "Headers represent additional http headers, that vmauth uses in form of [\"header_key: header_value\"] multiple values for header key: [\"header_key: value1,value2\"] it's available since 1.68.0 version of vmauth",
											Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
											Type:        "array",
										},
										"ip_filters": {
											Description: "IPFilters defines per target src ip filters supported only with enterprise version of vmauth https://docs.victoriametrics.com/vmauth.html#ip-filters",
											Properties: map[string]apiextensionsv1.JSONSchemaProps{
												"allow_list": {
													Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
													Type:  "array",
												},
												"deny_list": {
													Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
													Type:  "array",
												},
											},
											Type: "object",
										},
										"paths": {
											Description: "Paths - matched path to route.",
											Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
											Type:        "array",
										},
										"static": {
											Description: "Static - user defined url for traffic forward, for instance http://vmsingle:8429",
											Properties: map[string]apiextensionsv1.JSONSchemaProps{
												"url": {
													Description: "URL http url for given staticRef.",
													Type:        "string",
												},
												"urls": {
													Description: "URLs allows setting multiple urls for load-balancing at vmauth-side.",
													Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
													Type:        "array",
												},
											},
											Type: "object",
										},
										"target_path_suffix": {
											Description: "QueryParams []string `json:\"queryParams,omitempty\"` TargetPathSuffix allows to add some suffix to the target path It allows to hide tenant configuration from user with crd as ref. it also may contain any url encoded params.",
											Type:        "string",
										},
									},
									Type: "object",
								}},
								Type: "array",
							},
							"tokenRef": {
								Description: "TokenRef allows fetching token from user-created secrets by its name and key.",
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"key": {
										Description: "The key of the secret to select from.  Must be a valid secret key.",
										Type:        "string",
									},
									"name": {
										Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?",
										Type:        "string",
									},
									"optional": {
										Description: "Specify whether the Secret or its key must be defined",
										Type:        "boolean",
									},
								},
								Required: []string{"key"},
								Type:     "object",
								XMapType: P("atomic"),
							},
							"username": {
								Description: "UserName basic auth user name for accessing protected endpoint, will be replaced with metadata.name of VMUser if omitted.",
								Type:        "string",
							},
						},
						Required: []string{"targetRefs"},
						Type:     "object",
					},
					"status": {
						Description: "VMUserStatus defines the observed state of VMUser",
						Type:        "object",
					},
				},
				Type: "object",
			}},
			Served:       true,
			Storage:      true,
			Subresources: &apiextensionsv1.CustomResourceSubresources{},
		}},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
