@soft-stech/keda
Version:
KEDA(Kubernetes Event-driven Autoscaling) models
111 lines (110 loc) • 3.92 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ICloudEventSourceSchema = void 0;
// Generated by ts-to-zod
const zod_1 = require("zod");
const ObjectMeta_schema_1 = require("@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema");
/**
* CloudEventSource defines how a KEDA event will be sent to event sink
*/
exports.ICloudEventSourceSchema = zod_1.z.object({
/**
* 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
*/
apiVersion: zod_1.z.literal("eventing.keda.sh/v1alpha1"),
/**
* 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
*/
kind: zod_1.z.literal("CloudEventSource"),
metadata: ObjectMeta_schema_1.iObjectMetaSchema.optional(),
/**
* CloudEventSourceSpec defines the spec of CloudEventSource
*/
spec: zod_1.z.object({
/**
* AuthenticationRef points to the TriggerAuthentication or ClusterTriggerAuthentication object that
* is used to authenticate the scaler with the environment
*/
authenticationRef: zod_1.z
.object({
/**
* Kind of the resource being referred to. Defaults to TriggerAuthentication.
*/
kind: zod_1.z.string().optional(),
name: zod_1.z.string()
})
.optional(),
clusterName: zod_1.z.string().optional(),
/**
* Destination defines the various ways to emit events
*/
destination: zod_1.z.object({
azureEventGridTopic: zod_1.z
.object({
endpoint: zod_1.z.string()
})
.optional(),
http: zod_1.z
.object({
uri: zod_1.z.string()
})
.optional()
}),
/**
* EventSubscription defines filters for events
*/
eventSubscription: zod_1.z
.object({
excludedEventTypes: zod_1.z
.array(zod_1.z.union([
zod_1.z.literal("keda.scaledobject.ready.v1"),
zod_1.z.literal("keda.scaledobject.failed.v1")
]))
.optional(),
includedEventTypes: zod_1.z
.array(zod_1.z.union([
zod_1.z.literal("keda.scaledobject.ready.v1"),
zod_1.z.literal("keda.scaledobject.failed.v1")
]))
.optional()
})
.optional()
}),
/**
* CloudEventSourceStatus defines the observed state of CloudEventSource
*/
status: zod_1.z
.object({
/**
* Conditions an array representation to store multiple Conditions
*/
conditions: zod_1.z
.array(zod_1.z.object({
/**
* A human readable message indicating details about the transition.
*/
message: zod_1.z.string().optional(),
/**
* The reason for the condition's last transition.
*/
reason: zod_1.z.string().optional(),
/**
* Status of the condition, one of True, False, Unknown.
*/
status: zod_1.z.string(),
/**
* Type of condition
*/
type: zod_1.z.string()
}))
.optional()
})
.optional()
});