contract apiDataContract {
	function makeException(arg){
		var data  = {};
		data.status = "-1";
		data.msg = arg;
		return JSON.stringify(data);
	}
	export function preMain(args){
		#foreach($prop in $initList)
		Global.${prop[0]} = ${prop[1]};
		#end
	}
	
	function merge(map1,map2){
		var ret = {};
		for (var key in map1 )
			ret[key] = map1[key];
		for (var key in map2)
			ret[key] = map2[key];
		return ret;
	}
	
	export function main(args){
		if (${validate})
			return makeException(${validateFailedMsg});
		args = JSON.parse(args);
		var header = merge(Global.headers,args.headers);
		var argMap = merge(Global.args,args.args);
		return YancloudUtil.http(Global.baseUrl,Global.method,header,argMap,args.reservedList);
	}
}