UNPKG

@soft-stech/fleet

Version:
92 lines (91 loc) 2.5 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.GitRepoRestriction"; const schema = { "type": "object", "properties": { "allowedClientSecretNames": { "items": { "type": "string" }, "nullable": true, "type": "array" }, "allowedRepoPatterns": { "items": { "type": "string" }, "nullable": true, "type": "array" }, "allowedServiceAccounts": { "items": { "type": "string" }, "nullable": true, "type": "array" }, "allowedTargetNamespaces": { "items": { "type": "string" }, "nullable": true, "type": "array" }, "apiVersion": { "type": "string", "enum": [ "fleet.cattle.io/v1alpha1" ] }, "defaultClientSecretName": { "nullable": true, "type": "string" }, "defaultServiceAccount": { "nullable": true, "type": "string" }, "kind": { "type": "string", "enum": [ "GitRepoRestriction" ] }, "metadata": { "oneOf": [ { "$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#" }, { "type": "null" } ] } }, "required": [ "apiVersion", "kind" ] }; /** * GitRepoRestriction is a resource that can optionally be used to restrict * the options of GitRepos in the same namespace. */ export class GitRepoRestriction extends Model { constructor(data) { super({ apiVersion: GitRepoRestriction.apiVersion, kind: GitRepoRestriction.kind, ...data }); } } GitRepoRestriction.apiVersion = "fleet.cattle.io/v1alpha1"; GitRepoRestriction.kind = "GitRepoRestriction"; GitRepoRestriction.is = createTypeMetaGuard(GitRepoRestriction); setSchema(GitRepoRestriction, schemaId, () => { addSchema(); register(schemaId, schema); });