UNPKG

@soft-stech/fleet

Version:
135 lines (134 loc) 4.35 kB
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta"; import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base"; import { register } from "@soft-stech/validate"; const schemaId = "fleet.cattle.io.v1alpha1.BundleNamespaceMapping"; const schema = { "type": "object", "properties": { "apiVersion": { "type": "string", "enum": [ "fleet.cattle.io/v1alpha1" ] }, "bundleSelector": { "nullable": true, "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object" }, "kind": { "type": "string", "enum": [ "BundleNamespaceMapping" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] }, "namespaceSelector": { "nullable": true, "properties": { "matchExpressions": { "items": { "properties": { "key": { "type": "string" }, "operator": { "type": "string" }, "values": { "items": { "type": "string" }, "type": "array", "nullable": true } }, "required": [ "key", "operator" ], "type": "object" }, "type": "array", "nullable": true }, "matchLabels": { "additionalProperties": { "type": "string" }, "type": "object", "properties": {}, "nullable": true } }, "type": "object" } }, "required": [ "apiVersion", "kind" ] }; /** * BundleNamespaceMapping maps bundles to clusters in other namespaces. */ export class BundleNamespaceMapping extends Model { constructor(data) { super({ apiVersion: BundleNamespaceMapping.apiVersion, kind: BundleNamespaceMapping.kind, ...data }); } } BundleNamespaceMapping.apiVersion = "fleet.cattle.io/v1alpha1"; BundleNamespaceMapping.kind = "BundleNamespaceMapping"; BundleNamespaceMapping.is = createTypeMetaGuard(BundleNamespaceMapping); setSchema(BundleNamespaceMapping, schemaId, () => { addSchema(); register(schemaId, schema); });