#
# Autogenerated by Thrift Compiler (1.0.0-dev)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING



# types encapsulating arguments and return values of method OpenSession

type OpenSession_args
  req::TOpenSessionReq
  OpenSession_args() = (o=new(); fillunset(o); o)
end # type OpenSession_args

type OpenSession_result
  success::TOpenSessionResp
  OpenSession_result() = (o=new(); fillunset(o); o)
  OpenSession_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type OpenSession_result
meta(t::Type{OpenSession_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method CloseSession

type CloseSession_args
  req::TCloseSessionReq
  CloseSession_args() = (o=new(); fillunset(o); o)
end # type CloseSession_args

type CloseSession_result
  success::TCloseSessionResp
  CloseSession_result() = (o=new(); fillunset(o); o)
  CloseSession_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type CloseSession_result
meta(t::Type{CloseSession_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetInfo

type GetInfo_args
  req::TGetInfoReq
  GetInfo_args() = (o=new(); fillunset(o); o)
end # type GetInfo_args

type GetInfo_result
  success::TGetInfoResp
  GetInfo_result() = (o=new(); fillunset(o); o)
  GetInfo_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetInfo_result
meta(t::Type{GetInfo_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method ExecuteStatement

type ExecuteStatement_args
  req::TExecuteStatementReq
  ExecuteStatement_args() = (o=new(); fillunset(o); o)
end # type ExecuteStatement_args

type ExecuteStatement_result
  success::TExecuteStatementResp
  ExecuteStatement_result() = (o=new(); fillunset(o); o)
  ExecuteStatement_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type ExecuteStatement_result
meta(t::Type{ExecuteStatement_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetTypeInfo

type GetTypeInfo_args
  req::TGetTypeInfoReq
  GetTypeInfo_args() = (o=new(); fillunset(o); o)
end # type GetTypeInfo_args

type GetTypeInfo_result
  success::TGetTypeInfoResp
  GetTypeInfo_result() = (o=new(); fillunset(o); o)
  GetTypeInfo_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetTypeInfo_result
meta(t::Type{GetTypeInfo_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetCatalogs

type GetCatalogs_args
  req::TGetCatalogsReq
  GetCatalogs_args() = (o=new(); fillunset(o); o)
end # type GetCatalogs_args

type GetCatalogs_result
  success::TGetCatalogsResp
  GetCatalogs_result() = (o=new(); fillunset(o); o)
  GetCatalogs_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetCatalogs_result
meta(t::Type{GetCatalogs_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetSchemas

type GetSchemas_args
  req::TGetSchemasReq
  GetSchemas_args() = (o=new(); fillunset(o); o)
end # type GetSchemas_args

type GetSchemas_result
  success::TGetSchemasResp
  GetSchemas_result() = (o=new(); fillunset(o); o)
  GetSchemas_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetSchemas_result
meta(t::Type{GetSchemas_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetTables

type GetTables_args
  req::TGetTablesReq
  GetTables_args() = (o=new(); fillunset(o); o)
end # type GetTables_args

type GetTables_result
  success::TGetTablesResp
  GetTables_result() = (o=new(); fillunset(o); o)
  GetTables_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetTables_result
meta(t::Type{GetTables_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetTableTypes

type GetTableTypes_args
  req::TGetTableTypesReq
  GetTableTypes_args() = (o=new(); fillunset(o); o)
end # type GetTableTypes_args

type GetTableTypes_result
  success::TGetTableTypesResp
  GetTableTypes_result() = (o=new(); fillunset(o); o)
  GetTableTypes_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetTableTypes_result
meta(t::Type{GetTableTypes_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetColumns

type GetColumns_args
  req::TGetColumnsReq
  GetColumns_args() = (o=new(); fillunset(o); o)
end # type GetColumns_args

type GetColumns_result
  success::TGetColumnsResp
  GetColumns_result() = (o=new(); fillunset(o); o)
  GetColumns_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetColumns_result
meta(t::Type{GetColumns_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetFunctions

type GetFunctions_args
  req::TGetFunctionsReq
  GetFunctions_args() = (o=new(); fillunset(o); o)
end # type GetFunctions_args

type GetFunctions_result
  success::TGetFunctionsResp
  GetFunctions_result() = (o=new(); fillunset(o); o)
  GetFunctions_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetFunctions_result
meta(t::Type{GetFunctions_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetOperationStatus

type GetOperationStatus_args
  req::TGetOperationStatusReq
  GetOperationStatus_args() = (o=new(); fillunset(o); o)
end # type GetOperationStatus_args

type GetOperationStatus_result
  success::TGetOperationStatusResp
  GetOperationStatus_result() = (o=new(); fillunset(o); o)
  GetOperationStatus_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetOperationStatus_result
meta(t::Type{GetOperationStatus_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method CancelOperation

type CancelOperation_args
  req::TCancelOperationReq
  CancelOperation_args() = (o=new(); fillunset(o); o)
end # type CancelOperation_args

type CancelOperation_result
  success::TCancelOperationResp
  CancelOperation_result() = (o=new(); fillunset(o); o)
  CancelOperation_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type CancelOperation_result
meta(t::Type{CancelOperation_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method CloseOperation

type CloseOperation_args
  req::TCloseOperationReq
  CloseOperation_args() = (o=new(); fillunset(o); o)
end # type CloseOperation_args

type CloseOperation_result
  success::TCloseOperationResp
  CloseOperation_result() = (o=new(); fillunset(o); o)
  CloseOperation_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type CloseOperation_result
meta(t::Type{CloseOperation_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetResultSetMetadata

type GetResultSetMetadata_args
  req::TGetResultSetMetadataReq
  GetResultSetMetadata_args() = (o=new(); fillunset(o); o)
end # type GetResultSetMetadata_args

type GetResultSetMetadata_result
  success::TGetResultSetMetadataResp
  GetResultSetMetadata_result() = (o=new(); fillunset(o); o)
  GetResultSetMetadata_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetResultSetMetadata_result
meta(t::Type{GetResultSetMetadata_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method FetchResults

type FetchResults_args
  req::TFetchResultsReq
  FetchResults_args() = (o=new(); fillunset(o); o)
end # type FetchResults_args

type FetchResults_result
  success::TFetchResultsResp
  FetchResults_result() = (o=new(); fillunset(o); o)
  FetchResults_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type FetchResults_result
meta(t::Type{FetchResults_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method GetDelegationToken

type GetDelegationToken_args
  req::TGetDelegationTokenReq
  GetDelegationToken_args() = (o=new(); fillunset(o); o)
end # type GetDelegationToken_args

type GetDelegationToken_result
  success::TGetDelegationTokenResp
  GetDelegationToken_result() = (o=new(); fillunset(o); o)
  GetDelegationToken_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type GetDelegationToken_result
meta(t::Type{GetDelegationToken_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method CancelDelegationToken

type CancelDelegationToken_args
  req::TCancelDelegationTokenReq
  CancelDelegationToken_args() = (o=new(); fillunset(o); o)
end # type CancelDelegationToken_args

type CancelDelegationToken_result
  success::TCancelDelegationTokenResp
  CancelDelegationToken_result() = (o=new(); fillunset(o); o)
  CancelDelegationToken_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type CancelDelegationToken_result
meta(t::Type{CancelDelegationToken_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())

# types encapsulating arguments and return values of method RenewDelegationToken

type RenewDelegationToken_args
  req::TRenewDelegationTokenReq
  RenewDelegationToken_args() = (o=new(); fillunset(o); o)
end # type RenewDelegationToken_args

type RenewDelegationToken_result
  success::TRenewDelegationTokenResp
  RenewDelegationToken_result() = (o=new(); fillunset(o); o)
  RenewDelegationToken_result(success) = (o=new(); fillset(o, :success); o.success=success; o)
end # type RenewDelegationToken_result
meta(t::Type{RenewDelegationToken_result}) = meta(t, Symbol[:success], Int[0], Dict{Symbol,Any}())



# Processor for TCLIService service (to be used in server implementation)
type TCLIServiceProcessor <: TProcessor
  tp::ThriftProcessor
  function TCLIServiceProcessor()
    p = new(ThriftProcessor())
    handle(p.tp, ThriftHandler("OpenSession", _OpenSession, OpenSession_args, OpenSession_result))
    handle(p.tp, ThriftHandler("CloseSession", _CloseSession, CloseSession_args, CloseSession_result))
    handle(p.tp, ThriftHandler("GetInfo", _GetInfo, GetInfo_args, GetInfo_result))
    handle(p.tp, ThriftHandler("ExecuteStatement", _ExecuteStatement, ExecuteStatement_args, ExecuteStatement_result))
    handle(p.tp, ThriftHandler("GetTypeInfo", _GetTypeInfo, GetTypeInfo_args, GetTypeInfo_result))
    handle(p.tp, ThriftHandler("GetCatalogs", _GetCatalogs, GetCatalogs_args, GetCatalogs_result))
    handle(p.tp, ThriftHandler("GetSchemas", _GetSchemas, GetSchemas_args, GetSchemas_result))
    handle(p.tp, ThriftHandler("GetTables", _GetTables, GetTables_args, GetTables_result))
    handle(p.tp, ThriftHandler("GetTableTypes", _GetTableTypes, GetTableTypes_args, GetTableTypes_result))
    handle(p.tp, ThriftHandler("GetColumns", _GetColumns, GetColumns_args, GetColumns_result))
    handle(p.tp, ThriftHandler("GetFunctions", _GetFunctions, GetFunctions_args, GetFunctions_result))
    handle(p.tp, ThriftHandler("GetOperationStatus", _GetOperationStatus, GetOperationStatus_args, GetOperationStatus_result))
    handle(p.tp, ThriftHandler("CancelOperation", _CancelOperation, CancelOperation_args, CancelOperation_result))
    handle(p.tp, ThriftHandler("CloseOperation", _CloseOperation, CloseOperation_args, CloseOperation_result))
    handle(p.tp, ThriftHandler("GetResultSetMetadata", _GetResultSetMetadata, GetResultSetMetadata_args, GetResultSetMetadata_result))
    handle(p.tp, ThriftHandler("FetchResults", _FetchResults, FetchResults_args, FetchResults_result))
    handle(p.tp, ThriftHandler("GetDelegationToken", _GetDelegationToken, GetDelegationToken_args, GetDelegationToken_result))
    handle(p.tp, ThriftHandler("CancelDelegationToken", _CancelDelegationToken, CancelDelegationToken_args, CancelDelegationToken_result))
    handle(p.tp, ThriftHandler("RenewDelegationToken", _RenewDelegationToken, RenewDelegationToken_args, RenewDelegationToken_result))
    p
  end
  _OpenSession(inp::OpenSession_args) = OpenSession_result(OpenSession(inp.req))
  _CloseSession(inp::CloseSession_args) = CloseSession_result(CloseSession(inp.req))
  _GetInfo(inp::GetInfo_args) = GetInfo_result(GetInfo(inp.req))
  _ExecuteStatement(inp::ExecuteStatement_args) = ExecuteStatement_result(ExecuteStatement(inp.req))
  _GetTypeInfo(inp::GetTypeInfo_args) = GetTypeInfo_result(GetTypeInfo(inp.req))
  _GetCatalogs(inp::GetCatalogs_args) = GetCatalogs_result(GetCatalogs(inp.req))
  _GetSchemas(inp::GetSchemas_args) = GetSchemas_result(GetSchemas(inp.req))
  _GetTables(inp::GetTables_args) = GetTables_result(GetTables(inp.req))
  _GetTableTypes(inp::GetTableTypes_args) = GetTableTypes_result(GetTableTypes(inp.req))
  _GetColumns(inp::GetColumns_args) = GetColumns_result(GetColumns(inp.req))
  _GetFunctions(inp::GetFunctions_args) = GetFunctions_result(GetFunctions(inp.req))
  _GetOperationStatus(inp::GetOperationStatus_args) = GetOperationStatus_result(GetOperationStatus(inp.req))
  _CancelOperation(inp::CancelOperation_args) = CancelOperation_result(CancelOperation(inp.req))
  _CloseOperation(inp::CloseOperation_args) = CloseOperation_result(CloseOperation(inp.req))
  _GetResultSetMetadata(inp::GetResultSetMetadata_args) = GetResultSetMetadata_result(GetResultSetMetadata(inp.req))
  _FetchResults(inp::FetchResults_args) = FetchResults_result(FetchResults(inp.req))
  _GetDelegationToken(inp::GetDelegationToken_args) = GetDelegationToken_result(GetDelegationToken(inp.req))
  _CancelDelegationToken(inp::CancelDelegationToken_args) = CancelDelegationToken_result(CancelDelegationToken(inp.req))
  _RenewDelegationToken(inp::RenewDelegationToken_args) = RenewDelegationToken_result(RenewDelegationToken(inp.req))
end # type TCLIServiceProcessor
process(p::TCLIServiceProcessor, inp::TProtocol, outp::TProtocol) = process(p.tp, inp, outp)
distribute(p::TCLIServiceProcessor) = distribute(p.tp)


# Server side methods to be defined by user:
# function OpenSession(req::TOpenSessionReq)
#     # returns TOpenSessionResp
# function CloseSession(req::TCloseSessionReq)
#     # returns TCloseSessionResp
# function GetInfo(req::TGetInfoReq)
#     # returns TGetInfoResp
# function ExecuteStatement(req::TExecuteStatementReq)
#     # returns TExecuteStatementResp
# function GetTypeInfo(req::TGetTypeInfoReq)
#     # returns TGetTypeInfoResp
# function GetCatalogs(req::TGetCatalogsReq)
#     # returns TGetCatalogsResp
# function GetSchemas(req::TGetSchemasReq)
#     # returns TGetSchemasResp
# function GetTables(req::TGetTablesReq)
#     # returns TGetTablesResp
# function GetTableTypes(req::TGetTableTypesReq)
#     # returns TGetTableTypesResp
# function GetColumns(req::TGetColumnsReq)
#     # returns TGetColumnsResp
# function GetFunctions(req::TGetFunctionsReq)
#     # returns TGetFunctionsResp
# function GetOperationStatus(req::TGetOperationStatusReq)
#     # returns TGetOperationStatusResp
# function CancelOperation(req::TCancelOperationReq)
#     # returns TCancelOperationResp
# function CloseOperation(req::TCloseOperationReq)
#     # returns TCloseOperationResp
# function GetResultSetMetadata(req::TGetResultSetMetadataReq)
#     # returns TGetResultSetMetadataResp
# function FetchResults(req::TFetchResultsReq)
#     # returns TFetchResultsResp
# function GetDelegationToken(req::TGetDelegationTokenReq)
#     # returns TGetDelegationTokenResp
# function CancelDelegationToken(req::TCancelDelegationTokenReq)
#     # returns TCancelDelegationTokenResp
# function RenewDelegationToken(req::TRenewDelegationTokenReq)
#     # returns TRenewDelegationTokenResp


# Client implementation for TCLIService service
type TCLIServiceClient <: TCLIServiceClientBase
  p::TProtocol
  seqid::Int32
  TCLIServiceClient(p::TProtocol) = new(p, 0)
end # type TCLIServiceClient

# Client callable method for OpenSession
function OpenSession(c::TCLIServiceClientBase, req::TOpenSessionReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "OpenSession", Thrift.MessageType.CALL, c.seqid)
  inp = OpenSession_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, OpenSession_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function OpenSession

# Client callable method for CloseSession
function CloseSession(c::TCLIServiceClientBase, req::TCloseSessionReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "CloseSession", Thrift.MessageType.CALL, c.seqid)
  inp = CloseSession_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, CloseSession_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function CloseSession

# Client callable method for GetInfo
function GetInfo(c::TCLIServiceClientBase, req::TGetInfoReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetInfo", Thrift.MessageType.CALL, c.seqid)
  inp = GetInfo_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetInfo_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetInfo

# Client callable method for ExecuteStatement
function ExecuteStatement(c::TCLIServiceClientBase, req::TExecuteStatementReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "ExecuteStatement", Thrift.MessageType.CALL, c.seqid)
  inp = ExecuteStatement_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, ExecuteStatement_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function ExecuteStatement

# Client callable method for GetTypeInfo
function GetTypeInfo(c::TCLIServiceClientBase, req::TGetTypeInfoReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetTypeInfo", Thrift.MessageType.CALL, c.seqid)
  inp = GetTypeInfo_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetTypeInfo_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetTypeInfo

# Client callable method for GetCatalogs
function GetCatalogs(c::TCLIServiceClientBase, req::TGetCatalogsReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetCatalogs", Thrift.MessageType.CALL, c.seqid)
  inp = GetCatalogs_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetCatalogs_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetCatalogs

# Client callable method for GetSchemas
function GetSchemas(c::TCLIServiceClientBase, req::TGetSchemasReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetSchemas", Thrift.MessageType.CALL, c.seqid)
  inp = GetSchemas_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetSchemas_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetSchemas

# Client callable method for GetTables
function GetTables(c::TCLIServiceClientBase, req::TGetTablesReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetTables", Thrift.MessageType.CALL, c.seqid)
  inp = GetTables_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetTables_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetTables

# Client callable method for GetTableTypes
function GetTableTypes(c::TCLIServiceClientBase, req::TGetTableTypesReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetTableTypes", Thrift.MessageType.CALL, c.seqid)
  inp = GetTableTypes_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetTableTypes_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetTableTypes

# Client callable method for GetColumns
function GetColumns(c::TCLIServiceClientBase, req::TGetColumnsReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetColumns", Thrift.MessageType.CALL, c.seqid)
  inp = GetColumns_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetColumns_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetColumns

# Client callable method for GetFunctions
function GetFunctions(c::TCLIServiceClientBase, req::TGetFunctionsReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetFunctions", Thrift.MessageType.CALL, c.seqid)
  inp = GetFunctions_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetFunctions_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetFunctions

# Client callable method for GetOperationStatus
function GetOperationStatus(c::TCLIServiceClientBase, req::TGetOperationStatusReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetOperationStatus", Thrift.MessageType.CALL, c.seqid)
  inp = GetOperationStatus_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetOperationStatus_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetOperationStatus

# Client callable method for CancelOperation
function CancelOperation(c::TCLIServiceClientBase, req::TCancelOperationReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "CancelOperation", Thrift.MessageType.CALL, c.seqid)
  inp = CancelOperation_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, CancelOperation_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function CancelOperation

# Client callable method for CloseOperation
function CloseOperation(c::TCLIServiceClientBase, req::TCloseOperationReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "CloseOperation", Thrift.MessageType.CALL, c.seqid)
  inp = CloseOperation_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, CloseOperation_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function CloseOperation

# Client callable method for GetResultSetMetadata
function GetResultSetMetadata(c::TCLIServiceClientBase, req::TGetResultSetMetadataReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetResultSetMetadata", Thrift.MessageType.CALL, c.seqid)
  inp = GetResultSetMetadata_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetResultSetMetadata_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetResultSetMetadata

# Client callable method for FetchResults
function FetchResults(c::TCLIServiceClientBase, req::TFetchResultsReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "FetchResults", Thrift.MessageType.CALL, c.seqid)
  inp = FetchResults_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, FetchResults_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function FetchResults

# Client callable method for GetDelegationToken
function GetDelegationToken(c::TCLIServiceClientBase, req::TGetDelegationTokenReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "GetDelegationToken", Thrift.MessageType.CALL, c.seqid)
  inp = GetDelegationToken_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, GetDelegationToken_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function GetDelegationToken

# Client callable method for CancelDelegationToken
function CancelDelegationToken(c::TCLIServiceClientBase, req::TCancelDelegationTokenReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "CancelDelegationToken", Thrift.MessageType.CALL, c.seqid)
  inp = CancelDelegationToken_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, CancelDelegationToken_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function CancelDelegationToken

# Client callable method for RenewDelegationToken
function RenewDelegationToken(c::TCLIServiceClientBase, req::TRenewDelegationTokenReq)
  p = c.p
  c.seqid = (c.seqid < (2^31-1)) ? (c.seqid+1) : 0
  Thrift.writeMessageBegin(p, "RenewDelegationToken", Thrift.MessageType.CALL, c.seqid)
  inp = RenewDelegationToken_args()
  Thrift.set_field!(inp, :req, req)
  Thrift.write(p, inp)
  Thrift.writeMessageEnd(p)
  Thrift.flush(p.t)
  
  (fname, mtype, rseqid) = Thrift.readMessageBegin(p)
  (mtype == Thrift.MessageType.EXCEPTION) && throw(Thrift.read(p, Thrift.TApplicationException()))
  outp = Thrift.read(p, RenewDelegationToken_result())
  Thrift.readMessageEnd(p)
  (rseqid != c.seqid) && throw(Thrift.TApplicationException(ApplicationExceptionType.BAD_SEQUENCE_ID, "response sequence id $rseqid did not match request ($(c.seqid))"))
  Thrift.has_field(outp, :success) && (return Thrift.get_field(outp, :success))
  throw(Thrift.TApplicationException(Thrift.ApplicationExceptionType.MISSING_RESULT, "retrieve failed: unknown result"))
end # function RenewDelegationToken

