@soft-stech/flux-cd
Version:
155 lines (154 loc) • 4.71 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.Provider";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"notification.toolkit.fluxcd.io/v1beta3"
]
},
"kind": {
"type": "string",
"enum": [
"Provider"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"address": {
"maxLength": 2048,
"type": "string",
"nullable": true
},
"certSecretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"channel": {
"maxLength": 2048,
"type": "string",
"nullable": true
},
"interval": {
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$",
"nullable": true
},
"proxy": {
"maxLength": 2048,
"type": "string",
"pattern": "^(http|https):\\/\\/.*$",
"nullable": true
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"suspend": {
"type": "boolean",
"nullable": true
},
"timeout": {
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m))+$",
"nullable": true
},
"type": {
"enum": [
"slack",
"discord",
"msteams",
"rocket",
"generic",
"generic-hmac",
"github",
"gitlab",
"gitea",
"bitbucketserver",
"bitbucket",
"azuredevops",
"googlechat",
"googlepubsub",
"webex",
"sentry",
"azureeventhub",
"telegram",
"lark",
"matrix",
"opsgenie",
"alertmanager",
"grafana",
"githubdispatch",
"pagerduty",
"datadog",
"nats"
],
"type": "string"
},
"username": {
"maxLength": 2048,
"type": "string",
"nullable": true
}
},
"required": [
"type"
],
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* Provider is the Schema for the providers API
*/
export class Provider extends Model {
constructor(data) {
super({
apiVersion: Provider.apiVersion,
kind: Provider.kind,
...data
});
}
}
Provider.apiVersion = "notification.toolkit.fluxcd.io/v1beta3";
Provider.kind = "Provider";
Provider.is = createTypeMetaGuard(Provider);
setSchema(Provider, schemaId, () => {
addSchema();
register(schemaId, schema);
});