// 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 StreamTemplatesJetstreamNatsIoCRD = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{Name: "streamtemplates.jetstream.nats.io"},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Group: "jetstream.nats.io",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Kind:     "StreamTemplate",
			Plural:   "streamtemplates",
			Singular: "streamtemplate",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
			{
				AdditionalPrinterColumns: []apiextensionsv1.CustomResourceColumnDefinition{
					{
						Description: "The current state of the stream.",
						JSONPath:    ".status.conditions[?(@.type == 'Ready')].reason",
						Name:        "State",
						Type:        "string",
					}, {
						Description: "The name of the Jetstream Stream Template.",
						JSONPath:    ".spec.name",
						Name:        "Stream Template Name",
						Type:        "string",
					}, {
						Description: "The subjects this Stream produces.",
						JSONPath:    ".spec.subjects",
						Name:        "Subjects",
						Type:        "string",
					},
				},
				Name: "v1beta1",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Properties: map[string]apiextensionsv1.JSONSchemaProps{
							"spec": {
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"discard": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"old\"")},
										Description: "When a Stream reach it's limits either old messages are deleted or new ones are denied.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"old\"")},
											{Raw: []byte("\"new\"")},
										},
										Type: "string",
									},
									"duplicateWindow": {
										Description: "The duration window to track duplicate messages for.",
										Type:        "string",
									},
									"maxAge": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"\"")},
										Description: "Maximum age of any message in the stream, expressed in Go's time.Duration format. Empty for unlimited.",
										Type:        "string",
									},
									"maxBytes": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("-1")},
										Description: "How big the Stream may be, when the combined stream size exceeds this old messages are removed. -1 for unlimited.",
										Minimum:     P(-1.0),
										Type:        "integer",
									},
									"maxConsumers": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("-1")},
										Description: "How many Consumers can be defined for a given Stream. -1 for unlimited.",
										Minimum:     P(-1.0),
										Type:        "integer",
									},
									"maxMsgSize": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("-1")},
										Description: "The largest message that will be accepted by the Stream. -1 for unlimited.",
										Minimum:     P(-1.0),
										Type:        "integer",
									},
									"maxMsgs": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("-1")},
										Description: "How many messages may be in a Stream, oldest messages will be removed if the Stream exceeds this size. -1 for unlimited.",
										Minimum:     P(-1.0),
										Type:        "integer",
									},
									"maxStreams": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("-1")},
										Description: "The maximum number of Streams this Template can create, -1 for unlimited.",
										Minimum:     P(-1.0),
										Type:        "integer",
									},
									"name": {
										Description: "A unique name for the Stream Template.",
										MinLength:   P(int64(1)),
										Pattern:     "^[^.*>]*$",
										Type:        "string",
									},
									"noAck": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "Disables acknowledging messages that are received by the Stream.",
										Type:        "boolean",
									},
									"replicas": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("1")},
										Description: "How many replicas to keep for each message.",
										Minimum:     P(1.0),
										Type:        "integer",
									},
									"retention": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"limits\"")},
										Description: "How messages are retained in the Stream, once this is exceeded old messages are removed.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"limits\"")},
											{Raw: []byte("\"interest\"")},
											{Raw: []byte("\"workqueue\"")},
										},
										Type: "string",
									},
									"storage": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"memory\"")},
										Description: "The storage backend to use for the Stream.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"file\"")},
											{Raw: []byte("\"memory\"")},
										},
										Type: "string",
									},
									"subjects": {
										Description: "A list of subjects to consume, supports wildcards.",
										Items: &apiextensionsv1.JSONSchemaPropsOrArray{
											Schema: &apiextensionsv1.JSONSchemaProps{
												MinLength: P(int64(1)),
												Type:      "string",
											},
										},
										MinLength: P(int64(1)),
										Type:      "array",
									},
								},
								Type: "object",
							},
							"status": {
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"conditions": {
										Items: &apiextensionsv1.JSONSchemaPropsOrArray{
											Schema: &apiextensionsv1.JSONSchemaProps{
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"lastTransitionTime": {Type: "string"},
													"message":            {Type: "string"},
													"reason":             {Type: "string"},
													"status":             {Type: "string"},
													"type":               {Type: "string"},
												},
												Type: "object",
											},
										},
										Type: "array",
									},
									"observedGeneration": {Type: "integer"},
								},
								Type: "object",
							},
						},
						Type: "object",
					},
				},
				Storage:      true,
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			},
		},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
