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

package main

import (
	"apache/aurora"
	"context"
	"flag"
	"fmt"
	"math"
	"net"
	"net/url"
	"os"
	"strconv"
	"strings"

	"git.apache.org/thrift.git/lib/go/thrift"
)

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)
}

type httpHeaders map[string]string

func (h httpHeaders) String() string {
	var m map[string]string = h
	return fmt.Sprintf("%s", m)
}

func (h httpHeaders) Set(value string) error {
	parts := strings.Split(value, ": ")
	if len(parts) != 2 {
		return fmt.Errorf("header should be of format 'Key: Value'")
	}
	h[parts[0]] = parts[1]
	return nil
}

func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	headers := make(httpHeaders)
	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.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")")
	flag.Parse()

	if len(urlString) > 0 {
		var err error
		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" || parsedUrl.Scheme == "https"
	} 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())
		if len(headers) > 0 {
			httptrans := trans.(*thrift.THttpClient)
			for key, value := range headers {
				httptrans.SetHeader(key, value)
			}
		}
	} 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)
	}
	iprot := protocolFactory.GetProtocol(trans)
	oprot := protocolFactory.GetProtocol(trans)
	client := aurora.NewAuroraSchedulerManagerClient(thrift.NewTStandardClient(iprot, oprot))
	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()
		}
		arg162 := flag.Arg(1)
		mbTrans163 := thrift.NewTMemoryBufferLen(len(arg162))
		defer mbTrans163.Close()
		_, err164 := mbTrans163.WriteString(arg162)
		if err164 != nil {
			Usage()
			return
		}
		factory165 := thrift.NewTJSONProtocolFactory()
		jsProt166 := factory165.GetProtocol(mbTrans163)
		argvalue0 := aurora.NewJobConfiguration()
		err167 := argvalue0.Read(jsProt166)
		if err167 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.CreateJob(context.Background(), value0))
		fmt.Print("\n")
		break
	case "scheduleCronJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "ScheduleCronJob requires 1 args")
			flag.Usage()
		}
		arg168 := flag.Arg(1)
		mbTrans169 := thrift.NewTMemoryBufferLen(len(arg168))
		defer mbTrans169.Close()
		_, err170 := mbTrans169.WriteString(arg168)
		if err170 != nil {
			Usage()
			return
		}
		factory171 := thrift.NewTJSONProtocolFactory()
		jsProt172 := factory171.GetProtocol(mbTrans169)
		argvalue0 := aurora.NewJobConfiguration()
		err173 := argvalue0.Read(jsProt172)
		if err173 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.ScheduleCronJob(context.Background(), value0))
		fmt.Print("\n")
		break
	case "descheduleCronJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "DescheduleCronJob requires 1 args")
			flag.Usage()
		}
		arg174 := flag.Arg(1)
		mbTrans175 := thrift.NewTMemoryBufferLen(len(arg174))
		defer mbTrans175.Close()
		_, err176 := mbTrans175.WriteString(arg174)
		if err176 != nil {
			Usage()
			return
		}
		factory177 := thrift.NewTJSONProtocolFactory()
		jsProt178 := factory177.GetProtocol(mbTrans175)
		argvalue0 := aurora.NewJobKey()
		err179 := argvalue0.Read(jsProt178)
		if err179 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.DescheduleCronJob(context.Background(), value0))
		fmt.Print("\n")
		break
	case "startCronJob":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "StartCronJob requires 1 args")
			flag.Usage()
		}
		arg180 := flag.Arg(1)
		mbTrans181 := thrift.NewTMemoryBufferLen(len(arg180))
		defer mbTrans181.Close()
		_, err182 := mbTrans181.WriteString(arg180)
		if err182 != nil {
			Usage()
			return
		}
		factory183 := thrift.NewTJSONProtocolFactory()
		jsProt184 := factory183.GetProtocol(mbTrans181)
		argvalue0 := aurora.NewJobKey()
		err185 := argvalue0.Read(jsProt184)
		if err185 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.StartCronJob(context.Background(), value0))
		fmt.Print("\n")
		break
	case "restartShards":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "RestartShards requires 2 args")
			flag.Usage()
		}
		arg186 := flag.Arg(1)
		mbTrans187 := thrift.NewTMemoryBufferLen(len(arg186))
		defer mbTrans187.Close()
		_, err188 := mbTrans187.WriteString(arg186)
		if err188 != nil {
			Usage()
			return
		}
		factory189 := thrift.NewTJSONProtocolFactory()
		jsProt190 := factory189.GetProtocol(mbTrans187)
		argvalue0 := aurora.NewJobKey()
		err191 := argvalue0.Read(jsProt190)
		if err191 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg192 := flag.Arg(2)
		mbTrans193 := thrift.NewTMemoryBufferLen(len(arg192))
		defer mbTrans193.Close()
		_, err194 := mbTrans193.WriteString(arg192)
		if err194 != nil {
			Usage()
			return
		}
		factory195 := thrift.NewTJSONProtocolFactory()
		jsProt196 := factory195.GetProtocol(mbTrans193)
		containerStruct1 := aurora.NewAuroraSchedulerManagerRestartShardsArgs()
		err197 := containerStruct1.ReadField2(jsProt196)
		if err197 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.ShardIds
		value1 := argvalue1
		fmt.Print(client.RestartShards(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "killTasks":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "KillTasks requires 3 args")
			flag.Usage()
		}
		arg198 := flag.Arg(1)
		mbTrans199 := thrift.NewTMemoryBufferLen(len(arg198))
		defer mbTrans199.Close()
		_, err200 := mbTrans199.WriteString(arg198)
		if err200 != nil {
			Usage()
			return
		}
		factory201 := thrift.NewTJSONProtocolFactory()
		jsProt202 := factory201.GetProtocol(mbTrans199)
		argvalue0 := aurora.NewJobKey()
		err203 := argvalue0.Read(jsProt202)
		if err203 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg204 := flag.Arg(2)
		mbTrans205 := thrift.NewTMemoryBufferLen(len(arg204))
		defer mbTrans205.Close()
		_, err206 := mbTrans205.WriteString(arg204)
		if err206 != nil {
			Usage()
			return
		}
		factory207 := thrift.NewTJSONProtocolFactory()
		jsProt208 := factory207.GetProtocol(mbTrans205)
		containerStruct1 := aurora.NewAuroraSchedulerManagerKillTasksArgs()
		err209 := containerStruct1.ReadField2(jsProt208)
		if err209 != nil {
			Usage()
			return
		}
		argvalue1 := containerStruct1.Instances
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		fmt.Print(client.KillTasks(context.Background(), value0, value1, value2))
		fmt.Print("\n")
		break
	case "addInstances":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AddInstances requires 2 args")
			flag.Usage()
		}
		arg211 := flag.Arg(1)
		mbTrans212 := thrift.NewTMemoryBufferLen(len(arg211))
		defer mbTrans212.Close()
		_, err213 := mbTrans212.WriteString(arg211)
		if err213 != nil {
			Usage()
			return
		}
		factory214 := thrift.NewTJSONProtocolFactory()
		jsProt215 := factory214.GetProtocol(mbTrans212)
		argvalue0 := aurora.NewInstanceKey()
		err216 := argvalue0.Read(jsProt215)
		if err216 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		tmp1, err217 := (strconv.Atoi(flag.Arg(2)))
		if err217 != nil {
			Usage()
			return
		}
		argvalue1 := int32(tmp1)
		value1 := argvalue1
		fmt.Print(client.AddInstances(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "replaceCronTemplate":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "ReplaceCronTemplate requires 1 args")
			flag.Usage()
		}
		arg218 := flag.Arg(1)
		mbTrans219 := thrift.NewTMemoryBufferLen(len(arg218))
		defer mbTrans219.Close()
		_, err220 := mbTrans219.WriteString(arg218)
		if err220 != nil {
			Usage()
			return
		}
		factory221 := thrift.NewTJSONProtocolFactory()
		jsProt222 := factory221.GetProtocol(mbTrans219)
		argvalue0 := aurora.NewJobConfiguration()
		err223 := argvalue0.Read(jsProt222)
		if err223 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.ReplaceCronTemplate(context.Background(), value0))
		fmt.Print("\n")
		break
	case "startJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "StartJobUpdate requires 2 args")
			flag.Usage()
		}
		arg224 := flag.Arg(1)
		mbTrans225 := thrift.NewTMemoryBufferLen(len(arg224))
		defer mbTrans225.Close()
		_, err226 := mbTrans225.WriteString(arg224)
		if err226 != nil {
			Usage()
			return
		}
		factory227 := thrift.NewTJSONProtocolFactory()
		jsProt228 := factory227.GetProtocol(mbTrans225)
		argvalue0 := aurora.NewJobUpdateRequest()
		err229 := argvalue0.Read(jsProt228)
		if err229 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.StartJobUpdate(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "pauseJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "PauseJobUpdate requires 2 args")
			flag.Usage()
		}
		arg231 := flag.Arg(1)
		mbTrans232 := thrift.NewTMemoryBufferLen(len(arg231))
		defer mbTrans232.Close()
		_, err233 := mbTrans232.WriteString(arg231)
		if err233 != nil {
			Usage()
			return
		}
		factory234 := thrift.NewTJSONProtocolFactory()
		jsProt235 := factory234.GetProtocol(mbTrans232)
		argvalue0 := aurora.NewJobUpdateKey()
		err236 := argvalue0.Read(jsProt235)
		if err236 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.PauseJobUpdate(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "resumeJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "ResumeJobUpdate requires 2 args")
			flag.Usage()
		}
		arg238 := flag.Arg(1)
		mbTrans239 := thrift.NewTMemoryBufferLen(len(arg238))
		defer mbTrans239.Close()
		_, err240 := mbTrans239.WriteString(arg238)
		if err240 != nil {
			Usage()
			return
		}
		factory241 := thrift.NewTJSONProtocolFactory()
		jsProt242 := factory241.GetProtocol(mbTrans239)
		argvalue0 := aurora.NewJobUpdateKey()
		err243 := argvalue0.Read(jsProt242)
		if err243 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.ResumeJobUpdate(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "abortJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AbortJobUpdate requires 2 args")
			flag.Usage()
		}
		arg245 := flag.Arg(1)
		mbTrans246 := thrift.NewTMemoryBufferLen(len(arg245))
		defer mbTrans246.Close()
		_, err247 := mbTrans246.WriteString(arg245)
		if err247 != nil {
			Usage()
			return
		}
		factory248 := thrift.NewTJSONProtocolFactory()
		jsProt249 := factory248.GetProtocol(mbTrans246)
		argvalue0 := aurora.NewJobUpdateKey()
		err250 := argvalue0.Read(jsProt249)
		if err250 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.AbortJobUpdate(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "rollbackJobUpdate":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "RollbackJobUpdate requires 2 args")
			flag.Usage()
		}
		arg252 := flag.Arg(1)
		mbTrans253 := thrift.NewTMemoryBufferLen(len(arg252))
		defer mbTrans253.Close()
		_, err254 := mbTrans253.WriteString(arg252)
		if err254 != nil {
			Usage()
			return
		}
		factory255 := thrift.NewTJSONProtocolFactory()
		jsProt256 := factory255.GetProtocol(mbTrans253)
		argvalue0 := aurora.NewJobUpdateKey()
		err257 := argvalue0.Read(jsProt256)
		if err257 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.RollbackJobUpdate(context.Background(), value0, value1))
		fmt.Print("\n")
		break
	case "pulseJobUpdate":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "PulseJobUpdate requires 1 args")
			flag.Usage()
		}
		arg259 := flag.Arg(1)
		mbTrans260 := thrift.NewTMemoryBufferLen(len(arg259))
		defer mbTrans260.Close()
		_, err261 := mbTrans260.WriteString(arg259)
		if err261 != nil {
			Usage()
			return
		}
		factory262 := thrift.NewTJSONProtocolFactory()
		jsProt263 := factory262.GetProtocol(mbTrans260)
		argvalue0 := aurora.NewJobUpdateKey()
		err264 := argvalue0.Read(jsProt263)
		if err264 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.PulseJobUpdate(context.Background(), 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(context.Background()))
		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(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getTasksStatus":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetTasksStatus requires 1 args")
			flag.Usage()
		}
		arg266 := flag.Arg(1)
		mbTrans267 := thrift.NewTMemoryBufferLen(len(arg266))
		defer mbTrans267.Close()
		_, err268 := mbTrans267.WriteString(arg266)
		if err268 != nil {
			Usage()
			return
		}
		factory269 := thrift.NewTJSONProtocolFactory()
		jsProt270 := factory269.GetProtocol(mbTrans267)
		argvalue0 := aurora.NewTaskQuery()
		err271 := argvalue0.Read(jsProt270)
		if err271 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetTasksStatus(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getTasksWithoutConfigs":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetTasksWithoutConfigs requires 1 args")
			flag.Usage()
		}
		arg272 := flag.Arg(1)
		mbTrans273 := thrift.NewTMemoryBufferLen(len(arg272))
		defer mbTrans273.Close()
		_, err274 := mbTrans273.WriteString(arg272)
		if err274 != nil {
			Usage()
			return
		}
		factory275 := thrift.NewTJSONProtocolFactory()
		jsProt276 := factory275.GetProtocol(mbTrans273)
		argvalue0 := aurora.NewTaskQuery()
		err277 := argvalue0.Read(jsProt276)
		if err277 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetTasksWithoutConfigs(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getPendingReason":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetPendingReason requires 1 args")
			flag.Usage()
		}
		arg278 := flag.Arg(1)
		mbTrans279 := thrift.NewTMemoryBufferLen(len(arg278))
		defer mbTrans279.Close()
		_, err280 := mbTrans279.WriteString(arg278)
		if err280 != nil {
			Usage()
			return
		}
		factory281 := thrift.NewTJSONProtocolFactory()
		jsProt282 := factory281.GetProtocol(mbTrans279)
		argvalue0 := aurora.NewTaskQuery()
		err283 := argvalue0.Read(jsProt282)
		if err283 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetPendingReason(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getConfigSummary":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetConfigSummary requires 1 args")
			flag.Usage()
		}
		arg284 := flag.Arg(1)
		mbTrans285 := thrift.NewTMemoryBufferLen(len(arg284))
		defer mbTrans285.Close()
		_, err286 := mbTrans285.WriteString(arg284)
		if err286 != nil {
			Usage()
			return
		}
		factory287 := thrift.NewTJSONProtocolFactory()
		jsProt288 := factory287.GetProtocol(mbTrans285)
		argvalue0 := aurora.NewJobKey()
		err289 := argvalue0.Read(jsProt288)
		if err289 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetConfigSummary(context.Background(), 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(context.Background(), 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(context.Background(), value0))
		fmt.Print("\n")
		break
	case "populateJobConfig":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "PopulateJobConfig requires 1 args")
			flag.Usage()
		}
		arg292 := flag.Arg(1)
		mbTrans293 := thrift.NewTMemoryBufferLen(len(arg292))
		defer mbTrans293.Close()
		_, err294 := mbTrans293.WriteString(arg292)
		if err294 != nil {
			Usage()
			return
		}
		factory295 := thrift.NewTJSONProtocolFactory()
		jsProt296 := factory295.GetProtocol(mbTrans293)
		argvalue0 := aurora.NewJobConfiguration()
		err297 := argvalue0.Read(jsProt296)
		if err297 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.PopulateJobConfig(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getJobUpdateSummaries":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobUpdateSummaries requires 1 args")
			flag.Usage()
		}
		arg298 := flag.Arg(1)
		mbTrans299 := thrift.NewTMemoryBufferLen(len(arg298))
		defer mbTrans299.Close()
		_, err300 := mbTrans299.WriteString(arg298)
		if err300 != nil {
			Usage()
			return
		}
		factory301 := thrift.NewTJSONProtocolFactory()
		jsProt302 := factory301.GetProtocol(mbTrans299)
		argvalue0 := aurora.NewJobUpdateQuery()
		err303 := argvalue0.Read(jsProt302)
		if err303 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetJobUpdateSummaries(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getJobUpdateDetails":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobUpdateDetails requires 1 args")
			flag.Usage()
		}
		arg304 := flag.Arg(1)
		mbTrans305 := thrift.NewTMemoryBufferLen(len(arg304))
		defer mbTrans305.Close()
		_, err306 := mbTrans305.WriteString(arg304)
		if err306 != nil {
			Usage()
			return
		}
		factory307 := thrift.NewTJSONProtocolFactory()
		jsProt308 := factory307.GetProtocol(mbTrans305)
		argvalue0 := aurora.NewJobUpdateQuery()
		err309 := argvalue0.Read(jsProt308)
		if err309 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetJobUpdateDetails(context.Background(), value0))
		fmt.Print("\n")
		break
	case "getJobUpdateDiff":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetJobUpdateDiff requires 1 args")
			flag.Usage()
		}
		arg310 := flag.Arg(1)
		mbTrans311 := thrift.NewTMemoryBufferLen(len(arg310))
		defer mbTrans311.Close()
		_, err312 := mbTrans311.WriteString(arg310)
		if err312 != nil {
			Usage()
			return
		}
		factory313 := thrift.NewTJSONProtocolFactory()
		jsProt314 := factory313.GetProtocol(mbTrans311)
		argvalue0 := aurora.NewJobUpdateRequest()
		err315 := argvalue0.Read(jsProt314)
		if err315 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GetJobUpdateDiff(context.Background(), 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(context.Background()))
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}
