|
| 1 | +// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL |
| 2 | +// This file is automatically generated. DO NOT EDIT |
| 3 | + |
| 4 | +// eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 5 | +// @ts-ignore: Unused imports |
| 6 | +import { Create as $Create } from "@wailsio/runtime"; |
| 7 | + |
| 8 | +// eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 9 | +// @ts-ignore: Unused imports |
| 10 | +import * as resource$0 from "../../../../../../plugin-sdk/pkg/v1/resource/models.js"; |
| 11 | + |
| 12 | +export class DependencyNode { |
| 13 | + "edge": GraphEdge; |
| 14 | + "children": DependencyNode[]; |
| 15 | + |
| 16 | + /** Creates a new DependencyNode instance. */ |
| 17 | + constructor($$source: Partial<DependencyNode> = {}) { |
| 18 | + if (!("edge" in $$source)) { |
| 19 | + this["edge"] = (new GraphEdge()); |
| 20 | + } |
| 21 | + if (!("children" in $$source)) { |
| 22 | + this["children"] = []; |
| 23 | + } |
| 24 | + |
| 25 | + Object.assign(this, $$source); |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * Creates a new DependencyNode instance from a string or object. |
| 30 | + */ |
| 31 | + static createFrom($$source: any = {}): DependencyNode { |
| 32 | + const $$createField0_0 = $$createType0; |
| 33 | + const $$createField1_0 = $$createType2; |
| 34 | + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; |
| 35 | + if ("edge" in $$parsedSource) { |
| 36 | + $$parsedSource["edge"] = $$createField0_0($$parsedSource["edge"]); |
| 37 | + } |
| 38 | + if ("children" in $$parsedSource) { |
| 39 | + $$parsedSource["children"] = $$createField1_0($$parsedSource["children"]); |
| 40 | + } |
| 41 | + return new DependencyNode($$parsedSource as Partial<DependencyNode>); |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +export class DependencyTree { |
| 46 | + "root": GraphNode; |
| 47 | + "children": DependencyNode[]; |
| 48 | + |
| 49 | + /** Creates a new DependencyTree instance. */ |
| 50 | + constructor($$source: Partial<DependencyTree> = {}) { |
| 51 | + if (!("root" in $$source)) { |
| 52 | + this["root"] = (new GraphNode()); |
| 53 | + } |
| 54 | + if (!("children" in $$source)) { |
| 55 | + this["children"] = []; |
| 56 | + } |
| 57 | + |
| 58 | + Object.assign(this, $$source); |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * Creates a new DependencyTree instance from a string or object. |
| 63 | + */ |
| 64 | + static createFrom($$source: any = {}): DependencyTree { |
| 65 | + const $$createField0_0 = $$createType3; |
| 66 | + const $$createField1_0 = $$createType2; |
| 67 | + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; |
| 68 | + if ("root" in $$parsedSource) { |
| 69 | + $$parsedSource["root"] = $$createField0_0($$parsedSource["root"]); |
| 70 | + } |
| 71 | + if ("children" in $$parsedSource) { |
| 72 | + $$parsedSource["children"] = $$createField1_0($$parsedSource["children"]); |
| 73 | + } |
| 74 | + return new DependencyTree($$parsedSource as Partial<DependencyTree>); |
| 75 | + } |
| 76 | +} |
| 77 | + |
| 78 | +export class GraphEdge { |
| 79 | + "source": GraphNode; |
| 80 | + "target": GraphNode; |
| 81 | + "type": RelationshipType; |
| 82 | + "label": string; |
| 83 | + |
| 84 | + /** Creates a new GraphEdge instance. */ |
| 85 | + constructor($$source: Partial<GraphEdge> = {}) { |
| 86 | + if (!("source" in $$source)) { |
| 87 | + this["source"] = (new GraphNode()); |
| 88 | + } |
| 89 | + if (!("target" in $$source)) { |
| 90 | + this["target"] = (new GraphNode()); |
| 91 | + } |
| 92 | + if (!("type" in $$source)) { |
| 93 | + this["type"] = resource$0.RelationshipType.$zero; |
| 94 | + } |
| 95 | + if (!("label" in $$source)) { |
| 96 | + this["label"] = ""; |
| 97 | + } |
| 98 | + |
| 99 | + Object.assign(this, $$source); |
| 100 | + } |
| 101 | + |
| 102 | + /** |
| 103 | + * Creates a new GraphEdge instance from a string or object. |
| 104 | + */ |
| 105 | + static createFrom($$source: any = {}): GraphEdge { |
| 106 | + const $$createField0_0 = $$createType3; |
| 107 | + const $$createField1_0 = $$createType3; |
| 108 | + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; |
| 109 | + if ("source" in $$parsedSource) { |
| 110 | + $$parsedSource["source"] = $$createField0_0($$parsedSource["source"]); |
| 111 | + } |
| 112 | + if ("target" in $$parsedSource) { |
| 113 | + $$parsedSource["target"] = $$createField1_0($$parsedSource["target"]); |
| 114 | + } |
| 115 | + return new GraphEdge($$parsedSource as Partial<GraphEdge>); |
| 116 | + } |
| 117 | +} |
| 118 | + |
| 119 | +/** |
| 120 | + * GraphNode identifies a specific resource instance in the graph. |
| 121 | + */ |
| 122 | +export class GraphNode { |
| 123 | + "pluginId": string; |
| 124 | + "connectionId": string; |
| 125 | + "resourceKey": string; |
| 126 | + "id": string; |
| 127 | + "namespace"?: string; |
| 128 | + |
| 129 | + /** Creates a new GraphNode instance. */ |
| 130 | + constructor($$source: Partial<GraphNode> = {}) { |
| 131 | + if (!("pluginId" in $$source)) { |
| 132 | + this["pluginId"] = ""; |
| 133 | + } |
| 134 | + if (!("connectionId" in $$source)) { |
| 135 | + this["connectionId"] = ""; |
| 136 | + } |
| 137 | + if (!("resourceKey" in $$source)) { |
| 138 | + this["resourceKey"] = ""; |
| 139 | + } |
| 140 | + if (!("id" in $$source)) { |
| 141 | + this["id"] = ""; |
| 142 | + } |
| 143 | + |
| 144 | + Object.assign(this, $$source); |
| 145 | + } |
| 146 | + |
| 147 | + /** |
| 148 | + * Creates a new GraphNode instance from a string or object. |
| 149 | + */ |
| 150 | + static createFrom($$source: any = {}): GraphNode { |
| 151 | + let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source; |
| 152 | + return new GraphNode($$parsedSource as Partial<GraphNode>); |
| 153 | + } |
| 154 | +} |
| 155 | + |
| 156 | +/** |
| 157 | + * RelationshipType re-exports from SDK for convenience. |
| 158 | + */ |
| 159 | +export type RelationshipType = resource$0.RelationshipType; |
| 160 | + |
| 161 | +// Private type creation functions |
| 162 | +const $$createType0 = GraphEdge.createFrom; |
| 163 | +const $$createType1 = DependencyNode.createFrom; |
| 164 | +const $$createType2 = $Create.Array($$createType1); |
| 165 | +const $$createType3 = GraphNode.createFrom; |
0 commit comments