Пример #1
0
func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	var parsedUrl url.URL
	var trans thrift.TTransport
	_ = strconv.Atoi
	_ = math.Abs
	flag.Usage = Usage
	flag.StringVar(&host, "h", "localhost", "Specify host and port")
	flag.IntVar(&port, "p", 9090, "Specify port")
	flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
	flag.StringVar(&urlString, "u", "", "Specify the url")
	flag.BoolVar(&framed, "framed", false, "Use framed transport")
	flag.BoolVar(&useHttp, "http", false, "Use http")
	flag.Parse()

	if len(urlString) > 0 {
		parsedUrl, err := url.Parse(urlString)
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
		host = parsedUrl.Host
		useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
	} else if useHttp {
		_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
	}

	cmd := flag.Arg(0)
	var err error
	if useHttp {
		trans, err = thrift.NewTHttpClient(parsedUrl.String())
	} else {
		portStr := fmt.Sprint(port)
		if strings.Contains(host, ":") {
			host, portStr, err = net.SplitHostPort(host)
			if err != nil {
				fmt.Fprintln(os.Stderr, "error with host:", err)
				os.Exit(1)
			}
		}
		trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
		if err != nil {
			fmt.Fprintln(os.Stderr, "error resolving address:", err)
			os.Exit(1)
		}
		if framed {
			trans = thrift.NewTFramedTransport(trans)
		}
	}
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error creating transport", err)
		os.Exit(1)
	}
	defer trans.Close()
	var protocolFactory thrift.TProtocolFactory
	switch protocol {
	case "compact":
		protocolFactory = thrift.NewTCompactProtocolFactory()
		break
	case "simplejson":
		protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
		break
	case "json":
		protocolFactory = thrift.NewTJSONProtocolFactory()
		break
	case "binary", "":
		protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
		Usage()
		os.Exit(1)
	}
	client := services.NewSearchManagerClientFactory(trans, protocolFactory)
	if err := trans.Open(); err != nil {
		fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
		os.Exit(1)
	}

	switch cmd {
	case "searchPublicResources":
		if flag.NArg()-1 != 9 {
			fmt.Fprintln(os.Stderr, "SearchPublicResources requires 9 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.SearchCategory(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		tmp3, err := (strconv.Atoi(flag.Arg(4)))
		if err != nil {
			Usage()
			return
		}
		argvalue3 := services.Zone(tmp3)
		value3 := argvalue3
		tmp4, err1256 := (strconv.Atoi(flag.Arg(5)))
		if err1256 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		tmp5, err1257 := (strconv.Atoi(flag.Arg(6)))
		if err1257 != nil {
			Usage()
			return
		}
		argvalue5 := int32(tmp5)
		value5 := argvalue5
		arg1258 := flag.Arg(7)
		mbTrans1259 := thrift.NewTMemoryBufferLen(len(arg1258))
		defer mbTrans1259.Close()
		_, err1260 := mbTrans1259.WriteString(arg1258)
		if err1260 != nil {
			Usage()
			return
		}
		factory1261 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1262 := factory1261.GetProtocol(mbTrans1259)
		containerStruct6 := services.NewSearchPublicResourcesArgs()
		err1263 := containerStruct6.ReadField7(jsProt1262)
		if err1263 != nil {
			Usage()
			return
		}
		argvalue6 := containerStruct6.Sortlist
		value6 := argvalue6
		arg1264 := flag.Arg(8)
		mbTrans1265 := thrift.NewTMemoryBufferLen(len(arg1264))
		defer mbTrans1265.Close()
		_, err1266 := mbTrans1265.WriteString(arg1264)
		if err1266 != nil {
			Usage()
			return
		}
		factory1267 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1268 := factory1267.GetProtocol(mbTrans1265)
		containerStruct7 := services.NewSearchPublicResourcesArgs()
		err1269 := containerStruct7.ReadField8(jsProt1268)
		if err1269 != nil {
			Usage()
			return
		}
		argvalue7 := containerStruct7.Filterlist
		value7 := argvalue7
		arg1270 := flag.Arg(9)
		mbTrans1271 := thrift.NewTMemoryBufferLen(len(arg1270))
		defer mbTrans1271.Close()
		_, err1272 := mbTrans1271.WriteString(arg1270)
		if err1272 != nil {
			Usage()
			return
		}
		factory1273 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1274 := factory1273.GetProtocol(mbTrans1271)
		argvalue8 := services.NewFromInfo()
		err1275 := argvalue8.Read(jsProt1274)
		if err1275 != nil {
			Usage()
			return
		}
		value8 := argvalue8
		fmt.Print(client.SearchPublicResources(value0, value1, value2, value3, value4, value5, value6, value7, value8))
		fmt.Print("\n")
		break
	case "searchGroupResources":
		if flag.NArg()-1 != 9 {
			fmt.Fprintln(os.Stderr, "SearchGroupResources requires 9 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1, err1277 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1277 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		tmp3, err := (strconv.Atoi(flag.Arg(4)))
		if err != nil {
			Usage()
			return
		}
		argvalue3 := services.Zone(tmp3)
		value3 := argvalue3
		tmp4, err1278 := (strconv.Atoi(flag.Arg(5)))
		if err1278 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		tmp5, err1279 := (strconv.Atoi(flag.Arg(6)))
		if err1279 != nil {
			Usage()
			return
		}
		argvalue5 := int32(tmp5)
		value5 := argvalue5
		arg1280 := flag.Arg(7)
		mbTrans1281 := thrift.NewTMemoryBufferLen(len(arg1280))
		defer mbTrans1281.Close()
		_, err1282 := mbTrans1281.WriteString(arg1280)
		if err1282 != nil {
			Usage()
			return
		}
		factory1283 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1284 := factory1283.GetProtocol(mbTrans1281)
		containerStruct6 := services.NewSearchGroupResourcesArgs()
		err1285 := containerStruct6.ReadField7(jsProt1284)
		if err1285 != nil {
			Usage()
			return
		}
		argvalue6 := containerStruct6.Sortlist
		value6 := argvalue6
		arg1286 := flag.Arg(8)
		mbTrans1287 := thrift.NewTMemoryBufferLen(len(arg1286))
		defer mbTrans1287.Close()
		_, err1288 := mbTrans1287.WriteString(arg1286)
		if err1288 != nil {
			Usage()
			return
		}
		factory1289 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1290 := factory1289.GetProtocol(mbTrans1287)
		containerStruct7 := services.NewSearchGroupResourcesArgs()
		err1291 := containerStruct7.ReadField8(jsProt1290)
		if err1291 != nil {
			Usage()
			return
		}
		argvalue7 := containerStruct7.Filterlist
		value7 := argvalue7
		arg1292 := flag.Arg(9)
		mbTrans1293 := thrift.NewTMemoryBufferLen(len(arg1292))
		defer mbTrans1293.Close()
		_, err1294 := mbTrans1293.WriteString(arg1292)
		if err1294 != nil {
			Usage()
			return
		}
		factory1295 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1296 := factory1295.GetProtocol(mbTrans1293)
		argvalue8 := services.NewFromInfo()
		err1297 := argvalue8.Read(jsProt1296)
		if err1297 != nil {
			Usage()
			return
		}
		value8 := argvalue8
		fmt.Print(client.SearchGroupResources(value0, value1, value2, value3, value4, value5, value6, value7, value8))
		fmt.Print("\n")
		break
	case "searchGroup":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "SearchGroup requires 7 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.GroupType(tmp1)
		value1 := argvalue1
		tmp2, err1299 := (strconv.Atoi(flag.Arg(3)))
		if err1299 != nil {
			Usage()
			return
		}
		argvalue2 := int32(tmp2)
		value2 := argvalue2
		tmp3, err1300 := (strconv.Atoi(flag.Arg(4)))
		if err1300 != nil {
			Usage()
			return
		}
		argvalue3 := int32(tmp3)
		value3 := argvalue3
		arg1301 := flag.Arg(5)
		mbTrans1302 := thrift.NewTMemoryBufferLen(len(arg1301))
		defer mbTrans1302.Close()
		_, err1303 := mbTrans1302.WriteString(arg1301)
		if err1303 != nil {
			Usage()
			return
		}
		factory1304 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1305 := factory1304.GetProtocol(mbTrans1302)
		containerStruct4 := services.NewSearchGroupArgs()
		err1306 := containerStruct4.ReadField5(jsProt1305)
		if err1306 != nil {
			Usage()
			return
		}
		argvalue4 := containerStruct4.Sortlist
		value4 := argvalue4
		arg1307 := flag.Arg(6)
		mbTrans1308 := thrift.NewTMemoryBufferLen(len(arg1307))
		defer mbTrans1308.Close()
		_, err1309 := mbTrans1308.WriteString(arg1307)
		if err1309 != nil {
			Usage()
			return
		}
		factory1310 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1311 := factory1310.GetProtocol(mbTrans1308)
		containerStruct5 := services.NewSearchGroupArgs()
		err1312 := containerStruct5.ReadField6(jsProt1311)
		if err1312 != nil {
			Usage()
			return
		}
		argvalue5 := containerStruct5.Filterlist
		value5 := argvalue5
		arg1313 := flag.Arg(7)
		mbTrans1314 := thrift.NewTMemoryBufferLen(len(arg1313))
		defer mbTrans1314.Close()
		_, err1315 := mbTrans1314.WriteString(arg1313)
		if err1315 != nil {
			Usage()
			return
		}
		factory1316 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1317 := factory1316.GetProtocol(mbTrans1314)
		argvalue6 := services.NewFromInfo()
		err1318 := argvalue6.Read(jsProt1317)
		if err1318 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.SearchGroup(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "searchUser":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "SearchUser requires 4 args")
			flag.Usage()
		}
		arg1319 := flag.Arg(1)
		mbTrans1320 := thrift.NewTMemoryBufferLen(len(arg1319))
		defer mbTrans1320.Close()
		_, err1321 := mbTrans1320.WriteString(arg1319)
		if err1321 != nil {
			Usage()
			return
		}
		factory1322 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1323 := factory1322.GetProtocol(mbTrans1320)
		argvalue0 := services.NewUserSearchInfo()
		err1324 := argvalue0.Read(jsProt1323)
		if err1324 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg1325 := flag.Arg(2)
		mbTrans1326 := thrift.NewTMemoryBufferLen(len(arg1325))
		defer mbTrans1326.Close()
		_, err1327 := mbTrans1326.WriteString(arg1325)
		if err1327 != nil {
			Usage()
			return
		}
		factory1328 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1329 := factory1328.GetProtocol(mbTrans1326)
		containerStruct1 := services.NewSearchUserArgs()
		err1330 := containerStruct1.ReadField2(jsProt1329)
		if err1330 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.Sortlist
		value1 := argvalue1
		arg1331 := flag.Arg(3)
		mbTrans1332 := thrift.NewTMemoryBufferLen(len(arg1331))
		defer mbTrans1332.Close()
		_, err1333 := mbTrans1332.WriteString(arg1331)
		if err1333 != nil {
			Usage()
			return
		}
		factory1334 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1335 := factory1334.GetProtocol(mbTrans1332)
		containerStruct2 := services.NewSearchUserArgs()
		err1336 := containerStruct2.ReadField3(jsProt1335)
		if err1336 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.Filterlist
		value2 := argvalue2
		arg1337 := flag.Arg(4)
		mbTrans1338 := thrift.NewTMemoryBufferLen(len(arg1337))
		defer mbTrans1338.Close()
		_, err1339 := mbTrans1338.WriteString(arg1337)
		if err1339 != nil {
			Usage()
			return
		}
		factory1340 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1341 := factory1340.GetProtocol(mbTrans1338)
		argvalue3 := services.NewFromInfo()
		err1342 := argvalue3.Read(jsProt1341)
		if err1342 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.SearchUser(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "searchResourceByTag":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "SearchResourceByTag requires 8 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.ResourceType(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.Zone(tmp2)
		value2 := argvalue2
		tmp3, err1344 := (strconv.Atoi(flag.Arg(4)))
		if err1344 != nil {
			Usage()
			return
		}
		argvalue3 := int32(tmp3)
		value3 := argvalue3
		tmp4, err1345 := (strconv.Atoi(flag.Arg(5)))
		if err1345 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		arg1346 := flag.Arg(6)
		mbTrans1347 := thrift.NewTMemoryBufferLen(len(arg1346))
		defer mbTrans1347.Close()
		_, err1348 := mbTrans1347.WriteString(arg1346)
		if err1348 != nil {
			Usage()
			return
		}
		factory1349 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1350 := factory1349.GetProtocol(mbTrans1347)
		containerStruct5 := services.NewSearchResourceByTagArgs()
		err1351 := containerStruct5.ReadField6(jsProt1350)
		if err1351 != nil {
			Usage()
			return
		}
		argvalue5 := containerStruct5.Sortlist
		value5 := argvalue5
		arg1352 := flag.Arg(7)
		mbTrans1353 := thrift.NewTMemoryBufferLen(len(arg1352))
		defer mbTrans1353.Close()
		_, err1354 := mbTrans1353.WriteString(arg1352)
		if err1354 != nil {
			Usage()
			return
		}
		factory1355 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1356 := factory1355.GetProtocol(mbTrans1353)
		containerStruct6 := services.NewSearchResourceByTagArgs()
		err1357 := containerStruct6.ReadField7(jsProt1356)
		if err1357 != nil {
			Usage()
			return
		}
		argvalue6 := containerStruct6.Filterlist
		value6 := argvalue6
		arg1358 := flag.Arg(8)
		mbTrans1359 := thrift.NewTMemoryBufferLen(len(arg1358))
		defer mbTrans1359.Close()
		_, err1360 := mbTrans1359.WriteString(arg1358)
		if err1360 != nil {
			Usage()
			return
		}
		factory1361 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1362 := factory1361.GetProtocol(mbTrans1359)
		argvalue7 := services.NewFromInfo()
		err1363 := argvalue7.Read(jsProt1362)
		if err1363 != nil {
			Usage()
			return
		}
		value7 := argvalue7
		fmt.Print(client.SearchResourceByTag(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "searchGroupIds":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "SearchGroupIds requires 5 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.Zone(tmp1)
		value1 := argvalue1
		arg1365 := flag.Arg(3)
		mbTrans1366 := thrift.NewTMemoryBufferLen(len(arg1365))
		defer mbTrans1366.Close()
		_, err1367 := mbTrans1366.WriteString(arg1365)
		if err1367 != nil {
			Usage()
			return
		}
		factory1368 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1369 := factory1368.GetProtocol(mbTrans1366)
		containerStruct2 := services.NewSearchGroupIdsArgs()
		err1370 := containerStruct2.ReadField3(jsProt1369)
		if err1370 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.Sortlist
		value2 := argvalue2
		arg1371 := flag.Arg(4)
		mbTrans1372 := thrift.NewTMemoryBufferLen(len(arg1371))
		defer mbTrans1372.Close()
		_, err1373 := mbTrans1372.WriteString(arg1371)
		if err1373 != nil {
			Usage()
			return
		}
		factory1374 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1375 := factory1374.GetProtocol(mbTrans1372)
		containerStruct3 := services.NewSearchGroupIdsArgs()
		err1376 := containerStruct3.ReadField4(jsProt1375)
		if err1376 != nil {
			Usage()
			return
		}
		argvalue3 := containerStruct3.Filterlist
		value3 := argvalue3
		arg1377 := flag.Arg(5)
		mbTrans1378 := thrift.NewTMemoryBufferLen(len(arg1377))
		defer mbTrans1378.Close()
		_, err1379 := mbTrans1378.WriteString(arg1377)
		if err1379 != nil {
			Usage()
			return
		}
		factory1380 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1381 := factory1380.GetProtocol(mbTrans1378)
		argvalue4 := services.NewFromInfo()
		err1382 := argvalue4.Read(jsProt1381)
		if err1382 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.SearchGroupIds(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "searchTags":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "SearchTags requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err1384 := (strconv.Atoi(flag.Arg(2)))
		if err1384 != nil {
			Usage()
			return
		}
		argvalue1 := int32(tmp1)
		value1 := argvalue1
		tmp2, err1385 := (strconv.Atoi(flag.Arg(3)))
		if err1385 != nil {
			Usage()
			return
		}
		argvalue2 := int32(tmp2)
		value2 := argvalue2
		arg1386 := flag.Arg(4)
		mbTrans1387 := thrift.NewTMemoryBufferLen(len(arg1386))
		defer mbTrans1387.Close()
		_, err1388 := mbTrans1387.WriteString(arg1386)
		if err1388 != nil {
			Usage()
			return
		}
		factory1389 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1390 := factory1389.GetProtocol(mbTrans1387)
		argvalue3 := services.NewFromInfo()
		err1391 := argvalue3.Read(jsProt1390)
		if err1391 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.SearchTags(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}
Пример #2
0
func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	var parsedUrl url.URL
	var trans thrift.TTransport
	_ = strconv.Atoi
	_ = math.Abs
	flag.Usage = Usage
	flag.StringVar(&host, "h", "localhost", "Specify host and port")
	flag.IntVar(&port, "p", 9090, "Specify port")
	flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
	flag.StringVar(&urlString, "u", "", "Specify the url")
	flag.BoolVar(&framed, "framed", false, "Use framed transport")
	flag.BoolVar(&useHttp, "http", false, "Use http")
	flag.Parse()

	if len(urlString) > 0 {
		parsedUrl, err := url.Parse(urlString)
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
		host = parsedUrl.Host
		useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
	} else if useHttp {
		_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
	}

	cmd := flag.Arg(0)
	var err error
	if useHttp {
		trans, err = thrift.NewTHttpClient(parsedUrl.String())
	} else {
		portStr := fmt.Sprint(port)
		if strings.Contains(host, ":") {
			host, portStr, err = net.SplitHostPort(host)
			if err != nil {
				fmt.Fprintln(os.Stderr, "error with host:", err)
				os.Exit(1)
			}
		}
		trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
		if err != nil {
			fmt.Fprintln(os.Stderr, "error resolving address:", err)
			os.Exit(1)
		}
		if framed {
			trans = thrift.NewTFramedTransport(trans)
		}
	}
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error creating transport", err)
		os.Exit(1)
	}
	defer trans.Close()
	var protocolFactory thrift.TProtocolFactory
	switch protocol {
	case "compact":
		protocolFactory = thrift.NewTCompactProtocolFactory()
		break
	case "simplejson":
		protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
		break
	case "json":
		protocolFactory = thrift.NewTJSONProtocolFactory()
		break
	case "binary", "":
		protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
		Usage()
		os.Exit(1)
	}
	client := services.NewGroupManagerClientFactory(trans, protocolFactory)
	if err := trans.Open(); err != nil {
		fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
		os.Exit(1)
	}

	switch cmd {
	case "createGroup":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "CreateGroup requires 3 args")
			flag.Usage()
		}
		arg189 := flag.Arg(1)
		mbTrans190 := thrift.NewTMemoryBufferLen(len(arg189))
		defer mbTrans190.Close()
		_, err191 := mbTrans190.WriteString(arg189)
		if err191 != nil {
			Usage()
			return
		}
		factory192 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt193 := factory192.GetProtocol(mbTrans190)
		argvalue0 := services.NewGroup()
		err194 := argvalue0.Read(jsProt193)
		if err194 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg195 := flag.Arg(2)
		mbTrans196 := thrift.NewTMemoryBufferLen(len(arg195))
		defer mbTrans196.Close()
		_, err197 := mbTrans196.WriteString(arg195)
		if err197 != nil {
			Usage()
			return
		}
		factory198 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt199 := factory198.GetProtocol(mbTrans196)
		containerStruct1 := services.NewCreateGroupArgs()
		err200 := containerStruct1.ReadField2(jsProt199)
		if err200 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.FriendUidList
		value1 := argvalue1
		arg201 := flag.Arg(3)
		mbTrans202 := thrift.NewTMemoryBufferLen(len(arg201))
		defer mbTrans202.Close()
		_, err203 := mbTrans202.WriteString(arg201)
		if err203 != nil {
			Usage()
			return
		}
		factory204 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt205 := factory204.GetProtocol(mbTrans202)
		argvalue2 := services.NewFromInfo()
		err206 := argvalue2.Read(jsProt205)
		if err206 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.CreateGroup(value0, value1, value2))
		fmt.Print("\n")
		break
	case "getGroup":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetGroup requires 2 args")
			flag.Usage()
		}
		argvalue0, err207 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err207 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg208 := flag.Arg(2)
		mbTrans209 := thrift.NewTMemoryBufferLen(len(arg208))
		defer mbTrans209.Close()
		_, err210 := mbTrans209.WriteString(arg208)
		if err210 != nil {
			Usage()
			return
		}
		factory211 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt212 := factory211.GetProtocol(mbTrans209)
		argvalue1 := services.NewFromInfo()
		err213 := argvalue1.Read(jsProt212)
		if err213 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetGroup(value0, value1))
		fmt.Print("\n")
		break
	case "updateGroup":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "UpdateGroup requires 3 args")
			flag.Usage()
		}
		arg214 := flag.Arg(1)
		mbTrans215 := thrift.NewTMemoryBufferLen(len(arg214))
		defer mbTrans215.Close()
		_, err216 := mbTrans215.WriteString(arg214)
		if err216 != nil {
			Usage()
			return
		}
		factory217 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt218 := factory217.GetProtocol(mbTrans215)
		argvalue0 := services.NewGroup()
		err219 := argvalue0.Read(jsProt218)
		if err219 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err220 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err220 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg221 := flag.Arg(3)
		mbTrans222 := thrift.NewTMemoryBufferLen(len(arg221))
		defer mbTrans222.Close()
		_, err223 := mbTrans222.WriteString(arg221)
		if err223 != nil {
			Usage()
			return
		}
		factory224 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt225 := factory224.GetProtocol(mbTrans222)
		argvalue2 := services.NewFromInfo()
		err226 := argvalue2.Read(jsProt225)
		if err226 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.UpdateGroup(value0, value1, value2))
		fmt.Print("\n")
		break
	case "updateTrackedGroup":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "UpdateTrackedGroup requires 3 args")
			flag.Usage()
		}
		arg227 := flag.Arg(1)
		mbTrans228 := thrift.NewTMemoryBufferLen(len(arg227))
		defer mbTrans228.Close()
		_, err229 := mbTrans228.WriteString(arg227)
		if err229 != nil {
			Usage()
			return
		}
		factory230 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt231 := factory230.GetProtocol(mbTrans228)
		argvalue0 := services.NewTrackedGroup()
		err232 := argvalue0.Read(jsProt231)
		if err232 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err233 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err233 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg234 := flag.Arg(3)
		mbTrans235 := thrift.NewTMemoryBufferLen(len(arg234))
		defer mbTrans235.Close()
		_, err236 := mbTrans235.WriteString(arg234)
		if err236 != nil {
			Usage()
			return
		}
		factory237 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt238 := factory237.GetProtocol(mbTrans235)
		argvalue2 := services.NewFromInfo()
		err239 := argvalue2.Read(jsProt238)
		if err239 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.UpdateTrackedGroup(value0, value1, value2))
		fmt.Print("\n")
		break
	case "deleteGroup":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "DeleteGroup requires 3 args")
			flag.Usage()
		}
		argvalue0, err240 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err240 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err241 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err241 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg242 := flag.Arg(3)
		mbTrans243 := thrift.NewTMemoryBufferLen(len(arg242))
		defer mbTrans243.Close()
		_, err244 := mbTrans243.WriteString(arg242)
		if err244 != nil {
			Usage()
			return
		}
		factory245 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt246 := factory245.GetProtocol(mbTrans243)
		argvalue2 := services.NewFromInfo()
		err247 := argvalue2.Read(jsProt246)
		if err247 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.DeleteGroup(value0, value1, value2))
		fmt.Print("\n")
		break
	case "trackGroup":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "TrackGroup requires 4 args")
			flag.Usage()
		}
		argvalue0, err248 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err248 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err249 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err249 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2 := flag.Arg(3) == "true"
		value2 := argvalue2
		arg251 := flag.Arg(4)
		mbTrans252 := thrift.NewTMemoryBufferLen(len(arg251))
		defer mbTrans252.Close()
		_, err253 := mbTrans252.WriteString(arg251)
		if err253 != nil {
			Usage()
			return
		}
		factory254 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt255 := factory254.GetProtocol(mbTrans252)
		argvalue3 := services.NewFromInfo()
		err256 := argvalue3.Read(jsProt255)
		if err256 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.TrackGroup(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "hasTrackedGroup":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "HasTrackedGroup requires 3 args")
			flag.Usage()
		}
		argvalue0, err257 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err257 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err258 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err258 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg259 := flag.Arg(3)
		mbTrans260 := thrift.NewTMemoryBufferLen(len(arg259))
		defer mbTrans260.Close()
		_, err261 := mbTrans260.WriteString(arg259)
		if err261 != nil {
			Usage()
			return
		}
		factory262 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt263 := factory262.GetProtocol(mbTrans260)
		argvalue2 := services.NewFromInfo()
		err264 := argvalue2.Read(jsProt263)
		if err264 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.HasTrackedGroup(value0, value1, value2))
		fmt.Print("\n")
		break
	case "operateGroupMember":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "OperateGroupMember requires 6 args")
			flag.Usage()
		}
		tmp0, err := (strconv.Atoi(flag.Arg(1)))
		if err != nil {
			Usage()
			return
		}
		argvalue0 := services.MemberType(tmp0)
		value0 := argvalue0
		argvalue1, err265 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err265 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg266 := flag.Arg(3)
		mbTrans267 := thrift.NewTMemoryBufferLen(len(arg266))
		defer mbTrans267.Close()
		_, err268 := mbTrans267.WriteString(arg266)
		if err268 != nil {
			Usage()
			return
		}
		factory269 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt270 := factory269.GetProtocol(mbTrans267)
		containerStruct2 := services.NewOperateGroupMemberArgs()
		err271 := containerStruct2.ReadField3(jsProt270)
		if err271 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.OperandUidList
		value2 := argvalue2
		argvalue3, err272 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err272 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5) == "true"
		value4 := argvalue4
		arg274 := flag.Arg(6)
		mbTrans275 := thrift.NewTMemoryBufferLen(len(arg274))
		defer mbTrans275.Close()
		_, err276 := mbTrans275.WriteString(arg274)
		if err276 != nil {
			Usage()
			return
		}
		factory277 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt278 := factory277.GetProtocol(mbTrans275)
		argvalue5 := services.NewFromInfo()
		err279 := argvalue5.Read(jsProt278)
		if err279 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.OperateGroupMember(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "getGroupMembers":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetGroupMembers requires 2 args")
			flag.Usage()
		}
		argvalue0, err280 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err280 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg281 := flag.Arg(2)
		mbTrans282 := thrift.NewTMemoryBufferLen(len(arg281))
		defer mbTrans282.Close()
		_, err283 := mbTrans282.WriteString(arg281)
		if err283 != nil {
			Usage()
			return
		}
		factory284 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt285 := factory284.GetProtocol(mbTrans282)
		argvalue1 := services.NewFromInfo()
		err286 := argvalue1.Read(jsProt285)
		if err286 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetGroupMembers(value0, value1))
		fmt.Print("\n")
		break
	case "getGroupTrackers":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "GetGroupTrackers requires 7 args")
			flag.Usage()
		}
		argvalue0, err287 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err287 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err288 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err288 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err289 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err289 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err290 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err290 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5) == "true"
		value4 := argvalue4
		tmp5, err292 := (strconv.Atoi(flag.Arg(6)))
		if err292 != nil {
			Usage()
			return
		}
		argvalue5 := int32(tmp5)
		value5 := argvalue5
		arg293 := flag.Arg(7)
		mbTrans294 := thrift.NewTMemoryBufferLen(len(arg293))
		defer mbTrans294.Close()
		_, err295 := mbTrans294.WriteString(arg293)
		if err295 != nil {
			Usage()
			return
		}
		factory296 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt297 := factory296.GetProtocol(mbTrans294)
		argvalue6 := services.NewFromInfo()
		err298 := argvalue6.Read(jsProt297)
		if err298 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.GetGroupTrackers(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "getOwnedGroups":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "GetOwnedGroups requires 5 args")
			flag.Usage()
		}
		argvalue0, err299 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err299 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err300 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err300 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err301 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err301 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		tmp3, err302 := (strconv.Atoi(flag.Arg(4)))
		if err302 != nil {
			Usage()
			return
		}
		argvalue3 := int32(tmp3)
		value3 := argvalue3
		arg303 := flag.Arg(5)
		mbTrans304 := thrift.NewTMemoryBufferLen(len(arg303))
		defer mbTrans304.Close()
		_, err305 := mbTrans304.WriteString(arg303)
		if err305 != nil {
			Usage()
			return
		}
		factory306 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt307 := factory306.GetProtocol(mbTrans304)
		argvalue4 := services.NewFromInfo()
		err308 := argvalue4.Read(jsProt307)
		if err308 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.GetOwnedGroups(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "getJoinedGroups":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "GetJoinedGroups requires 4 args")
			flag.Usage()
		}
		argvalue0, err309 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err309 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err310 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err310 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err311 := (strconv.Atoi(flag.Arg(3)))
		if err311 != nil {
			Usage()
			return
		}
		argvalue2 := int32(tmp2)
		value2 := argvalue2
		arg312 := flag.Arg(4)
		mbTrans313 := thrift.NewTMemoryBufferLen(len(arg312))
		defer mbTrans313.Close()
		_, err314 := mbTrans313.WriteString(arg312)
		if err314 != nil {
			Usage()
			return
		}
		factory315 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt316 := factory315.GetProtocol(mbTrans313)
		argvalue3 := services.NewFromInfo()
		err317 := argvalue3.Read(jsProt316)
		if err317 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.GetJoinedGroups(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getTrackedGroups":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "GetTrackedGroups requires 7 args")
			flag.Usage()
		}
		argvalue0, err318 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err318 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err319 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err319 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err320 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err320 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err321 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err321 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5) == "true"
		value4 := argvalue4
		tmp5, err323 := (strconv.Atoi(flag.Arg(6)))
		if err323 != nil {
			Usage()
			return
		}
		argvalue5 := int32(tmp5)
		value5 := argvalue5
		arg324 := flag.Arg(7)
		mbTrans325 := thrift.NewTMemoryBufferLen(len(arg324))
		defer mbTrans325.Close()
		_, err326 := mbTrans325.WriteString(arg324)
		if err326 != nil {
			Usage()
			return
		}
		factory327 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt328 := factory327.GetProtocol(mbTrans325)
		argvalue6 := services.NewFromInfo()
		err329 := argvalue6.Read(jsProt328)
		if err329 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.GetTrackedGroups(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "blockGroupUser":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "BlockGroupUser requires 6 args")
			flag.Usage()
		}
		argvalue0, err330 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err330 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg331 := flag.Arg(2)
		mbTrans332 := thrift.NewTMemoryBufferLen(len(arg331))
		defer mbTrans332.Close()
		_, err333 := mbTrans332.WriteString(arg331)
		if err333 != nil {
			Usage()
			return
		}
		factory334 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt335 := factory334.GetProtocol(mbTrans332)
		containerStruct1 := services.NewBlockGroupUserArgs()
		err336 := containerStruct1.ReadField2(jsProt335)
		if err336 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.BlockUsers
		value1 := argvalue1
		argvalue2, err337 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err337 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3 := flag.Arg(4) == "true"
		value3 := argvalue3
		tmp4, err := (strconv.Atoi(flag.Arg(5)))
		if err != nil {
			Usage()
			return
		}
		argvalue4 := services.Zone(tmp4)
		value4 := argvalue4
		arg339 := flag.Arg(6)
		mbTrans340 := thrift.NewTMemoryBufferLen(len(arg339))
		defer mbTrans340.Close()
		_, err341 := mbTrans340.WriteString(arg339)
		if err341 != nil {
			Usage()
			return
		}
		factory342 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt343 := factory342.GetProtocol(mbTrans340)
		argvalue5 := services.NewFromInfo()
		err344 := argvalue5.Read(jsProt343)
		if err344 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.BlockGroupUser(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "getGroupUserBlockList":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetGroupUserBlockList requires 2 args")
			flag.Usage()
		}
		argvalue0, err345 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err345 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg346 := flag.Arg(2)
		mbTrans347 := thrift.NewTMemoryBufferLen(len(arg346))
		defer mbTrans347.Close()
		_, err348 := mbTrans347.WriteString(arg346)
		if err348 != nil {
			Usage()
			return
		}
		factory349 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt350 := factory349.GetProtocol(mbTrans347)
		argvalue1 := services.NewFromInfo()
		err351 := argvalue1.Read(jsProt350)
		if err351 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetGroupUserBlockList(value0, value1))
		fmt.Print("\n")
		break
	case "updateGroupMember":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "UpdateGroupMember requires 5 args")
			flag.Usage()
		}
		argvalue0, err352 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err352 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err353 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err353 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		tmp3, err := (strconv.Atoi(flag.Arg(4)))
		if err != nil {
			Usage()
			return
		}
		argvalue3 := services.MemberType(tmp3)
		value3 := argvalue3
		arg355 := flag.Arg(5)
		mbTrans356 := thrift.NewTMemoryBufferLen(len(arg355))
		defer mbTrans356.Close()
		_, err357 := mbTrans356.WriteString(arg355)
		if err357 != nil {
			Usage()
			return
		}
		factory358 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt359 := factory358.GetProtocol(mbTrans356)
		argvalue4 := services.NewFromInfo()
		err360 := argvalue4.Read(jsProt359)
		if err360 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.UpdateGroupMember(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "groupOwnerLeave":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GroupOwnerLeave requires 3 args")
			flag.Usage()
		}
		argvalue0, err361 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err361 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err362 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err362 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg363 := flag.Arg(3)
		mbTrans364 := thrift.NewTMemoryBufferLen(len(arg363))
		defer mbTrans364.Close()
		_, err365 := mbTrans364.WriteString(arg363)
		if err365 != nil {
			Usage()
			return
		}
		factory366 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt367 := factory366.GetProtocol(mbTrans364)
		argvalue2 := services.NewFromInfo()
		err368 := argvalue2.Read(jsProt367)
		if err368 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.GroupOwnerLeave(value0, value1, value2))
		fmt.Print("\n")
		break
	case "setGroupNoDisturbing":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "SetGroupNoDisturbing requires 4 args")
			flag.Usage()
		}
		argvalue0, err369 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err369 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err370 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err370 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2 := flag.Arg(3) == "true"
		value2 := argvalue2
		arg372 := flag.Arg(4)
		mbTrans373 := thrift.NewTMemoryBufferLen(len(arg372))
		defer mbTrans373.Close()
		_, err374 := mbTrans373.WriteString(arg372)
		if err374 != nil {
			Usage()
			return
		}
		factory375 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt376 := factory375.GetProtocol(mbTrans373)
		argvalue3 := services.NewFromInfo()
		err377 := argvalue3.Read(jsProt376)
		if err377 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.SetGroupNoDisturbing(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getUserGroups":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetUserGroups requires 2 args")
			flag.Usage()
		}
		argvalue0, err378 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err378 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg379 := flag.Arg(2)
		mbTrans380 := thrift.NewTMemoryBufferLen(len(arg379))
		defer mbTrans380.Close()
		_, err381 := mbTrans380.WriteString(arg379)
		if err381 != nil {
			Usage()
			return
		}
		factory382 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt383 := factory382.GetProtocol(mbTrans380)
		argvalue1 := services.NewFromInfo()
		err384 := argvalue1.Read(jsProt383)
		if err384 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetUserGroups(value0, value1))
		fmt.Print("\n")
		break
	case "getGroupCloudSize":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetGroupCloudSize requires 2 args")
			flag.Usage()
		}
		argvalue0, err385 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err385 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg386 := flag.Arg(2)
		mbTrans387 := thrift.NewTMemoryBufferLen(len(arg386))
		defer mbTrans387.Close()
		_, err388 := mbTrans387.WriteString(arg386)
		if err388 != nil {
			Usage()
			return
		}
		factory389 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt390 := factory389.GetProtocol(mbTrans387)
		argvalue1 := services.NewFromInfo()
		err391 := argvalue1.Read(jsProt390)
		if err391 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetGroupCloudSize(value0, value1))
		fmt.Print("\n")
		break
	case "addUpGroupResourceSize":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AddUpGroupResourceSize requires 2 args")
			flag.Usage()
		}
		argvalue0, err392 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err392 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg393 := flag.Arg(2)
		mbTrans394 := thrift.NewTMemoryBufferLen(len(arg393))
		defer mbTrans394.Close()
		_, err395 := mbTrans394.WriteString(arg393)
		if err395 != nil {
			Usage()
			return
		}
		factory396 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt397 := factory396.GetProtocol(mbTrans394)
		argvalue1 := services.NewFromInfo()
		err398 := argvalue1.Read(jsProt397)
		if err398 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.AddUpGroupResourceSize(value0, value1))
		fmt.Print("\n")
		break
	case "getUserGroupRelations":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetUserGroupRelations requires 3 args")
			flag.Usage()
		}
		argvalue0, err399 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err399 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg400 := flag.Arg(2)
		mbTrans401 := thrift.NewTMemoryBufferLen(len(arg400))
		defer mbTrans401.Close()
		_, err402 := mbTrans401.WriteString(arg400)
		if err402 != nil {
			Usage()
			return
		}
		factory403 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt404 := factory403.GetProtocol(mbTrans401)
		containerStruct1 := services.NewGetUserGroupRelationsArgs()
		err405 := containerStruct1.ReadField2(jsProt404)
		if err405 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.Gids
		value1 := argvalue1
		arg406 := flag.Arg(3)
		mbTrans407 := thrift.NewTMemoryBufferLen(len(arg406))
		defer mbTrans407.Close()
		_, err408 := mbTrans407.WriteString(arg406)
		if err408 != nil {
			Usage()
			return
		}
		factory409 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt410 := factory409.GetProtocol(mbTrans407)
		argvalue2 := services.NewFromInfo()
		err411 := argvalue2.Read(jsProt410)
		if err411 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.GetUserGroupRelations(value0, value1, value2))
		fmt.Print("\n")
		break
	case "updateGroupToPrivate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "UpdateGroupToPrivate requires 2 args")
			flag.Usage()
		}
		argvalue0, err412 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err412 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg413 := flag.Arg(2)
		mbTrans414 := thrift.NewTMemoryBufferLen(len(arg413))
		defer mbTrans414.Close()
		_, err415 := mbTrans414.WriteString(arg413)
		if err415 != nil {
			Usage()
			return
		}
		factory416 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt417 := factory416.GetProtocol(mbTrans414)
		argvalue1 := services.NewFromInfo()
		err418 := argvalue1.Read(jsProt417)
		if err418 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.UpdateGroupToPrivate(value0, value1))
		fmt.Print("\n")
		break
	case "updateGroupNoSpeakingList":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "UpdateGroupNoSpeakingList requires 4 args")
			flag.Usage()
		}
		argvalue0, err419 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err419 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg420 := flag.Arg(2)
		mbTrans421 := thrift.NewTMemoryBufferLen(len(arg420))
		defer mbTrans421.Close()
		_, err422 := mbTrans421.WriteString(arg420)
		if err422 != nil {
			Usage()
			return
		}
		factory423 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt424 := factory423.GetProtocol(mbTrans421)
		containerStruct1 := services.NewUpdateGroupNoSpeakingListArgs()
		err425 := containerStruct1.ReadField2(jsProt424)
		if err425 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.SpeakingList
		value1 := argvalue1
		arg426 := flag.Arg(3)
		mbTrans427 := thrift.NewTMemoryBufferLen(len(arg426))
		defer mbTrans427.Close()
		_, err428 := mbTrans427.WriteString(arg426)
		if err428 != nil {
			Usage()
			return
		}
		factory429 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt430 := factory429.GetProtocol(mbTrans427)
		containerStruct2 := services.NewUpdateGroupNoSpeakingListArgs()
		err431 := containerStruct2.ReadField3(jsProt430)
		if err431 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.NoSpeakingList
		value2 := argvalue2
		arg432 := flag.Arg(4)
		mbTrans433 := thrift.NewTMemoryBufferLen(len(arg432))
		defer mbTrans433.Close()
		_, err434 := mbTrans433.WriteString(arg432)
		if err434 != nil {
			Usage()
			return
		}
		factory435 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt436 := factory435.GetProtocol(mbTrans433)
		argvalue3 := services.NewFromInfo()
		err437 := argvalue3.Read(jsProt436)
		if err437 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.UpdateGroupNoSpeakingList(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "enableGroupNoSpeakingList":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "EnableGroupNoSpeakingList requires 3 args")
			flag.Usage()
		}
		argvalue0, err438 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err438 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2) == "true"
		value1 := argvalue1
		arg440 := flag.Arg(3)
		mbTrans441 := thrift.NewTMemoryBufferLen(len(arg440))
		defer mbTrans441.Close()
		_, err442 := mbTrans441.WriteString(arg440)
		if err442 != nil {
			Usage()
			return
		}
		factory443 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt444 := factory443.GetProtocol(mbTrans441)
		argvalue2 := services.NewFromInfo()
		err445 := argvalue2.Read(jsProt444)
		if err445 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.EnableGroupNoSpeakingList(value0, value1, value2))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}
Пример #3
0
func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	var parsedUrl url.URL
	var trans thrift.TTransport
	_ = strconv.Atoi
	_ = math.Abs
	flag.Usage = Usage
	flag.StringVar(&host, "h", "localhost", "Specify host and port")
	flag.IntVar(&port, "p", 9090, "Specify port")
	flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
	flag.StringVar(&urlString, "u", "", "Specify the url")
	flag.BoolVar(&framed, "framed", false, "Use framed transport")
	flag.BoolVar(&useHttp, "http", false, "Use http")
	flag.Parse()

	if len(urlString) > 0 {
		parsedUrl, err := url.Parse(urlString)
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
		host = parsedUrl.Host
		useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
	} else if useHttp {
		_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
	}

	cmd := flag.Arg(0)
	var err error
	if useHttp {
		trans, err = thrift.NewTHttpClient(parsedUrl.String())
	} else {
		portStr := fmt.Sprint(port)
		if strings.Contains(host, ":") {
			host, portStr, err = net.SplitHostPort(host)
			if err != nil {
				fmt.Fprintln(os.Stderr, "error with host:", err)
				os.Exit(1)
			}
		}
		trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
		if err != nil {
			fmt.Fprintln(os.Stderr, "error resolving address:", err)
			os.Exit(1)
		}
		if framed {
			trans = thrift.NewTFramedTransport(trans)
		}
	}
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error creating transport", err)
		os.Exit(1)
	}
	defer trans.Close()
	var protocolFactory thrift.TProtocolFactory
	switch protocol {
	case "compact":
		protocolFactory = thrift.NewTCompactProtocolFactory()
		break
	case "simplejson":
		protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
		break
	case "json":
		protocolFactory = thrift.NewTJSONProtocolFactory()
		break
	case "binary", "":
		protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
		Usage()
		os.Exit(1)
	}
	client := services.NewAccessManagerClientFactory(trans, protocolFactory)
	if err := trans.Open(); err != nil {
		fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
		os.Exit(1)
	}

	switch cmd {
	case "grantUserAccessToGroupRegion":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "GrantUserAccessToGroupRegion requires 6 args")
			flag.Usage()
		}
		argvalue0, err455 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err455 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err456 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err456 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg457 := flag.Arg(3)
		mbTrans458 := thrift.NewTMemoryBufferLen(len(arg457))
		defer mbTrans458.Close()
		_, err459 := mbTrans458.WriteString(arg457)
		if err459 != nil {
			Usage()
			return
		}
		factory460 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt461 := factory460.GetProtocol(mbTrans458)
		containerStruct2 := services.NewGrantUserAccessToGroupRegionArgs()
		err462 := containerStruct2.ReadField3(jsProt461)
		if err462 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.Zones
		value2 := argvalue2
		tmp3, err463 := (strconv.Atoi(flag.Arg(4)))
		if err463 != nil {
			Usage()
			return
		}
		argvalue3 := int32(tmp3)
		value3 := argvalue3
		tmp4, err464 := (strconv.Atoi(flag.Arg(5)))
		if err464 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		arg465 := flag.Arg(6)
		mbTrans466 := thrift.NewTMemoryBufferLen(len(arg465))
		defer mbTrans466.Close()
		_, err467 := mbTrans466.WriteString(arg465)
		if err467 != nil {
			Usage()
			return
		}
		factory468 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt469 := factory468.GetProtocol(mbTrans466)
		argvalue5 := services.NewFromInfo()
		err470 := argvalue5.Read(jsProt469)
		if err470 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.GrantUserAccessToGroupRegion(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "hasAccessToRegion":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "HasAccessToRegion requires 4 args")
			flag.Usage()
		}
		argvalue0, err471 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err471 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err472 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err472 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.Zone(tmp2)
		value2 := argvalue2
		arg473 := flag.Arg(4)
		mbTrans474 := thrift.NewTMemoryBufferLen(len(arg473))
		defer mbTrans474.Close()
		_, err475 := mbTrans474.WriteString(arg473)
		if err475 != nil {
			Usage()
			return
		}
		factory476 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt477 := factory476.GetProtocol(mbTrans474)
		argvalue3 := services.NewFromInfo()
		err478 := argvalue3.Read(jsProt477)
		if err478 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.HasAccessToRegion(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getAccessableGroupResources":
		if flag.NArg()-1 != 10 {
			fmt.Fprintln(os.Stderr, "GetAccessableGroupResources requires 10 args")
			flag.Usage()
		}
		argvalue0, err479 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err479 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err480 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err480 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.Zone(tmp2)
		value2 := argvalue2
		tmp3, err := (strconv.Atoi(flag.Arg(4)))
		if err != nil {
			Usage()
			return
		}
		argvalue3 := services.ResourceType(tmp3)
		value3 := argvalue3
		argvalue4, err481 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err481 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err482 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err482 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6, err483 := (strconv.ParseInt(flag.Arg(7), 10, 64))
		if err483 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		argvalue7 := flag.Arg(8) == "true"
		value7 := argvalue7
		tmp8, err485 := (strconv.Atoi(flag.Arg(9)))
		if err485 != nil {
			Usage()
			return
		}
		argvalue8 := int32(tmp8)
		value8 := argvalue8
		arg486 := flag.Arg(10)
		mbTrans487 := thrift.NewTMemoryBufferLen(len(arg486))
		defer mbTrans487.Close()
		_, err488 := mbTrans487.WriteString(arg486)
		if err488 != nil {
			Usage()
			return
		}
		factory489 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt490 := factory489.GetProtocol(mbTrans487)
		argvalue9 := services.NewFromInfo()
		err491 := argvalue9.Read(jsProt490)
		if err491 != nil {
			Usage()
			return
		}
		value9 := argvalue9
		fmt.Print(client.GetAccessableGroupResources(value0, value1, value2, value3, value4, value5, value6, value7, value8, value9))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}
Пример #4
0
func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	var parsedUrl url.URL
	var trans thrift.TTransport
	_ = strconv.Atoi
	_ = math.Abs
	flag.Usage = Usage
	flag.StringVar(&host, "h", "localhost", "Specify host and port")
	flag.IntVar(&port, "p", 9090, "Specify port")
	flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
	flag.StringVar(&urlString, "u", "", "Specify the url")
	flag.BoolVar(&framed, "framed", false, "Use framed transport")
	flag.BoolVar(&useHttp, "http", false, "Use http")
	flag.Parse()

	if len(urlString) > 0 {
		parsedUrl, err := url.Parse(urlString)
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
		host = parsedUrl.Host
		useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
	} else if useHttp {
		_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
	}

	cmd := flag.Arg(0)
	var err error
	if useHttp {
		trans, err = thrift.NewTHttpClient(parsedUrl.String())
	} else {
		portStr := fmt.Sprint(port)
		if strings.Contains(host, ":") {
			host, portStr, err = net.SplitHostPort(host)
			if err != nil {
				fmt.Fprintln(os.Stderr, "error with host:", err)
				os.Exit(1)
			}
		}
		trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
		if err != nil {
			fmt.Fprintln(os.Stderr, "error resolving address:", err)
			os.Exit(1)
		}
		if framed {
			trans = thrift.NewTFramedTransport(trans)
		}
	}
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error creating transport", err)
		os.Exit(1)
	}
	defer trans.Close()
	var protocolFactory thrift.TProtocolFactory
	switch protocol {
	case "compact":
		protocolFactory = thrift.NewTCompactProtocolFactory()
		break
	case "simplejson":
		protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
		break
	case "json":
		protocolFactory = thrift.NewTJSONProtocolFactory()
		break
	case "binary", "":
		protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
		Usage()
		os.Exit(1)
	}
	client := services.NewResourceManagerClientFactory(trans, protocolFactory)
	if err := trans.Open(); err != nil {
		fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
		os.Exit(1)
	}

	switch cmd {
	case "createResource":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "CreateResource requires 3 args")
			flag.Usage()
		}
		arg664 := flag.Arg(1)
		mbTrans665 := thrift.NewTMemoryBufferLen(len(arg664))
		defer mbTrans665.Close()
		_, err666 := mbTrans665.WriteString(arg664)
		if err666 != nil {
			Usage()
			return
		}
		factory667 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt668 := factory667.GetProtocol(mbTrans665)
		argvalue0 := services.NewResource()
		err669 := argvalue0.Read(jsProt668)
		if err669 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg670 := flag.Arg(2)
		mbTrans671 := thrift.NewTMemoryBufferLen(len(arg670))
		defer mbTrans671.Close()
		_, err672 := mbTrans671.WriteString(arg670)
		if err672 != nil {
			Usage()
			return
		}
		factory673 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt674 := factory673.GetProtocol(mbTrans671)
		containerStruct1 := services.NewCreateResourceArgs()
		err675 := containerStruct1.ReadField2(jsProt674)
		if err675 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.Tags
		value1 := argvalue1
		arg676 := flag.Arg(3)
		mbTrans677 := thrift.NewTMemoryBufferLen(len(arg676))
		defer mbTrans677.Close()
		_, err678 := mbTrans677.WriteString(arg676)
		if err678 != nil {
			Usage()
			return
		}
		factory679 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt680 := factory679.GetProtocol(mbTrans677)
		argvalue2 := services.NewFromInfo()
		err681 := argvalue2.Read(jsProt680)
		if err681 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.CreateResource(value0, value1, value2))
		fmt.Print("\n")
		break
	case "getResource":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetResource requires 3 args")
			flag.Usage()
		}
		argvalue0, err682 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err682 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err683 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err683 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg684 := flag.Arg(3)
		mbTrans685 := thrift.NewTMemoryBufferLen(len(arg684))
		defer mbTrans685.Close()
		_, err686 := mbTrans685.WriteString(arg684)
		if err686 != nil {
			Usage()
			return
		}
		factory687 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt688 := factory687.GetProtocol(mbTrans685)
		argvalue2 := services.NewFromInfo()
		err689 := argvalue2.Read(jsProt688)
		if err689 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.GetResource(value0, value1, value2))
		fmt.Print("\n")
		break
	case "getResourceInfo":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetResourceInfo requires 3 args")
			flag.Usage()
		}
		argvalue0, err690 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err690 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err691 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err691 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg692 := flag.Arg(3)
		mbTrans693 := thrift.NewTMemoryBufferLen(len(arg692))
		defer mbTrans693.Close()
		_, err694 := mbTrans693.WriteString(arg692)
		if err694 != nil {
			Usage()
			return
		}
		factory695 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt696 := factory695.GetProtocol(mbTrans693)
		argvalue2 := services.NewFromInfo()
		err697 := argvalue2.Read(jsProt696)
		if err697 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.GetResourceInfo(value0, value1, value2))
		fmt.Print("\n")
		break
	case "updateResource":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "UpdateResource requires 5 args")
			flag.Usage()
		}
		arg698 := flag.Arg(1)
		mbTrans699 := thrift.NewTMemoryBufferLen(len(arg698))
		defer mbTrans699.Close()
		_, err700 := mbTrans699.WriteString(arg698)
		if err700 != nil {
			Usage()
			return
		}
		factory701 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt702 := factory701.GetProtocol(mbTrans699)
		argvalue0 := services.NewResource()
		err703 := argvalue0.Read(jsProt702)
		if err703 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err704 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err704 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err705 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err705 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		arg706 := flag.Arg(4)
		mbTrans707 := thrift.NewTMemoryBufferLen(len(arg706))
		defer mbTrans707.Close()
		_, err708 := mbTrans707.WriteString(arg706)
		if err708 != nil {
			Usage()
			return
		}
		factory709 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt710 := factory709.GetProtocol(mbTrans707)
		containerStruct3 := services.NewUpdateResourceArgs()
		err711 := containerStruct3.ReadField4(jsProt710)
		if err711 != nil {
			Usage()
			return
		}
		argvalue3 := containerStruct3.Tags
		value3 := argvalue3
		arg712 := flag.Arg(5)
		mbTrans713 := thrift.NewTMemoryBufferLen(len(arg712))
		defer mbTrans713.Close()
		_, err714 := mbTrans713.WriteString(arg712)
		if err714 != nil {
			Usage()
			return
		}
		factory715 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt716 := factory715.GetProtocol(mbTrans713)
		argvalue4 := services.NewFromInfo()
		err717 := argvalue4.Read(jsProt716)
		if err717 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.UpdateResource(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "deleteResourceBySharedId":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "DeleteResourceBySharedId requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1, err719 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err719 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg720 := flag.Arg(3)
		mbTrans721 := thrift.NewTMemoryBufferLen(len(arg720))
		defer mbTrans721.Close()
		_, err722 := mbTrans721.WriteString(arg720)
		if err722 != nil {
			Usage()
			return
		}
		factory723 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt724 := factory723.GetProtocol(mbTrans721)
		argvalue2 := services.NewFromInfo()
		err725 := argvalue2.Read(jsProt724)
		if err725 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.DeleteResourceBySharedId(value0, value1, value2))
		fmt.Print("\n")
		break
	case "deleteResource":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "DeleteResource requires 3 args")
			flag.Usage()
		}
		argvalue0, err726 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err726 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err727 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err727 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg728 := flag.Arg(3)
		mbTrans729 := thrift.NewTMemoryBufferLen(len(arg728))
		defer mbTrans729.Close()
		_, err730 := mbTrans729.WriteString(arg728)
		if err730 != nil {
			Usage()
			return
		}
		factory731 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt732 := factory731.GetProtocol(mbTrans729)
		argvalue2 := services.NewFromInfo()
		err733 := argvalue2.Read(jsProt732)
		if err733 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.DeleteResource(value0, value1, value2))
		fmt.Print("\n")
		break
	case "shareResource":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "ShareResource requires 5 args")
			flag.Usage()
		}
		arg734 := flag.Arg(1)
		mbTrans735 := thrift.NewTMemoryBufferLen(len(arg734))
		defer mbTrans735.Close()
		_, err736 := mbTrans735.WriteString(arg734)
		if err736 != nil {
			Usage()
			return
		}
		factory737 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt738 := factory737.GetProtocol(mbTrans735)
		argvalue0 := services.NewResource()
		err739 := argvalue0.Read(jsProt738)
		if err739 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg740 := flag.Arg(2)
		mbTrans741 := thrift.NewTMemoryBufferLen(len(arg740))
		defer mbTrans741.Close()
		_, err742 := mbTrans741.WriteString(arg740)
		if err742 != nil {
			Usage()
			return
		}
		factory743 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt744 := factory743.GetProtocol(mbTrans741)
		containerStruct1 := services.NewShareResourceArgs()
		err745 := containerStruct1.ReadField2(jsProt744)
		if err745 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.ShareGroups
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.Zone(tmp2)
		value2 := argvalue2
		argvalue3, err746 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err746 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		arg747 := flag.Arg(5)
		mbTrans748 := thrift.NewTMemoryBufferLen(len(arg747))
		defer mbTrans748.Close()
		_, err749 := mbTrans748.WriteString(arg747)
		if err749 != nil {
			Usage()
			return
		}
		factory750 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt751 := factory750.GetProtocol(mbTrans748)
		argvalue4 := services.NewFromInfo()
		err752 := argvalue4.Read(jsProt751)
		if err752 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.ShareResource(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "getSharedResources":
		if flag.NArg()-1 != 9 {
			fmt.Fprintln(os.Stderr, "GetSharedResources requires 9 args")
			flag.Usage()
		}
		argvalue0, err753 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err753 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err754 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err754 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err755 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err755 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err756 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err756 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6 := flag.Arg(7) == "true"
		value6 := argvalue6
		tmp7, err758 := (strconv.Atoi(flag.Arg(8)))
		if err758 != nil {
			Usage()
			return
		}
		argvalue7 := int32(tmp7)
		value7 := argvalue7
		arg759 := flag.Arg(9)
		mbTrans760 := thrift.NewTMemoryBufferLen(len(arg759))
		defer mbTrans760.Close()
		_, err761 := mbTrans760.WriteString(arg759)
		if err761 != nil {
			Usage()
			return
		}
		factory762 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt763 := factory762.GetProtocol(mbTrans760)
		argvalue8 := services.NewFromInfo()
		err764 := argvalue8.Read(jsProt763)
		if err764 != nil {
			Usage()
			return
		}
		value8 := argvalue8
		fmt.Print(client.GetSharedResources(value0, value1, value2, value3, value4, value5, value6, value7, value8))
		fmt.Print("\n")
		break
	case "cancelSharedResource":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "CancelSharedResource requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		arg766 := flag.Arg(2)
		mbTrans767 := thrift.NewTMemoryBufferLen(len(arg766))
		defer mbTrans767.Close()
		_, err768 := mbTrans767.WriteString(arg766)
		if err768 != nil {
			Usage()
			return
		}
		factory769 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt770 := factory769.GetProtocol(mbTrans767)
		argvalue1 := services.NewFromInfo()
		err771 := argvalue1.Read(jsProt770)
		if err771 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.CancelSharedResource(value0, value1))
		fmt.Print("\n")
		break
	case "getUserResources":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "GetUserResources requires 8 args")
			flag.Usage()
		}
		argvalue0, err772 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err772 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.ResourceType(tmp1)
		value1 := argvalue1
		argvalue2, err773 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err773 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err774 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err774 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err775 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err775 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		tmp6, err777 := (strconv.Atoi(flag.Arg(7)))
		if err777 != nil {
			Usage()
			return
		}
		argvalue6 := int32(tmp6)
		value6 := argvalue6
		arg778 := flag.Arg(8)
		mbTrans779 := thrift.NewTMemoryBufferLen(len(arg778))
		defer mbTrans779.Close()
		_, err780 := mbTrans779.WriteString(arg778)
		if err780 != nil {
			Usage()
			return
		}
		factory781 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt782 := factory781.GetProtocol(mbTrans779)
		argvalue7 := services.NewFromInfo()
		err783 := argvalue7.Read(jsProt782)
		if err783 != nil {
			Usage()
			return
		}
		value7 := argvalue7
		fmt.Print(client.GetUserResources(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "addComment":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AddComment requires 2 args")
			flag.Usage()
		}
		arg784 := flag.Arg(1)
		mbTrans785 := thrift.NewTMemoryBufferLen(len(arg784))
		defer mbTrans785.Close()
		_, err786 := mbTrans785.WriteString(arg784)
		if err786 != nil {
			Usage()
			return
		}
		factory787 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt788 := factory787.GetProtocol(mbTrans785)
		argvalue0 := services.NewComment()
		err789 := argvalue0.Read(jsProt788)
		if err789 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg790 := flag.Arg(2)
		mbTrans791 := thrift.NewTMemoryBufferLen(len(arg790))
		defer mbTrans791.Close()
		_, err792 := mbTrans791.WriteString(arg790)
		if err792 != nil {
			Usage()
			return
		}
		factory793 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt794 := factory793.GetProtocol(mbTrans791)
		argvalue1 := services.NewFromInfo()
		err795 := argvalue1.Read(jsProt794)
		if err795 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.AddComment(value0, value1))
		fmt.Print("\n")
		break
	case "deleteComment":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "DeleteComment requires 6 args")
			flag.Usage()
		}
		argvalue0, err796 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err796 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err797 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err797 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err798 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err798 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err799 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err799 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err800 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err800 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		arg801 := flag.Arg(6)
		mbTrans802 := thrift.NewTMemoryBufferLen(len(arg801))
		defer mbTrans802.Close()
		_, err803 := mbTrans802.WriteString(arg801)
		if err803 != nil {
			Usage()
			return
		}
		factory804 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt805 := factory804.GetProtocol(mbTrans802)
		argvalue5 := services.NewFromInfo()
		err806 := argvalue5.Read(jsProt805)
		if err806 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.DeleteComment(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "getComments":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "GetComments requires 7 args")
			flag.Usage()
		}
		argvalue0, err807 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err807 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err808 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err808 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err809 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err809 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err810 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err810 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5) == "true"
		value4 := argvalue4
		tmp5, err812 := (strconv.Atoi(flag.Arg(6)))
		if err812 != nil {
			Usage()
			return
		}
		argvalue5 := int32(tmp5)
		value5 := argvalue5
		arg813 := flag.Arg(7)
		mbTrans814 := thrift.NewTMemoryBufferLen(len(arg813))
		defer mbTrans814.Close()
		_, err815 := mbTrans814.WriteString(arg813)
		if err815 != nil {
			Usage()
			return
		}
		factory816 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt817 := factory816.GetProtocol(mbTrans814)
		argvalue6 := services.NewFromInfo()
		err818 := argvalue6.Read(jsProt817)
		if err818 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.GetComments(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "operateThumb":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "OperateThumb requires 6 args")
			flag.Usage()
		}
		argvalue0, err819 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err819 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err820 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err820 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ThumbType(tmp2)
		value2 := argvalue2
		argvalue3, err821 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err821 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err := (strconv.Atoi(flag.Arg(5)))
		if err != nil {
			Usage()
			return
		}
		argvalue4 := services.ResourceType(tmp4)
		value4 := argvalue4
		arg822 := flag.Arg(6)
		mbTrans823 := thrift.NewTMemoryBufferLen(len(arg822))
		defer mbTrans823.Close()
		_, err824 := mbTrans823.WriteString(arg822)
		if err824 != nil {
			Usage()
			return
		}
		factory825 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt826 := factory825.GetProtocol(mbTrans823)
		argvalue5 := services.NewFromInfo()
		err827 := argvalue5.Read(jsProt826)
		if err827 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.OperateThumb(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "getThumbs":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "GetThumbs requires 8 args")
			flag.Usage()
		}
		argvalue0, err828 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err828 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err829 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err829 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ThumbType(tmp2)
		value2 := argvalue2
		argvalue3, err830 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err830 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err831 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err831 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		tmp6, err833 := (strconv.Atoi(flag.Arg(7)))
		if err833 != nil {
			Usage()
			return
		}
		argvalue6 := int32(tmp6)
		value6 := argvalue6
		arg834 := flag.Arg(8)
		mbTrans835 := thrift.NewTMemoryBufferLen(len(arg834))
		defer mbTrans835.Close()
		_, err836 := mbTrans835.WriteString(arg834)
		if err836 != nil {
			Usage()
			return
		}
		factory837 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt838 := factory837.GetProtocol(mbTrans835)
		argvalue7 := services.NewFromInfo()
		err839 := argvalue7.Read(jsProt838)
		if err839 != nil {
			Usage()
			return
		}
		value7 := argvalue7
		fmt.Print(client.GetThumbs(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "registerResourceNotification":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "RegisterResourceNotification requires 3 args")
			flag.Usage()
		}
		argvalue0, err840 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err840 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err841 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err841 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg842 := flag.Arg(3)
		mbTrans843 := thrift.NewTMemoryBufferLen(len(arg842))
		defer mbTrans843.Close()
		_, err844 := mbTrans843.WriteString(arg842)
		if err844 != nil {
			Usage()
			return
		}
		factory845 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt846 := factory845.GetProtocol(mbTrans843)
		argvalue2 := services.NewFromInfo()
		err847 := argvalue2.Read(jsProt846)
		if err847 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.RegisterResourceNotification(value0, value1, value2))
		fmt.Print("\n")
		break
	case "unregisterResourceNotification":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "UnregisterResourceNotification requires 4 args")
			flag.Usage()
		}
		argvalue0, err848 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err848 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err849 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err849 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		arg850 := flag.Arg(4)
		mbTrans851 := thrift.NewTMemoryBufferLen(len(arg850))
		defer mbTrans851.Close()
		_, err852 := mbTrans851.WriteString(arg850)
		if err852 != nil {
			Usage()
			return
		}
		factory853 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt854 := factory853.GetProtocol(mbTrans851)
		argvalue3 := services.NewFromInfo()
		err855 := argvalue3.Read(jsProt854)
		if err855 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.UnregisterResourceNotification(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "sendResourceNotification":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "SendResourceNotification requires 5 args")
			flag.Usage()
		}
		argvalue0, err856 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err856 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err857 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err857 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg858 := flag.Arg(3)
		mbTrans859 := thrift.NewTMemoryBufferLen(len(arg858))
		defer mbTrans859.Close()
		_, err860 := mbTrans859.WriteString(arg858)
		if err860 != nil {
			Usage()
			return
		}
		factory861 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt862 := factory861.GetProtocol(mbTrans859)
		argvalue2 := services.NewComment()
		err863 := argvalue2.Read(jsProt862)
		if err863 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err864 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err864 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		arg865 := flag.Arg(5)
		mbTrans866 := thrift.NewTMemoryBufferLen(len(arg865))
		defer mbTrans866.Close()
		_, err867 := mbTrans866.WriteString(arg865)
		if err867 != nil {
			Usage()
			return
		}
		factory868 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt869 := factory868.GetProtocol(mbTrans866)
		argvalue4 := services.NewFromInfo()
		err870 := argvalue4.Read(jsProt869)
		if err870 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.SendResourceNotification(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "getCommentsHistory":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "GetCommentsHistory requires 8 args")
			flag.Usage()
		}
		argvalue0, err871 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err871 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.CommentHistoryType(tmp1)
		value1 := argvalue1
		argvalue2, err872 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err872 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err873 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err873 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err874 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err874 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		tmp6, err876 := (strconv.Atoi(flag.Arg(7)))
		if err876 != nil {
			Usage()
			return
		}
		argvalue6 := int32(tmp6)
		value6 := argvalue6
		arg877 := flag.Arg(8)
		mbTrans878 := thrift.NewTMemoryBufferLen(len(arg877))
		defer mbTrans878.Close()
		_, err879 := mbTrans878.WriteString(arg877)
		if err879 != nil {
			Usage()
			return
		}
		factory880 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt881 := factory880.GetProtocol(mbTrans878)
		argvalue7 := services.NewFromInfo()
		err882 := argvalue7.Read(jsProt881)
		if err882 != nil {
			Usage()
			return
		}
		value7 := argvalue7
		fmt.Print(client.GetCommentsHistory(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "deleteCommentHistory":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "DeleteCommentHistory requires 6 args")
			flag.Usage()
		}
		argvalue0, err883 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err883 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.CommentHistoryType(tmp1)
		value1 := argvalue1
		argvalue2, err884 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err884 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err885 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err885 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err886 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err886 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		arg887 := flag.Arg(6)
		mbTrans888 := thrift.NewTMemoryBufferLen(len(arg887))
		defer mbTrans888.Close()
		_, err889 := mbTrans888.WriteString(arg887)
		if err889 != nil {
			Usage()
			return
		}
		factory890 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt891 := factory890.GetProtocol(mbTrans888)
		argvalue5 := services.NewFromInfo()
		err892 := argvalue5.Read(jsProt891)
		if err892 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.DeleteCommentHistory(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "updateGroupResourceName":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "UpdateGroupResourceName requires 7 args")
			flag.Usage()
		}
		argvalue0, err893 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err893 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err894 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err894 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err895 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err895 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6)
		value5 := argvalue5
		arg897 := flag.Arg(7)
		mbTrans898 := thrift.NewTMemoryBufferLen(len(arg897))
		defer mbTrans898.Close()
		_, err899 := mbTrans898.WriteString(arg897)
		if err899 != nil {
			Usage()
			return
		}
		factory900 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt901 := factory900.GetProtocol(mbTrans898)
		argvalue6 := services.NewFromInfo()
		err902 := argvalue6.Read(jsProt901)
		if err902 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.UpdateGroupResourceName(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "getSharedGroupResource":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetSharedGroupResource requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		arg904 := flag.Arg(2)
		mbTrans905 := thrift.NewTMemoryBufferLen(len(arg904))
		defer mbTrans905.Close()
		_, err906 := mbTrans905.WriteString(arg904)
		if err906 != nil {
			Usage()
			return
		}
		factory907 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt908 := factory907.GetProtocol(mbTrans905)
		argvalue1 := services.NewFromInfo()
		err909 := argvalue1.Read(jsProt908)
		if err909 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetSharedGroupResource(value0, value1))
		fmt.Print("\n")
		break
	case "getResourceChatRoomViewer":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "GetResourceChatRoomViewer requires 4 args")
			flag.Usage()
		}
		argvalue0, err910 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err910 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err911 := (strconv.Atoi(flag.Arg(2)))
		if err911 != nil {
			Usage()
			return
		}
		argvalue1 := int32(tmp1)
		value1 := argvalue1
		argvalue2, err912 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err912 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		arg913 := flag.Arg(4)
		mbTrans914 := thrift.NewTMemoryBufferLen(len(arg913))
		defer mbTrans914.Close()
		_, err915 := mbTrans914.WriteString(arg913)
		if err915 != nil {
			Usage()
			return
		}
		factory916 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt917 := factory916.GetProtocol(mbTrans914)
		argvalue3 := services.NewFromInfo()
		err918 := argvalue3.Read(jsProt917)
		if err918 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.GetResourceChatRoomViewer(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getResourceChatRoomViewerCount":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetResourceChatRoomViewerCount requires 2 args")
			flag.Usage()
		}
		argvalue0, err919 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err919 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg920 := flag.Arg(2)
		mbTrans921 := thrift.NewTMemoryBufferLen(len(arg920))
		defer mbTrans921.Close()
		_, err922 := mbTrans921.WriteString(arg920)
		if err922 != nil {
			Usage()
			return
		}
		factory923 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt924 := factory923.GetProtocol(mbTrans921)
		argvalue1 := services.NewFromInfo()
		err925 := argvalue1.Read(jsProt924)
		if err925 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.GetResourceChatRoomViewerCount(value0, value1))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}
func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	var parsedUrl url.URL
	var trans thrift.TTransport
	_ = strconv.Atoi
	_ = math.Abs
	flag.Usage = Usage
	flag.StringVar(&host, "h", "localhost", "Specify host and port")
	flag.IntVar(&port, "p", 9090, "Specify port")
	flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
	flag.StringVar(&urlString, "u", "", "Specify the url")
	flag.BoolVar(&framed, "framed", false, "Use framed transport")
	flag.BoolVar(&useHttp, "http", false, "Use http")
	flag.Parse()

	if len(urlString) > 0 {
		parsedUrl, err := url.Parse(urlString)
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
		host = parsedUrl.Host
		useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
	} else if useHttp {
		_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
	}

	cmd := flag.Arg(0)
	var err error
	if useHttp {
		trans, err = thrift.NewTHttpClient(parsedUrl.String())
	} else {
		portStr := fmt.Sprint(port)
		if strings.Contains(host, ":") {
			host, portStr, err = net.SplitHostPort(host)
			if err != nil {
				fmt.Fprintln(os.Stderr, "error with host:", err)
				os.Exit(1)
			}
		}
		trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
		if err != nil {
			fmt.Fprintln(os.Stderr, "error resolving address:", err)
			os.Exit(1)
		}
		if framed {
			trans = thrift.NewTFramedTransport(trans)
		}
	}
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error creating transport", err)
		os.Exit(1)
	}
	defer trans.Close()
	var protocolFactory thrift.TProtocolFactory
	switch protocol {
	case "compact":
		protocolFactory = thrift.NewTCompactProtocolFactory()
		break
	case "simplejson":
		protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
		break
	case "json":
		protocolFactory = thrift.NewTJSONProtocolFactory()
		break
	case "binary", "":
		protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
		Usage()
		os.Exit(1)
	}
	client := services.NewResourceCategoryManagerClientFactory(trans, protocolFactory)
	if err := trans.Open(); err != nil {
		fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
		os.Exit(1)
	}

	switch cmd {
	case "getChildren":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "GetChildren requires 6 args")
			flag.Usage()
		}
		argvalue0, err1063 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1063 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1064 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1064 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err1065 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1065 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err1066 := (strconv.Atoi(flag.Arg(5)))
		if err1066 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		arg1067 := flag.Arg(6)
		mbTrans1068 := thrift.NewTMemoryBufferLen(len(arg1067))
		defer mbTrans1068.Close()
		_, err1069 := mbTrans1068.WriteString(arg1067)
		if err1069 != nil {
			Usage()
			return
		}
		factory1070 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1071 := factory1070.GetProtocol(mbTrans1068)
		argvalue5 := services.NewFromInfo()
		err1072 := argvalue5.Read(jsProt1071)
		if err1072 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.GetChildren(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "getChildrenByType":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "GetChildrenByType requires 6 args")
			flag.Usage()
		}
		argvalue0, err1073 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1073 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1074 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1074 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err1075 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1075 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err1076 := (strconv.Atoi(flag.Arg(5)))
		if err1076 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		arg1077 := flag.Arg(6)
		mbTrans1078 := thrift.NewTMemoryBufferLen(len(arg1077))
		defer mbTrans1078.Close()
		_, err1079 := mbTrans1078.WriteString(arg1077)
		if err1079 != nil {
			Usage()
			return
		}
		factory1080 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1081 := factory1080.GetProtocol(mbTrans1078)
		argvalue5 := services.NewFromInfo()
		err1082 := argvalue5.Read(jsProt1081)
		if err1082 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.GetChildrenByType(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "removeChild":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "RemoveChild requires 5 args")
			flag.Usage()
		}
		argvalue0, err1083 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1083 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1084 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1084 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err1085 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1085 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		arg1086 := flag.Arg(5)
		mbTrans1087 := thrift.NewTMemoryBufferLen(len(arg1086))
		defer mbTrans1087.Close()
		_, err1088 := mbTrans1087.WriteString(arg1086)
		if err1088 != nil {
			Usage()
			return
		}
		factory1089 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1090 := factory1089.GetProtocol(mbTrans1087)
		argvalue4 := services.NewFromInfo()
		err1091 := argvalue4.Read(jsProt1090)
		if err1091 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.RemoveChild(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "moveChild":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "MoveChild requires 7 args")
			flag.Usage()
		}
		argvalue0, err1092 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1092 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1093 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1093 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err1094 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1094 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err1095 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err1095 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		arg1097 := flag.Arg(7)
		mbTrans1098 := thrift.NewTMemoryBufferLen(len(arg1097))
		defer mbTrans1098.Close()
		_, err1099 := mbTrans1098.WriteString(arg1097)
		if err1099 != nil {
			Usage()
			return
		}
		factory1100 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1101 := factory1100.GetProtocol(mbTrans1098)
		argvalue6 := services.NewFromInfo()
		err1102 := argvalue6.Read(jsProt1101)
		if err1102 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.MoveChild(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "renameChild":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "RenameChild requires 6 args")
			flag.Usage()
		}
		argvalue0, err1103 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1103 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1104 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1104 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err1105 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1105 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5)
		value4 := argvalue4
		arg1107 := flag.Arg(6)
		mbTrans1108 := thrift.NewTMemoryBufferLen(len(arg1107))
		defer mbTrans1108.Close()
		_, err1109 := mbTrans1108.WriteString(arg1107)
		if err1109 != nil {
			Usage()
			return
		}
		factory1110 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1111 := factory1110.GetProtocol(mbTrans1108)
		argvalue5 := services.NewFromInfo()
		err1112 := argvalue5.Read(jsProt1111)
		if err1112 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.RenameChild(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "createCategory":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "CreateCategory requires 4 args")
			flag.Usage()
		}
		argvalue0, err1113 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1113 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1114 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1114 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		arg1116 := flag.Arg(4)
		mbTrans1117 := thrift.NewTMemoryBufferLen(len(arg1116))
		defer mbTrans1117.Close()
		_, err1118 := mbTrans1117.WriteString(arg1116)
		if err1118 != nil {
			Usage()
			return
		}
		factory1119 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1120 := factory1119.GetProtocol(mbTrans1117)
		argvalue3 := services.NewFromInfo()
		err1121 := argvalue3.Read(jsProt1120)
		if err1121 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.CreateCategory(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "assignCategory":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "AssignCategory requires 6 args")
			flag.Usage()
		}
		argvalue0, err1122 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1122 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1123 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1123 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg1124 := flag.Arg(3)
		mbTrans1125 := thrift.NewTMemoryBufferLen(len(arg1124))
		defer mbTrans1125.Close()
		_, err1126 := mbTrans1125.WriteString(arg1124)
		if err1126 != nil {
			Usage()
			return
		}
		factory1127 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1128 := factory1127.GetProtocol(mbTrans1125)
		argvalue2 := services.NewResource()
		err1129 := argvalue2.Read(jsProt1128)
		if err1129 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		tmp3, err := (strconv.Atoi(flag.Arg(4)))
		if err != nil {
			Usage()
			return
		}
		argvalue3 := services.Zone(tmp3)
		value3 := argvalue3
		argvalue4 := flag.Arg(5)
		value4 := argvalue4
		arg1131 := flag.Arg(6)
		mbTrans1132 := thrift.NewTMemoryBufferLen(len(arg1131))
		defer mbTrans1132.Close()
		_, err1133 := mbTrans1132.WriteString(arg1131)
		if err1133 != nil {
			Usage()
			return
		}
		factory1134 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1135 := factory1134.GetProtocol(mbTrans1132)
		argvalue5 := services.NewFromInfo()
		err1136 := argvalue5.Read(jsProt1135)
		if err1136 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		fmt.Print(client.AssignCategory(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "assignResourceZone":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "AssignResourceZone requires 7 args")
			flag.Usage()
		}
		argvalue0, err1137 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1137 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err1138 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err1138 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err1139 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1139 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err := (strconv.Atoi(flag.Arg(5)))
		if err != nil {
			Usage()
			return
		}
		argvalue4 := services.Zone(tmp4)
		value4 := argvalue4
		argvalue5 := flag.Arg(6)
		value5 := argvalue5
		arg1141 := flag.Arg(7)
		mbTrans1142 := thrift.NewTMemoryBufferLen(len(arg1141))
		defer mbTrans1142.Close()
		_, err1143 := mbTrans1142.WriteString(arg1141)
		if err1143 != nil {
			Usage()
			return
		}
		factory1144 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1145 := factory1144.GetProtocol(mbTrans1142)
		argvalue6 := services.NewFromInfo()
		err1146 := argvalue6.Read(jsProt1145)
		if err1146 != nil {
			Usage()
			return
		}
		value6 := argvalue6
		fmt.Print(client.AssignResourceZone(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "assignUnclassifiedResourceZone":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "AssignUnclassifiedResourceZone requires 4 args")
			flag.Usage()
		}
		tmp0, err := (strconv.Atoi(flag.Arg(1)))
		if err != nil {
			Usage()
			return
		}
		argvalue0 := services.Zone(tmp0)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2, err1148 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err1148 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		arg1149 := flag.Arg(4)
		mbTrans1150 := thrift.NewTMemoryBufferLen(len(arg1149))
		defer mbTrans1150.Close()
		_, err1151 := mbTrans1150.WriteString(arg1149)
		if err1151 != nil {
			Usage()
			return
		}
		factory1152 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1153 := factory1152.GetProtocol(mbTrans1150)
		argvalue3 := services.NewFromInfo()
		err1154 := argvalue3.Read(jsProt1153)
		if err1154 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.AssignUnclassifiedResourceZone(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getUnclassifiedGroupResources":
		if flag.NArg()-1 != 9 {
			fmt.Fprintln(os.Stderr, "GetUnclassifiedGroupResources requires 9 args")
			flag.Usage()
		}
		argvalue0, err1155 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1155 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err1156 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1156 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err1157 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err1157 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err1158 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err1158 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6 := flag.Arg(7) == "true"
		value6 := argvalue6
		tmp7, err1160 := (strconv.Atoi(flag.Arg(8)))
		if err1160 != nil {
			Usage()
			return
		}
		argvalue7 := int32(tmp7)
		value7 := argvalue7
		arg1161 := flag.Arg(9)
		mbTrans1162 := thrift.NewTMemoryBufferLen(len(arg1161))
		defer mbTrans1162.Close()
		_, err1163 := mbTrans1162.WriteString(arg1161)
		if err1163 != nil {
			Usage()
			return
		}
		factory1164 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1165 := factory1164.GetProtocol(mbTrans1162)
		argvalue8 := services.NewFromInfo()
		err1166 := argvalue8.Read(jsProt1165)
		if err1166 != nil {
			Usage()
			return
		}
		value8 := argvalue8
		fmt.Print(client.GetUnclassifiedGroupResources(value0, value1, value2, value3, value4, value5, value6, value7, value8))
		fmt.Print("\n")
		break
	case "getUnclassifiedGroupResourcesByType":
		if flag.NArg()-1 != 9 {
			fmt.Fprintln(os.Stderr, "GetUnclassifiedGroupResourcesByType requires 9 args")
			flag.Usage()
		}
		argvalue0, err1167 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err1167 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := services.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := services.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err1168 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err1168 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err1169 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err1169 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err1170 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err1170 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6 := flag.Arg(7) == "true"
		value6 := argvalue6
		tmp7, err1172 := (strconv.Atoi(flag.Arg(8)))
		if err1172 != nil {
			Usage()
			return
		}
		argvalue7 := int32(tmp7)
		value7 := argvalue7
		arg1173 := flag.Arg(9)
		mbTrans1174 := thrift.NewTMemoryBufferLen(len(arg1173))
		defer mbTrans1174.Close()
		_, err1175 := mbTrans1174.WriteString(arg1173)
		if err1175 != nil {
			Usage()
			return
		}
		factory1176 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt1177 := factory1176.GetProtocol(mbTrans1174)
		argvalue8 := services.NewFromInfo()
		err1178 := argvalue8.Read(jsProt1177)
		if err1178 != nil {
			Usage()
			return
		}
		value8 := argvalue8
		fmt.Print(client.GetUnclassifiedGroupResourcesByType(value0, value1, value2, value3, value4, value5, value6, value7, value8))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}