@soft-stech/flux-cd
Version:
166 lines (165 loc) • 5.41 kB
JavaScript
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta";
import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base";
import { register } from "@soft-stech/validate";
const schemaId = "notification.toolkit.fluxcd.io.v1beta3.Alert";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"notification.toolkit.fluxcd.io/v1beta3"
]
},
"kind": {
"type": "string",
"enum": [
"Alert"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"eventMetadata": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
},
"eventSeverity": {
"default": "info",
"enum": [
"info",
"error"
],
"type": "string",
"nullable": true
},
"eventSources": {
"items": {
"properties": {
"apiVersion": {
"type": "string",
"nullable": true
},
"kind": {
"enum": [
"Bucket",
"GitRepository",
"Kustomization",
"HelmRelease",
"HelmChart",
"HelmRepository",
"ImageRepository",
"ImagePolicy",
"ImageUpdateAutomation",
"OCIRepository"
],
"type": "string"
},
"matchLabels": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
},
"name": {
"maxLength": 53,
"minLength": 1,
"type": "string"
},
"namespace": {
"maxLength": 53,
"minLength": 1,
"type": "string",
"nullable": true
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
"type": "array"
},
"exclusionList": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"inclusionList": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"providerRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"summary": {
"maxLength": 255,
"type": "string",
"nullable": true
},
"suspend": {
"type": "boolean",
"nullable": true
}
},
"required": [
"eventSources",
"providerRef"
],
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* Alert is the Schema for the alerts API
*/
export class Alert extends Model {
constructor(data) {
super({
apiVersion: Alert.apiVersion,
kind: Alert.kind,
...data
});
}
}
Alert.apiVersion = "notification.toolkit.fluxcd.io/v1beta3";
Alert.kind = "Alert";
Alert.is = createTypeMetaGuard(Alert);
setSchema(Alert, schemaId, () => {
addSchema();
register(schemaId, schema);
});