@soft-stech/flux-cd
Version:
234 lines (233 loc) • 8.15 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.v1beta2.Receiver";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"notification.toolkit.fluxcd.io/v1beta2"
]
},
"kind": {
"type": "string",
"enum": [
"Receiver"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"events": {
"items": {
"type": "string"
},
"type": "array",
"nullable": true
},
"interval": {
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$",
"nullable": true
},
"resources": {
"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"
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"suspend": {
"type": "boolean",
"nullable": true
},
"type": {
"enum": [
"generic",
"generic-hmac",
"github",
"gitlab",
"bitbucket",
"harbor",
"dockerhub",
"quay",
"gcr",
"nexus",
"acr"
],
"type": "string"
}
},
"required": [
"resources",
"type"
],
"type": "object",
"nullable": true
},
"status": {
"default": {
"observedGeneration": -1
},
"properties": {
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"format": "date-time",
"type": "string"
},
"message": {
"maxLength": 32768,
"type": "string"
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"minimum": 0,
"nullable": true
},
"reason": {
"maxLength": 1024,
"minLength": 1,
"type": "string",
"pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
},
"status": {
"enum": [
"True",
"False",
"Unknown"
],
"type": "string"
},
"type": {
"maxLength": 316,
"type": "string",
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\\/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$"
}
},
"required": [
"lastTransitionTime",
"message",
"reason",
"status",
"type"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"lastHandledReconcileAt": {
"type": "string",
"nullable": true
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"url": {
"type": "string",
"nullable": true
},
"webhookPath": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* Receiver is the Schema for the receivers API.
*/
export class Receiver extends Model {
constructor(data) {
super({
apiVersion: Receiver.apiVersion,
kind: Receiver.kind,
...data
});
}
}
Receiver.apiVersion = "notification.toolkit.fluxcd.io/v1beta2";
Receiver.kind = "Receiver";
Receiver.is = createTypeMetaGuard(Receiver);
setSchema(Receiver, schemaId, () => {
addSchema();
register(schemaId, schema);
});