// 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 ConsumersJetstreamNatsIoCRD = &apiextensionsv1.CustomResourceDefinition{
	ObjectMeta: metav1.ObjectMeta{Name: "consumers.jetstream.nats.io"},
	Spec: apiextensionsv1.CustomResourceDefinitionSpec{
		Group: "jetstream.nats.io",
		Names: apiextensionsv1.CustomResourceDefinitionNames{
			Kind:     "Consumer",
			Plural:   "consumers",
			Singular: "consumer",
		},
		Scope: apiextensionsv1.ResourceScope("Namespaced"),
		Versions: []apiextensionsv1.CustomResourceDefinitionVersion{
			{
				AdditionalPrinterColumns: []apiextensionsv1.CustomResourceColumnDefinition{
					{
						Description: "The current state of the consumer.",
						JSONPath:    ".status.conditions[?(@.type == 'Ready')].reason",
						Name:        "State",
						Type:        "string",
					}, {
						Description: "The name of the Jetstream Stream.",
						JSONPath:    ".spec.streamName",
						Name:        "Stream",
						Type:        "string",
					}, {
						Description: "The name of the Jetstream Consumer.",
						JSONPath:    ".spec.durableName",
						Name:        "Consumer",
						Type:        "string",
					}, {
						Description: "The ack policy.",
						JSONPath:    ".spec.ackPolicy",
						Name:        "Ack Policy",
						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 Consumer belongs.",
										Pattern:     "^[^.*>]*$",
										Type:        "string",
									},
									"ackPolicy": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"none\"")},
										Description: "How messages should be acknowledged.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"none\"")},
											{Raw: []byte("\"all\"")},
											{Raw: []byte("\"explicit\"")},
										},
										Type: "string",
									},
									"ackWait": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"1ns\"")},
										Description: "How long to allow messages to remain un-acknowledged before attempting redelivery.",
										Type:        "string",
									},
									"backoff": {
										Description: "List of durations representing a retry time scale for NaK'd or retried messages",
										Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
										Type:        "array",
									},
									"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",
									},
									"deliverGroup": {
										Description: "The name of a queue group.",
										Type:        "string",
									},
									"deliverPolicy": {
										Default: &apiextensionsv1.JSON{Raw: []byte("\"all\"")},
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"all\"")},
											{Raw: []byte("\"last\"")},
											{Raw: []byte("\"new\"")},
											{Raw: []byte("\"byStartSequence\"")},
											{Raw: []byte("\"byStartTime\"")},
										},
										Type: "string",
									},
									"deliverSubject": {
										Description: "The subject to deliver observed messages, when not set, a pull-based Consumer is created.",
										Type:        "string",
									},
									"description": {
										Description: "The description of the consumer.",
										Type:        "string",
									},
									"durableName": {
										Description: "The name of the Consumer.",
										MinLength:   P(int64(1)),
										Pattern:     "^[^.*>]+$",
										Type:        "string",
									},
									"filterSubject": {
										Description: "Select only a specific incoming subjects, supports wildcards.",
										Type:        "string",
									},
									"flowControl": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "Enables flow control.",
										Type:        "boolean",
									},
									"headersOnly": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When set, only the headers of messages in the stream are delivered, and not the bodies. Additionally, Nats-Msg-Size header is added to indicate the size of the removed payload",
										Type:        "boolean",
									},
									"heartbeatInterval": {
										Description: "The interval used to deliver idle heartbeats for push-based consumers, in Go's time.Duration format.",
										Type:        "string",
									},
									"maxAckPending": {
										Description: "Maximum pending Acks before consumers are paused.",
										Type:        "integer",
									},
									"maxDeliver": {
										Minimum: P(-1.0),
										Type:    "integer",
									},
									"maxRequestBatch": {
										Description: "The largest batch property that may be specified when doing a pull on a Pull Consumer.",
										Type:        "integer",
									},
									"maxRequestExpires": {
										Description: "The maximum expires duration that may be set when doing a pull on a Pull Consumer.",
										Type:        "string",
									},
									"maxRequestMaxBytes": {
										Description: "The maximum max_bytes value that maybe set when dong a pull on a Pull Consumer.",
										Type:        "integer",
									},
									"maxWaiting": {
										Description: "The number of pulls that can be outstanding on a pull consumer, pulls received after this is reached are ignored.",
										Type:        "integer",
									},
									"memStorage": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "Force the consumer state to be kept in memory rather than inherit the setting from the stream.",
										Type:        "boolean",
									},
									"nkey": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"\"")},
										Description: "NATS user NKey for connecting to servers.",
										Type:        "string",
									},
									"optStartSeq": {Type: "integer"},
									"optStartTime": {
										Description: "Time format must be RFC3339.",
										Type:        "string",
									},
									"preventDelete": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, the managed Consumer will not be deleted when the resource is deleted",
										Type:        "boolean",
									},
									"preventUpdate": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "When true, the managed Consumer will not be updated when the resource is updated",
										Type:        "boolean",
									},
									"rateLimitBps": {
										Description: "rate at which messages will be delivered to clients, expressed in bit per second.",
										Type:        "integer",
									},
									"replayPolicy": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"instant\"")},
										Description: "How messages are sent.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"instant\"")},
											{Raw: []byte("\"original\"")},
										},
										Type: "string",
									},
									"replicas": {
										Description: "When set do not inherit the replica count from the stream but specifically set it to this amount.",
										Type:        "integer",
									},
									"sampleFreq": {
										Description: "What percentage of acknowledgements should be samples for observability.",
										Type:        "string",
									},
									"servers": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("[]")},
										Description: "A list of servers for creating consumer",
										Items:       &apiextensionsv1.JSONSchemaPropsOrArray{Schema: &apiextensionsv1.JSONSchemaProps{Type: "string"}},
										Type:        "array",
									},
									"streamName": {
										Description: "The name of the Stream to create the Consumer in.",
										Type:        "string",
									},
									"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 consumer.",
						JSONPath:    ".status.conditions[?(@.type == 'Ready')].reason",
						Name:        "State",
						Type:        "string",
					}, {
						Description: "The name of the Jetstream Stream.",
						JSONPath:    ".spec.streamName",
						Name:        "Stream",
						Type:        "string",
					}, {
						Description: "The name of the Jetstream Consumer.",
						JSONPath:    ".spec.durableName",
						Name:        "Consumer",
						Type:        "string",
					}, {
						Description: "The ack policy.",
						JSONPath:    ".spec.ackPolicy",
						Name:        "Ack Policy",
						Type:        "string",
					},
				},
				Name: "v1beta1",
				Schema: &apiextensionsv1.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensionsv1.JSONSchemaProps{
						Properties: map[string]apiextensionsv1.JSONSchemaProps{
							"spec": {
								Properties: map[string]apiextensionsv1.JSONSchemaProps{
									"ackPolicy": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"none\"")},
										Description: "How messages should be acknowledged.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"none\"")},
											{Raw: []byte("\"all\"")},
											{Raw: []byte("\"explicit\"")},
										},
										Type: "string",
									},
									"ackWait": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"1ns\"")},
										Description: "How long to allow messages to remain un-acknowledged before attempting redelivery.",
										Type:        "string",
									},
									"deliverGroup": {
										Description: "The name of a queue group.",
										Type:        "string",
									},
									"deliverPolicy": {
										Default: &apiextensionsv1.JSON{Raw: []byte("\"all\"")},
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"all\"")},
											{Raw: []byte("\"last\"")},
											{Raw: []byte("\"new\"")},
											{Raw: []byte("\"byStartSequence\"")},
											{Raw: []byte("\"byStartTime\"")},
										},
										Type: "string",
									},
									"deliverSubject": {
										Description: "The subject to deliver observed messages, when not set, a pull-based Consumer is created.",
										Type:        "string",
									},
									"description": {
										Description: "The description of the consumer.",
										Type:        "string",
									},
									"durableName": {
										Description: "The name of the Consumer.",
										MinLength:   P(int64(1)),
										Pattern:     "^[^.*>]+$",
										Type:        "string",
									},
									"filterSubject": {
										Description: "Select only a specific incoming subjects, supports wildcards.",
										Type:        "string",
									},
									"flowControl": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("false")},
										Description: "Enables flow control.",
										Type:        "boolean",
									},
									"heartbeatInterval": {
										Description: "The interval used to deliver idle heartbeats for push-based consumers, in Go's time.Duration format.",
										Type:        "string",
									},
									"maxAckPending": {
										Description: "Maximum pending Acks before consumers are paused.",
										Type:        "integer",
									},
									"maxDeliver": {
										Minimum: P(-1.0),
										Type:    "integer",
									},
									"optStartSeq": {Type: "integer"},
									"optStartTime": {
										Description: "Time format must be RFC3339.",
										Type:        "string",
									},
									"rateLimitBps": {
										Description: "rate at which messages will be delivered to clients, expressed in bit per second.",
										Type:        "integer",
									},
									"replayPolicy": {
										Default:     &apiextensionsv1.JSON{Raw: []byte("\"instant\"")},
										Description: "How messages are sent.",
										Enum: []apiextensionsv1.JSON{
											{Raw: []byte("\"instant\"")},
											{Raw: []byte("\"original\"")},
										},
										Type: "string",
									},
									"sampleFreq": {
										Description: "What percentage of acknowledgements should be samples for observability.",
										Type:        "string",
									},
									"streamName": {
										Description: "The name of the Stream to create the Consumer in.",
										Type:        "string",
									},
								},
								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",
	},
}
