Exemplo n.º 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 := servicessync.NewResourceManagerSyncClientFactory(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 != 2 {
			fmt.Fprintln(os.Stderr, "CreateResource requires 2 args")
			flag.Usage()
		}
		argvalue0, err313 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err313 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg314 := flag.Arg(2)
		mbTrans315 := thrift.NewTMemoryBufferLen(len(arg314))
		defer mbTrans315.Close()
		_, err316 := mbTrans315.WriteString(arg314)
		if err316 != nil {
			Usage()
			return
		}
		factory317 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt318 := factory317.GetProtocol(mbTrans315)
		argvalue1 := servicessync.NewResource()
		err319 := argvalue1.Read(jsProt318)
		if err319 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.CreateResource(value0, value1))
		fmt.Print("\n")
		break
	case "getResource":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetResource requires 1 args")
			flag.Usage()
		}
		argvalue0, err320 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err320 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetResource(value0))
		fmt.Print("\n")
		break
	case "getResourceInfo":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetResourceInfo requires 1 args")
			flag.Usage()
		}
		argvalue0, err321 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err321 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetResourceInfo(value0))
		fmt.Print("\n")
		break
	case "updateResource":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "UpdateResource requires 2 args")
			flag.Usage()
		}
		arg322 := flag.Arg(1)
		mbTrans323 := thrift.NewTMemoryBufferLen(len(arg322))
		defer mbTrans323.Close()
		_, err324 := mbTrans323.WriteString(arg322)
		if err324 != nil {
			Usage()
			return
		}
		factory325 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt326 := factory325.GetProtocol(mbTrans323)
		argvalue0 := servicessync.NewResource()
		err327 := argvalue0.Read(jsProt326)
		if err327 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err328 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err328 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.UpdateResource(value0, value1))
		fmt.Print("\n")
		break
	case "deleteResource":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "DeleteResource requires 2 args")
			flag.Usage()
		}
		argvalue0, err329 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err329 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err330 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err330 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.DeleteResource(value0, value1))
		fmt.Print("\n")
		break
	case "shareResource":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "ShareResource requires 4 args")
			flag.Usage()
		}
		arg331 := flag.Arg(1)
		mbTrans332 := thrift.NewTMemoryBufferLen(len(arg331))
		defer mbTrans332.Close()
		_, err333 := mbTrans332.WriteString(arg331)
		if err333 != nil {
			Usage()
			return
		}
		factory334 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt335 := factory334.GetProtocol(mbTrans332)
		argvalue0 := servicessync.NewResource()
		err336 := argvalue0.Read(jsProt335)
		if err336 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg337 := flag.Arg(2)
		mbTrans338 := thrift.NewTMemoryBufferLen(len(arg337))
		defer mbTrans338.Close()
		_, err339 := mbTrans338.WriteString(arg337)
		if err339 != nil {
			Usage()
			return
		}
		factory340 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt341 := factory340.GetProtocol(mbTrans338)
		containerStruct1 := servicessync.NewShareResourceArgs()
		err342 := containerStruct1.ReadField2(jsProt341)
		if err342 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.ShareGroups
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.Zone(tmp2)
		value2 := argvalue2
		argvalue3, err343 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err343 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.ShareResource(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getSharedResources":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "GetSharedResources requires 8 args")
			flag.Usage()
		}
		argvalue0, err344 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err344 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := servicessync.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err345 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err345 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err346 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err346 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err347 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err347 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6 := flag.Arg(7) == "true"
		value6 := argvalue6
		tmp7, err349 := (strconv.Atoi(flag.Arg(8)))
		if err349 != nil {
			Usage()
			return
		}
		argvalue7 := int32(tmp7)
		value7 := argvalue7
		fmt.Print(client.GetSharedResources(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "cancelSharedResource":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CancelSharedResource requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.CancelSharedResource(value0))
		fmt.Print("\n")
		break
	case "getUserResources":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "GetUserResources requires 7 args")
			flag.Usage()
		}
		argvalue0, err351 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err351 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := servicessync.ResourceType(tmp1)
		value1 := argvalue1
		argvalue2, err352 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err352 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err353 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err353 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err354 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err354 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		tmp6, err356 := (strconv.Atoi(flag.Arg(7)))
		if err356 != nil {
			Usage()
			return
		}
		argvalue6 := int32(tmp6)
		value6 := argvalue6
		fmt.Print(client.GetUserResources(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "addComment":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "AddComment requires 1 args")
			flag.Usage()
		}
		arg357 := flag.Arg(1)
		mbTrans358 := thrift.NewTMemoryBufferLen(len(arg357))
		defer mbTrans358.Close()
		_, err359 := mbTrans358.WriteString(arg357)
		if err359 != nil {
			Usage()
			return
		}
		factory360 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt361 := factory360.GetProtocol(mbTrans358)
		argvalue0 := servicessync.NewComment()
		err362 := argvalue0.Read(jsProt361)
		if err362 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.AddComment(value0))
		fmt.Print("\n")
		break
	case "deleteComment":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "DeleteComment requires 4 args")
			flag.Usage()
		}
		argvalue0, err363 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err363 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err364 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err364 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err365 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err365 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err366 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err366 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.DeleteComment(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getComments":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "GetComments requires 6 args")
			flag.Usage()
		}
		argvalue0, err367 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err367 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err368 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err368 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2, err369 := (strconv.ParseInt(flag.Arg(3), 10, 64))
		if err369 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		argvalue3, err370 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err370 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5) == "true"
		value4 := argvalue4
		tmp5, err372 := (strconv.Atoi(flag.Arg(6)))
		if err372 != nil {
			Usage()
			return
		}
		argvalue5 := int32(tmp5)
		value5 := argvalue5
		fmt.Print(client.GetComments(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "operateThumb":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "OperateThumb requires 4 args")
			flag.Usage()
		}
		argvalue0, err373 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err373 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err374 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err374 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ThumbType(tmp2)
		value2 := argvalue2
		argvalue3, err375 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err375 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.OperateThumb(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getThumbs":
		if flag.NArg()-1 != 7 {
			fmt.Fprintln(os.Stderr, "GetThumbs requires 7 args")
			flag.Usage()
		}
		argvalue0, err376 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err376 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err377 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err377 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ThumbType(tmp2)
		value2 := argvalue2
		argvalue3, err378 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err378 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err379 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err379 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		tmp6, err381 := (strconv.Atoi(flag.Arg(7)))
		if err381 != nil {
			Usage()
			return
		}
		argvalue6 := int32(tmp6)
		value6 := argvalue6
		fmt.Print(client.GetThumbs(value0, value1, value2, value3, value4, value5, value6))
		fmt.Print("\n")
		break
	case "getResources":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "GetResources requires 4 args")
			flag.Usage()
		}
		argvalue0, err382 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err382 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err383 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err383 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2 := flag.Arg(3) == "true"
		value2 := argvalue2
		tmp3, err385 := (strconv.Atoi(flag.Arg(4)))
		if err385 != nil {
			Usage()
			return
		}
		argvalue3 := int32(tmp3)
		value3 := argvalue3
		fmt.Print(client.GetResources(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "getLatestResourcesByGid":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetLatestResourcesByGid requires 2 args")
			flag.Usage()
		}
		argvalue0, err386 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err386 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err387 := (strconv.Atoi(flag.Arg(2)))
		if err387 != nil {
			Usage()
			return
		}
		argvalue1 := int32(tmp1)
		value1 := argvalue1
		fmt.Print(client.GetLatestResourcesByGid(value0, value1))
		fmt.Print("\n")
		break
	case "getResourceForOperationPlatform":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetResourceForOperationPlatform requires 1 args")
			flag.Usage()
		}
		argvalue0, err388 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err388 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetResourceForOperationPlatform(value0))
		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 := servicessync.NewResourceCategoryManagerSyncClientFactory(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 != 5 {
			fmt.Fprintln(os.Stderr, "GetChildren requires 5 args")
			flag.Usage()
		}
		argvalue0, err580 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err580 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err581 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err581 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err582 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err582 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err583 := (strconv.Atoi(flag.Arg(5)))
		if err583 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		fmt.Print(client.GetChildren(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "getChildrenByType":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "GetChildrenByType requires 5 args")
			flag.Usage()
		}
		argvalue0, err584 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err584 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err585 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err585 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err586 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err586 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err587 := (strconv.Atoi(flag.Arg(5)))
		if err587 != nil {
			Usage()
			return
		}
		argvalue4 := int32(tmp4)
		value4 := argvalue4
		fmt.Print(client.GetChildrenByType(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "removeChild":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "RemoveChild requires 4 args")
			flag.Usage()
		}
		argvalue0, err588 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err588 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err589 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err589 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err590 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err590 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.RemoveChild(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "moveChild":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "MoveChild requires 5 args")
			flag.Usage()
		}
		argvalue0, err591 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err591 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err592 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err592 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err593 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err593 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err594 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err594 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		fmt.Print(client.MoveChild(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "renameChild":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "RenameChild requires 5 args")
			flag.Usage()
		}
		argvalue0, err595 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err595 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err596 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err596 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err597 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err597 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4 := flag.Arg(5)
		value4 := argvalue4
		fmt.Print(client.RenameChild(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "createCategory":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "CreateCategory requires 3 args")
			flag.Usage()
		}
		argvalue0, err599 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err599 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err600 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err600 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		fmt.Print(client.CreateCategory(value0, value1, value2))
		fmt.Print("\n")
		break
	case "assignCategory":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "AssignCategory requires 5 args")
			flag.Usage()
		}
		argvalue0, err602 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err602 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err603 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err603 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		arg604 := flag.Arg(3)
		mbTrans605 := thrift.NewTMemoryBufferLen(len(arg604))
		defer mbTrans605.Close()
		_, err606 := mbTrans605.WriteString(arg604)
		if err606 != nil {
			Usage()
			return
		}
		factory607 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt608 := factory607.GetProtocol(mbTrans605)
		argvalue2 := servicessync.NewResource()
		err609 := argvalue2.Read(jsProt608)
		if err609 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		tmp3, err := (strconv.Atoi(flag.Arg(4)))
		if err != nil {
			Usage()
			return
		}
		argvalue3 := servicessync.Zone(tmp3)
		value3 := argvalue3
		argvalue4 := flag.Arg(5)
		value4 := argvalue4
		fmt.Print(client.AssignCategory(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "assignResourceZone":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "AssignResourceZone requires 6 args")
			flag.Usage()
		}
		argvalue0, err611 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err611 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1, err612 := (strconv.ParseInt(flag.Arg(2), 10, 64))
		if err612 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceNodeType(tmp2)
		value2 := argvalue2
		argvalue3, err613 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err613 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		tmp4, err := (strconv.Atoi(flag.Arg(5)))
		if err != nil {
			Usage()
			return
		}
		argvalue4 := servicessync.Zone(tmp4)
		value4 := argvalue4
		argvalue5 := flag.Arg(6)
		value5 := argvalue5
		fmt.Print(client.AssignResourceZone(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "getUnclassifiedGroupResources":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "GetUnclassifiedGroupResources requires 8 args")
			flag.Usage()
		}
		argvalue0, err615 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err615 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := servicessync.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err616 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err616 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err617 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err617 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err618 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err618 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6 := flag.Arg(7) == "true"
		value6 := argvalue6
		tmp7, err620 := (strconv.Atoi(flag.Arg(8)))
		if err620 != nil {
			Usage()
			return
		}
		argvalue7 := int32(tmp7)
		value7 := argvalue7
		fmt.Print(client.GetUnclassifiedGroupResources(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "getUnclassifiedGroupResourcesByType":
		if flag.NArg()-1 != 8 {
			fmt.Fprintln(os.Stderr, "GetUnclassifiedGroupResourcesByType requires 8 args")
			flag.Usage()
		}
		argvalue0, err621 := (strconv.ParseInt(flag.Arg(1), 10, 64))
		if err621 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := servicessync.Zone(tmp1)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := servicessync.ResourceType(tmp2)
		value2 := argvalue2
		argvalue3, err622 := (strconv.ParseInt(flag.Arg(4), 10, 64))
		if err622 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		argvalue4, err623 := (strconv.ParseInt(flag.Arg(5), 10, 64))
		if err623 != nil {
			Usage()
			return
		}
		value4 := argvalue4
		argvalue5, err624 := (strconv.ParseInt(flag.Arg(6), 10, 64))
		if err624 != nil {
			Usage()
			return
		}
		value5 := argvalue5
		argvalue6 := flag.Arg(7) == "true"
		value6 := argvalue6
		tmp7, err626 := (strconv.Atoi(flag.Arg(8)))
		if err626 != nil {
			Usage()
			return
		}
		argvalue7 := int32(tmp7)
		value7 := argvalue7
		fmt.Print(client.GetUnclassifiedGroupResourcesByType(value0, value1, value2, value3, value4, value5, value6, value7))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}