export namespace fn_operations { export class Assertion { id: string; entity_id: string; name: string; kind: string; rule: string; severity: string; description: string; active: boolean; // Go type: time created_at: any; static createFrom(source: any = {}) { return new Assertion(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.entity_id = source["entity_id"]; this.name = source["name"]; this.kind = source["kind"]; this.rule = source["rule"]; this.severity = source["severity"]; this.description = source["description"]; this.active = source["active"]; this.created_at = this.convertValues(source["created_at"], null); } convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } if (a.slice && a.map) { return (a as any[]).map(elem => this.convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; } } export class AssertionResult { id: string; assertion_id: string; execution_id: string; status: string; value: Record; message: string; // Go type: time evaluated_at: any; static createFrom(source: any = {}) { return new AssertionResult(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.assertion_id = source["assertion_id"]; this.execution_id = source["execution_id"]; this.status = source["status"]; this.value = source["value"]; this.message = source["message"]; this.evaluated_at = this.convertValues(source["evaluated_at"], null); } convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } if (a.slice && a.map) { return (a as any[]).map(elem => this.convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; } } export class Entity { id: string; name: string; type_ref: string; status: string; description: string; domain: string; tags: string[]; source: string; metadata: Record; notes: string; // Go type: time created_at: any; // Go type: time updated_at: any; static createFrom(source: any = {}) { return new Entity(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.name = source["name"]; this.type_ref = source["type_ref"]; this.status = source["status"]; this.description = source["description"]; this.domain = source["domain"]; this.tags = source["tags"]; this.source = source["source"]; this.metadata = source["metadata"]; this.notes = source["notes"]; this.created_at = this.convertValues(source["created_at"], null); this.updated_at = this.convertValues(source["updated_at"], null); } convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } if (a.slice && a.map) { return (a as any[]).map(elem => this.convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; } } export class Relation { id: string; name: string; from_entity: string; to_entity: string; via: string; description: string; purity: string; direction: string; weight?: number; status: string; // Go type: time started_at?: any; // Go type: time ended_at?: any; order?: number; tags: string[]; notes: string; // Go type: time created_at: any; // Go type: time updated_at: any; static createFrom(source: any = {}) { return new Relation(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.name = source["name"]; this.from_entity = source["from_entity"]; this.to_entity = source["to_entity"]; this.via = source["via"]; this.description = source["description"]; this.purity = source["purity"]; this.direction = source["direction"]; this.weight = source["weight"]; this.status = source["status"]; this.started_at = this.convertValues(source["started_at"], null); this.ended_at = this.convertValues(source["ended_at"], null); this.order = source["order"]; this.tags = source["tags"]; this.notes = source["notes"]; this.created_at = this.convertValues(source["created_at"], null); this.updated_at = this.convertValues(source["updated_at"], null); } convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } if (a.slice && a.map) { return (a as any[]).map(elem => this.convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; } } } export namespace main { export class AssertionInput { entity_id: string; name: string; kind: string; rule: string; severity: string; description: string; static createFrom(source: any = {}) { return new AssertionInput(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.entity_id = source["entity_id"]; this.name = source["name"]; this.kind = source["kind"]; this.rule = source["rule"]; this.severity = source["severity"]; this.description = source["description"]; } } export class EnricherDef { id: string; label: string; description: string; applies_to: string[]; script: string; icon: string; static createFrom(source: any = {}) { return new EnricherDef(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.label = source["label"]; this.description = source["description"]; this.applies_to = source["applies_to"]; this.script = source["script"]; this.icon = source["icon"]; } } export class EntityInput { name: string; type_ref: string; description: string; tags: string[]; metadata: Record; notes: string; static createFrom(source: any = {}) { return new EntityInput(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; this.type_ref = source["type_ref"]; this.description = source["description"]; this.tags = source["tags"]; this.metadata = source["metadata"]; this.notes = source["notes"]; } } export class EntityTypePreset { type_ref: string; label: string; color: string; metadata_fields: string[]; static createFrom(source: any = {}) { return new EntityTypePreset(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.type_ref = source["type_ref"]; this.label = source["label"]; this.color = source["color"]; this.metadata_fields = source["metadata_fields"]; } } export class GraphEdge { id: string; source: string; target: string; label: string; color: string; size: number; type: string; static createFrom(source: any = {}) { return new GraphEdge(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.source = source["source"]; this.target = source["target"]; this.label = source["label"]; this.color = source["color"]; this.size = source["size"]; this.type = source["type"]; } } export class GraphNode { id: string; label: string; type: string; color: string; size: number; x: number; y: number; extra?: Record; static createFrom(source: any = {}) { return new GraphNode(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.label = source["label"]; this.type = source["type"]; this.color = source["color"]; this.size = source["size"]; this.x = source["x"]; this.y = source["y"]; this.extra = source["extra"]; } } export class GraphData { nodes: GraphNode[]; edges: GraphEdge[]; static createFrom(source: any = {}) { return new GraphData(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.nodes = this.convertValues(source["nodes"], GraphNode); this.edges = this.convertValues(source["edges"], GraphEdge); } convertValues(a: any, classs: any, asMap: boolean = false): any { if (!a) { return a; } if (a.slice && a.map) { return (a as any[]).map(elem => this.convertValues(elem, classs)); } else if ("object" === typeof a) { if (asMap) { for (const key of Object.keys(a)) { a[key] = new classs(a[key]); } return a; } return new classs(a); } return a; } } export class ProjectInfo { name: string; description: string; entity_count: number; relation_count: number; static createFrom(source: any = {}) { return new ProjectInfo(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; this.description = source["description"]; this.entity_count = source["entity_count"]; this.relation_count = source["relation_count"]; } } export class RelationInputDTO { name: string; from_entity: string; to_entity: string; description: string; weight?: number; tags: string[]; notes: string; static createFrom(source: any = {}) { return new RelationInputDTO(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.name = source["name"]; this.from_entity = source["from_entity"]; this.to_entity = source["to_entity"]; this.description = source["description"]; this.weight = source["weight"]; this.tags = source["tags"]; this.notes = source["notes"]; } } }