export namespace models { export class Transport { type?: string; path?: string; static createFrom(source: any = {}) { return new Transport(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.type = source["type"]; this.path = source["path"]; } } export class TLS { enabled: boolean; server_name?: string; static createFrom(source: any = {}) { return new TLS(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.enabled = source["enabled"]; this.server_name = source["server_name"]; } } export class Server { tag: string; region: string; type: string; server: string; server_port: number; udp_over_tcp?: boolean; uuid?: string; method?: string; password?: string; tls?: TLS; transport?: Transport; static createFrom(source: any = {}) { return new Server(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.tag = source["tag"]; this.region = source["region"]; this.type = source["type"]; this.server = source["server"]; this.server_port = source["server_port"]; this.udp_over_tcp = source["udp_over_tcp"]; this.uuid = source["uuid"]; this.method = source["method"]; this.password = source["password"]; this.tls = this.convertValues(source["tls"], TLS); this.transport = this.convertValues(source["transport"], Transport); } 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 sync { export class LatencyResult { tag: string; region: string; latency_ms: number; static createFrom(source: any = {}) { return new LatencyResult(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.tag = source["tag"]; this.region = source["region"]; this.latency_ms = source["latency_ms"]; } } export class UpdateInfo { available: boolean; version: string; changelog: string; current_version: string; static createFrom(source: any = {}) { return new UpdateInfo(source); } constructor(source: any = {}) { if ('string' === typeof source) source = JSON.parse(source); this.available = source["available"]; this.version = source["version"]; this.changelog = source["changelog"]; this.current_version = source["current_version"]; } } }