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

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

package jetstream

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

var AccountsJetstreamNatsIoCRD = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{Name: "accounts.jetstream.nats.io"},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Group: "jetstream.nats.io",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Kind:     "Account",
			Plural:   "accounts",
			Singular: "account",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
			{
				Name: "v1beta2",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Properties: map[string]apiextensionsv1.JSONSchemaProps{
							"spec": {
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"creds": {
										Description: "The creds to be used to connect to the NATS Service.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"file": {
												Description: "Credentials file, generated with github.com/nats-io/nsc tool.",
												Type:        "string",
											},
											"secret": {
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"name": {
														Description: "Name of the secret with the creds.",
														Type:        "string",
													},
												},
												Type: "object",
											},
										},
										Type: "object",
									},
									"name": {
										Description: "A unique name for the Account.",
										MinLength:   P(int64(1)),
										Pattern:     "^[^.*>]*$",
										Type:        "string",
									},
									"servers": {
										Description: "A list of servers to connect.",
										Items: &apiextensionsv1.JSONSchemaPropsOrArray{
											Schema: &apiextensionsv1.JSONSchemaProps{
												MinLength: P(int64(1)),
												Type:      "string",
											},
										},
										MinLength: P(int64(1)),
										Type:      "array",
									},
									"tls": {
										Description: "The TLS certs to be used to connect to the NATS Service.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"ca": {
												Description: "Filename of the Root CA of the TLS cert.",
												Type:        "string",
											},
											"cert": {
												Description: "Filename of the TLS cert.",
												Type:        "string",
											},
											"key": {
												Description: "Filename of the TLS cert key.",
												Type:        "string",
											},
											"secret": {
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"name": {
														Description: "Name of the TLS secret with the certs.",
														Type:        "string",
													},
												},
												Type: "object",
											},
										},
										Type: "object",
									},
								},
								Type: "object",
							},
						},
						Type: "object",
					},
				},
				Served:       true,
				Storage:      true,
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			},
		},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
