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.NewRecommendationManagerClientFactory(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 "getResourceRecommendation": if flag.NArg()-1 != 7 { fmt.Fprintln(os.Stderr, "GetResourceRecommendation requires 7 args") flag.Usage() } argvalue0, err1405 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1405 != nil { Usage() return } value0 := argvalue0 tmp1, err := (strconv.Atoi(flag.Arg(2))) if err != nil { Usage() return } argvalue1 := services.ResourceType(tmp1) value1 := argvalue1 tmp2, err1406 := (strconv.Atoi(flag.Arg(3))) if err1406 != nil { Usage() return } argvalue2 := int32(tmp2) value2 := argvalue2 tmp3, err1407 := (strconv.Atoi(flag.Arg(4))) if err1407 != nil { Usage() return } argvalue3 := int32(tmp3) value3 := argvalue3 arg1408 := flag.Arg(5) mbTrans1409 := thrift.NewTMemoryBufferLen(len(arg1408)) defer mbTrans1409.Close() _, err1410 := mbTrans1409.WriteString(arg1408) if err1410 != nil { Usage() return } factory1411 := thrift.NewTSimpleJSONProtocolFactory() jsProt1412 := factory1411.GetProtocol(mbTrans1409) argvalue4 := services.NewRecommendationAugmentInfo() err1413 := argvalue4.Read(jsProt1412) if err1413 != nil { Usage() return } value4 := argvalue4 tmp5, err := (strconv.Atoi(flag.Arg(6))) if err != nil { Usage() return } argvalue5 := services.RecommendationReason(tmp5) value5 := argvalue5 arg1414 := flag.Arg(7) mbTrans1415 := thrift.NewTMemoryBufferLen(len(arg1414)) defer mbTrans1415.Close() _, err1416 := mbTrans1415.WriteString(arg1414) if err1416 != nil { Usage() return } factory1417 := thrift.NewTSimpleJSONProtocolFactory() jsProt1418 := factory1417.GetProtocol(mbTrans1415) argvalue6 := services.NewFromInfo() err1419 := argvalue6.Read(jsProt1418) if err1419 != nil { Usage() return } value6 := argvalue6 fmt.Print(client.GetResourceRecommendation(value0, value1, value2, value3, value4, value5, value6)) fmt.Print("\n") break case "getGroupRecommendation": if flag.NArg()-1 != 6 { fmt.Fprintln(os.Stderr, "GetGroupRecommendation requires 6 args") flag.Usage() } argvalue0, err1420 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1420 != nil { Usage() return } value0 := argvalue0 tmp1, err1421 := (strconv.Atoi(flag.Arg(2))) if err1421 != nil { Usage() return } argvalue1 := int32(tmp1) value1 := argvalue1 tmp2, err1422 := (strconv.Atoi(flag.Arg(3))) if err1422 != nil { Usage() return } argvalue2 := int32(tmp2) value2 := argvalue2 tmp3, err := (strconv.Atoi(flag.Arg(4))) if err != nil { Usage() return } argvalue3 := services.RecommendationReason(tmp3) value3 := argvalue3 arg1423 := flag.Arg(5) mbTrans1424 := thrift.NewTMemoryBufferLen(len(arg1423)) defer mbTrans1424.Close() _, err1425 := mbTrans1424.WriteString(arg1423) if err1425 != nil { Usage() return } factory1426 := thrift.NewTSimpleJSONProtocolFactory() jsProt1427 := factory1426.GetProtocol(mbTrans1424) argvalue4 := services.NewRecommendationAugmentInfo() err1428 := argvalue4.Read(jsProt1427) if err1428 != nil { Usage() return } value4 := argvalue4 arg1429 := flag.Arg(6) mbTrans1430 := thrift.NewTMemoryBufferLen(len(arg1429)) defer mbTrans1430.Close() _, err1431 := mbTrans1430.WriteString(arg1429) if err1431 != nil { Usage() return } factory1432 := thrift.NewTSimpleJSONProtocolFactory() jsProt1433 := factory1432.GetProtocol(mbTrans1430) argvalue5 := services.NewFromInfo() err1434 := argvalue5.Read(jsProt1433) if err1434 != nil { Usage() return } value5 := argvalue5 fmt.Print(client.GetGroupRecommendation(value0, value1, value2, value3, value4, value5)) fmt.Print("\n") break case "getTagRecommendation": if flag.NArg()-1 != 7 { fmt.Fprintln(os.Stderr, "GetTagRecommendation requires 7 args") flag.Usage() } argvalue0, err1435 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1435 != nil { Usage() return } value0 := argvalue0 arg1436 := flag.Arg(2) mbTrans1437 := thrift.NewTMemoryBufferLen(len(arg1436)) defer mbTrans1437.Close() _, err1438 := mbTrans1437.WriteString(arg1436) if err1438 != nil { Usage() return } factory1439 := thrift.NewTSimpleJSONProtocolFactory() jsProt1440 := factory1439.GetProtocol(mbTrans1437) containerStruct1 := services.NewGetTagRecommendationArgs() err1441 := containerStruct1.ReadField2(jsProt1440) if err1441 != nil { Usage() return } argvalue1 := containerStruct1.TagList value1 := argvalue1 tmp2, err1442 := (strconv.Atoi(flag.Arg(3))) if err1442 != nil { Usage() return } argvalue2 := int32(tmp2) value2 := argvalue2 tmp3, err1443 := (strconv.Atoi(flag.Arg(4))) if err1443 != nil { Usage() return } argvalue3 := int32(tmp3) value3 := argvalue3 tmp4, err := (strconv.Atoi(flag.Arg(5))) if err != nil { Usage() return } argvalue4 := services.RecommendationReason(tmp4) value4 := argvalue4 tmp5, err := (strconv.Atoi(flag.Arg(6))) if err != nil { Usage() return } argvalue5 := services.ResourceType(tmp5) value5 := argvalue5 arg1444 := flag.Arg(7) mbTrans1445 := thrift.NewTMemoryBufferLen(len(arg1444)) defer mbTrans1445.Close() _, err1446 := mbTrans1445.WriteString(arg1444) if err1446 != nil { Usage() return } factory1447 := thrift.NewTSimpleJSONProtocolFactory() jsProt1448 := factory1447.GetProtocol(mbTrans1445) argvalue6 := services.NewFromInfo() err1449 := argvalue6.Read(jsProt1448) if err1449 != nil { Usage() return } value6 := argvalue6 fmt.Print(client.GetTagRecommendation(value0, value1, value2, value3, value4, value5, value6)) fmt.Print("\n") break case "getFriendRecommendation": if flag.NArg()-1 != 5 { fmt.Fprintln(os.Stderr, "GetFriendRecommendation requires 5 args") flag.Usage() } argvalue0, err1450 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1450 != nil { Usage() return } value0 := argvalue0 tmp1, err1451 := (strconv.Atoi(flag.Arg(2))) if err1451 != nil { Usage() return } argvalue1 := int32(tmp1) value1 := argvalue1 tmp2, err1452 := (strconv.Atoi(flag.Arg(3))) if err1452 != nil { Usage() return } argvalue2 := int32(tmp2) value2 := argvalue2 tmp3, err := (strconv.Atoi(flag.Arg(4))) if err != nil { Usage() return } argvalue3 := services.RecommendationReason(tmp3) value3 := argvalue3 arg1453 := flag.Arg(5) mbTrans1454 := thrift.NewTMemoryBufferLen(len(arg1453)) defer mbTrans1454.Close() _, err1455 := mbTrans1454.WriteString(arg1453) if err1455 != nil { Usage() return } factory1456 := thrift.NewTSimpleJSONProtocolFactory() jsProt1457 := factory1456.GetProtocol(mbTrans1454) argvalue4 := services.NewFromInfo() err1458 := argvalue4.Read(jsProt1457) if err1458 != nil { Usage() return } value4 := argvalue4 fmt.Print(client.GetFriendRecommendation(value0, value1, value2, value3, value4)) fmt.Print("\n") break case "getRecommendationByMix": if flag.NArg()-1 != 6 { fmt.Fprintln(os.Stderr, "GetRecommendationByMix requires 6 args") flag.Usage() } argvalue0, err1459 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1459 != nil { Usage() return } value0 := argvalue0 tmp1, err1460 := (strconv.Atoi(flag.Arg(2))) if err1460 != nil { Usage() return } argvalue1 := int32(tmp1) value1 := argvalue1 tmp2, err1461 := (strconv.Atoi(flag.Arg(3))) if err1461 != nil { Usage() return } argvalue2 := int32(tmp2) value2 := argvalue2 tmp3, err := (strconv.Atoi(flag.Arg(4))) if err != nil { Usage() return } argvalue3 := services.RecommendationReason(tmp3) value3 := argvalue3 arg1462 := flag.Arg(5) mbTrans1463 := thrift.NewTMemoryBufferLen(len(arg1462)) defer mbTrans1463.Close() _, err1464 := mbTrans1463.WriteString(arg1462) if err1464 != nil { Usage() return } factory1465 := thrift.NewTSimpleJSONProtocolFactory() jsProt1466 := factory1465.GetProtocol(mbTrans1463) argvalue4 := services.NewRecommendationAugmentInfo() err1467 := argvalue4.Read(jsProt1466) if err1467 != nil { Usage() return } value4 := argvalue4 arg1468 := flag.Arg(6) mbTrans1469 := thrift.NewTMemoryBufferLen(len(arg1468)) defer mbTrans1469.Close() _, err1470 := mbTrans1469.WriteString(arg1468) if err1470 != nil { Usage() return } factory1471 := thrift.NewTSimpleJSONProtocolFactory() jsProt1472 := factory1471.GetProtocol(mbTrans1469) argvalue5 := services.NewFromInfo() err1473 := argvalue5.Read(jsProt1472) if err1473 != nil { Usage() return } value5 := argvalue5 fmt.Print(client.GetRecommendationByMix(value0, value1, value2, value3, value4, value5)) 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.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) } }
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.NewTagManagerClientFactory(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 "addTag": if flag.NArg()-1 != 5 { fmt.Fprintln(os.Stderr, "AddTag requires 5 args") flag.Usage() } argvalue0, err1486 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1486 != nil { Usage() return } value0 := argvalue0 argvalue1, err1487 := (strconv.ParseInt(flag.Arg(2), 10, 64)) if err1487 != nil { Usage() return } value1 := argvalue1 tmp2, err := (strconv.Atoi(flag.Arg(3))) if err != nil { Usage() return } argvalue2 := services.ResourceType(tmp2) value2 := argvalue2 arg1488 := flag.Arg(4) mbTrans1489 := thrift.NewTMemoryBufferLen(len(arg1488)) defer mbTrans1489.Close() _, err1490 := mbTrans1489.WriteString(arg1488) if err1490 != nil { Usage() return } factory1491 := thrift.NewTSimpleJSONProtocolFactory() jsProt1492 := factory1491.GetProtocol(mbTrans1489) containerStruct3 := services.NewAddTagArgs() err1493 := containerStruct3.ReadField4(jsProt1492) if err1493 != nil { Usage() return } argvalue3 := containerStruct3.Tags value3 := argvalue3 arg1494 := flag.Arg(5) mbTrans1495 := thrift.NewTMemoryBufferLen(len(arg1494)) defer mbTrans1495.Close() _, err1496 := mbTrans1495.WriteString(arg1494) if err1496 != nil { Usage() return } factory1497 := thrift.NewTSimpleJSONProtocolFactory() jsProt1498 := factory1497.GetProtocol(mbTrans1495) argvalue4 := services.NewFromInfo() err1499 := argvalue4.Read(jsProt1498) if err1499 != nil { Usage() return } value4 := argvalue4 fmt.Print(client.AddTag(value0, value1, value2, value3, value4)) fmt.Print("\n") break case "getTags": if flag.NArg()-1 != 3 { fmt.Fprintln(os.Stderr, "GetTags requires 3 args") flag.Usage() } argvalue0, err1500 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1500 != nil { Usage() return } value0 := argvalue0 argvalue1, err1501 := (strconv.ParseInt(flag.Arg(2), 10, 64)) if err1501 != nil { Usage() return } value1 := argvalue1 arg1502 := flag.Arg(3) mbTrans1503 := thrift.NewTMemoryBufferLen(len(arg1502)) defer mbTrans1503.Close() _, err1504 := mbTrans1503.WriteString(arg1502) if err1504 != nil { Usage() return } factory1505 := thrift.NewTSimpleJSONProtocolFactory() jsProt1506 := factory1505.GetProtocol(mbTrans1503) argvalue2 := services.NewFromInfo() err1507 := argvalue2.Read(jsProt1506) if err1507 != nil { Usage() return } value2 := argvalue2 fmt.Print(client.GetTags(value0, value1, value2)) fmt.Print("\n") break case "getTagsByUid": if flag.NArg()-1 != 4 { fmt.Fprintln(os.Stderr, "GetTagsByUid requires 4 args") flag.Usage() } argvalue0, err1508 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1508 != nil { Usage() return } value0 := argvalue0 argvalue1, err1509 := (strconv.ParseInt(flag.Arg(2), 10, 64)) if err1509 != nil { Usage() return } value1 := argvalue1 tmp2, err1510 := (strconv.Atoi(flag.Arg(3))) if err1510 != nil { Usage() return } argvalue2 := int32(tmp2) value2 := argvalue2 arg1511 := flag.Arg(4) mbTrans1512 := thrift.NewTMemoryBufferLen(len(arg1511)) defer mbTrans1512.Close() _, err1513 := mbTrans1512.WriteString(arg1511) if err1513 != nil { Usage() return } factory1514 := thrift.NewTSimpleJSONProtocolFactory() jsProt1515 := factory1514.GetProtocol(mbTrans1512) argvalue3 := services.NewFromInfo() err1516 := argvalue3.Read(jsProt1515) if err1516 != nil { Usage() return } value3 := argvalue3 fmt.Print(client.GetTagsByUid(value0, value1, value2, value3)) fmt.Print("\n") break case "updateTags": if flag.NArg()-1 != 5 { fmt.Fprintln(os.Stderr, "UpdateTags requires 5 args") flag.Usage() } argvalue0, err1517 := (strconv.ParseInt(flag.Arg(1), 10, 64)) if err1517 != nil { Usage() return } value0 := argvalue0 argvalue1, err1518 := (strconv.ParseInt(flag.Arg(2), 10, 64)) if err1518 != nil { Usage() return } value1 := argvalue1 tmp2, err := (strconv.Atoi(flag.Arg(3))) if err != nil { Usage() return } argvalue2 := services.ResourceType(tmp2) value2 := argvalue2 arg1519 := flag.Arg(4) mbTrans1520 := thrift.NewTMemoryBufferLen(len(arg1519)) defer mbTrans1520.Close() _, err1521 := mbTrans1520.WriteString(arg1519) if err1521 != nil { Usage() return } factory1522 := thrift.NewTSimpleJSONProtocolFactory() jsProt1523 := factory1522.GetProtocol(mbTrans1520) containerStruct3 := services.NewUpdateTagsArgs() err1524 := containerStruct3.ReadField4(jsProt1523) if err1524 != nil { Usage() return } argvalue3 := containerStruct3.Tags value3 := argvalue3 arg1525 := flag.Arg(5) mbTrans1526 := thrift.NewTMemoryBufferLen(len(arg1525)) defer mbTrans1526.Close() _, err1527 := mbTrans1526.WriteString(arg1525) if err1527 != nil { Usage() return } factory1528 := thrift.NewTSimpleJSONProtocolFactory() jsProt1529 := factory1528.GetProtocol(mbTrans1526) argvalue4 := services.NewFromInfo() err1530 := argvalue4.Read(jsProt1529) if err1530 != nil { Usage() return } value4 := argvalue4 fmt.Print(client.UpdateTags(value0, value1, value2, value3, value4)) 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.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.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) } }
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) } }