// Autogenerated by Thrift Compiler (0.9.3)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

package main

import (
	"apache/aurora"
	"flag"
	"fmt"
	"git.apache.org/thrift.git/lib/go/thrift"
	"math"
	"net"
	"net/url"
	"os"
	"strconv"
	"strings"
)

func Usage() {
	fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:")
	flag.PrintDefaults()
	fmt.Fprintln(os.Stderr, "\nFunctions:")
	fmt.Fprintln(os.Stderr, "  Response createJob(JobConfiguration description)")
	fmt.Fprintln(os.Stderr, "  Response scheduleCronJob(JobConfiguration description)")
	fmt.Fprintln(os.Stderr, "  Response descheduleCronJob(JobKey job)")
	fmt.Fprintln(os.Stderr, "  Response startCronJob(JobKey job)")
	fmt.Fprintln(os.Stderr, "  Response restartShards(JobKey job,  shardIds)")
	fmt.Fprintln(os.Stderr, "  Response killTasks(JobKey job,  instances, string message)")
	fmt.Fprintln(os.Stderr, "  Response addInstances(InstanceKey key, i32 count)")
	fmt.Fprintln(os.Stderr, "  Response replaceCronTemplate(JobConfiguration config)")
	fmt.Fprintln(os.Stderr, "  Response startJobUpdate(JobUpdateRequest request, string message)")
	fmt.Fprintln(os.Stderr, "  Response pauseJobUpdate(JobUpdateKey key, string message)")
	fmt.Fprintln(os.Stderr, "  Response resumeJobUpdate(JobUpdateKey key, string message)")
	fmt.Fprintln(os.Stderr, "  Response abortJobUpdate(JobUpdateKey key, string message)")
	fmt.Fprintln(os.Stderr, "  Response rollbackJobUpdate(JobUpdateKey key, string message)")
	fmt.Fprintln(os.Stderr, "  Response pulseJobUpdate(JobUpdateKey key)")
	fmt.Fprintln(os.Stderr, "  Response getRoleSummary()")
	fmt.Fprintln(os.Stderr, "  Response getJobSummary(string role)")
	fmt.Fprintln(os.Stderr, "  Response getTasksStatus(TaskQuery query)")
	fmt.Fprintln(os.Stderr, "  Response getTasksWithoutConfigs(TaskQuery query)")
	fmt.Fprintln(os.Stderr, "  Response getPendingReason(TaskQuery query)")
	fmt.Fprintln(os.Stderr, "  Response getConfigSummary(JobKey job)")
	fmt.Fprintln(os.Stderr, "  Response getJobs(string ownerRole)")
	fmt.Fprintln(os.Stderr, "  Response getQuota(string ownerRole)")
	fmt.Fprintln(os.Stderr, "  Response populateJobConfig(JobConfiguration description)")
	fmt.Fprintln(os.Stderr, "  Response getJobUpdateSummaries(JobUpdateQuery jobUpdateQuery)")
	fmt.Fprintln(os.Stderr, "  Response getJobUpdateDetails(JobUpdateQuery query)")
	fmt.Fprintln(os.Stderr, "  Response getJobUpdateDiff(JobUpdateRequest request)")
	fmt.Fprintln(os.Stderr, "  Response getTierConfigs()")
	fmt.Fprintln(os.Stderr)
	os.Exit(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 := aurora.NewAuroraSchedulerManagerClientFactory(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 "createJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CreateJob requires 1 args")
			flag.Usage()
		}
		arg163 := flag.Arg(1)
		mbTrans164 := thrift.NewTMemoryBufferLen(len(arg163))
		defer mbTrans164.Close()
		_, err165 := mbTrans164.WriteString(arg163)
		if err165 != nil {
			Usage()
			return
		}
		factory166 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt167 := factory166.GetProtocol(mbTrans164)
		argvalue0 := aurora.NewJobConfiguration()
		err168 := argvalue0.Read(jsProt167)
		if err168 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.CreateJob(value0))
		fmt.Print("\n")
		break
	case "scheduleCronJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "ScheduleCronJob requires 1 args")
			flag.Usage()
		}
		arg169 := flag.Arg(1)
		mbTrans170 := thrift.NewTMemoryBufferLen(len(arg169))
		defer mbTrans170.Close()
		_, err171 := mbTrans170.WriteString(arg169)
		if err171 != nil {
			Usage()
			return
		}
		factory172 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt173 := factory172.GetProtocol(mbTrans170)
		argvalue0 := aurora.NewJobConfiguration()
		err174 := argvalue0.Read(jsProt173)
		if err174 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.ScheduleCronJob(value0))
		fmt.Print("\n")
		break
	case "descheduleCronJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "DescheduleCronJob requires 1 args")
			flag.Usage()
		}
		arg175 := flag.Arg(1)
		mbTrans176 := thrift.NewTMemoryBufferLen(len(arg175))
		defer mbTrans176.Close()
		_, err177 := mbTrans176.WriteString(arg175)
		if err177 != nil {
			Usage()
			return
		}
		factory178 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt179 := factory178.GetProtocol(mbTrans176)
		argvalue0 := aurora.NewJobKey()
		err180 := argvalue0.Read(jsProt179)
		if err180 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.DescheduleCronJob(value0))
		fmt.Print("\n")
		break
	case "startCronJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "StartCronJob requires 1 args")
			flag.Usage()
		}
		arg181 := flag.Arg(1)
		mbTrans182 := thrift.NewTMemoryBufferLen(len(arg181))
		defer mbTrans182.Close()
		_, err183 := mbTrans182.WriteString(arg181)
		if err183 != nil {
			Usage()
			return
		}
		factory184 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt185 := factory184.GetProtocol(mbTrans182)
		argvalue0 := aurora.NewJobKey()
		err186 := argvalue0.Read(jsProt185)
		if err186 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.StartCronJob(value0))
		fmt.Print("\n")
		break
	case "restartShards":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "RestartShards requires 2 args")
			flag.Usage()
		}
		arg187 := flag.Arg(1)
		mbTrans188 := thrift.NewTMemoryBufferLen(len(arg187))
		defer mbTrans188.Close()
		_, err189 := mbTrans188.WriteString(arg187)
		if err189 != nil {
			Usage()
			return
		}
		factory190 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt191 := factory190.GetProtocol(mbTrans188)
		argvalue0 := aurora.NewJobKey()
		err192 := argvalue0.Read(jsProt191)
		if err192 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg193 := flag.Arg(2)
		mbTrans194 := thrift.NewTMemoryBufferLen(len(arg193))
		defer mbTrans194.Close()
		_, err195 := mbTrans194.WriteString(arg193)
		if err195 != nil {
			Usage()
			return
		}
		factory196 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt197 := factory196.GetProtocol(mbTrans194)
		containerStruct1 := aurora.NewAuroraSchedulerManagerRestartShardsArgs()
		err198 := containerStruct1.ReadField2(jsProt197)
		if err198 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.ShardIds
		value1 := argvalue1
		fmt.Print(client.RestartShards(value0, value1))
		fmt.Print("\n")
		break
	case "killTasks":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "KillTasks requires 3 args")
			flag.Usage()
		}
		arg199 := flag.Arg(1)
		mbTrans200 := thrift.NewTMemoryBufferLen(len(arg199))
		defer mbTrans200.Close()
		_, err201 := mbTrans200.WriteString(arg199)
		if err201 != nil {
			Usage()
			return
		}
		factory202 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt203 := factory202.GetProtocol(mbTrans200)
		argvalue0 := aurora.NewJobKey()
		err204 := argvalue0.Read(jsProt203)
		if err204 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg205 := flag.Arg(2)
		mbTrans206 := thrift.NewTMemoryBufferLen(len(arg205))
		defer mbTrans206.Close()
		_, err207 := mbTrans206.WriteString(arg205)
		if err207 != nil {
			Usage()
			return
		}
		factory208 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt209 := factory208.GetProtocol(mbTrans206)
		containerStruct1 := aurora.NewAuroraSchedulerManagerKillTasksArgs()
		err210 := containerStruct1.ReadField2(jsProt209)
		if err210 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.Instances
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		fmt.Print(client.KillTasks(value0, value1, value2))
		fmt.Print("\n")
		break
	case "addInstances":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AddInstances requires 2 args")
			flag.Usage()
		}
		arg212 := flag.Arg(1)
		mbTrans213 := thrift.NewTMemoryBufferLen(len(arg212))
		defer mbTrans213.Close()
		_, err214 := mbTrans213.WriteString(arg212)
		if err214 != nil {
			Usage()
			return
		}
		factory215 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt216 := factory215.GetProtocol(mbTrans213)
		argvalue0 := aurora.NewInstanceKey()
		err217 := argvalue0.Read(jsProt216)
		if err217 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err218 := (strconv.Atoi(flag.Arg(2)))
		if err218 != nil {
			Usage()
			return
		}
		argvalue1 := int32(tmp1)
		value1 := argvalue1
		fmt.Print(client.AddInstances(value0, value1))
		fmt.Print("\n")
		break
	case "replaceCronTemplate":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "ReplaceCronTemplate requires 1 args")
			flag.Usage()
		}
		arg219 := flag.Arg(1)
		mbTrans220 := thrift.NewTMemoryBufferLen(len(arg219))
		defer mbTrans220.Close()
		_, err221 := mbTrans220.WriteString(arg219)
		if err221 != nil {
			Usage()
			return
		}
		factory222 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt223 := factory222.GetProtocol(mbTrans220)
		argvalue0 := aurora.NewJobConfiguration()
		err224 := argvalue0.Read(jsProt223)
		if err224 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.ReplaceCronTemplate(value0))
		fmt.Print("\n")
		break
	case "startJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "StartJobUpdate requires 2 args")
			flag.Usage()
		}
		arg225 := flag.Arg(1)
		mbTrans226 := thrift.NewTMemoryBufferLen(len(arg225))
		defer mbTrans226.Close()
		_, err227 := mbTrans226.WriteString(arg225)
		if err227 != nil {
			Usage()
			return
		}
		factory228 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt229 := factory228.GetProtocol(mbTrans226)
		argvalue0 := aurora.NewJobUpdateRequest()
		err230 := argvalue0.Read(jsProt229)
		if err230 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.StartJobUpdate(value0, value1))
		fmt.Print("\n")
		break
	case "pauseJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "PauseJobUpdate requires 2 args")
			flag.Usage()
		}
		arg232 := flag.Arg(1)
		mbTrans233 := thrift.NewTMemoryBufferLen(len(arg232))
		defer mbTrans233.Close()
		_, err234 := mbTrans233.WriteString(arg232)
		if err234 != nil {
			Usage()
			return
		}
		factory235 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt236 := factory235.GetProtocol(mbTrans233)
		argvalue0 := aurora.NewJobUpdateKey()
		err237 := argvalue0.Read(jsProt236)
		if err237 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.PauseJobUpdate(value0, value1))
		fmt.Print("\n")
		break
	case "resumeJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args")
			flag.Usage()
		}
		arg239 := flag.Arg(1)
		mbTrans240 := thrift.NewTMemoryBufferLen(len(arg239))
		defer mbTrans240.Close()
		_, err241 := mbTrans240.WriteString(arg239)
		if err241 != nil {
			Usage()
			return
		}
		factory242 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt243 := factory242.GetProtocol(mbTrans240)
		argvalue0 := aurora.NewJobUpdateKey()
		err244 := argvalue0.Read(jsProt243)
		if err244 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.ResumeJobUpdate(value0, value1))
		fmt.Print("\n")
		break
	case "abortJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args")
			flag.Usage()
		}
		arg246 := flag.Arg(1)
		mbTrans247 := thrift.NewTMemoryBufferLen(len(arg246))
		defer mbTrans247.Close()
		_, err248 := mbTrans247.WriteString(arg246)
		if err248 != nil {
			Usage()
			return
		}
		factory249 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt250 := factory249.GetProtocol(mbTrans247)
		argvalue0 := aurora.NewJobUpdateKey()
		err251 := argvalue0.Read(jsProt250)
		if err251 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.AbortJobUpdate(value0, value1))
		fmt.Print("\n")
		break
	case "rollbackJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args")
			flag.Usage()
		}
		arg253 := flag.Arg(1)
		mbTrans254 := thrift.NewTMemoryBufferLen(len(arg253))
		defer mbTrans254.Close()
		_, err255 := mbTrans254.WriteString(arg253)
		if err255 != nil {
			Usage()
			return
		}
		factory256 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt257 := factory256.GetProtocol(mbTrans254)
		argvalue0 := aurora.NewJobUpdateKey()
		err258 := argvalue0.Read(jsProt257)
		if err258 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.RollbackJobUpdate(value0, value1))
		fmt.Print("\n")
		break
	case "pulseJobUpdate":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args")
			flag.Usage()
		}
		arg260 := flag.Arg(1)
		mbTrans261 := thrift.NewTMemoryBufferLen(len(arg260))
		defer mbTrans261.Close()
		_, err262 := mbTrans261.WriteString(arg260)
		if err262 != nil {
			Usage()
			return
		}
		factory263 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt264 := factory263.GetProtocol(mbTrans261)
		argvalue0 := aurora.NewJobUpdateKey()
		err265 := argvalue0.Read(jsProt264)
		if err265 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.PulseJobUpdate(value0))
		fmt.Print("\n")
		break
	case "getRoleSummary":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetRoleSummary requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetRoleSummary())
		fmt.Print("\n")
		break
	case "getJobSummary":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobSummary requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetJobSummary(value0))
		fmt.Print("\n")
		break
	case "getTasksStatus":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args")
			flag.Usage()
		}
		arg267 := flag.Arg(1)
		mbTrans268 := thrift.NewTMemoryBufferLen(len(arg267))
		defer mbTrans268.Close()
		_, err269 := mbTrans268.WriteString(arg267)
		if err269 != nil {
			Usage()
			return
		}
		factory270 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt271 := factory270.GetProtocol(mbTrans268)
		argvalue0 := aurora.NewTaskQuery()
		err272 := argvalue0.Read(jsProt271)
		if err272 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetTasksStatus(value0))
		fmt.Print("\n")
		break
	case "getTasksWithoutConfigs":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args")
			flag.Usage()
		}
		arg273 := flag.Arg(1)
		mbTrans274 := thrift.NewTMemoryBufferLen(len(arg273))
		defer mbTrans274.Close()
		_, err275 := mbTrans274.WriteString(arg273)
		if err275 != nil {
			Usage()
			return
		}
		factory276 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt277 := factory276.GetProtocol(mbTrans274)
		argvalue0 := aurora.NewTaskQuery()
		err278 := argvalue0.Read(jsProt277)
		if err278 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetTasksWithoutConfigs(value0))
		fmt.Print("\n")
		break
	case "getPendingReason":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args")
			flag.Usage()
		}
		arg279 := flag.Arg(1)
		mbTrans280 := thrift.NewTMemoryBufferLen(len(arg279))
		defer mbTrans280.Close()
		_, err281 := mbTrans280.WriteString(arg279)
		if err281 != nil {
			Usage()
			return
		}
		factory282 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt283 := factory282.GetProtocol(mbTrans280)
		argvalue0 := aurora.NewTaskQuery()
		err284 := argvalue0.Read(jsProt283)
		if err284 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetPendingReason(value0))
		fmt.Print("\n")
		break
	case "getConfigSummary":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args")
			flag.Usage()
		}
		arg285 := flag.Arg(1)
		mbTrans286 := thrift.NewTMemoryBufferLen(len(arg285))
		defer mbTrans286.Close()
		_, err287 := mbTrans286.WriteString(arg285)
		if err287 != nil {
			Usage()
			return
		}
		factory288 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt289 := factory288.GetProtocol(mbTrans286)
		argvalue0 := aurora.NewJobKey()
		err290 := argvalue0.Read(jsProt289)
		if err290 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetConfigSummary(value0))
		fmt.Print("\n")
		break
	case "getJobs":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobs requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetJobs(value0))
		fmt.Print("\n")
		break
	case "getQuota":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetQuota requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetQuota(value0))
		fmt.Print("\n")
		break
	case "populateJobConfig":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args")
			flag.Usage()
		}
		arg293 := flag.Arg(1)
		mbTrans294 := thrift.NewTMemoryBufferLen(len(arg293))
		defer mbTrans294.Close()
		_, err295 := mbTrans294.WriteString(arg293)
		if err295 != nil {
			Usage()
			return
		}
		factory296 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt297 := factory296.GetProtocol(mbTrans294)
		argvalue0 := aurora.NewJobConfiguration()
		err298 := argvalue0.Read(jsProt297)
		if err298 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.PopulateJobConfig(value0))
		fmt.Print("\n")
		break
	case "getJobUpdateSummaries":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args")
			flag.Usage()
		}
		arg299 := flag.Arg(1)
		mbTrans300 := thrift.NewTMemoryBufferLen(len(arg299))
		defer mbTrans300.Close()
		_, err301 := mbTrans300.WriteString(arg299)
		if err301 != nil {
			Usage()
			return
		}
		factory302 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt303 := factory302.GetProtocol(mbTrans300)
		argvalue0 := aurora.NewJobUpdateQuery()
		err304 := argvalue0.Read(jsProt303)
		if err304 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetJobUpdateSummaries(value0))
		fmt.Print("\n")
		break
	case "getJobUpdateDetails":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args")
			flag.Usage()
		}
		arg305 := flag.Arg(1)
		mbTrans306 := thrift.NewTMemoryBufferLen(len(arg305))
		defer mbTrans306.Close()
		_, err307 := mbTrans306.WriteString(arg305)
		if err307 != nil {
			Usage()
			return
		}
		factory308 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt309 := factory308.GetProtocol(mbTrans306)
		argvalue0 := aurora.NewJobUpdateQuery()
		err310 := argvalue0.Read(jsProt309)
		if err310 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetJobUpdateDetails(value0))
		fmt.Print("\n")
		break
	case "getJobUpdateDiff":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args")
			flag.Usage()
		}
		arg311 := flag.Arg(1)
		mbTrans312 := thrift.NewTMemoryBufferLen(len(arg311))
		defer mbTrans312.Close()
		_, err313 := mbTrans312.WriteString(arg311)
		if err313 != nil {
			Usage()
			return
		}
		factory314 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt315 := factory314.GetProtocol(mbTrans312)
		argvalue0 := aurora.NewJobUpdateRequest()
		err316 := argvalue0.Read(jsProt315)
		if err316 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetJobUpdateDiff(value0))
		fmt.Print("\n")
		break
	case "getTierConfigs":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetTierConfigs requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetTierConfigs())
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}
