// 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 StreamsJetstreamNatsIoCRD = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{Name: "streams.jetstream.nats.io"},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Group: "jetstream.nats.io",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Kind:     "Stream",
			Plural:   "streams",
			Singular: "stream",
		},
		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.",
						JSONPath:    ".spec.name",
						Name:        "Stream Name",
						Type:        "string",
					}, {
						Description: "The subjects this Stream produces.",
						JSONPath:    ".spec.subjects",
						Name:        "Subjects",
						Type:        "string",
					},
				},
				Name: "v1beta2",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Properties: map[string]apiextensionsv1.JSONSchemaProps{
							"spec": {
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"account": {
										Description: "Name of the account to which the Stream belongs.",
										Pattern:     "^[^.*>]*$",
										Type:        "string",
									},
									"allowDirect": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, allow higher performance, direct access to get individual messages",
										Type:        "boolean",
									},
									"allowRollup": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, allows the use of the Nats-Rollup header to replace all contents of a stream, or subject in a stream, with a single new message.",
										Type:        "boolean",
									},
									"creds": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"\"")},
										Description: "NATS user credentials for connecting to servers. Please make sure your controller has mounted the cerds on its path.",
										Type:        "string",
									},
									"denyDelete": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, restricts the ability to delete messages from a stream via the API. Cannot be changed once set to true.",
										Type:        "boolean",
									},
									"description": {
										Description: "The description of the stream.",
										Type:        "string",
									},
									"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",
									},
									"maxMsgsPerSubject": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("0")},
										Description: "The maximum of messages per subject.",
										Type:        "integer",
									},
									"mirror": {
										Description: "A stream mirror.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"externalApiPrefix":     {Type: "string"},
											"externalDeliverPrefix": {Type: "string"},
											"filterSubject":         {Type: "string"},
											"name":                  {Type: "string"},
											"optStartSeq":           {Type: "integer"},
											"optStartTime": {
												Description: "Time format must be RFC3339.",
												Type:        "string",
											},
										},
										Type: "object",
									},
									"name": {
										Description: "A unique name for the Stream.",
										MinLength:   P(int64(1)),
										Pattern:     "^[^.*>]*$",
										Type:        "string",
									},
									"nkey": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"\"")},
										Description: "NATS user NKey for connecting to servers.",
										Type:        "string",
									},
									"noAck": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "Disables acknowledging messages that are received by the Stream.",
										Type:        "boolean",
									},
									"placement": {
										Description: "A stream's placement.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"cluster": {Type: "string"},
											"tags": {
												Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
												Type:  "array",
											},
										},
										Type: "object",
									},
									"preventDelete": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, the managed Stream will not be deleted when the resource is deleted",
										Type:        "boolean",
									},
									"preventUpdate": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, the managed Stream will not be updated when the resource is updated",
										Type:        "boolean",
									},
									"replicas": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("1")},
										Description: "How many replicas to keep for each message.",
										Minimum:     P(1.0),
										Type:        "integer",
									},
									"republish": {
										Description: "Republish configuration of the stream.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"destination": {
												Description: "Messages will be additionally published to that subject.",
												Type:        "string",
											},
											"source": {
												Description: "Messages will be published from that subject to the destination subject.",
												Type:        "string",
											},
										},
										Type: "object",
									},
									"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",
									},
									"servers": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("[]")},
										Description: "A list of servers for creating stream",
										Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
										Type:        "array",
									},
									"sources": {
										Description: "A stream's sources.",
										Items: &apiextensionsv1.JSONSchemaPropsOrArray{
											Schema: &apiextensionsv1.JSONSchemaProps{
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"externalApiPrefix":     {Type: "string"},
													"externalDeliverPrefix": {Type: "string"},
													"filterSubject":         {Type: "string"},
													"name":                  {Type: "string"},
													"optStartSeq":           {Type: "integer"},
													"optStartTime": {
														Description: "Time format must be RFC3339.",
														Type:        "string",
													},
												},
												Type: "object",
											},
										},
										Type: "array",
									},
									"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",
									},
									"tls": {
										Description: "A client's TLS certs and keys.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"clientCert": {
												Description: "A client's cert filepath. Should be mounted.",
												Type:        "string",
											},
											"clientKey": {
												Description: "A client's key filepath. Should be mounted.",
												Type:        "string",
											},
											"rootCas": {
												Description: "A list of filepaths to CAs. Should be mounted.",
												Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
												Type:        "array",
											},
										},
										Type: "object",
									},
								},
								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",
					},
				},
				Served:       true,
				Storage:      true,
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			}, {
				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.",
						JSONPath:    ".spec.name",
						Name:        "Stream 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{
									"description": {
										Description: "The description of the stream.",
										Type:        "string",
									},
									"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",
									},
									"maxMsgsPerSubject": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("0")},
										Description: "The maximum of messages per subject.",
										Type:        "integer",
									},
									"mirror": {
										Description: "A stream mirror.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"externalApiPrefix":     {Type: "string"},
											"externalDeliverPrefix": {Type: "string"},
											"filterSubject":         {Type: "string"},
											"name":                  {Type: "string"},
											"optStartSeq":           {Type: "integer"},
											"optStartTime": {
												Description: "Time format must be RFC3339.",
												Type:        "string",
											},
										},
										Type: "object",
									},
									"name": {
										Description: "A unique name for the Stream.",
										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",
									},
									"placement": {
										Description: "A stream's placement.",
										Properties: map[string]apiextensionsv1.JSONSchemaProps{
											"cluster": {Type: "string"},
											"tags": {
												Items: &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
												Type:  "array",
											},
										},
										Type: "object",
									},
									"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",
									},
									"sources": {
										Description: "A stream's sources.",
										Items: &apiextensionsv1.JSONSchemaPropsOrArray{
											Schema: &apiextensionsv1.JSONSchemaProps{
												Properties: map[string]apiextensionsv1.JSONSchemaProps{
													"externalApiPrefix":     {Type: "string"},
													"externalDeliverPrefix": {Type: "string"},
													"filterSubject":         {Type: "string"},
													"name":                  {Type: "string"},
													"optStartSeq":           {Type: "integer"},
													"optStartTime": {
														Description: "Time format must be RFC3339.",
														Type:        "string",
													},
												},
												Type: "object",
											},
										},
										Type: "array",
									},
									"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",
					},
				},
				Subresources: &apiextensionsv1.CustomResourceSubresources{},
			},
		},
	},
	TypeMeta: metav1.TypeMeta{
		APIVersion: "apiextensions.k8s.io/v1",
		Kind:       "CustomResourceDefinition",
	},
}
