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

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

package crd

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

var PasswordsGeneratorsCrd = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{
		Annotations: map[string]string{"controller-gen.kubebuilder.io/version": "v0.11.1"},
		Name:        "passwords.generators.external-secrets.io",
	},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Conversion: &apiextensionsv1.CustomResourceConversion{
			Strategy: apiextensionsv1.ConversionStrategyType("Webhook"),
			Webhook: &apiextensionsv1.WebhookConversion{
				ClientConfig: &apiextensionsv1.WebhookClientConfig{
					Service: &apiextensionsv1.ServiceReference{
						Name:      "external-secrets-webhook",
						Namespace: "external-secrets",
						Path:      P("/convert"),
					},
				},
				ConversionReviewVersions: []string{"v1"},
			},
		},
		Group: "generators.external-secrets.io",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Categories: []string{"password"},
			Kind:       "Password",
			ListKind:   "PasswordList",
			Plural:     "passwords",
			ShortNames: []string{"password"},
			Singular:   "password",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
			{
				Name: "v1alpha1",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Description: "Password generates a random password based on the configuration parameters in spec. You can specify the length, characterset and other attributes.",
						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: "PasswordSpec controls the behavior of the password generator.",
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"allowRepeat": {
										Default: &apiextensionsv1.JSON{
											Raw: []uint8{
												uint8(0x66),
												uint8(0x61),
												uint8(0x6c),
												uint8(0x73),
												uint8(0x65),
											},
										},
										Description: "set AllowRepeat to true to allow repeating characters.",
										Type:        "boolean",
									},
									"digits": {
										Description: "Digits specifies the number of digits in the generated password. If omitted it defaults to 25% of the length of the password",
										Type:        "integer",
									},
									"length": {
										Default: &apiextensionsv1.JSON{
											Raw: []uint8{
												uint8(0x32),
												uint8(0x34),
											},
										},
										Description: "Length of the password to be generated. Defaults to 24",
										Type:        "integer",
									},
									"noUpper": {
										Default: &apiextensionsv1.JSON{
											Raw: []uint8{
												uint8(0x66),
												uint8(0x61),
												uint8(0x6c),
												uint8(0x73),
												uint8(0x65),
											},
										},
										Description: "Set NoUpper to disable uppercase characters",
										Type:        "boolean",
									},
									"symbolCharacters": {
										Description: "SymbolCharacters specifies the special characters that should be used in the generated password.",
										Type:        "string",
									},
									"symbols": {
										Description: "Symbols specifies the number of symbol characters in the generated password. If omitted it defaults to 25% of the length of the password",
										Type:        "integer",
									},
								},
								Required: []string{
									"allowRepeat",
									"length",
									"noUpper",
								},
								Type: "object",
							},
						},
						Type: "object",
					},
				},
				Served:       true,
				Storage:      true,
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			},
		},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
