export namespace main {
	
	export class ListProcessorsResponse {
	    name: string;
	    label: string;
	
	    static createFrom(source: any = {}) {
	        return new ListProcessorsResponse(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.name = source["name"];
	        this.label = source["label"];
	    }
	}
	export class TextSpan {
	    text: string;
	    pos: number;
	    len: number;
	    append: boolean;
	
	    static createFrom(source: any = {}) {
	        return new TextSpan(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.text = source["text"];
	        this.pos = source["pos"];
	        this.len = source["len"];
	        this.append = source["append"];
	    }
	}
	export class ProcessTextRequest {
	    action: string;
	    input: TextSpan[];
	
	    static createFrom(source: any = {}) {
	        return new ProcessTextRequest(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.action = source["action"];
	        this.input = this.convertValues(source["input"], TextSpan);
	    }
	
		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;
		}
	}

}

