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

package cli_service

import (
	"bytes"
	"context"
	"reflect"
	"database/sql/driver"
	"errors"
	"fmt"
	"github.com/apache/thrift/lib/go/thrift"
)

// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = context.Background
var _ = reflect.DeepEqual
var _ = bytes.Equal

type TProtocolVersion int64
const (
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 0
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 1
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 2
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 3
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 4
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 5
  TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 6
)

func (p TProtocolVersion) String() string {
  switch p {
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1: return "HIVE_CLI_SERVICE_PROTOCOL_V1"
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2: return "HIVE_CLI_SERVICE_PROTOCOL_V2"
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3: return "HIVE_CLI_SERVICE_PROTOCOL_V3"
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4: return "HIVE_CLI_SERVICE_PROTOCOL_V4"
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5: return "HIVE_CLI_SERVICE_PROTOCOL_V5"
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6: return "HIVE_CLI_SERVICE_PROTOCOL_V6"
  case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7: return "HIVE_CLI_SERVICE_PROTOCOL_V7"
  }
  return "<UNSET>"
}

func TProtocolVersionFromString(s string) (TProtocolVersion, error) {
  switch s {
  case "HIVE_CLI_SERVICE_PROTOCOL_V1": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1, nil 
  case "HIVE_CLI_SERVICE_PROTOCOL_V2": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2, nil 
  case "HIVE_CLI_SERVICE_PROTOCOL_V3": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3, nil 
  case "HIVE_CLI_SERVICE_PROTOCOL_V4": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4, nil 
  case "HIVE_CLI_SERVICE_PROTOCOL_V5": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5, nil 
  case "HIVE_CLI_SERVICE_PROTOCOL_V6": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6, nil 
  case "HIVE_CLI_SERVICE_PROTOCOL_V7": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7, nil 
  }
  return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string")
}


func TProtocolVersionPtr(v TProtocolVersion) *TProtocolVersion { return &v }

func (p TProtocolVersion) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TProtocolVersion) UnmarshalText(text []byte) error {
q, err := TProtocolVersionFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TProtocolVersion) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TProtocolVersion(v)
return nil
}

func (p * TProtocolVersion) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TTypeId int64
const (
  TTypeId_BOOLEAN_TYPE TTypeId = 0
  TTypeId_TINYINT_TYPE TTypeId = 1
  TTypeId_SMALLINT_TYPE TTypeId = 2
  TTypeId_INT_TYPE TTypeId = 3
  TTypeId_BIGINT_TYPE TTypeId = 4
  TTypeId_FLOAT_TYPE TTypeId = 5
  TTypeId_DOUBLE_TYPE TTypeId = 6
  TTypeId_STRING_TYPE TTypeId = 7
  TTypeId_TIMESTAMP_TYPE TTypeId = 8
  TTypeId_BINARY_TYPE TTypeId = 9
  TTypeId_ARRAY_TYPE TTypeId = 10
  TTypeId_MAP_TYPE TTypeId = 11
  TTypeId_STRUCT_TYPE TTypeId = 12
  TTypeId_UNION_TYPE TTypeId = 13
  TTypeId_USER_DEFINED_TYPE TTypeId = 14
  TTypeId_DECIMAL_TYPE TTypeId = 15
  TTypeId_NULL_TYPE TTypeId = 16
  TTypeId_DATE_TYPE TTypeId = 17
  TTypeId_VARCHAR_TYPE TTypeId = 18
  TTypeId_CHAR_TYPE TTypeId = 19
)

func (p TTypeId) String() string {
  switch p {
  case TTypeId_BOOLEAN_TYPE: return "BOOLEAN_TYPE"
  case TTypeId_TINYINT_TYPE: return "TINYINT_TYPE"
  case TTypeId_SMALLINT_TYPE: return "SMALLINT_TYPE"
  case TTypeId_INT_TYPE: return "INT_TYPE"
  case TTypeId_BIGINT_TYPE: return "BIGINT_TYPE"
  case TTypeId_FLOAT_TYPE: return "FLOAT_TYPE"
  case TTypeId_DOUBLE_TYPE: return "DOUBLE_TYPE"
  case TTypeId_STRING_TYPE: return "STRING_TYPE"
  case TTypeId_TIMESTAMP_TYPE: return "TIMESTAMP_TYPE"
  case TTypeId_BINARY_TYPE: return "BINARY_TYPE"
  case TTypeId_ARRAY_TYPE: return "ARRAY_TYPE"
  case TTypeId_MAP_TYPE: return "MAP_TYPE"
  case TTypeId_STRUCT_TYPE: return "STRUCT_TYPE"
  case TTypeId_UNION_TYPE: return "UNION_TYPE"
  case TTypeId_USER_DEFINED_TYPE: return "USER_DEFINED_TYPE"
  case TTypeId_DECIMAL_TYPE: return "DECIMAL_TYPE"
  case TTypeId_NULL_TYPE: return "NULL_TYPE"
  case TTypeId_DATE_TYPE: return "DATE_TYPE"
  case TTypeId_VARCHAR_TYPE: return "VARCHAR_TYPE"
  case TTypeId_CHAR_TYPE: return "CHAR_TYPE"
  }
  return "<UNSET>"
}

func TTypeIdFromString(s string) (TTypeId, error) {
  switch s {
  case "BOOLEAN_TYPE": return TTypeId_BOOLEAN_TYPE, nil 
  case "TINYINT_TYPE": return TTypeId_TINYINT_TYPE, nil 
  case "SMALLINT_TYPE": return TTypeId_SMALLINT_TYPE, nil 
  case "INT_TYPE": return TTypeId_INT_TYPE, nil 
  case "BIGINT_TYPE": return TTypeId_BIGINT_TYPE, nil 
  case "FLOAT_TYPE": return TTypeId_FLOAT_TYPE, nil 
  case "DOUBLE_TYPE": return TTypeId_DOUBLE_TYPE, nil 
  case "STRING_TYPE": return TTypeId_STRING_TYPE, nil 
  case "TIMESTAMP_TYPE": return TTypeId_TIMESTAMP_TYPE, nil 
  case "BINARY_TYPE": return TTypeId_BINARY_TYPE, nil 
  case "ARRAY_TYPE": return TTypeId_ARRAY_TYPE, nil 
  case "MAP_TYPE": return TTypeId_MAP_TYPE, nil 
  case "STRUCT_TYPE": return TTypeId_STRUCT_TYPE, nil 
  case "UNION_TYPE": return TTypeId_UNION_TYPE, nil 
  case "USER_DEFINED_TYPE": return TTypeId_USER_DEFINED_TYPE, nil 
  case "DECIMAL_TYPE": return TTypeId_DECIMAL_TYPE, nil 
  case "NULL_TYPE": return TTypeId_NULL_TYPE, nil 
  case "DATE_TYPE": return TTypeId_DATE_TYPE, nil 
  case "VARCHAR_TYPE": return TTypeId_VARCHAR_TYPE, nil 
  case "CHAR_TYPE": return TTypeId_CHAR_TYPE, nil 
  }
  return TTypeId(0), fmt.Errorf("not a valid TTypeId string")
}


func TTypeIdPtr(v TTypeId) *TTypeId { return &v }

func (p TTypeId) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TTypeId) UnmarshalText(text []byte) error {
q, err := TTypeIdFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TTypeId) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TTypeId(v)
return nil
}

func (p * TTypeId) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TStatusCode int64
const (
  TStatusCode_SUCCESS_STATUS TStatusCode = 0
  TStatusCode_SUCCESS_WITH_INFO_STATUS TStatusCode = 1
  TStatusCode_STILL_EXECUTING_STATUS TStatusCode = 2
  TStatusCode_ERROR_STATUS TStatusCode = 3
  TStatusCode_INVALID_HANDLE_STATUS TStatusCode = 4
)

func (p TStatusCode) String() string {
  switch p {
  case TStatusCode_SUCCESS_STATUS: return "SUCCESS_STATUS"
  case TStatusCode_SUCCESS_WITH_INFO_STATUS: return "SUCCESS_WITH_INFO_STATUS"
  case TStatusCode_STILL_EXECUTING_STATUS: return "STILL_EXECUTING_STATUS"
  case TStatusCode_ERROR_STATUS: return "ERROR_STATUS"
  case TStatusCode_INVALID_HANDLE_STATUS: return "INVALID_HANDLE_STATUS"
  }
  return "<UNSET>"
}

func TStatusCodeFromString(s string) (TStatusCode, error) {
  switch s {
  case "SUCCESS_STATUS": return TStatusCode_SUCCESS_STATUS, nil 
  case "SUCCESS_WITH_INFO_STATUS": return TStatusCode_SUCCESS_WITH_INFO_STATUS, nil 
  case "STILL_EXECUTING_STATUS": return TStatusCode_STILL_EXECUTING_STATUS, nil 
  case "ERROR_STATUS": return TStatusCode_ERROR_STATUS, nil 
  case "INVALID_HANDLE_STATUS": return TStatusCode_INVALID_HANDLE_STATUS, nil 
  }
  return TStatusCode(0), fmt.Errorf("not a valid TStatusCode string")
}


func TStatusCodePtr(v TStatusCode) *TStatusCode { return &v }

func (p TStatusCode) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TStatusCode) UnmarshalText(text []byte) error {
q, err := TStatusCodeFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TStatusCode) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TStatusCode(v)
return nil
}

func (p * TStatusCode) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TOperationState int64
const (
  TOperationState_INITIALIZED_STATE TOperationState = 0
  TOperationState_RUNNING_STATE TOperationState = 1
  TOperationState_FINISHED_STATE TOperationState = 2
  TOperationState_CANCELED_STATE TOperationState = 3
  TOperationState_CLOSED_STATE TOperationState = 4
  TOperationState_ERROR_STATE TOperationState = 5
  TOperationState_UKNOWN_STATE TOperationState = 6
  TOperationState_PENDING_STATE TOperationState = 7
)

func (p TOperationState) String() string {
  switch p {
  case TOperationState_INITIALIZED_STATE: return "INITIALIZED_STATE"
  case TOperationState_RUNNING_STATE: return "RUNNING_STATE"
  case TOperationState_FINISHED_STATE: return "FINISHED_STATE"
  case TOperationState_CANCELED_STATE: return "CANCELED_STATE"
  case TOperationState_CLOSED_STATE: return "CLOSED_STATE"
  case TOperationState_ERROR_STATE: return "ERROR_STATE"
  case TOperationState_UKNOWN_STATE: return "UKNOWN_STATE"
  case TOperationState_PENDING_STATE: return "PENDING_STATE"
  }
  return "<UNSET>"
}

func TOperationStateFromString(s string) (TOperationState, error) {
  switch s {
  case "INITIALIZED_STATE": return TOperationState_INITIALIZED_STATE, nil 
  case "RUNNING_STATE": return TOperationState_RUNNING_STATE, nil 
  case "FINISHED_STATE": return TOperationState_FINISHED_STATE, nil 
  case "CANCELED_STATE": return TOperationState_CANCELED_STATE, nil 
  case "CLOSED_STATE": return TOperationState_CLOSED_STATE, nil 
  case "ERROR_STATE": return TOperationState_ERROR_STATE, nil 
  case "UKNOWN_STATE": return TOperationState_UKNOWN_STATE, nil 
  case "PENDING_STATE": return TOperationState_PENDING_STATE, nil 
  }
  return TOperationState(0), fmt.Errorf("not a valid TOperationState string")
}


func TOperationStatePtr(v TOperationState) *TOperationState { return &v }

func (p TOperationState) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TOperationState) UnmarshalText(text []byte) error {
q, err := TOperationStateFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TOperationState) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TOperationState(v)
return nil
}

func (p * TOperationState) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TOperationType int64
const (
  TOperationType_EXECUTE_STATEMENT TOperationType = 0
  TOperationType_GET_TYPE_INFO TOperationType = 1
  TOperationType_GET_CATALOGS TOperationType = 2
  TOperationType_GET_SCHEMAS TOperationType = 3
  TOperationType_GET_TABLES TOperationType = 4
  TOperationType_GET_TABLE_TYPES TOperationType = 5
  TOperationType_GET_COLUMNS TOperationType = 6
  TOperationType_GET_FUNCTIONS TOperationType = 7
  TOperationType_UNKNOWN TOperationType = 8
)

func (p TOperationType) String() string {
  switch p {
  case TOperationType_EXECUTE_STATEMENT: return "EXECUTE_STATEMENT"
  case TOperationType_GET_TYPE_INFO: return "GET_TYPE_INFO"
  case TOperationType_GET_CATALOGS: return "GET_CATALOGS"
  case TOperationType_GET_SCHEMAS: return "GET_SCHEMAS"
  case TOperationType_GET_TABLES: return "GET_TABLES"
  case TOperationType_GET_TABLE_TYPES: return "GET_TABLE_TYPES"
  case TOperationType_GET_COLUMNS: return "GET_COLUMNS"
  case TOperationType_GET_FUNCTIONS: return "GET_FUNCTIONS"
  case TOperationType_UNKNOWN: return "UNKNOWN"
  }
  return "<UNSET>"
}

func TOperationTypeFromString(s string) (TOperationType, error) {
  switch s {
  case "EXECUTE_STATEMENT": return TOperationType_EXECUTE_STATEMENT, nil 
  case "GET_TYPE_INFO": return TOperationType_GET_TYPE_INFO, nil 
  case "GET_CATALOGS": return TOperationType_GET_CATALOGS, nil 
  case "GET_SCHEMAS": return TOperationType_GET_SCHEMAS, nil 
  case "GET_TABLES": return TOperationType_GET_TABLES, nil 
  case "GET_TABLE_TYPES": return TOperationType_GET_TABLE_TYPES, nil 
  case "GET_COLUMNS": return TOperationType_GET_COLUMNS, nil 
  case "GET_FUNCTIONS": return TOperationType_GET_FUNCTIONS, nil 
  case "UNKNOWN": return TOperationType_UNKNOWN, nil 
  }
  return TOperationType(0), fmt.Errorf("not a valid TOperationType string")
}


func TOperationTypePtr(v TOperationType) *TOperationType { return &v }

func (p TOperationType) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TOperationType) UnmarshalText(text []byte) error {
q, err := TOperationTypeFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TOperationType) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TOperationType(v)
return nil
}

func (p * TOperationType) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TGetInfoType int64
const (
  TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS TGetInfoType = 0
  TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES TGetInfoType = 1
  TGetInfoType_CLI_DATA_SOURCE_NAME TGetInfoType = 2
  TGetInfoType_CLI_FETCH_DIRECTION TGetInfoType = 8
  TGetInfoType_CLI_SERVER_NAME TGetInfoType = 13
  TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE TGetInfoType = 14
  TGetInfoType_CLI_DBMS_NAME TGetInfoType = 17
  TGetInfoType_CLI_DBMS_VER TGetInfoType = 18
  TGetInfoType_CLI_ACCESSIBLE_TABLES TGetInfoType = 19
  TGetInfoType_CLI_ACCESSIBLE_PROCEDURES TGetInfoType = 20
  TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR TGetInfoType = 23
  TGetInfoType_CLI_DATA_SOURCE_READ_ONLY TGetInfoType = 25
  TGetInfoType_CLI_DEFAULT_TXN_ISOLATION TGetInfoType = 26
  TGetInfoType_CLI_IDENTIFIER_CASE TGetInfoType = 28
  TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR TGetInfoType = 29
  TGetInfoType_CLI_MAX_COLUMN_NAME_LEN TGetInfoType = 30
  TGetInfoType_CLI_MAX_CURSOR_NAME_LEN TGetInfoType = 31
  TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN TGetInfoType = 32
  TGetInfoType_CLI_MAX_CATALOG_NAME_LEN TGetInfoType = 34
  TGetInfoType_CLI_MAX_TABLE_NAME_LEN TGetInfoType = 35
  TGetInfoType_CLI_SCROLL_CONCURRENCY TGetInfoType = 43
  TGetInfoType_CLI_TXN_CAPABLE TGetInfoType = 46
  TGetInfoType_CLI_USER_NAME TGetInfoType = 47
  TGetInfoType_CLI_TXN_ISOLATION_OPTION TGetInfoType = 72
  TGetInfoType_CLI_INTEGRITY TGetInfoType = 73
  TGetInfoType_CLI_GETDATA_EXTENSIONS TGetInfoType = 81
  TGetInfoType_CLI_NULL_COLLATION TGetInfoType = 85
  TGetInfoType_CLI_ALTER_TABLE TGetInfoType = 86
  TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT TGetInfoType = 90
  TGetInfoType_CLI_SPECIAL_CHARACTERS TGetInfoType = 94
  TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY TGetInfoType = 97
  TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX TGetInfoType = 98
  TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY TGetInfoType = 99
  TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT TGetInfoType = 100
  TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE TGetInfoType = 101
  TGetInfoType_CLI_MAX_INDEX_SIZE TGetInfoType = 102
  TGetInfoType_CLI_MAX_ROW_SIZE TGetInfoType = 104
  TGetInfoType_CLI_MAX_STATEMENT_LEN TGetInfoType = 105
  TGetInfoType_CLI_MAX_TABLES_IN_SELECT TGetInfoType = 106
  TGetInfoType_CLI_MAX_USER_NAME_LEN TGetInfoType = 107
  TGetInfoType_CLI_OJ_CAPABILITIES TGetInfoType = 115
  TGetInfoType_CLI_XOPEN_CLI_YEAR TGetInfoType = 10000
  TGetInfoType_CLI_CURSOR_SENSITIVITY TGetInfoType = 10001
  TGetInfoType_CLI_DESCRIBE_PARAMETER TGetInfoType = 10002
  TGetInfoType_CLI_CATALOG_NAME TGetInfoType = 10003
  TGetInfoType_CLI_COLLATION_SEQ TGetInfoType = 10004
  TGetInfoType_CLI_MAX_IDENTIFIER_LEN TGetInfoType = 10005
)

func (p TGetInfoType) String() string {
  switch p {
  case TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS: return "CLI_MAX_DRIVER_CONNECTIONS"
  case TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES: return "CLI_MAX_CONCURRENT_ACTIVITIES"
  case TGetInfoType_CLI_DATA_SOURCE_NAME: return "CLI_DATA_SOURCE_NAME"
  case TGetInfoType_CLI_FETCH_DIRECTION: return "CLI_FETCH_DIRECTION"
  case TGetInfoType_CLI_SERVER_NAME: return "CLI_SERVER_NAME"
  case TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE: return "CLI_SEARCH_PATTERN_ESCAPE"
  case TGetInfoType_CLI_DBMS_NAME: return "CLI_DBMS_NAME"
  case TGetInfoType_CLI_DBMS_VER: return "CLI_DBMS_VER"
  case TGetInfoType_CLI_ACCESSIBLE_TABLES: return "CLI_ACCESSIBLE_TABLES"
  case TGetInfoType_CLI_ACCESSIBLE_PROCEDURES: return "CLI_ACCESSIBLE_PROCEDURES"
  case TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR: return "CLI_CURSOR_COMMIT_BEHAVIOR"
  case TGetInfoType_CLI_DATA_SOURCE_READ_ONLY: return "CLI_DATA_SOURCE_READ_ONLY"
  case TGetInfoType_CLI_DEFAULT_TXN_ISOLATION: return "CLI_DEFAULT_TXN_ISOLATION"
  case TGetInfoType_CLI_IDENTIFIER_CASE: return "CLI_IDENTIFIER_CASE"
  case TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR: return "CLI_IDENTIFIER_QUOTE_CHAR"
  case TGetInfoType_CLI_MAX_COLUMN_NAME_LEN: return "CLI_MAX_COLUMN_NAME_LEN"
  case TGetInfoType_CLI_MAX_CURSOR_NAME_LEN: return "CLI_MAX_CURSOR_NAME_LEN"
  case TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN: return "CLI_MAX_SCHEMA_NAME_LEN"
  case TGetInfoType_CLI_MAX_CATALOG_NAME_LEN: return "CLI_MAX_CATALOG_NAME_LEN"
  case TGetInfoType_CLI_MAX_TABLE_NAME_LEN: return "CLI_MAX_TABLE_NAME_LEN"
  case TGetInfoType_CLI_SCROLL_CONCURRENCY: return "CLI_SCROLL_CONCURRENCY"
  case TGetInfoType_CLI_TXN_CAPABLE: return "CLI_TXN_CAPABLE"
  case TGetInfoType_CLI_USER_NAME: return "CLI_USER_NAME"
  case TGetInfoType_CLI_TXN_ISOLATION_OPTION: return "CLI_TXN_ISOLATION_OPTION"
  case TGetInfoType_CLI_INTEGRITY: return "CLI_INTEGRITY"
  case TGetInfoType_CLI_GETDATA_EXTENSIONS: return "CLI_GETDATA_EXTENSIONS"
  case TGetInfoType_CLI_NULL_COLLATION: return "CLI_NULL_COLLATION"
  case TGetInfoType_CLI_ALTER_TABLE: return "CLI_ALTER_TABLE"
  case TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT: return "CLI_ORDER_BY_COLUMNS_IN_SELECT"
  case TGetInfoType_CLI_SPECIAL_CHARACTERS: return "CLI_SPECIAL_CHARACTERS"
  case TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY: return "CLI_MAX_COLUMNS_IN_GROUP_BY"
  case TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX: return "CLI_MAX_COLUMNS_IN_INDEX"
  case TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY: return "CLI_MAX_COLUMNS_IN_ORDER_BY"
  case TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT: return "CLI_MAX_COLUMNS_IN_SELECT"
  case TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE: return "CLI_MAX_COLUMNS_IN_TABLE"
  case TGetInfoType_CLI_MAX_INDEX_SIZE: return "CLI_MAX_INDEX_SIZE"
  case TGetInfoType_CLI_MAX_ROW_SIZE: return "CLI_MAX_ROW_SIZE"
  case TGetInfoType_CLI_MAX_STATEMENT_LEN: return "CLI_MAX_STATEMENT_LEN"
  case TGetInfoType_CLI_MAX_TABLES_IN_SELECT: return "CLI_MAX_TABLES_IN_SELECT"
  case TGetInfoType_CLI_MAX_USER_NAME_LEN: return "CLI_MAX_USER_NAME_LEN"
  case TGetInfoType_CLI_OJ_CAPABILITIES: return "CLI_OJ_CAPABILITIES"
  case TGetInfoType_CLI_XOPEN_CLI_YEAR: return "CLI_XOPEN_CLI_YEAR"
  case TGetInfoType_CLI_CURSOR_SENSITIVITY: return "CLI_CURSOR_SENSITIVITY"
  case TGetInfoType_CLI_DESCRIBE_PARAMETER: return "CLI_DESCRIBE_PARAMETER"
  case TGetInfoType_CLI_CATALOG_NAME: return "CLI_CATALOG_NAME"
  case TGetInfoType_CLI_COLLATION_SEQ: return "CLI_COLLATION_SEQ"
  case TGetInfoType_CLI_MAX_IDENTIFIER_LEN: return "CLI_MAX_IDENTIFIER_LEN"
  }
  return "<UNSET>"
}

func TGetInfoTypeFromString(s string) (TGetInfoType, error) {
  switch s {
  case "CLI_MAX_DRIVER_CONNECTIONS": return TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS, nil 
  case "CLI_MAX_CONCURRENT_ACTIVITIES": return TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES, nil 
  case "CLI_DATA_SOURCE_NAME": return TGetInfoType_CLI_DATA_SOURCE_NAME, nil 
  case "CLI_FETCH_DIRECTION": return TGetInfoType_CLI_FETCH_DIRECTION, nil 
  case "CLI_SERVER_NAME": return TGetInfoType_CLI_SERVER_NAME, nil 
  case "CLI_SEARCH_PATTERN_ESCAPE": return TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE, nil 
  case "CLI_DBMS_NAME": return TGetInfoType_CLI_DBMS_NAME, nil 
  case "CLI_DBMS_VER": return TGetInfoType_CLI_DBMS_VER, nil 
  case "CLI_ACCESSIBLE_TABLES": return TGetInfoType_CLI_ACCESSIBLE_TABLES, nil 
  case "CLI_ACCESSIBLE_PROCEDURES": return TGetInfoType_CLI_ACCESSIBLE_PROCEDURES, nil 
  case "CLI_CURSOR_COMMIT_BEHAVIOR": return TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR, nil 
  case "CLI_DATA_SOURCE_READ_ONLY": return TGetInfoType_CLI_DATA_SOURCE_READ_ONLY, nil 
  case "CLI_DEFAULT_TXN_ISOLATION": return TGetInfoType_CLI_DEFAULT_TXN_ISOLATION, nil 
  case "CLI_IDENTIFIER_CASE": return TGetInfoType_CLI_IDENTIFIER_CASE, nil 
  case "CLI_IDENTIFIER_QUOTE_CHAR": return TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR, nil 
  case "CLI_MAX_COLUMN_NAME_LEN": return TGetInfoType_CLI_MAX_COLUMN_NAME_LEN, nil 
  case "CLI_MAX_CURSOR_NAME_LEN": return TGetInfoType_CLI_MAX_CURSOR_NAME_LEN, nil 
  case "CLI_MAX_SCHEMA_NAME_LEN": return TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN, nil 
  case "CLI_MAX_CATALOG_NAME_LEN": return TGetInfoType_CLI_MAX_CATALOG_NAME_LEN, nil 
  case "CLI_MAX_TABLE_NAME_LEN": return TGetInfoType_CLI_MAX_TABLE_NAME_LEN, nil 
  case "CLI_SCROLL_CONCURRENCY": return TGetInfoType_CLI_SCROLL_CONCURRENCY, nil 
  case "CLI_TXN_CAPABLE": return TGetInfoType_CLI_TXN_CAPABLE, nil 
  case "CLI_USER_NAME": return TGetInfoType_CLI_USER_NAME, nil 
  case "CLI_TXN_ISOLATION_OPTION": return TGetInfoType_CLI_TXN_ISOLATION_OPTION, nil 
  case "CLI_INTEGRITY": return TGetInfoType_CLI_INTEGRITY, nil 
  case "CLI_GETDATA_EXTENSIONS": return TGetInfoType_CLI_GETDATA_EXTENSIONS, nil 
  case "CLI_NULL_COLLATION": return TGetInfoType_CLI_NULL_COLLATION, nil 
  case "CLI_ALTER_TABLE": return TGetInfoType_CLI_ALTER_TABLE, nil 
  case "CLI_ORDER_BY_COLUMNS_IN_SELECT": return TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT, nil 
  case "CLI_SPECIAL_CHARACTERS": return TGetInfoType_CLI_SPECIAL_CHARACTERS, nil 
  case "CLI_MAX_COLUMNS_IN_GROUP_BY": return TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY, nil 
  case "CLI_MAX_COLUMNS_IN_INDEX": return TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX, nil 
  case "CLI_MAX_COLUMNS_IN_ORDER_BY": return TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY, nil 
  case "CLI_MAX_COLUMNS_IN_SELECT": return TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT, nil 
  case "CLI_MAX_COLUMNS_IN_TABLE": return TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE, nil 
  case "CLI_MAX_INDEX_SIZE": return TGetInfoType_CLI_MAX_INDEX_SIZE, nil 
  case "CLI_MAX_ROW_SIZE": return TGetInfoType_CLI_MAX_ROW_SIZE, nil 
  case "CLI_MAX_STATEMENT_LEN": return TGetInfoType_CLI_MAX_STATEMENT_LEN, nil 
  case "CLI_MAX_TABLES_IN_SELECT": return TGetInfoType_CLI_MAX_TABLES_IN_SELECT, nil 
  case "CLI_MAX_USER_NAME_LEN": return TGetInfoType_CLI_MAX_USER_NAME_LEN, nil 
  case "CLI_OJ_CAPABILITIES": return TGetInfoType_CLI_OJ_CAPABILITIES, nil 
  case "CLI_XOPEN_CLI_YEAR": return TGetInfoType_CLI_XOPEN_CLI_YEAR, nil 
  case "CLI_CURSOR_SENSITIVITY": return TGetInfoType_CLI_CURSOR_SENSITIVITY, nil 
  case "CLI_DESCRIBE_PARAMETER": return TGetInfoType_CLI_DESCRIBE_PARAMETER, nil 
  case "CLI_CATALOG_NAME": return TGetInfoType_CLI_CATALOG_NAME, nil 
  case "CLI_COLLATION_SEQ": return TGetInfoType_CLI_COLLATION_SEQ, nil 
  case "CLI_MAX_IDENTIFIER_LEN": return TGetInfoType_CLI_MAX_IDENTIFIER_LEN, nil 
  }
  return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string")
}


func TGetInfoTypePtr(v TGetInfoType) *TGetInfoType { return &v }

func (p TGetInfoType) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TGetInfoType) UnmarshalText(text []byte) error {
q, err := TGetInfoTypeFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TGetInfoType) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TGetInfoType(v)
return nil
}

func (p * TGetInfoType) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TFetchOrientation int64
const (
  TFetchOrientation_FETCH_NEXT TFetchOrientation = 0
  TFetchOrientation_FETCH_PRIOR TFetchOrientation = 1
  TFetchOrientation_FETCH_RELATIVE TFetchOrientation = 2
  TFetchOrientation_FETCH_ABSOLUTE TFetchOrientation = 3
  TFetchOrientation_FETCH_FIRST TFetchOrientation = 4
  TFetchOrientation_FETCH_LAST TFetchOrientation = 5
)

func (p TFetchOrientation) String() string {
  switch p {
  case TFetchOrientation_FETCH_NEXT: return "FETCH_NEXT"
  case TFetchOrientation_FETCH_PRIOR: return "FETCH_PRIOR"
  case TFetchOrientation_FETCH_RELATIVE: return "FETCH_RELATIVE"
  case TFetchOrientation_FETCH_ABSOLUTE: return "FETCH_ABSOLUTE"
  case TFetchOrientation_FETCH_FIRST: return "FETCH_FIRST"
  case TFetchOrientation_FETCH_LAST: return "FETCH_LAST"
  }
  return "<UNSET>"
}

func TFetchOrientationFromString(s string) (TFetchOrientation, error) {
  switch s {
  case "FETCH_NEXT": return TFetchOrientation_FETCH_NEXT, nil 
  case "FETCH_PRIOR": return TFetchOrientation_FETCH_PRIOR, nil 
  case "FETCH_RELATIVE": return TFetchOrientation_FETCH_RELATIVE, nil 
  case "FETCH_ABSOLUTE": return TFetchOrientation_FETCH_ABSOLUTE, nil 
  case "FETCH_FIRST": return TFetchOrientation_FETCH_FIRST, nil 
  case "FETCH_LAST": return TFetchOrientation_FETCH_LAST, nil 
  }
  return TFetchOrientation(0), fmt.Errorf("not a valid TFetchOrientation string")
}


func TFetchOrientationPtr(v TFetchOrientation) *TFetchOrientation { return &v }

func (p TFetchOrientation) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *TFetchOrientation) UnmarshalText(text []byte) error {
q, err := TFetchOrientationFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *TFetchOrientation) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TFetchOrientation(v)
return nil
}

func (p * TFetchOrientation) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type TTypeEntryPtr int32

func TTypeEntryPtrPtr(v TTypeEntryPtr) *TTypeEntryPtr { return &v }

type TIdentifier string

func TIdentifierPtr(v TIdentifier) *TIdentifier { return &v }

type TPattern string

func TPatternPtr(v TPattern) *TPattern { return &v }

type TPatternOrIdentifier string

func TPatternOrIdentifierPtr(v TPatternOrIdentifier) *TPatternOrIdentifier { return &v }

// Attributes:
//  - I32Value
//  - StringValue
type TTypeQualifierValue struct {
  I32Value *int32 `thrift:"i32Value,1" db:"i32Value" json:"i32Value,omitempty"`
  StringValue *string `thrift:"stringValue,2" db:"stringValue" json:"stringValue,omitempty"`
}

func NewTTypeQualifierValue() *TTypeQualifierValue {
  return &TTypeQualifierValue{}
}

var TTypeQualifierValue_I32Value_DEFAULT int32
func (p *TTypeQualifierValue) GetI32Value() int32 {
  if !p.IsSetI32Value() {
    return TTypeQualifierValue_I32Value_DEFAULT
  }
return *p.I32Value
}
var TTypeQualifierValue_StringValue_DEFAULT string
func (p *TTypeQualifierValue) GetStringValue() string {
  if !p.IsSetStringValue() {
    return TTypeQualifierValue_StringValue_DEFAULT
  }
return *p.StringValue
}
func (p *TTypeQualifierValue) CountSetFieldsTTypeQualifierValue() int {
  count := 0
  if (p.IsSetI32Value()) {
    count++
  }
  if (p.IsSetStringValue()) {
    count++
  }
  return count

}

func (p *TTypeQualifierValue) IsSetI32Value() bool {
  return p.I32Value != nil
}

func (p *TTypeQualifierValue) IsSetStringValue() bool {
  return p.StringValue != nil
}

func (p *TTypeQualifierValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TTypeQualifierValue)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.I32Value = &v
}
  return nil
}

func (p *TTypeQualifierValue)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.StringValue = &v
}
  return nil
}

func (p *TTypeQualifierValue) Write(oprot thrift.TProtocol) error {
  if c := p.CountSetFieldsTTypeQualifierValue(); c != 1 {
    return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
  }
  if err := oprot.WriteStructBegin("TTypeQualifierValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TTypeQualifierValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetI32Value() {
    if err := oprot.WriteFieldBegin("i32Value", thrift.I32, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) }
    if err := oprot.WriteI32(int32(*p.I32Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) }
  }
  return err
}

func (p *TTypeQualifierValue) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetStringValue() {
    if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) }
    if err := oprot.WriteString(string(*p.StringValue)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) }
  }
  return err
}

func (p *TTypeQualifierValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TTypeQualifierValue(%+v)", *p)
}

// Attributes:
//  - Qualifiers
type TTypeQualifiers struct {
  Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"`
}

func NewTTypeQualifiers() *TTypeQualifiers {
  return &TTypeQualifiers{}
}


func (p *TTypeQualifiers) GetQualifiers() map[string]*TTypeQualifierValue {
  return p.Qualifiers
}
func (p *TTypeQualifiers) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetQualifiers bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetQualifiers = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetQualifiers{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Qualifiers is not set"));
  }
  return nil
}

func (p *TTypeQualifiers)  ReadField1(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]*TTypeQualifierValue, size)
  p.Qualifiers =  tMap
  for i := 0; i < size; i ++ {
var _key0 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key0 = v
}
    _val1 := &TTypeQualifierValue{}
    if err := _val1.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err)
    }
    p.Qualifiers[_key0] = _val1
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *TTypeQualifiers) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TTypeQualifiers"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TTypeQualifiers) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("qualifiers", thrift.MAP, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Qualifiers {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) }
  return err
}

func (p *TTypeQualifiers) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TTypeQualifiers(%+v)", *p)
}

// Attributes:
//  - Type
//  - TypeQualifiers
type TPrimitiveTypeEntry struct {
  Type TTypeId `thrift:"type,1,required" db:"type" json:"type"`
  TypeQualifiers *TTypeQualifiers `thrift:"typeQualifiers,2" db:"typeQualifiers" json:"typeQualifiers,omitempty"`
}

func NewTPrimitiveTypeEntry() *TPrimitiveTypeEntry {
  return &TPrimitiveTypeEntry{}
}


func (p *TPrimitiveTypeEntry) GetType() TTypeId {
  return p.Type
}
var TPrimitiveTypeEntry_TypeQualifiers_DEFAULT *TTypeQualifiers
func (p *TPrimitiveTypeEntry) GetTypeQualifiers() *TTypeQualifiers {
  if !p.IsSetTypeQualifiers() {
    return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT
  }
return p.TypeQualifiers
}
func (p *TPrimitiveTypeEntry) IsSetTypeQualifiers() bool {
  return p.TypeQualifiers != nil
}

func (p *TPrimitiveTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetType bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetType = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetType{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set"));
  }
  return nil
}

func (p *TPrimitiveTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := TTypeId(v)
  p.Type = temp
}
  return nil
}

func (p *TPrimitiveTypeEntry)  ReadField2(iprot thrift.TProtocol) error {
  p.TypeQualifiers = &TTypeQualifiers{}
  if err := p.TypeQualifiers.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err)
  }
  return nil
}

func (p *TPrimitiveTypeEntry) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TPrimitiveTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TPrimitiveTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) }
  if err := oprot.WriteI32(int32(p.Type)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) }
  return err
}

func (p *TPrimitiveTypeEntry) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetTypeQualifiers() {
    if err := oprot.WriteFieldBegin("typeQualifiers", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeQualifiers: ", p), err) }
    if err := p.TypeQualifiers.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) }
  }
  return err
}

func (p *TPrimitiveTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p)
}

// Attributes:
//  - ObjectTypePtr
type TArrayTypeEntry struct {
  ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"`
}

func NewTArrayTypeEntry() *TArrayTypeEntry {
  return &TArrayTypeEntry{}
}


func (p *TArrayTypeEntry) GetObjectTypePtr() TTypeEntryPtr {
  return p.ObjectTypePtr
}
func (p *TArrayTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetObjectTypePtr bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetObjectTypePtr = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetObjectTypePtr{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ObjectTypePtr is not set"));
  }
  return nil
}

func (p *TArrayTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := TTypeEntryPtr(v)
  p.ObjectTypePtr = temp
}
  return nil
}

func (p *TArrayTypeEntry) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TArrayTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TArrayTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("objectTypePtr", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) }
  if err := oprot.WriteI32(int32(p.ObjectTypePtr)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) }
  return err
}

func (p *TArrayTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TArrayTypeEntry(%+v)", *p)
}

// Attributes:
//  - KeyTypePtr
//  - ValueTypePtr
type TMapTypeEntry struct {
  KeyTypePtr TTypeEntryPtr `thrift:"keyTypePtr,1,required" db:"keyTypePtr" json:"keyTypePtr"`
  ValueTypePtr TTypeEntryPtr `thrift:"valueTypePtr,2,required" db:"valueTypePtr" json:"valueTypePtr"`
}

func NewTMapTypeEntry() *TMapTypeEntry {
  return &TMapTypeEntry{}
}


func (p *TMapTypeEntry) GetKeyTypePtr() TTypeEntryPtr {
  return p.KeyTypePtr
}

func (p *TMapTypeEntry) GetValueTypePtr() TTypeEntryPtr {
  return p.ValueTypePtr
}
func (p *TMapTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetKeyTypePtr bool = false;
  var issetValueTypePtr bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetKeyTypePtr = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetValueTypePtr = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetKeyTypePtr{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field KeyTypePtr is not set"));
  }
  if !issetValueTypePtr{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueTypePtr is not set"));
  }
  return nil
}

func (p *TMapTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := TTypeEntryPtr(v)
  p.KeyTypePtr = temp
}
  return nil
}

func (p *TMapTypeEntry)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TTypeEntryPtr(v)
  p.ValueTypePtr = temp
}
  return nil
}

func (p *TMapTypeEntry) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TMapTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TMapTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("keyTypePtr", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) }
  if err := oprot.WriteI32(int32(p.KeyTypePtr)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) }
  return err
}

func (p *TMapTypeEntry) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("valueTypePtr", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) }
  if err := oprot.WriteI32(int32(p.ValueTypePtr)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) }
  return err
}

func (p *TMapTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TMapTypeEntry(%+v)", *p)
}

// Attributes:
//  - NameToTypePtr
type TStructTypeEntry struct {
  NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"`
}

func NewTStructTypeEntry() *TStructTypeEntry {
  return &TStructTypeEntry{}
}


func (p *TStructTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr {
  return p.NameToTypePtr
}
func (p *TStructTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetNameToTypePtr bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetNameToTypePtr = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetNameToTypePtr{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set"));
  }
  return nil
}

func (p *TStructTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]TTypeEntryPtr, size)
  p.NameToTypePtr =  tMap
  for i := 0; i < size; i ++ {
var _key2 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key2 = v
}
var _val3 TTypeEntryPtr
    if v, err := iprot.ReadI32(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    temp := TTypeEntryPtr(v)
    _val3 = temp
}
    p.NameToTypePtr[_key2] = _val3
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *TStructTypeEntry) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TStructTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TStructTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nameToTypePtr", thrift.MAP, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.NameToTypePtr {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteI32(int32(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) }
  return err
}

func (p *TStructTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TStructTypeEntry(%+v)", *p)
}

// Attributes:
//  - NameToTypePtr
type TUnionTypeEntry struct {
  NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"`
}

func NewTUnionTypeEntry() *TUnionTypeEntry {
  return &TUnionTypeEntry{}
}


func (p *TUnionTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr {
  return p.NameToTypePtr
}
func (p *TUnionTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetNameToTypePtr bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetNameToTypePtr = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetNameToTypePtr{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set"));
  }
  return nil
}

func (p *TUnionTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]TTypeEntryPtr, size)
  p.NameToTypePtr =  tMap
  for i := 0; i < size; i ++ {
var _key4 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key4 = v
}
var _val5 TTypeEntryPtr
    if v, err := iprot.ReadI32(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    temp := TTypeEntryPtr(v)
    _val5 = temp
}
    p.NameToTypePtr[_key4] = _val5
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *TUnionTypeEntry) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TUnionTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TUnionTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nameToTypePtr", thrift.MAP, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.NameToTypePtr {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteI32(int32(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) }
  return err
}

func (p *TUnionTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TUnionTypeEntry(%+v)", *p)
}

// Attributes:
//  - TypeClassName
type TUserDefinedTypeEntry struct {
  TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"`
}

func NewTUserDefinedTypeEntry() *TUserDefinedTypeEntry {
  return &TUserDefinedTypeEntry{}
}


func (p *TUserDefinedTypeEntry) GetTypeClassName() string {
  return p.TypeClassName
}
func (p *TUserDefinedTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetTypeClassName bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetTypeClassName = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetTypeClassName{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeClassName is not set"));
  }
  return nil
}

func (p *TUserDefinedTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.TypeClassName = v
}
  return nil
}

func (p *TUserDefinedTypeEntry) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TUserDefinedTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TUserDefinedTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("typeClassName", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) }
  if err := oprot.WriteString(string(p.TypeClassName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) }
  return err
}

func (p *TUserDefinedTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p)
}

// Attributes:
//  - PrimitiveEntry
//  - ArrayEntry
//  - MapEntry
//  - StructEntry
//  - UnionEntry
//  - UserDefinedTypeEntry
type TTypeEntry struct {
  PrimitiveEntry *TPrimitiveTypeEntry `thrift:"primitiveEntry,1" db:"primitiveEntry" json:"primitiveEntry,omitempty"`
  ArrayEntry *TArrayTypeEntry `thrift:"arrayEntry,2" db:"arrayEntry" json:"arrayEntry,omitempty"`
  MapEntry *TMapTypeEntry `thrift:"mapEntry,3" db:"mapEntry" json:"mapEntry,omitempty"`
  StructEntry *TStructTypeEntry `thrift:"structEntry,4" db:"structEntry" json:"structEntry,omitempty"`
  UnionEntry *TUnionTypeEntry `thrift:"unionEntry,5" db:"unionEntry" json:"unionEntry,omitempty"`
  UserDefinedTypeEntry *TUserDefinedTypeEntry `thrift:"userDefinedTypeEntry,6" db:"userDefinedTypeEntry" json:"userDefinedTypeEntry,omitempty"`
}

func NewTTypeEntry() *TTypeEntry {
  return &TTypeEntry{}
}

var TTypeEntry_PrimitiveEntry_DEFAULT *TPrimitiveTypeEntry
func (p *TTypeEntry) GetPrimitiveEntry() *TPrimitiveTypeEntry {
  if !p.IsSetPrimitiveEntry() {
    return TTypeEntry_PrimitiveEntry_DEFAULT
  }
return p.PrimitiveEntry
}
var TTypeEntry_ArrayEntry_DEFAULT *TArrayTypeEntry
func (p *TTypeEntry) GetArrayEntry() *TArrayTypeEntry {
  if !p.IsSetArrayEntry() {
    return TTypeEntry_ArrayEntry_DEFAULT
  }
return p.ArrayEntry
}
var TTypeEntry_MapEntry_DEFAULT *TMapTypeEntry
func (p *TTypeEntry) GetMapEntry() *TMapTypeEntry {
  if !p.IsSetMapEntry() {
    return TTypeEntry_MapEntry_DEFAULT
  }
return p.MapEntry
}
var TTypeEntry_StructEntry_DEFAULT *TStructTypeEntry
func (p *TTypeEntry) GetStructEntry() *TStructTypeEntry {
  if !p.IsSetStructEntry() {
    return TTypeEntry_StructEntry_DEFAULT
  }
return p.StructEntry
}
var TTypeEntry_UnionEntry_DEFAULT *TUnionTypeEntry
func (p *TTypeEntry) GetUnionEntry() *TUnionTypeEntry {
  if !p.IsSetUnionEntry() {
    return TTypeEntry_UnionEntry_DEFAULT
  }
return p.UnionEntry
}
var TTypeEntry_UserDefinedTypeEntry_DEFAULT *TUserDefinedTypeEntry
func (p *TTypeEntry) GetUserDefinedTypeEntry() *TUserDefinedTypeEntry {
  if !p.IsSetUserDefinedTypeEntry() {
    return TTypeEntry_UserDefinedTypeEntry_DEFAULT
  }
return p.UserDefinedTypeEntry
}
func (p *TTypeEntry) CountSetFieldsTTypeEntry() int {
  count := 0
  if (p.IsSetPrimitiveEntry()) {
    count++
  }
  if (p.IsSetArrayEntry()) {
    count++
  }
  if (p.IsSetMapEntry()) {
    count++
  }
  if (p.IsSetStructEntry()) {
    count++
  }
  if (p.IsSetUnionEntry()) {
    count++
  }
  if (p.IsSetUserDefinedTypeEntry()) {
    count++
  }
  return count

}

func (p *TTypeEntry) IsSetPrimitiveEntry() bool {
  return p.PrimitiveEntry != nil
}

func (p *TTypeEntry) IsSetArrayEntry() bool {
  return p.ArrayEntry != nil
}

func (p *TTypeEntry) IsSetMapEntry() bool {
  return p.MapEntry != nil
}

func (p *TTypeEntry) IsSetStructEntry() bool {
  return p.StructEntry != nil
}

func (p *TTypeEntry) IsSetUnionEntry() bool {
  return p.UnionEntry != nil
}

func (p *TTypeEntry) IsSetUserDefinedTypeEntry() bool {
  return p.UserDefinedTypeEntry != nil
}

func (p *TTypeEntry) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TTypeEntry)  ReadField1(iprot thrift.TProtocol) error {
  p.PrimitiveEntry = &TPrimitiveTypeEntry{}
  if err := p.PrimitiveEntry.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err)
  }
  return nil
}

func (p *TTypeEntry)  ReadField2(iprot thrift.TProtocol) error {
  p.ArrayEntry = &TArrayTypeEntry{}
  if err := p.ArrayEntry.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err)
  }
  return nil
}

func (p *TTypeEntry)  ReadField3(iprot thrift.TProtocol) error {
  p.MapEntry = &TMapTypeEntry{}
  if err := p.MapEntry.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err)
  }
  return nil
}

func (p *TTypeEntry)  ReadField4(iprot thrift.TProtocol) error {
  p.StructEntry = &TStructTypeEntry{}
  if err := p.StructEntry.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err)
  }
  return nil
}

func (p *TTypeEntry)  ReadField5(iprot thrift.TProtocol) error {
  p.UnionEntry = &TUnionTypeEntry{}
  if err := p.UnionEntry.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err)
  }
  return nil
}

func (p *TTypeEntry)  ReadField6(iprot thrift.TProtocol) error {
  p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{}
  if err := p.UserDefinedTypeEntry.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err)
  }
  return nil
}

func (p *TTypeEntry) Write(oprot thrift.TProtocol) error {
  if c := p.CountSetFieldsTTypeEntry(); c != 1 {
    return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
  }
  if err := oprot.WriteStructBegin("TTypeEntry"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TTypeEntry) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetPrimitiveEntry() {
    if err := oprot.WriteFieldBegin("primitiveEntry", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:primitiveEntry: ", p), err) }
    if err := p.PrimitiveEntry.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) }
  }
  return err
}

func (p *TTypeEntry) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetArrayEntry() {
    if err := oprot.WriteFieldBegin("arrayEntry", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arrayEntry: ", p), err) }
    if err := p.ArrayEntry.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) }
  }
  return err
}

func (p *TTypeEntry) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetMapEntry() {
    if err := oprot.WriteFieldBegin("mapEntry", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mapEntry: ", p), err) }
    if err := p.MapEntry.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) }
  }
  return err
}

func (p *TTypeEntry) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetStructEntry() {
    if err := oprot.WriteFieldBegin("structEntry", thrift.STRUCT, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:structEntry: ", p), err) }
    if err := p.StructEntry.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) }
  }
  return err
}

func (p *TTypeEntry) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetUnionEntry() {
    if err := oprot.WriteFieldBegin("unionEntry", thrift.STRUCT, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:unionEntry: ", p), err) }
    if err := p.UnionEntry.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) }
  }
  return err
}

func (p *TTypeEntry) writeField6(oprot thrift.TProtocol) (err error) {
  if p.IsSetUserDefinedTypeEntry() {
    if err := oprot.WriteFieldBegin("userDefinedTypeEntry", thrift.STRUCT, 6); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:userDefinedTypeEntry: ", p), err) }
    if err := p.UserDefinedTypeEntry.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) }
  }
  return err
}

func (p *TTypeEntry) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TTypeEntry(%+v)", *p)
}

// Attributes:
//  - Types
type TTypeDesc struct {
  Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"`
}

func NewTTypeDesc() *TTypeDesc {
  return &TTypeDesc{}
}


func (p *TTypeDesc) GetTypes() []*TTypeEntry {
  return p.Types
}
func (p *TTypeDesc) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetTypes bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetTypes = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetTypes{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Types is not set"));
  }
  return nil
}

func (p *TTypeDesc)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*TTypeEntry, 0, size)
  p.Types =  tSlice
  for i := 0; i < size; i ++ {
    _elem6 := &TTypeEntry{}
    if err := _elem6.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err)
    }
    p.Types = append(p.Types, _elem6)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TTypeDesc) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TTypeDesc"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TTypeDesc) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("types", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Types)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Types {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) }
  return err
}

func (p *TTypeDesc) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TTypeDesc(%+v)", *p)
}

// Attributes:
//  - ColumnName
//  - TypeDesc
//  - Position
//  - Comment
type TColumnDesc struct {
  ColumnName string `thrift:"columnName,1,required" db:"columnName" json:"columnName"`
  TypeDesc *TTypeDesc `thrift:"typeDesc,2,required" db:"typeDesc" json:"typeDesc"`
  Position int32 `thrift:"position,3,required" db:"position" json:"position"`
  Comment *string `thrift:"comment,4" db:"comment" json:"comment,omitempty"`
}

func NewTColumnDesc() *TColumnDesc {
  return &TColumnDesc{}
}


func (p *TColumnDesc) GetColumnName() string {
  return p.ColumnName
}
var TColumnDesc_TypeDesc_DEFAULT *TTypeDesc
func (p *TColumnDesc) GetTypeDesc() *TTypeDesc {
  if !p.IsSetTypeDesc() {
    return TColumnDesc_TypeDesc_DEFAULT
  }
return p.TypeDesc
}

func (p *TColumnDesc) GetPosition() int32 {
  return p.Position
}
var TColumnDesc_Comment_DEFAULT string
func (p *TColumnDesc) GetComment() string {
  if !p.IsSetComment() {
    return TColumnDesc_Comment_DEFAULT
  }
return *p.Comment
}
func (p *TColumnDesc) IsSetTypeDesc() bool {
  return p.TypeDesc != nil
}

func (p *TColumnDesc) IsSetComment() bool {
  return p.Comment != nil
}

func (p *TColumnDesc) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetColumnName bool = false;
  var issetTypeDesc bool = false;
  var issetPosition bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetColumnName = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetTypeDesc = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
        issetPosition = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetColumnName{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColumnName is not set"));
  }
  if !issetTypeDesc{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeDesc is not set"));
  }
  if !issetPosition{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Position is not set"));
  }
  return nil
}

func (p *TColumnDesc)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.ColumnName = v
}
  return nil
}

func (p *TColumnDesc)  ReadField2(iprot thrift.TProtocol) error {
  p.TypeDesc = &TTypeDesc{}
  if err := p.TypeDesc.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err)
  }
  return nil
}

func (p *TColumnDesc)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Position = v
}
  return nil
}

func (p *TColumnDesc)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.Comment = &v
}
  return nil
}

func (p *TColumnDesc) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TColumnDesc"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TColumnDesc) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("columnName", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) }
  if err := oprot.WriteString(string(p.ColumnName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) }
  return err
}

func (p *TColumnDesc) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("typeDesc", thrift.STRUCT, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeDesc: ", p), err) }
  if err := p.TypeDesc.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) }
  return err
}

func (p *TColumnDesc) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("position", thrift.I32, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) }
  if err := oprot.WriteI32(int32(p.Position)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) }
  return err
}

func (p *TColumnDesc) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetComment() {
    if err := oprot.WriteFieldBegin("comment", thrift.STRING, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) }
    if err := oprot.WriteString(string(*p.Comment)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) }
  }
  return err
}

func (p *TColumnDesc) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TColumnDesc(%+v)", *p)
}

// Attributes:
//  - Columns
type TTableSchema struct {
  Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"`
}

func NewTTableSchema() *TTableSchema {
  return &TTableSchema{}
}


func (p *TTableSchema) GetColumns() []*TColumnDesc {
  return p.Columns
}
func (p *TTableSchema) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetColumns bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetColumns = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetColumns{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Columns is not set"));
  }
  return nil
}

func (p *TTableSchema)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*TColumnDesc, 0, size)
  p.Columns =  tSlice
  for i := 0; i < size; i ++ {
    _elem7 := &TColumnDesc{}
    if err := _elem7.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err)
    }
    p.Columns = append(p.Columns, _elem7)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TTableSchema) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TTableSchema"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TTableSchema) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Columns {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) }
  return err
}

func (p *TTableSchema) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TTableSchema(%+v)", *p)
}

// Attributes:
//  - Value
type TBoolValue struct {
  Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTBoolValue() *TBoolValue {
  return &TBoolValue{}
}

var TBoolValue_Value_DEFAULT bool
func (p *TBoolValue) GetValue() bool {
  if !p.IsSetValue() {
    return TBoolValue_Value_DEFAULT
  }
return *p.Value
}
func (p *TBoolValue) IsSetValue() bool {
  return p.Value != nil
}

func (p *TBoolValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TBoolValue)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Value = &v
}
  return nil
}

func (p *TBoolValue) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TBoolValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TBoolValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.BOOL, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TBoolValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TBoolValue(%+v)", *p)
}

// Attributes:
//  - Value
type TByteValue struct {
  Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTByteValue() *TByteValue {
  return &TByteValue{}
}

var TByteValue_Value_DEFAULT int8
func (p *TByteValue) GetValue() int8 {
  if !p.IsSetValue() {
    return TByteValue_Value_DEFAULT
  }
return *p.Value
}
func (p *TByteValue) IsSetValue() bool {
  return p.Value != nil
}

func (p *TByteValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.BYTE {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TByteValue)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadByte(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := int8(v)
  p.Value = &temp
}
  return nil
}

func (p *TByteValue) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TByteValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TByteValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.BYTE, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteByte(int8(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TByteValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TByteValue(%+v)", *p)
}

// Attributes:
//  - Value
type TI16Value struct {
  Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTI16Value() *TI16Value {
  return &TI16Value{}
}

var TI16Value_Value_DEFAULT int16
func (p *TI16Value) GetValue() int16 {
  if !p.IsSetValue() {
    return TI16Value_Value_DEFAULT
  }
return *p.Value
}
func (p *TI16Value) IsSetValue() bool {
  return p.Value != nil
}

func (p *TI16Value) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TI16Value)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Value = &v
}
  return nil
}

func (p *TI16Value) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TI16Value"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TI16Value) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.I16, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteI16(int16(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TI16Value) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TI16Value(%+v)", *p)
}

// Attributes:
//  - Value
type TI32Value struct {
  Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTI32Value() *TI32Value {
  return &TI32Value{}
}

var TI32Value_Value_DEFAULT int32
func (p *TI32Value) GetValue() int32 {
  if !p.IsSetValue() {
    return TI32Value_Value_DEFAULT
  }
return *p.Value
}
func (p *TI32Value) IsSetValue() bool {
  return p.Value != nil
}

func (p *TI32Value) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TI32Value)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Value = &v
}
  return nil
}

func (p *TI32Value) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TI32Value"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TI32Value) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.I32, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteI32(int32(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TI32Value) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TI32Value(%+v)", *p)
}

// Attributes:
//  - Value
type TI64Value struct {
  Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTI64Value() *TI64Value {
  return &TI64Value{}
}

var TI64Value_Value_DEFAULT int64
func (p *TI64Value) GetValue() int64 {
  if !p.IsSetValue() {
    return TI64Value_Value_DEFAULT
  }
return *p.Value
}
func (p *TI64Value) IsSetValue() bool {
  return p.Value != nil
}

func (p *TI64Value) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TI64Value)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Value = &v
}
  return nil
}

func (p *TI64Value) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TI64Value"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TI64Value) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.I64, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteI64(int64(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TI64Value) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TI64Value(%+v)", *p)
}

// Attributes:
//  - Value
type TDoubleValue struct {
  Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTDoubleValue() *TDoubleValue {
  return &TDoubleValue{}
}

var TDoubleValue_Value_DEFAULT float64
func (p *TDoubleValue) GetValue() float64 {
  if !p.IsSetValue() {
    return TDoubleValue_Value_DEFAULT
  }
return *p.Value
}
func (p *TDoubleValue) IsSetValue() bool {
  return p.Value != nil
}

func (p *TDoubleValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.DOUBLE {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TDoubleValue)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadDouble(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Value = &v
}
  return nil
}

func (p *TDoubleValue) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TDoubleValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TDoubleValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.DOUBLE, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteDouble(float64(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TDoubleValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TDoubleValue(%+v)", *p)
}

// Attributes:
//  - Value
type TStringValue struct {
  Value *string `thrift:"value,1" db:"value" json:"value,omitempty"`
}

func NewTStringValue() *TStringValue {
  return &TStringValue{}
}

var TStringValue_Value_DEFAULT string
func (p *TStringValue) GetValue() string {
  if !p.IsSetValue() {
    return TStringValue_Value_DEFAULT
  }
return *p.Value
}
func (p *TStringValue) IsSetValue() bool {
  return p.Value != nil
}

func (p *TStringValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TStringValue)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Value = &v
}
  return nil
}

func (p *TStringValue) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TStringValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TStringValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetValue() {
    if err := oprot.WriteFieldBegin("value", thrift.STRING, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
    if err := oprot.WriteString(string(*p.Value)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
  }
  return err
}

func (p *TStringValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TStringValue(%+v)", *p)
}

// Attributes:
//  - BoolVal
//  - ByteVal
//  - I16Val
//  - I32Val
//  - I64Val
//  - DoubleVal
//  - StringVal
type TColumnValue struct {
  BoolVal *TBoolValue `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"`
  ByteVal *TByteValue `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"`
  I16Val *TI16Value `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"`
  I32Val *TI32Value `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"`
  I64Val *TI64Value `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"`
  DoubleVal *TDoubleValue `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"`
  StringVal *TStringValue `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"`
}

func NewTColumnValue() *TColumnValue {
  return &TColumnValue{}
}

var TColumnValue_BoolVal_DEFAULT *TBoolValue
func (p *TColumnValue) GetBoolVal() *TBoolValue {
  if !p.IsSetBoolVal() {
    return TColumnValue_BoolVal_DEFAULT
  }
return p.BoolVal
}
var TColumnValue_ByteVal_DEFAULT *TByteValue
func (p *TColumnValue) GetByteVal() *TByteValue {
  if !p.IsSetByteVal() {
    return TColumnValue_ByteVal_DEFAULT
  }
return p.ByteVal
}
var TColumnValue_I16Val_DEFAULT *TI16Value
func (p *TColumnValue) GetI16Val() *TI16Value {
  if !p.IsSetI16Val() {
    return TColumnValue_I16Val_DEFAULT
  }
return p.I16Val
}
var TColumnValue_I32Val_DEFAULT *TI32Value
func (p *TColumnValue) GetI32Val() *TI32Value {
  if !p.IsSetI32Val() {
    return TColumnValue_I32Val_DEFAULT
  }
return p.I32Val
}
var TColumnValue_I64Val_DEFAULT *TI64Value
func (p *TColumnValue) GetI64Val() *TI64Value {
  if !p.IsSetI64Val() {
    return TColumnValue_I64Val_DEFAULT
  }
return p.I64Val
}
var TColumnValue_DoubleVal_DEFAULT *TDoubleValue
func (p *TColumnValue) GetDoubleVal() *TDoubleValue {
  if !p.IsSetDoubleVal() {
    return TColumnValue_DoubleVal_DEFAULT
  }
return p.DoubleVal
}
var TColumnValue_StringVal_DEFAULT *TStringValue
func (p *TColumnValue) GetStringVal() *TStringValue {
  if !p.IsSetStringVal() {
    return TColumnValue_StringVal_DEFAULT
  }
return p.StringVal
}
func (p *TColumnValue) CountSetFieldsTColumnValue() int {
  count := 0
  if (p.IsSetBoolVal()) {
    count++
  }
  if (p.IsSetByteVal()) {
    count++
  }
  if (p.IsSetI16Val()) {
    count++
  }
  if (p.IsSetI32Val()) {
    count++
  }
  if (p.IsSetI64Val()) {
    count++
  }
  if (p.IsSetDoubleVal()) {
    count++
  }
  if (p.IsSetStringVal()) {
    count++
  }
  return count

}

func (p *TColumnValue) IsSetBoolVal() bool {
  return p.BoolVal != nil
}

func (p *TColumnValue) IsSetByteVal() bool {
  return p.ByteVal != nil
}

func (p *TColumnValue) IsSetI16Val() bool {
  return p.I16Val != nil
}

func (p *TColumnValue) IsSetI32Val() bool {
  return p.I32Val != nil
}

func (p *TColumnValue) IsSetI64Val() bool {
  return p.I64Val != nil
}

func (p *TColumnValue) IsSetDoubleVal() bool {
  return p.DoubleVal != nil
}

func (p *TColumnValue) IsSetStringVal() bool {
  return p.StringVal != nil
}

func (p *TColumnValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 7:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField7(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField1(iprot thrift.TProtocol) error {
  p.BoolVal = &TBoolValue{}
  if err := p.BoolVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField2(iprot thrift.TProtocol) error {
  p.ByteVal = &TByteValue{}
  if err := p.ByteVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField3(iprot thrift.TProtocol) error {
  p.I16Val = &TI16Value{}
  if err := p.I16Val.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField4(iprot thrift.TProtocol) error {
  p.I32Val = &TI32Value{}
  if err := p.I32Val.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField5(iprot thrift.TProtocol) error {
  p.I64Val = &TI64Value{}
  if err := p.I64Val.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField6(iprot thrift.TProtocol) error {
  p.DoubleVal = &TDoubleValue{}
  if err := p.DoubleVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err)
  }
  return nil
}

func (p *TColumnValue)  ReadField7(iprot thrift.TProtocol) error {
  p.StringVal = &TStringValue{}
  if err := p.StringVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err)
  }
  return nil
}

func (p *TColumnValue) Write(oprot thrift.TProtocol) error {
  if c := p.CountSetFieldsTColumnValue(); c != 1 {
    return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
  }
  if err := oprot.WriteStructBegin("TColumnValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
    if err := p.writeField7(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TColumnValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetBoolVal() {
    if err := oprot.WriteFieldBegin("boolVal", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) }
    if err := p.BoolVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) }
  }
  return err
}

func (p *TColumnValue) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetByteVal() {
    if err := oprot.WriteFieldBegin("byteVal", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) }
    if err := p.ByteVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) }
  }
  return err
}

func (p *TColumnValue) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetI16Val() {
    if err := oprot.WriteFieldBegin("i16Val", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) }
    if err := p.I16Val.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) }
  }
  return err
}

func (p *TColumnValue) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetI32Val() {
    if err := oprot.WriteFieldBegin("i32Val", thrift.STRUCT, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) }
    if err := p.I32Val.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) }
  }
  return err
}

func (p *TColumnValue) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetI64Val() {
    if err := oprot.WriteFieldBegin("i64Val", thrift.STRUCT, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) }
    if err := p.I64Val.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) }
  }
  return err
}

func (p *TColumnValue) writeField6(oprot thrift.TProtocol) (err error) {
  if p.IsSetDoubleVal() {
    if err := oprot.WriteFieldBegin("doubleVal", thrift.STRUCT, 6); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) }
    if err := p.DoubleVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) }
  }
  return err
}

func (p *TColumnValue) writeField7(oprot thrift.TProtocol) (err error) {
  if p.IsSetStringVal() {
    if err := oprot.WriteFieldBegin("stringVal", thrift.STRUCT, 7); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) }
    if err := p.StringVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) }
  }
  return err
}

func (p *TColumnValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TColumnValue(%+v)", *p)
}

// Attributes:
//  - ColVals
type TRow struct {
  ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"`
}

func NewTRow() *TRow {
  return &TRow{}
}


func (p *TRow) GetColVals() []*TColumnValue {
  return p.ColVals
}
func (p *TRow) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetColVals bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetColVals = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetColVals{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColVals is not set"));
  }
  return nil
}

func (p *TRow)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*TColumnValue, 0, size)
  p.ColVals =  tSlice
  for i := 0; i < size; i ++ {
    _elem8 := &TColumnValue{}
    if err := _elem8.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err)
    }
    p.ColVals = append(p.ColVals, _elem8)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TRow) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TRow"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TRow) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("colVals", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.ColVals {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) }
  return err
}

func (p *TRow) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TRow(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TBoolColumn struct {
  Values []bool `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTBoolColumn() *TBoolColumn {
  return &TBoolColumn{}
}


func (p *TBoolColumn) GetValues() []bool {
  return p.Values
}

func (p *TBoolColumn) GetNulls() []byte {
  return p.Nulls
}
func (p *TBoolColumn) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TBoolColumn)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]bool, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem9 bool
    if v, err := iprot.ReadBool(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem9 = v
}
    p.Values = append(p.Values, _elem9)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TBoolColumn)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TBoolColumn) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TBoolColumn"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TBoolColumn) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.BOOL, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteBool(bool(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TBoolColumn) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TBoolColumn) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TBoolColumn(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TByteColumn struct {
  Values []int8 `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTByteColumn() *TByteColumn {
  return &TByteColumn{}
}


func (p *TByteColumn) GetValues() []int8 {
  return p.Values
}

func (p *TByteColumn) GetNulls() []byte {
  return p.Nulls
}
func (p *TByteColumn) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TByteColumn)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]int8, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem10 int8
    if v, err := iprot.ReadByte(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    temp := int8(v)
    _elem10 = temp
}
    p.Values = append(p.Values, _elem10)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TByteColumn)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TByteColumn) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TByteColumn"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TByteColumn) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.BYTE, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteByte(int8(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TByteColumn) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TByteColumn) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TByteColumn(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TI16Column struct {
  Values []int16 `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTI16Column() *TI16Column {
  return &TI16Column{}
}


func (p *TI16Column) GetValues() []int16 {
  return p.Values
}

func (p *TI16Column) GetNulls() []byte {
  return p.Nulls
}
func (p *TI16Column) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TI16Column)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]int16, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem11 int16
    if v, err := iprot.ReadI16(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem11 = v
}
    p.Values = append(p.Values, _elem11)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TI16Column)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TI16Column) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TI16Column"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TI16Column) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.I16, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteI16(int16(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TI16Column) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TI16Column) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TI16Column(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TI32Column struct {
  Values []int32 `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTI32Column() *TI32Column {
  return &TI32Column{}
}


func (p *TI32Column) GetValues() []int32 {
  return p.Values
}

func (p *TI32Column) GetNulls() []byte {
  return p.Nulls
}
func (p *TI32Column) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TI32Column)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]int32, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem12 int32
    if v, err := iprot.ReadI32(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem12 = v
}
    p.Values = append(p.Values, _elem12)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TI32Column)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TI32Column) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TI32Column"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TI32Column) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.I32, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteI32(int32(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TI32Column) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TI32Column) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TI32Column(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TI64Column struct {
  Values []int64 `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTI64Column() *TI64Column {
  return &TI64Column{}
}


func (p *TI64Column) GetValues() []int64 {
  return p.Values
}

func (p *TI64Column) GetNulls() []byte {
  return p.Nulls
}
func (p *TI64Column) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TI64Column)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]int64, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem13 int64
    if v, err := iprot.ReadI64(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem13 = v
}
    p.Values = append(p.Values, _elem13)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TI64Column)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TI64Column) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TI64Column"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TI64Column) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.I64, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteI64(int64(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TI64Column) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TI64Column) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TI64Column(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TDoubleColumn struct {
  Values []float64 `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTDoubleColumn() *TDoubleColumn {
  return &TDoubleColumn{}
}


func (p *TDoubleColumn) GetValues() []float64 {
  return p.Values
}

func (p *TDoubleColumn) GetNulls() []byte {
  return p.Nulls
}
func (p *TDoubleColumn) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TDoubleColumn)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]float64, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem14 float64
    if v, err := iprot.ReadDouble(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem14 = v
}
    p.Values = append(p.Values, _elem14)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TDoubleColumn)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TDoubleColumn) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TDoubleColumn"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TDoubleColumn) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.DOUBLE, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteDouble(float64(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TDoubleColumn) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TDoubleColumn) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TDoubleColumn(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TStringColumn struct {
  Values []string `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTStringColumn() *TStringColumn {
  return &TStringColumn{}
}


func (p *TStringColumn) GetValues() []string {
  return p.Values
}

func (p *TStringColumn) GetNulls() []byte {
  return p.Nulls
}
func (p *TStringColumn) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TStringColumn)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem15 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem15 = v
}
    p.Values = append(p.Values, _elem15)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TStringColumn)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TStringColumn) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TStringColumn"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TStringColumn) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TStringColumn) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TStringColumn) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TStringColumn(%+v)", *p)
}

// Attributes:
//  - Values
//  - Nulls
type TBinaryColumn struct {
  Values [][]byte `thrift:"values,1,required" db:"values" json:"values"`
  Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"`
}

func NewTBinaryColumn() *TBinaryColumn {
  return &TBinaryColumn{}
}


func (p *TBinaryColumn) GetValues() [][]byte {
  return p.Values
}

func (p *TBinaryColumn) GetNulls() []byte {
  return p.Nulls
}
func (p *TBinaryColumn) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetValues bool = false;
  var issetNulls bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetValues = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetNulls = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetValues{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set"));
  }
  if !issetNulls{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set"));
  }
  return nil
}

func (p *TBinaryColumn)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([][]byte, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem16 []byte
    if v, err := iprot.ReadBinary(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem16 = v
}
    p.Values = append(p.Values, _elem16)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TBinaryColumn)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Nulls = v
}
  return nil
}

func (p *TBinaryColumn) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TBinaryColumn"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TBinaryColumn) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteBinary(v); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *TBinaryColumn) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) }
  if err := oprot.WriteBinary(p.Nulls); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) }
  return err
}

func (p *TBinaryColumn) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TBinaryColumn(%+v)", *p)
}

// Attributes:
//  - BoolVal
//  - ByteVal
//  - I16Val
//  - I32Val
//  - I64Val
//  - DoubleVal
//  - StringVal
//  - BinaryVal
type TColumn struct {
  BoolVal *TBoolColumn `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"`
  ByteVal *TByteColumn `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"`
  I16Val *TI16Column `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"`
  I32Val *TI32Column `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"`
  I64Val *TI64Column `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"`
  DoubleVal *TDoubleColumn `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"`
  StringVal *TStringColumn `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"`
  BinaryVal *TBinaryColumn `thrift:"binaryVal,8" db:"binaryVal" json:"binaryVal,omitempty"`
}

func NewTColumn() *TColumn {
  return &TColumn{}
}

var TColumn_BoolVal_DEFAULT *TBoolColumn
func (p *TColumn) GetBoolVal() *TBoolColumn {
  if !p.IsSetBoolVal() {
    return TColumn_BoolVal_DEFAULT
  }
return p.BoolVal
}
var TColumn_ByteVal_DEFAULT *TByteColumn
func (p *TColumn) GetByteVal() *TByteColumn {
  if !p.IsSetByteVal() {
    return TColumn_ByteVal_DEFAULT
  }
return p.ByteVal
}
var TColumn_I16Val_DEFAULT *TI16Column
func (p *TColumn) GetI16Val() *TI16Column {
  if !p.IsSetI16Val() {
    return TColumn_I16Val_DEFAULT
  }
return p.I16Val
}
var TColumn_I32Val_DEFAULT *TI32Column
func (p *TColumn) GetI32Val() *TI32Column {
  if !p.IsSetI32Val() {
    return TColumn_I32Val_DEFAULT
  }
return p.I32Val
}
var TColumn_I64Val_DEFAULT *TI64Column
func (p *TColumn) GetI64Val() *TI64Column {
  if !p.IsSetI64Val() {
    return TColumn_I64Val_DEFAULT
  }
return p.I64Val
}
var TColumn_DoubleVal_DEFAULT *TDoubleColumn
func (p *TColumn) GetDoubleVal() *TDoubleColumn {
  if !p.IsSetDoubleVal() {
    return TColumn_DoubleVal_DEFAULT
  }
return p.DoubleVal
}
var TColumn_StringVal_DEFAULT *TStringColumn
func (p *TColumn) GetStringVal() *TStringColumn {
  if !p.IsSetStringVal() {
    return TColumn_StringVal_DEFAULT
  }
return p.StringVal
}
var TColumn_BinaryVal_DEFAULT *TBinaryColumn
func (p *TColumn) GetBinaryVal() *TBinaryColumn {
  if !p.IsSetBinaryVal() {
    return TColumn_BinaryVal_DEFAULT
  }
return p.BinaryVal
}
func (p *TColumn) CountSetFieldsTColumn() int {
  count := 0
  if (p.IsSetBoolVal()) {
    count++
  }
  if (p.IsSetByteVal()) {
    count++
  }
  if (p.IsSetI16Val()) {
    count++
  }
  if (p.IsSetI32Val()) {
    count++
  }
  if (p.IsSetI64Val()) {
    count++
  }
  if (p.IsSetDoubleVal()) {
    count++
  }
  if (p.IsSetStringVal()) {
    count++
  }
  if (p.IsSetBinaryVal()) {
    count++
  }
  return count

}

func (p *TColumn) IsSetBoolVal() bool {
  return p.BoolVal != nil
}

func (p *TColumn) IsSetByteVal() bool {
  return p.ByteVal != nil
}

func (p *TColumn) IsSetI16Val() bool {
  return p.I16Val != nil
}

func (p *TColumn) IsSetI32Val() bool {
  return p.I32Val != nil
}

func (p *TColumn) IsSetI64Val() bool {
  return p.I64Val != nil
}

func (p *TColumn) IsSetDoubleVal() bool {
  return p.DoubleVal != nil
}

func (p *TColumn) IsSetStringVal() bool {
  return p.StringVal != nil
}

func (p *TColumn) IsSetBinaryVal() bool {
  return p.BinaryVal != nil
}

func (p *TColumn) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 7:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField7(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 8:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField8(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TColumn)  ReadField1(iprot thrift.TProtocol) error {
  p.BoolVal = &TBoolColumn{}
  if err := p.BoolVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err)
  }
  return nil
}

func (p *TColumn)  ReadField2(iprot thrift.TProtocol) error {
  p.ByteVal = &TByteColumn{}
  if err := p.ByteVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err)
  }
  return nil
}

func (p *TColumn)  ReadField3(iprot thrift.TProtocol) error {
  p.I16Val = &TI16Column{}
  if err := p.I16Val.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err)
  }
  return nil
}

func (p *TColumn)  ReadField4(iprot thrift.TProtocol) error {
  p.I32Val = &TI32Column{}
  if err := p.I32Val.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err)
  }
  return nil
}

func (p *TColumn)  ReadField5(iprot thrift.TProtocol) error {
  p.I64Val = &TI64Column{}
  if err := p.I64Val.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err)
  }
  return nil
}

func (p *TColumn)  ReadField6(iprot thrift.TProtocol) error {
  p.DoubleVal = &TDoubleColumn{}
  if err := p.DoubleVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err)
  }
  return nil
}

func (p *TColumn)  ReadField7(iprot thrift.TProtocol) error {
  p.StringVal = &TStringColumn{}
  if err := p.StringVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err)
  }
  return nil
}

func (p *TColumn)  ReadField8(iprot thrift.TProtocol) error {
  p.BinaryVal = &TBinaryColumn{}
  if err := p.BinaryVal.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err)
  }
  return nil
}

func (p *TColumn) Write(oprot thrift.TProtocol) error {
  if c := p.CountSetFieldsTColumn(); c != 1 {
    return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
  }
  if err := oprot.WriteStructBegin("TColumn"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
    if err := p.writeField7(oprot); err != nil { return err }
    if err := p.writeField8(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TColumn) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetBoolVal() {
    if err := oprot.WriteFieldBegin("boolVal", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) }
    if err := p.BoolVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetByteVal() {
    if err := oprot.WriteFieldBegin("byteVal", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) }
    if err := p.ByteVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetI16Val() {
    if err := oprot.WriteFieldBegin("i16Val", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) }
    if err := p.I16Val.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetI32Val() {
    if err := oprot.WriteFieldBegin("i32Val", thrift.STRUCT, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) }
    if err := p.I32Val.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetI64Val() {
    if err := oprot.WriteFieldBegin("i64Val", thrift.STRUCT, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) }
    if err := p.I64Val.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField6(oprot thrift.TProtocol) (err error) {
  if p.IsSetDoubleVal() {
    if err := oprot.WriteFieldBegin("doubleVal", thrift.STRUCT, 6); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) }
    if err := p.DoubleVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField7(oprot thrift.TProtocol) (err error) {
  if p.IsSetStringVal() {
    if err := oprot.WriteFieldBegin("stringVal", thrift.STRUCT, 7); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) }
    if err := p.StringVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) }
  }
  return err
}

func (p *TColumn) writeField8(oprot thrift.TProtocol) (err error) {
  if p.IsSetBinaryVal() {
    if err := oprot.WriteFieldBegin("binaryVal", thrift.STRUCT, 8); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binaryVal: ", p), err) }
    if err := p.BinaryVal.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) }
  }
  return err
}

func (p *TColumn) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TColumn(%+v)", *p)
}

// Attributes:
//  - StartRowOffset
//  - Rows
//  - Columns
type TRowSet struct {
  StartRowOffset int64 `thrift:"startRowOffset,1,required" db:"startRowOffset" json:"startRowOffset"`
  Rows []*TRow `thrift:"rows,2,required" db:"rows" json:"rows"`
  Columns []*TColumn `thrift:"columns,3" db:"columns" json:"columns,omitempty"`
}

func NewTRowSet() *TRowSet {
  return &TRowSet{}
}


func (p *TRowSet) GetStartRowOffset() int64 {
  return p.StartRowOffset
}

func (p *TRowSet) GetRows() []*TRow {
  return p.Rows
}
var TRowSet_Columns_DEFAULT []*TColumn

func (p *TRowSet) GetColumns() []*TColumn {
  return p.Columns
}
func (p *TRowSet) IsSetColumns() bool {
  return p.Columns != nil
}

func (p *TRowSet) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStartRowOffset bool = false;
  var issetRows bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStartRowOffset = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetRows = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStartRowOffset{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set"));
  }
  if !issetRows{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set"));
  }
  return nil
}

func (p *TRowSet)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.StartRowOffset = v
}
  return nil
}

func (p *TRowSet)  ReadField2(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*TRow, 0, size)
  p.Rows =  tSlice
  for i := 0; i < size; i ++ {
    _elem17 := &TRow{}
    if err := _elem17.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err)
    }
    p.Rows = append(p.Rows, _elem17)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TRowSet)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*TColumn, 0, size)
  p.Columns =  tSlice
  for i := 0; i < size; i ++ {
    _elem18 := &TColumn{}
    if err := _elem18.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err)
    }
    p.Columns = append(p.Columns, _elem18)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TRowSet) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TRowSet"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TRowSet) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("startRowOffset", thrift.I64, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) }
  if err := oprot.WriteI64(int64(p.StartRowOffset)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) }
  return err
}

func (p *TRowSet) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("rows", thrift.LIST, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rows)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Rows {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) }
  return err
}

func (p *TRowSet) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetColumns() {
    if err := oprot.WriteFieldBegin("columns", thrift.LIST, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Columns {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) }
  }
  return err
}

func (p *TRowSet) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TRowSet(%+v)", *p)
}

// Attributes:
//  - StatusCode
//  - InfoMessages
//  - SqlState
//  - ErrorCode
//  - ErrorMessage
type TStatus struct {
  StatusCode TStatusCode `thrift:"statusCode,1,required" db:"statusCode" json:"statusCode"`
  InfoMessages []string `thrift:"infoMessages,2" db:"infoMessages" json:"infoMessages,omitempty"`
  SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"`
  ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"`
  ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"`
}

func NewTStatus() *TStatus {
  return &TStatus{}
}


func (p *TStatus) GetStatusCode() TStatusCode {
  return p.StatusCode
}
var TStatus_InfoMessages_DEFAULT []string

func (p *TStatus) GetInfoMessages() []string {
  return p.InfoMessages
}
var TStatus_SqlState_DEFAULT string
func (p *TStatus) GetSqlState() string {
  if !p.IsSetSqlState() {
    return TStatus_SqlState_DEFAULT
  }
return *p.SqlState
}
var TStatus_ErrorCode_DEFAULT int32
func (p *TStatus) GetErrorCode() int32 {
  if !p.IsSetErrorCode() {
    return TStatus_ErrorCode_DEFAULT
  }
return *p.ErrorCode
}
var TStatus_ErrorMessage_DEFAULT string
func (p *TStatus) GetErrorMessage() string {
  if !p.IsSetErrorMessage() {
    return TStatus_ErrorMessage_DEFAULT
  }
return *p.ErrorMessage
}
func (p *TStatus) IsSetInfoMessages() bool {
  return p.InfoMessages != nil
}

func (p *TStatus) IsSetSqlState() bool {
  return p.SqlState != nil
}

func (p *TStatus) IsSetErrorCode() bool {
  return p.ErrorCode != nil
}

func (p *TStatus) IsSetErrorMessage() bool {
  return p.ErrorMessage != nil
}

func (p *TStatus) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatusCode bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatusCode = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatusCode{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatusCode is not set"));
  }
  return nil
}

func (p *TStatus)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := TStatusCode(v)
  p.StatusCode = temp
}
  return nil
}

func (p *TStatus)  ReadField2(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.InfoMessages =  tSlice
  for i := 0; i < size; i ++ {
var _elem19 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem19 = v
}
    p.InfoMessages = append(p.InfoMessages, _elem19)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TStatus)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.SqlState = &v
}
  return nil
}

func (p *TStatus)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.ErrorCode = &v
}
  return nil
}

func (p *TStatus)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.ErrorMessage = &v
}
  return nil
}

func (p *TStatus) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TStatus"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TStatus) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("statusCode", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) }
  if err := oprot.WriteI32(int32(p.StatusCode)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) }
  return err
}

func (p *TStatus) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetInfoMessages() {
    if err := oprot.WriteFieldBegin("infoMessages", thrift.LIST, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.InfoMessages)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.InfoMessages {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) }
  }
  return err
}

func (p *TStatus) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSqlState() {
    if err := oprot.WriteFieldBegin("sqlState", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) }
    if err := oprot.WriteString(string(*p.SqlState)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) }
  }
  return err
}

func (p *TStatus) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetErrorCode() {
    if err := oprot.WriteFieldBegin("errorCode", thrift.I32, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) }
    if err := oprot.WriteI32(int32(*p.ErrorCode)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) }
  }
  return err
}

func (p *TStatus) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetErrorMessage() {
    if err := oprot.WriteFieldBegin("errorMessage", thrift.STRING, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) }
    if err := oprot.WriteString(string(*p.ErrorMessage)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) }
  }
  return err
}

func (p *TStatus) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TStatus(%+v)", *p)
}

// Attributes:
//  - GUID
//  - Secret
type THandleIdentifier struct {
  GUID []byte `thrift:"guid,1,required" db:"guid" json:"guid"`
  Secret []byte `thrift:"secret,2,required" db:"secret" json:"secret"`
}

func NewTHandleIdentifier() *THandleIdentifier {
  return &THandleIdentifier{}
}


func (p *THandleIdentifier) GetGUID() []byte {
  return p.GUID
}

func (p *THandleIdentifier) GetSecret() []byte {
  return p.Secret
}
func (p *THandleIdentifier) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetGUID bool = false;
  var issetSecret bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetGUID = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetSecret = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetGUID{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field GUID is not set"));
  }
  if !issetSecret{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Secret is not set"));
  }
  return nil
}

func (p *THandleIdentifier)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.GUID = v
}
  return nil
}

func (p *THandleIdentifier)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBinary(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Secret = v
}
  return nil
}

func (p *THandleIdentifier) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("THandleIdentifier"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *THandleIdentifier) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("guid", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) }
  if err := oprot.WriteBinary(p.GUID); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) }
  return err
}

func (p *THandleIdentifier) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("secret", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) }
  if err := oprot.WriteBinary(p.Secret); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) }
  return err
}

func (p *THandleIdentifier) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("THandleIdentifier(%+v)", *p)
}

// Attributes:
//  - SessionId
type TSessionHandle struct {
  SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
}

func NewTSessionHandle() *TSessionHandle {
  return &TSessionHandle{}
}

var TSessionHandle_SessionId_DEFAULT *THandleIdentifier
func (p *TSessionHandle) GetSessionId() *THandleIdentifier {
  if !p.IsSetSessionId() {
    return TSessionHandle_SessionId_DEFAULT
  }
return p.SessionId
}
func (p *TSessionHandle) IsSetSessionId() bool {
  return p.SessionId != nil
}

func (p *TSessionHandle) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionId bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionId = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionId{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
  }
  return nil
}

func (p *TSessionHandle)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionId = &THandleIdentifier{}
  if err := p.SessionId.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err)
  }
  return nil
}

func (p *TSessionHandle) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TSessionHandle"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TSessionHandle) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionId", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
  if err := p.SessionId.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
  return err
}

func (p *TSessionHandle) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TSessionHandle(%+v)", *p)
}

// Attributes:
//  - OperationId
//  - OperationType
//  - HasResultSet
//  - ModifiedRowCount
type TOperationHandle struct {
  OperationId *THandleIdentifier `thrift:"operationId,1,required" db:"operationId" json:"operationId"`
  OperationType TOperationType `thrift:"operationType,2,required" db:"operationType" json:"operationType"`
  HasResultSet bool `thrift:"hasResultSet,3,required" db:"hasResultSet" json:"hasResultSet"`
  ModifiedRowCount *float64 `thrift:"modifiedRowCount,4" db:"modifiedRowCount" json:"modifiedRowCount,omitempty"`
}

func NewTOperationHandle() *TOperationHandle {
  return &TOperationHandle{}
}

var TOperationHandle_OperationId_DEFAULT *THandleIdentifier
func (p *TOperationHandle) GetOperationId() *THandleIdentifier {
  if !p.IsSetOperationId() {
    return TOperationHandle_OperationId_DEFAULT
  }
return p.OperationId
}

func (p *TOperationHandle) GetOperationType() TOperationType {
  return p.OperationType
}

func (p *TOperationHandle) GetHasResultSet() bool {
  return p.HasResultSet
}
var TOperationHandle_ModifiedRowCount_DEFAULT float64
func (p *TOperationHandle) GetModifiedRowCount() float64 {
  if !p.IsSetModifiedRowCount() {
    return TOperationHandle_ModifiedRowCount_DEFAULT
  }
return *p.ModifiedRowCount
}
func (p *TOperationHandle) IsSetOperationId() bool {
  return p.OperationId != nil
}

func (p *TOperationHandle) IsSetModifiedRowCount() bool {
  return p.ModifiedRowCount != nil
}

func (p *TOperationHandle) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationId bool = false;
  var issetOperationType bool = false;
  var issetHasResultSet bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationId = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetOperationType = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
        issetHasResultSet = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.DOUBLE {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationId{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationId is not set"));
  }
  if !issetOperationType{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationType is not set"));
  }
  if !issetHasResultSet{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set"));
  }
  return nil
}

func (p *TOperationHandle)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationId = &THandleIdentifier{}
  if err := p.OperationId.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err)
  }
  return nil
}

func (p *TOperationHandle)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TOperationType(v)
  p.OperationType = temp
}
  return nil
}

func (p *TOperationHandle)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.HasResultSet = v
}
  return nil
}

func (p *TOperationHandle)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadDouble(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.ModifiedRowCount = &v
}
  return nil
}

func (p *TOperationHandle) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TOperationHandle"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TOperationHandle) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationId", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationId: ", p), err) }
  if err := p.OperationId.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) }
  return err
}

func (p *TOperationHandle) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationType", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) }
  if err := oprot.WriteI32(int32(p.OperationType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) }
  return err
}

func (p *TOperationHandle) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("hasResultSet", thrift.BOOL, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) }
  if err := oprot.WriteBool(bool(p.HasResultSet)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) }
  return err
}

func (p *TOperationHandle) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetModifiedRowCount() {
    if err := oprot.WriteFieldBegin("modifiedRowCount", thrift.DOUBLE, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) }
    if err := oprot.WriteDouble(float64(*p.ModifiedRowCount)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) }
  }
  return err
}

func (p *TOperationHandle) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TOperationHandle(%+v)", *p)
}

// Attributes:
//  - ClientProtocol
//  - Username
//  - Password
//  - Configuration
type TOpenSessionReq struct {
  ClientProtocol TProtocolVersion `thrift:"client_protocol,1,required" db:"client_protocol" json:"client_protocol"`
  Username *string `thrift:"username,2" db:"username" json:"username,omitempty"`
  Password *string `thrift:"password,3" db:"password" json:"password,omitempty"`
  Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"`
}

func NewTOpenSessionReq() *TOpenSessionReq {
  return &TOpenSessionReq{
ClientProtocol: 5,
}
}


func (p *TOpenSessionReq) GetClientProtocol() TProtocolVersion {
  return p.ClientProtocol
}
var TOpenSessionReq_Username_DEFAULT string
func (p *TOpenSessionReq) GetUsername() string {
  if !p.IsSetUsername() {
    return TOpenSessionReq_Username_DEFAULT
  }
return *p.Username
}
var TOpenSessionReq_Password_DEFAULT string
func (p *TOpenSessionReq) GetPassword() string {
  if !p.IsSetPassword() {
    return TOpenSessionReq_Password_DEFAULT
  }
return *p.Password
}
var TOpenSessionReq_Configuration_DEFAULT map[string]string

func (p *TOpenSessionReq) GetConfiguration() map[string]string {
  return p.Configuration
}
func (p *TOpenSessionReq) IsSetUsername() bool {
  return p.Username != nil
}

func (p *TOpenSessionReq) IsSetPassword() bool {
  return p.Password != nil
}

func (p *TOpenSessionReq) IsSetConfiguration() bool {
  return p.Configuration != nil
}

func (p *TOpenSessionReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetClientProtocol bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetClientProtocol = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetClientProtocol{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientProtocol is not set"));
  }
  return nil
}

func (p *TOpenSessionReq)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := TProtocolVersion(v)
  p.ClientProtocol = temp
}
  return nil
}

func (p *TOpenSessionReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Username = &v
}
  return nil
}

func (p *TOpenSessionReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Password = &v
}
  return nil
}

func (p *TOpenSessionReq)  ReadField4(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Configuration =  tMap
  for i := 0; i < size; i ++ {
var _key20 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key20 = v
}
var _val21 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val21 = v
}
    p.Configuration[_key20] = _val21
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *TOpenSessionReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TOpenSessionReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TOpenSessionReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("client_protocol", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) }
  if err := oprot.WriteI32(int32(p.ClientProtocol)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) }
  return err
}

func (p *TOpenSessionReq) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetUsername() {
    if err := oprot.WriteFieldBegin("username", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) }
    if err := oprot.WriteString(string(*p.Username)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) }
  }
  return err
}

func (p *TOpenSessionReq) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetPassword() {
    if err := oprot.WriteFieldBegin("password", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) }
    if err := oprot.WriteString(string(*p.Password)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) }
  }
  return err
}

func (p *TOpenSessionReq) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetConfiguration() {
    if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Configuration {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) }
  }
  return err
}

func (p *TOpenSessionReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TOpenSessionReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - ServerProtocolVersion
//  - SessionHandle
//  - Configuration
type TOpenSessionResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  ServerProtocolVersion TProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"`
  SessionHandle *TSessionHandle `thrift:"sessionHandle,3" db:"sessionHandle" json:"sessionHandle,omitempty"`
  Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"`
}

func NewTOpenSessionResp() *TOpenSessionResp {
  return &TOpenSessionResp{
ServerProtocolVersion: 5,
}
}

var TOpenSessionResp_Status_DEFAULT *TStatus
func (p *TOpenSessionResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TOpenSessionResp_Status_DEFAULT
  }
return p.Status
}

func (p *TOpenSessionResp) GetServerProtocolVersion() TProtocolVersion {
  return p.ServerProtocolVersion
}
var TOpenSessionResp_SessionHandle_DEFAULT *TSessionHandle
func (p *TOpenSessionResp) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TOpenSessionResp_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
var TOpenSessionResp_Configuration_DEFAULT map[string]string

func (p *TOpenSessionResp) GetConfiguration() map[string]string {
  return p.Configuration
}
func (p *TOpenSessionResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TOpenSessionResp) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TOpenSessionResp) IsSetConfiguration() bool {
  return p.Configuration != nil
}

func (p *TOpenSessionResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;
  var issetServerProtocolVersion bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetServerProtocolVersion = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  if !issetServerProtocolVersion{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set"));
  }
  return nil
}

func (p *TOpenSessionResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TOpenSessionResp)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TProtocolVersion(v)
  p.ServerProtocolVersion = temp
}
  return nil
}

func (p *TOpenSessionResp)  ReadField3(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TOpenSessionResp)  ReadField4(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Configuration =  tMap
  for i := 0; i < size; i ++ {
var _key22 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key22 = v
}
var _val23 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val23 = v
}
    p.Configuration[_key22] = _val23
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *TOpenSessionResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TOpenSessionResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TOpenSessionResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TOpenSessionResp) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("serverProtocolVersion", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) }
  if err := oprot.WriteI32(int32(p.ServerProtocolVersion)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) }
  return err
}

func (p *TOpenSessionResp) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSessionHandle() {
    if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionHandle: ", p), err) }
    if err := p.SessionHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) }
  }
  return err
}

func (p *TOpenSessionResp) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetConfiguration() {
    if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Configuration {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) }
  }
  return err
}

func (p *TOpenSessionResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TOpenSessionResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
type TCloseSessionReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
}

func NewTCloseSessionReq() *TCloseSessionReq {
  return &TCloseSessionReq{}
}

var TCloseSessionReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TCloseSessionReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TCloseSessionReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
func (p *TCloseSessionReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TCloseSessionReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TCloseSessionReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TCloseSessionReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCloseSessionReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCloseSessionReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TCloseSessionReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCloseSessionReq(%+v)", *p)
}

// Attributes:
//  - Status
type TCloseSessionResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
}

func NewTCloseSessionResp() *TCloseSessionResp {
  return &TCloseSessionResp{}
}

var TCloseSessionResp_Status_DEFAULT *TStatus
func (p *TCloseSessionResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TCloseSessionResp_Status_DEFAULT
  }
return p.Status
}
func (p *TCloseSessionResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TCloseSessionResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TCloseSessionResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TCloseSessionResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCloseSessionResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCloseSessionResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TCloseSessionResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCloseSessionResp(%+v)", *p)
}

// Attributes:
//  - StringValue
//  - SmallIntValue
//  - IntegerBitmask
//  - IntegerFlag
//  - BinaryValue
//  - LenValue
type TGetInfoValue struct {
  StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"`
  SmallIntValue *int16 `thrift:"smallIntValue,2" db:"smallIntValue" json:"smallIntValue,omitempty"`
  IntegerBitmask *int32 `thrift:"integerBitmask,3" db:"integerBitmask" json:"integerBitmask,omitempty"`
  IntegerFlag *int32 `thrift:"integerFlag,4" db:"integerFlag" json:"integerFlag,omitempty"`
  BinaryValue *int32 `thrift:"binaryValue,5" db:"binaryValue" json:"binaryValue,omitempty"`
  LenValue *int64 `thrift:"lenValue,6" db:"lenValue" json:"lenValue,omitempty"`
}

func NewTGetInfoValue() *TGetInfoValue {
  return &TGetInfoValue{}
}

var TGetInfoValue_StringValue_DEFAULT string
func (p *TGetInfoValue) GetStringValue() string {
  if !p.IsSetStringValue() {
    return TGetInfoValue_StringValue_DEFAULT
  }
return *p.StringValue
}
var TGetInfoValue_SmallIntValue_DEFAULT int16
func (p *TGetInfoValue) GetSmallIntValue() int16 {
  if !p.IsSetSmallIntValue() {
    return TGetInfoValue_SmallIntValue_DEFAULT
  }
return *p.SmallIntValue
}
var TGetInfoValue_IntegerBitmask_DEFAULT int32
func (p *TGetInfoValue) GetIntegerBitmask() int32 {
  if !p.IsSetIntegerBitmask() {
    return TGetInfoValue_IntegerBitmask_DEFAULT
  }
return *p.IntegerBitmask
}
var TGetInfoValue_IntegerFlag_DEFAULT int32
func (p *TGetInfoValue) GetIntegerFlag() int32 {
  if !p.IsSetIntegerFlag() {
    return TGetInfoValue_IntegerFlag_DEFAULT
  }
return *p.IntegerFlag
}
var TGetInfoValue_BinaryValue_DEFAULT int32
func (p *TGetInfoValue) GetBinaryValue() int32 {
  if !p.IsSetBinaryValue() {
    return TGetInfoValue_BinaryValue_DEFAULT
  }
return *p.BinaryValue
}
var TGetInfoValue_LenValue_DEFAULT int64
func (p *TGetInfoValue) GetLenValue() int64 {
  if !p.IsSetLenValue() {
    return TGetInfoValue_LenValue_DEFAULT
  }
return *p.LenValue
}
func (p *TGetInfoValue) CountSetFieldsTGetInfoValue() int {
  count := 0
  if (p.IsSetStringValue()) {
    count++
  }
  if (p.IsSetSmallIntValue()) {
    count++
  }
  if (p.IsSetIntegerBitmask()) {
    count++
  }
  if (p.IsSetIntegerFlag()) {
    count++
  }
  if (p.IsSetBinaryValue()) {
    count++
  }
  if (p.IsSetLenValue()) {
    count++
  }
  return count

}

func (p *TGetInfoValue) IsSetStringValue() bool {
  return p.StringValue != nil
}

func (p *TGetInfoValue) IsSetSmallIntValue() bool {
  return p.SmallIntValue != nil
}

func (p *TGetInfoValue) IsSetIntegerBitmask() bool {
  return p.IntegerBitmask != nil
}

func (p *TGetInfoValue) IsSetIntegerFlag() bool {
  return p.IntegerFlag != nil
}

func (p *TGetInfoValue) IsSetBinaryValue() bool {
  return p.BinaryValue != nil
}

func (p *TGetInfoValue) IsSetLenValue() bool {
  return p.LenValue != nil
}

func (p *TGetInfoValue) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TGetInfoValue)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.StringValue = &v
}
  return nil
}

func (p *TGetInfoValue)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.SmallIntValue = &v
}
  return nil
}

func (p *TGetInfoValue)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.IntegerBitmask = &v
}
  return nil
}

func (p *TGetInfoValue)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.IntegerFlag = &v
}
  return nil
}

func (p *TGetInfoValue)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.BinaryValue = &v
}
  return nil
}

func (p *TGetInfoValue)  ReadField6(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 6: ", err)
} else {
  p.LenValue = &v
}
  return nil
}

func (p *TGetInfoValue) Write(oprot thrift.TProtocol) error {
  if c := p.CountSetFieldsTGetInfoValue(); c != 1 {
    return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
  }
  if err := oprot.WriteStructBegin("TGetInfoValue"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetInfoValue) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetStringValue() {
    if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) }
    if err := oprot.WriteString(string(*p.StringValue)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) }
  }
  return err
}

func (p *TGetInfoValue) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetSmallIntValue() {
    if err := oprot.WriteFieldBegin("smallIntValue", thrift.I16, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) }
    if err := oprot.WriteI16(int16(*p.SmallIntValue)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) }
  }
  return err
}

func (p *TGetInfoValue) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetIntegerBitmask() {
    if err := oprot.WriteFieldBegin("integerBitmask", thrift.I32, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) }
    if err := oprot.WriteI32(int32(*p.IntegerBitmask)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) }
  }
  return err
}

func (p *TGetInfoValue) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetIntegerFlag() {
    if err := oprot.WriteFieldBegin("integerFlag", thrift.I32, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) }
    if err := oprot.WriteI32(int32(*p.IntegerFlag)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) }
  }
  return err
}

func (p *TGetInfoValue) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetBinaryValue() {
    if err := oprot.WriteFieldBegin("binaryValue", thrift.I32, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) }
    if err := oprot.WriteI32(int32(*p.BinaryValue)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) }
  }
  return err
}

func (p *TGetInfoValue) writeField6(oprot thrift.TProtocol) (err error) {
  if p.IsSetLenValue() {
    if err := oprot.WriteFieldBegin("lenValue", thrift.I64, 6); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) }
    if err := oprot.WriteI64(int64(*p.LenValue)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) }
  }
  return err
}

func (p *TGetInfoValue) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetInfoValue(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - InfoType
type TGetInfoReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  InfoType TGetInfoType `thrift:"infoType,2,required" db:"infoType" json:"infoType"`
}

func NewTGetInfoReq() *TGetInfoReq {
  return &TGetInfoReq{}
}

var TGetInfoReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetInfoReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetInfoReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}

func (p *TGetInfoReq) GetInfoType() TGetInfoType {
  return p.InfoType
}
func (p *TGetInfoReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetInfoReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;
  var issetInfoType bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetInfoType = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  if !issetInfoType{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoType is not set"));
  }
  return nil
}

func (p *TGetInfoReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetInfoReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TGetInfoType(v)
  p.InfoType = temp
}
  return nil
}

func (p *TGetInfoReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetInfoReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetInfoReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetInfoReq) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("infoType", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) }
  if err := oprot.WriteI32(int32(p.InfoType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) }
  return err
}

func (p *TGetInfoReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetInfoReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - InfoValue
type TGetInfoResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  InfoValue *TGetInfoValue `thrift:"infoValue,2,required" db:"infoValue" json:"infoValue"`
}

func NewTGetInfoResp() *TGetInfoResp {
  return &TGetInfoResp{}
}

var TGetInfoResp_Status_DEFAULT *TStatus
func (p *TGetInfoResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetInfoResp_Status_DEFAULT
  }
return p.Status
}
var TGetInfoResp_InfoValue_DEFAULT *TGetInfoValue
func (p *TGetInfoResp) GetInfoValue() *TGetInfoValue {
  if !p.IsSetInfoValue() {
    return TGetInfoResp_InfoValue_DEFAULT
  }
return p.InfoValue
}
func (p *TGetInfoResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetInfoResp) IsSetInfoValue() bool {
  return p.InfoValue != nil
}

func (p *TGetInfoResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;
  var issetInfoValue bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetInfoValue = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  if !issetInfoValue{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoValue is not set"));
  }
  return nil
}

func (p *TGetInfoResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetInfoResp)  ReadField2(iprot thrift.TProtocol) error {
  p.InfoValue = &TGetInfoValue{}
  if err := p.InfoValue.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err)
  }
  return nil
}

func (p *TGetInfoResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetInfoResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetInfoResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetInfoResp) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("infoValue", thrift.STRUCT, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoValue: ", p), err) }
  if err := p.InfoValue.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) }
  return err
}

func (p *TGetInfoResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetInfoResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - Statement
//  - ConfOverlay
//  - RunAsync
type TExecuteStatementReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  Statement string `thrift:"statement,2,required" db:"statement" json:"statement"`
  ConfOverlay map[string]string `thrift:"confOverlay,3" db:"confOverlay" json:"confOverlay,omitempty"`
  RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync,omitempty"`
}

func NewTExecuteStatementReq() *TExecuteStatementReq {
  return &TExecuteStatementReq{}
}

var TExecuteStatementReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TExecuteStatementReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TExecuteStatementReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}

func (p *TExecuteStatementReq) GetStatement() string {
  return p.Statement
}
var TExecuteStatementReq_ConfOverlay_DEFAULT map[string]string

func (p *TExecuteStatementReq) GetConfOverlay() map[string]string {
  return p.ConfOverlay
}
var TExecuteStatementReq_RunAsync_DEFAULT bool = false

func (p *TExecuteStatementReq) GetRunAsync() bool {
  return p.RunAsync
}
func (p *TExecuteStatementReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TExecuteStatementReq) IsSetConfOverlay() bool {
  return p.ConfOverlay != nil
}

func (p *TExecuteStatementReq) IsSetRunAsync() bool {
  return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT
}

func (p *TExecuteStatementReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;
  var issetStatement bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetStatement = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  if !issetStatement{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set"));
  }
  return nil
}

func (p *TExecuteStatementReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TExecuteStatementReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Statement = v
}
  return nil
}

func (p *TExecuteStatementReq)  ReadField3(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.ConfOverlay =  tMap
  for i := 0; i < size; i ++ {
var _key24 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key24 = v
}
var _val25 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val25 = v
}
    p.ConfOverlay[_key24] = _val25
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *TExecuteStatementReq)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.RunAsync = v
}
  return nil
}

func (p *TExecuteStatementReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TExecuteStatementReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TExecuteStatementReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TExecuteStatementReq) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("statement", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) }
  if err := oprot.WriteString(string(p.Statement)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) }
  return err
}

func (p *TExecuteStatementReq) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetConfOverlay() {
    if err := oprot.WriteFieldBegin("confOverlay", thrift.MAP, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.ConfOverlay {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) }
  }
  return err
}

func (p *TExecuteStatementReq) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetRunAsync() {
    if err := oprot.WriteFieldBegin("runAsync", thrift.BOOL, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) }
    if err := oprot.WriteBool(bool(p.RunAsync)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) }
  }
  return err
}

func (p *TExecuteStatementReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TExecuteStatementReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TExecuteStatementResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTExecuteStatementResp() *TExecuteStatementResp {
  return &TExecuteStatementResp{}
}

var TExecuteStatementResp_Status_DEFAULT *TStatus
func (p *TExecuteStatementResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TExecuteStatementResp_Status_DEFAULT
  }
return p.Status
}
var TExecuteStatementResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TExecuteStatementResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TExecuteStatementResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TExecuteStatementResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TExecuteStatementResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TExecuteStatementResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TExecuteStatementResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TExecuteStatementResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TExecuteStatementResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TExecuteStatementResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TExecuteStatementResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TExecuteStatementResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TExecuteStatementResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TExecuteStatementResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
type TGetTypeInfoReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
}

func NewTGetTypeInfoReq() *TGetTypeInfoReq {
  return &TGetTypeInfoReq{}
}

var TGetTypeInfoReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetTypeInfoReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetTypeInfoReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
func (p *TGetTypeInfoReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetTypeInfoReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TGetTypeInfoReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetTypeInfoReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetTypeInfoReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetTypeInfoReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetTypeInfoReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetTypeInfoReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetTypeInfoResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetTypeInfoResp() *TGetTypeInfoResp {
  return &TGetTypeInfoResp{}
}

var TGetTypeInfoResp_Status_DEFAULT *TStatus
func (p *TGetTypeInfoResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetTypeInfoResp_Status_DEFAULT
  }
return p.Status
}
var TGetTypeInfoResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetTypeInfoResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetTypeInfoResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetTypeInfoResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetTypeInfoResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetTypeInfoResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetTypeInfoResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetTypeInfoResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetTypeInfoResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetTypeInfoResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetTypeInfoResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetTypeInfoResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetTypeInfoResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
type TGetCatalogsReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
}

func NewTGetCatalogsReq() *TGetCatalogsReq {
  return &TGetCatalogsReq{}
}

var TGetCatalogsReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetCatalogsReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetCatalogsReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
func (p *TGetCatalogsReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetCatalogsReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TGetCatalogsReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetCatalogsReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetCatalogsReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetCatalogsReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetCatalogsReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetCatalogsReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetCatalogsResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetCatalogsResp() *TGetCatalogsResp {
  return &TGetCatalogsResp{}
}

var TGetCatalogsResp_Status_DEFAULT *TStatus
func (p *TGetCatalogsResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetCatalogsResp_Status_DEFAULT
  }
return p.Status
}
var TGetCatalogsResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetCatalogsResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetCatalogsResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetCatalogsResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetCatalogsResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetCatalogsResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetCatalogsResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetCatalogsResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetCatalogsResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetCatalogsResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetCatalogsResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetCatalogsResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetCatalogsResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetCatalogsResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - CatalogName
//  - SchemaName
type TGetSchemasReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"`
  SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"`
}

func NewTGetSchemasReq() *TGetSchemasReq {
  return &TGetSchemasReq{}
}

var TGetSchemasReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetSchemasReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetSchemasReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
var TGetSchemasReq_CatalogName_DEFAULT TIdentifier
func (p *TGetSchemasReq) GetCatalogName() TIdentifier {
  if !p.IsSetCatalogName() {
    return TGetSchemasReq_CatalogName_DEFAULT
  }
return *p.CatalogName
}
var TGetSchemasReq_SchemaName_DEFAULT TPatternOrIdentifier
func (p *TGetSchemasReq) GetSchemaName() TPatternOrIdentifier {
  if !p.IsSetSchemaName() {
    return TGetSchemasReq_SchemaName_DEFAULT
  }
return *p.SchemaName
}
func (p *TGetSchemasReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetSchemasReq) IsSetCatalogName() bool {
  return p.CatalogName != nil
}

func (p *TGetSchemasReq) IsSetSchemaName() bool {
  return p.SchemaName != nil
}

func (p *TGetSchemasReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TGetSchemasReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetSchemasReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TIdentifier(v)
  p.CatalogName = &temp
}
  return nil
}

func (p *TGetSchemasReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.SchemaName = &temp
}
  return nil
}

func (p *TGetSchemasReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetSchemasReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetSchemasReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetSchemasReq) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetCatalogName() {
    if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) }
    if err := oprot.WriteString(string(*p.CatalogName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) }
  }
  return err
}

func (p *TGetSchemasReq) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSchemaName() {
    if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) }
    if err := oprot.WriteString(string(*p.SchemaName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) }
  }
  return err
}

func (p *TGetSchemasReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetSchemasReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetSchemasResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetSchemasResp() *TGetSchemasResp {
  return &TGetSchemasResp{}
}

var TGetSchemasResp_Status_DEFAULT *TStatus
func (p *TGetSchemasResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetSchemasResp_Status_DEFAULT
  }
return p.Status
}
var TGetSchemasResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetSchemasResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetSchemasResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetSchemasResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetSchemasResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetSchemasResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetSchemasResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetSchemasResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetSchemasResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetSchemasResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetSchemasResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetSchemasResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetSchemasResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetSchemasResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - CatalogName
//  - SchemaName
//  - TableName
//  - TableTypes
type TGetTablesReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  CatalogName *TPatternOrIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"`
  SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"`
  TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"`
  TableTypes []string `thrift:"tableTypes,5" db:"tableTypes" json:"tableTypes,omitempty"`
}

func NewTGetTablesReq() *TGetTablesReq {
  return &TGetTablesReq{}
}

var TGetTablesReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetTablesReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetTablesReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
var TGetTablesReq_CatalogName_DEFAULT TPatternOrIdentifier
func (p *TGetTablesReq) GetCatalogName() TPatternOrIdentifier {
  if !p.IsSetCatalogName() {
    return TGetTablesReq_CatalogName_DEFAULT
  }
return *p.CatalogName
}
var TGetTablesReq_SchemaName_DEFAULT TPatternOrIdentifier
func (p *TGetTablesReq) GetSchemaName() TPatternOrIdentifier {
  if !p.IsSetSchemaName() {
    return TGetTablesReq_SchemaName_DEFAULT
  }
return *p.SchemaName
}
var TGetTablesReq_TableName_DEFAULT TPatternOrIdentifier
func (p *TGetTablesReq) GetTableName() TPatternOrIdentifier {
  if !p.IsSetTableName() {
    return TGetTablesReq_TableName_DEFAULT
  }
return *p.TableName
}
var TGetTablesReq_TableTypes_DEFAULT []string

func (p *TGetTablesReq) GetTableTypes() []string {
  return p.TableTypes
}
func (p *TGetTablesReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetTablesReq) IsSetCatalogName() bool {
  return p.CatalogName != nil
}

func (p *TGetTablesReq) IsSetSchemaName() bool {
  return p.SchemaName != nil
}

func (p *TGetTablesReq) IsSetTableName() bool {
  return p.TableName != nil
}

func (p *TGetTablesReq) IsSetTableTypes() bool {
  return p.TableTypes != nil
}

func (p *TGetTablesReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TGetTablesReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetTablesReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.CatalogName = &temp
}
  return nil
}

func (p *TGetTablesReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.SchemaName = &temp
}
  return nil
}

func (p *TGetTablesReq)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.TableName = &temp
}
  return nil
}

func (p *TGetTablesReq)  ReadField5(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.TableTypes =  tSlice
  for i := 0; i < size; i ++ {
var _elem26 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem26 = v
}
    p.TableTypes = append(p.TableTypes, _elem26)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *TGetTablesReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetTablesReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetTablesReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetTablesReq) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetCatalogName() {
    if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) }
    if err := oprot.WriteString(string(*p.CatalogName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) }
  }
  return err
}

func (p *TGetTablesReq) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSchemaName() {
    if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) }
    if err := oprot.WriteString(string(*p.SchemaName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) }
  }
  return err
}

func (p *TGetTablesReq) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetTableName() {
    if err := oprot.WriteFieldBegin("tableName", thrift.STRING, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) }
    if err := oprot.WriteString(string(*p.TableName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) }
  }
  return err
}

func (p *TGetTablesReq) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetTableTypes() {
    if err := oprot.WriteFieldBegin("tableTypes", thrift.LIST, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.TableTypes)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.TableTypes {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) }
  }
  return err
}

func (p *TGetTablesReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetTablesReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetTablesResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetTablesResp() *TGetTablesResp {
  return &TGetTablesResp{}
}

var TGetTablesResp_Status_DEFAULT *TStatus
func (p *TGetTablesResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetTablesResp_Status_DEFAULT
  }
return p.Status
}
var TGetTablesResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetTablesResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetTablesResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetTablesResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetTablesResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetTablesResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetTablesResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetTablesResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetTablesResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetTablesResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetTablesResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetTablesResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetTablesResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetTablesResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
type TGetTableTypesReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
}

func NewTGetTableTypesReq() *TGetTableTypesReq {
  return &TGetTableTypesReq{}
}

var TGetTableTypesReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetTableTypesReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetTableTypesReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
func (p *TGetTableTypesReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetTableTypesReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TGetTableTypesReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetTableTypesReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetTableTypesReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetTableTypesReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetTableTypesReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetTableTypesReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetTableTypesResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetTableTypesResp() *TGetTableTypesResp {
  return &TGetTableTypesResp{}
}

var TGetTableTypesResp_Status_DEFAULT *TStatus
func (p *TGetTableTypesResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetTableTypesResp_Status_DEFAULT
  }
return p.Status
}
var TGetTableTypesResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetTableTypesResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetTableTypesResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetTableTypesResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetTableTypesResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetTableTypesResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetTableTypesResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetTableTypesResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetTableTypesResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetTableTypesResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetTableTypesResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetTableTypesResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetTableTypesResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetTableTypesResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - CatalogName
//  - SchemaName
//  - TableName
//  - ColumnName
type TGetColumnsReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"`
  SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"`
  TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"`
  ColumnName *TPatternOrIdentifier `thrift:"columnName,5" db:"columnName" json:"columnName,omitempty"`
}

func NewTGetColumnsReq() *TGetColumnsReq {
  return &TGetColumnsReq{}
}

var TGetColumnsReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetColumnsReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetColumnsReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
var TGetColumnsReq_CatalogName_DEFAULT TIdentifier
func (p *TGetColumnsReq) GetCatalogName() TIdentifier {
  if !p.IsSetCatalogName() {
    return TGetColumnsReq_CatalogName_DEFAULT
  }
return *p.CatalogName
}
var TGetColumnsReq_SchemaName_DEFAULT TPatternOrIdentifier
func (p *TGetColumnsReq) GetSchemaName() TPatternOrIdentifier {
  if !p.IsSetSchemaName() {
    return TGetColumnsReq_SchemaName_DEFAULT
  }
return *p.SchemaName
}
var TGetColumnsReq_TableName_DEFAULT TPatternOrIdentifier
func (p *TGetColumnsReq) GetTableName() TPatternOrIdentifier {
  if !p.IsSetTableName() {
    return TGetColumnsReq_TableName_DEFAULT
  }
return *p.TableName
}
var TGetColumnsReq_ColumnName_DEFAULT TPatternOrIdentifier
func (p *TGetColumnsReq) GetColumnName() TPatternOrIdentifier {
  if !p.IsSetColumnName() {
    return TGetColumnsReq_ColumnName_DEFAULT
  }
return *p.ColumnName
}
func (p *TGetColumnsReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetColumnsReq) IsSetCatalogName() bool {
  return p.CatalogName != nil
}

func (p *TGetColumnsReq) IsSetSchemaName() bool {
  return p.SchemaName != nil
}

func (p *TGetColumnsReq) IsSetTableName() bool {
  return p.TableName != nil
}

func (p *TGetColumnsReq) IsSetColumnName() bool {
  return p.ColumnName != nil
}

func (p *TGetColumnsReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  return nil
}

func (p *TGetColumnsReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetColumnsReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TIdentifier(v)
  p.CatalogName = &temp
}
  return nil
}

func (p *TGetColumnsReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.SchemaName = &temp
}
  return nil
}

func (p *TGetColumnsReq)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.TableName = &temp
}
  return nil
}

func (p *TGetColumnsReq)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.ColumnName = &temp
}
  return nil
}

func (p *TGetColumnsReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetColumnsReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetColumnsReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetColumnsReq) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetCatalogName() {
    if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) }
    if err := oprot.WriteString(string(*p.CatalogName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) }
  }
  return err
}

func (p *TGetColumnsReq) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSchemaName() {
    if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) }
    if err := oprot.WriteString(string(*p.SchemaName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) }
  }
  return err
}

func (p *TGetColumnsReq) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetTableName() {
    if err := oprot.WriteFieldBegin("tableName", thrift.STRING, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) }
    if err := oprot.WriteString(string(*p.TableName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) }
  }
  return err
}

func (p *TGetColumnsReq) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetColumnName() {
    if err := oprot.WriteFieldBegin("columnName", thrift.STRING, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) }
    if err := oprot.WriteString(string(*p.ColumnName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) }
  }
  return err
}

func (p *TGetColumnsReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetColumnsReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetColumnsResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetColumnsResp() *TGetColumnsResp {
  return &TGetColumnsResp{}
}

var TGetColumnsResp_Status_DEFAULT *TStatus
func (p *TGetColumnsResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetColumnsResp_Status_DEFAULT
  }
return p.Status
}
var TGetColumnsResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetColumnsResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetColumnsResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetColumnsResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetColumnsResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetColumnsResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetColumnsResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetColumnsResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetColumnsResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetColumnsResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetColumnsResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetColumnsResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetColumnsResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetColumnsResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - CatalogName
//  - SchemaName
//  - FunctionName
type TGetFunctionsReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"`
  SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"`
  FunctionName TPatternOrIdentifier `thrift:"functionName,4,required" db:"functionName" json:"functionName"`
}

func NewTGetFunctionsReq() *TGetFunctionsReq {
  return &TGetFunctionsReq{}
}

var TGetFunctionsReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetFunctionsReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetFunctionsReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}
var TGetFunctionsReq_CatalogName_DEFAULT TIdentifier
func (p *TGetFunctionsReq) GetCatalogName() TIdentifier {
  if !p.IsSetCatalogName() {
    return TGetFunctionsReq_CatalogName_DEFAULT
  }
return *p.CatalogName
}
var TGetFunctionsReq_SchemaName_DEFAULT TPatternOrIdentifier
func (p *TGetFunctionsReq) GetSchemaName() TPatternOrIdentifier {
  if !p.IsSetSchemaName() {
    return TGetFunctionsReq_SchemaName_DEFAULT
  }
return *p.SchemaName
}

func (p *TGetFunctionsReq) GetFunctionName() TPatternOrIdentifier {
  return p.FunctionName
}
func (p *TGetFunctionsReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetFunctionsReq) IsSetCatalogName() bool {
  return p.CatalogName != nil
}

func (p *TGetFunctionsReq) IsSetSchemaName() bool {
  return p.SchemaName != nil
}

func (p *TGetFunctionsReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;
  var issetFunctionName bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
        issetFunctionName = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  if !issetFunctionName{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FunctionName is not set"));
  }
  return nil
}

func (p *TGetFunctionsReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetFunctionsReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TIdentifier(v)
  p.CatalogName = &temp
}
  return nil
}

func (p *TGetFunctionsReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.SchemaName = &temp
}
  return nil
}

func (p *TGetFunctionsReq)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  temp := TPatternOrIdentifier(v)
  p.FunctionName = temp
}
  return nil
}

func (p *TGetFunctionsReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetFunctionsReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetFunctionsReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetFunctionsReq) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetCatalogName() {
    if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) }
    if err := oprot.WriteString(string(*p.CatalogName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) }
  }
  return err
}

func (p *TGetFunctionsReq) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSchemaName() {
    if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) }
    if err := oprot.WriteString(string(*p.SchemaName)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) }
  }
  return err
}

func (p *TGetFunctionsReq) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("functionName", thrift.STRING, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) }
  if err := oprot.WriteString(string(p.FunctionName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) }
  return err
}

func (p *TGetFunctionsReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetFunctionsReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationHandle
type TGetFunctionsResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"`
}

func NewTGetFunctionsResp() *TGetFunctionsResp {
  return &TGetFunctionsResp{}
}

var TGetFunctionsResp_Status_DEFAULT *TStatus
func (p *TGetFunctionsResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetFunctionsResp_Status_DEFAULT
  }
return p.Status
}
var TGetFunctionsResp_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetFunctionsResp) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetFunctionsResp_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetFunctionsResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetFunctionsResp) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetFunctionsResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetFunctionsResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetFunctionsResp)  ReadField2(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetFunctionsResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetFunctionsResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetFunctionsResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetFunctionsResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationHandle() {
    if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) }
    if err := p.OperationHandle.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) }
  }
  return err
}

func (p *TGetFunctionsResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetFunctionsResp(%+v)", *p)
}

// Attributes:
//  - OperationHandle
type TGetOperationStatusReq struct {
  OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"`
}

func NewTGetOperationStatusReq() *TGetOperationStatusReq {
  return &TGetOperationStatusReq{}
}

var TGetOperationStatusReq_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetOperationStatusReq) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetOperationStatusReq_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetOperationStatusReq) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetOperationStatusReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set"));
  }
  return nil
}

func (p *TGetOperationStatusReq)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetOperationStatusReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetOperationStatusReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetOperationStatusReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) }
  if err := p.OperationHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) }
  return err
}

func (p *TGetOperationStatusReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - OperationState
//  - SqlState
//  - ErrorCode
//  - ErrorMessage
type TGetOperationStatusResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"`
  SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"`
  ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"`
  ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"`
}

func NewTGetOperationStatusResp() *TGetOperationStatusResp {
  return &TGetOperationStatusResp{}
}

var TGetOperationStatusResp_Status_DEFAULT *TStatus
func (p *TGetOperationStatusResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetOperationStatusResp_Status_DEFAULT
  }
return p.Status
}
var TGetOperationStatusResp_OperationState_DEFAULT TOperationState
func (p *TGetOperationStatusResp) GetOperationState() TOperationState {
  if !p.IsSetOperationState() {
    return TGetOperationStatusResp_OperationState_DEFAULT
  }
return *p.OperationState
}
var TGetOperationStatusResp_SqlState_DEFAULT string
func (p *TGetOperationStatusResp) GetSqlState() string {
  if !p.IsSetSqlState() {
    return TGetOperationStatusResp_SqlState_DEFAULT
  }
return *p.SqlState
}
var TGetOperationStatusResp_ErrorCode_DEFAULT int32
func (p *TGetOperationStatusResp) GetErrorCode() int32 {
  if !p.IsSetErrorCode() {
    return TGetOperationStatusResp_ErrorCode_DEFAULT
  }
return *p.ErrorCode
}
var TGetOperationStatusResp_ErrorMessage_DEFAULT string
func (p *TGetOperationStatusResp) GetErrorMessage() string {
  if !p.IsSetErrorMessage() {
    return TGetOperationStatusResp_ErrorMessage_DEFAULT
  }
return *p.ErrorMessage
}
func (p *TGetOperationStatusResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetOperationStatusResp) IsSetOperationState() bool {
  return p.OperationState != nil
}

func (p *TGetOperationStatusResp) IsSetSqlState() bool {
  return p.SqlState != nil
}

func (p *TGetOperationStatusResp) IsSetErrorCode() bool {
  return p.ErrorCode != nil
}

func (p *TGetOperationStatusResp) IsSetErrorMessage() bool {
  return p.ErrorMessage != nil
}

func (p *TGetOperationStatusResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetOperationStatusResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetOperationStatusResp)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TOperationState(v)
  p.OperationState = &temp
}
  return nil
}

func (p *TGetOperationStatusResp)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.SqlState = &v
}
  return nil
}

func (p *TGetOperationStatusResp)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.ErrorCode = &v
}
  return nil
}

func (p *TGetOperationStatusResp)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.ErrorMessage = &v
}
  return nil
}

func (p *TGetOperationStatusResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetOperationStatusResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetOperationStatusResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetOperationStatusResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetOperationState() {
    if err := oprot.WriteFieldBegin("operationState", thrift.I32, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) }
    if err := oprot.WriteI32(int32(*p.OperationState)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) }
  }
  return err
}

func (p *TGetOperationStatusResp) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetSqlState() {
    if err := oprot.WriteFieldBegin("sqlState", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) }
    if err := oprot.WriteString(string(*p.SqlState)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) }
  }
  return err
}

func (p *TGetOperationStatusResp) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetErrorCode() {
    if err := oprot.WriteFieldBegin("errorCode", thrift.I32, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) }
    if err := oprot.WriteI32(int32(*p.ErrorCode)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) }
  }
  return err
}

func (p *TGetOperationStatusResp) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetErrorMessage() {
    if err := oprot.WriteFieldBegin("errorMessage", thrift.STRING, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) }
    if err := oprot.WriteString(string(*p.ErrorMessage)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) }
  }
  return err
}

func (p *TGetOperationStatusResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p)
}

// Attributes:
//  - OperationHandle
type TCancelOperationReq struct {
  OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"`
}

func NewTCancelOperationReq() *TCancelOperationReq {
  return &TCancelOperationReq{}
}

var TCancelOperationReq_OperationHandle_DEFAULT *TOperationHandle
func (p *TCancelOperationReq) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TCancelOperationReq_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TCancelOperationReq) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TCancelOperationReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set"));
  }
  return nil
}

func (p *TCancelOperationReq)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TCancelOperationReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCancelOperationReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCancelOperationReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) }
  if err := p.OperationHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) }
  return err
}

func (p *TCancelOperationReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCancelOperationReq(%+v)", *p)
}

// Attributes:
//  - Status
type TCancelOperationResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
}

func NewTCancelOperationResp() *TCancelOperationResp {
  return &TCancelOperationResp{}
}

var TCancelOperationResp_Status_DEFAULT *TStatus
func (p *TCancelOperationResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TCancelOperationResp_Status_DEFAULT
  }
return p.Status
}
func (p *TCancelOperationResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TCancelOperationResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TCancelOperationResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TCancelOperationResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCancelOperationResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCancelOperationResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TCancelOperationResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCancelOperationResp(%+v)", *p)
}

// Attributes:
//  - OperationHandle
type TCloseOperationReq struct {
  OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"`
}

func NewTCloseOperationReq() *TCloseOperationReq {
  return &TCloseOperationReq{}
}

var TCloseOperationReq_OperationHandle_DEFAULT *TOperationHandle
func (p *TCloseOperationReq) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TCloseOperationReq_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TCloseOperationReq) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TCloseOperationReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set"));
  }
  return nil
}

func (p *TCloseOperationReq)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TCloseOperationReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCloseOperationReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCloseOperationReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) }
  if err := p.OperationHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) }
  return err
}

func (p *TCloseOperationReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCloseOperationReq(%+v)", *p)
}

// Attributes:
//  - Status
type TCloseOperationResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
}

func NewTCloseOperationResp() *TCloseOperationResp {
  return &TCloseOperationResp{}
}

var TCloseOperationResp_Status_DEFAULT *TStatus
func (p *TCloseOperationResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TCloseOperationResp_Status_DEFAULT
  }
return p.Status
}
func (p *TCloseOperationResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TCloseOperationResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TCloseOperationResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TCloseOperationResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCloseOperationResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCloseOperationResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TCloseOperationResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCloseOperationResp(%+v)", *p)
}

// Attributes:
//  - OperationHandle
type TGetResultSetMetadataReq struct {
  OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"`
}

func NewTGetResultSetMetadataReq() *TGetResultSetMetadataReq {
  return &TGetResultSetMetadataReq{}
}

var TGetResultSetMetadataReq_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetResultSetMetadataReq) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetResultSetMetadataReq_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetResultSetMetadataReq) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetResultSetMetadataReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set"));
  }
  return nil
}

func (p *TGetResultSetMetadataReq)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetResultSetMetadataReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetResultSetMetadataReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetResultSetMetadataReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) }
  if err := p.OperationHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) }
  return err
}

func (p *TGetResultSetMetadataReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - Schema
type TGetResultSetMetadataResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"`
}

func NewTGetResultSetMetadataResp() *TGetResultSetMetadataResp {
  return &TGetResultSetMetadataResp{}
}

var TGetResultSetMetadataResp_Status_DEFAULT *TStatus
func (p *TGetResultSetMetadataResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetResultSetMetadataResp_Status_DEFAULT
  }
return p.Status
}
var TGetResultSetMetadataResp_Schema_DEFAULT *TTableSchema
func (p *TGetResultSetMetadataResp) GetSchema() *TTableSchema {
  if !p.IsSetSchema() {
    return TGetResultSetMetadataResp_Schema_DEFAULT
  }
return p.Schema
}
func (p *TGetResultSetMetadataResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetResultSetMetadataResp) IsSetSchema() bool {
  return p.Schema != nil
}

func (p *TGetResultSetMetadataResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetResultSetMetadataResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetResultSetMetadataResp)  ReadField2(iprot thrift.TProtocol) error {
  p.Schema = &TTableSchema{}
  if err := p.Schema.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err)
  }
  return nil
}

func (p *TGetResultSetMetadataResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetResultSetMetadataResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetResultSetMetadataResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetResultSetMetadataResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetSchema() {
    if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) }
    if err := p.Schema.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) }
  }
  return err
}

func (p *TGetResultSetMetadataResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p)
}

// Attributes:
//  - OperationHandle
//  - Orientation
//  - MaxRows
type TFetchResultsReq struct {
  OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"`
  Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"`
  MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"`
}

func NewTFetchResultsReq() *TFetchResultsReq {
  return &TFetchResultsReq{
Orientation: 0,
}
}

var TFetchResultsReq_OperationHandle_DEFAULT *TOperationHandle
func (p *TFetchResultsReq) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TFetchResultsReq_OperationHandle_DEFAULT
  }
return p.OperationHandle
}

func (p *TFetchResultsReq) GetOrientation() TFetchOrientation {
  return p.Orientation
}

func (p *TFetchResultsReq) GetMaxRows() int64 {
  return p.MaxRows
}
func (p *TFetchResultsReq) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TFetchResultsReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationHandle bool = false;
  var issetOrientation bool = false;
  var issetMaxRows bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetOrientation = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
        issetMaxRows = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set"));
  }
  if !issetOrientation{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set"));
  }
  if !issetMaxRows{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set"));
  }
  return nil
}

func (p *TFetchResultsReq)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TFetchResultsReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := TFetchOrientation(v)
  p.Orientation = temp
}
  return nil
}

func (p *TFetchResultsReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.MaxRows = v
}
  return nil
}

func (p *TFetchResultsReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TFetchResultsReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TFetchResultsReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) }
  if err := p.OperationHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) }
  return err
}

func (p *TFetchResultsReq) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("orientation", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) }
  if err := oprot.WriteI32(int32(p.Orientation)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) }
  return err
}

func (p *TFetchResultsReq) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("maxRows", thrift.I64, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) }
  if err := oprot.WriteI64(int64(p.MaxRows)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) }
  return err
}

func (p *TFetchResultsReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TFetchResultsReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - HasMoreRows
//  - Results
type TFetchResultsResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"`
  Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"`
}

func NewTFetchResultsResp() *TFetchResultsResp {
  return &TFetchResultsResp{}
}

var TFetchResultsResp_Status_DEFAULT *TStatus
func (p *TFetchResultsResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TFetchResultsResp_Status_DEFAULT
  }
return p.Status
}
var TFetchResultsResp_HasMoreRows_DEFAULT bool
func (p *TFetchResultsResp) GetHasMoreRows() bool {
  if !p.IsSetHasMoreRows() {
    return TFetchResultsResp_HasMoreRows_DEFAULT
  }
return *p.HasMoreRows
}
var TFetchResultsResp_Results_DEFAULT *TRowSet
func (p *TFetchResultsResp) GetResults() *TRowSet {
  if !p.IsSetResults() {
    return TFetchResultsResp_Results_DEFAULT
  }
return p.Results
}
func (p *TFetchResultsResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TFetchResultsResp) IsSetHasMoreRows() bool {
  return p.HasMoreRows != nil
}

func (p *TFetchResultsResp) IsSetResults() bool {
  return p.Results != nil
}

func (p *TFetchResultsResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TFetchResultsResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TFetchResultsResp)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.HasMoreRows = &v
}
  return nil
}

func (p *TFetchResultsResp)  ReadField3(iprot thrift.TProtocol) error {
  p.Results = &TRowSet{}
  if err := p.Results.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err)
  }
  return nil
}

func (p *TFetchResultsResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TFetchResultsResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TFetchResultsResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TFetchResultsResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetHasMoreRows() {
    if err := oprot.WriteFieldBegin("hasMoreRows", thrift.BOOL, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) }
    if err := oprot.WriteBool(bool(*p.HasMoreRows)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) }
  }
  return err
}

func (p *TFetchResultsResp) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetResults() {
    if err := oprot.WriteFieldBegin("results", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) }
    if err := p.Results.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) }
  }
  return err
}

func (p *TFetchResultsResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TFetchResultsResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - Owner
//  - Renewer
type TGetDelegationTokenReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  Owner string `thrift:"owner,2,required" db:"owner" json:"owner"`
  Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"`
}

func NewTGetDelegationTokenReq() *TGetDelegationTokenReq {
  return &TGetDelegationTokenReq{}
}

var TGetDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TGetDelegationTokenReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TGetDelegationTokenReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}

func (p *TGetDelegationTokenReq) GetOwner() string {
  return p.Owner
}

func (p *TGetDelegationTokenReq) GetRenewer() string {
  return p.Renewer
}
func (p *TGetDelegationTokenReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TGetDelegationTokenReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;
  var issetOwner bool = false;
  var issetRenewer bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetOwner = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
        issetRenewer = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  if !issetOwner{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set"));
  }
  if !issetRenewer{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set"));
  }
  return nil
}

func (p *TGetDelegationTokenReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TGetDelegationTokenReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Owner = v
}
  return nil
}

func (p *TGetDelegationTokenReq)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Renewer = v
}
  return nil
}

func (p *TGetDelegationTokenReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetDelegationTokenReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetDelegationTokenReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TGetDelegationTokenReq) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("owner", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) }
  if err := oprot.WriteString(string(p.Owner)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) }
  return err
}

func (p *TGetDelegationTokenReq) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("renewer", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) }
  if err := oprot.WriteString(string(p.Renewer)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) }
  return err
}

func (p *TGetDelegationTokenReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - DelegationToken
type TGetDelegationTokenResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"`
}

func NewTGetDelegationTokenResp() *TGetDelegationTokenResp {
  return &TGetDelegationTokenResp{}
}

var TGetDelegationTokenResp_Status_DEFAULT *TStatus
func (p *TGetDelegationTokenResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetDelegationTokenResp_Status_DEFAULT
  }
return p.Status
}
var TGetDelegationTokenResp_DelegationToken_DEFAULT string
func (p *TGetDelegationTokenResp) GetDelegationToken() string {
  if !p.IsSetDelegationToken() {
    return TGetDelegationTokenResp_DelegationToken_DEFAULT
  }
return *p.DelegationToken
}
func (p *TGetDelegationTokenResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetDelegationTokenResp) IsSetDelegationToken() bool {
  return p.DelegationToken != nil
}

func (p *TGetDelegationTokenResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TGetDelegationTokenResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetDelegationTokenResp)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DelegationToken = &v
}
  return nil
}

func (p *TGetDelegationTokenResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetDelegationTokenResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetDelegationTokenResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetDelegationTokenResp) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetDelegationToken() {
    if err := oprot.WriteFieldBegin("delegationToken", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) }
    if err := oprot.WriteString(string(*p.DelegationToken)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) }
  }
  return err
}

func (p *TGetDelegationTokenResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - DelegationToken
type TCancelDelegationTokenReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"`
}

func NewTCancelDelegationTokenReq() *TCancelDelegationTokenReq {
  return &TCancelDelegationTokenReq{}
}

var TCancelDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TCancelDelegationTokenReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TCancelDelegationTokenReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}

func (p *TCancelDelegationTokenReq) GetDelegationToken() string {
  return p.DelegationToken
}
func (p *TCancelDelegationTokenReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TCancelDelegationTokenReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;
  var issetDelegationToken bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetDelegationToken = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  if !issetDelegationToken{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set"));
  }
  return nil
}

func (p *TCancelDelegationTokenReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TCancelDelegationTokenReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DelegationToken = v
}
  return nil
}

func (p *TCancelDelegationTokenReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCancelDelegationTokenReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCancelDelegationTokenReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TCancelDelegationTokenReq) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("delegationToken", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) }
  if err := oprot.WriteString(string(p.DelegationToken)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) }
  return err
}

func (p *TCancelDelegationTokenReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p)
}

// Attributes:
//  - Status
type TCancelDelegationTokenResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
}

func NewTCancelDelegationTokenResp() *TCancelDelegationTokenResp {
  return &TCancelDelegationTokenResp{}
}

var TCancelDelegationTokenResp_Status_DEFAULT *TStatus
func (p *TCancelDelegationTokenResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TCancelDelegationTokenResp_Status_DEFAULT
  }
return p.Status
}
func (p *TCancelDelegationTokenResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TCancelDelegationTokenResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TCancelDelegationTokenResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TCancelDelegationTokenResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TCancelDelegationTokenResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCancelDelegationTokenResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TCancelDelegationTokenResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p)
}

// Attributes:
//  - SessionHandle
//  - DelegationToken
type TRenewDelegationTokenReq struct {
  SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"`
  DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"`
}

func NewTRenewDelegationTokenReq() *TRenewDelegationTokenReq {
  return &TRenewDelegationTokenReq{}
}

var TRenewDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle
func (p *TRenewDelegationTokenReq) GetSessionHandle() *TSessionHandle {
  if !p.IsSetSessionHandle() {
    return TRenewDelegationTokenReq_SessionHandle_DEFAULT
  }
return p.SessionHandle
}

func (p *TRenewDelegationTokenReq) GetDelegationToken() string {
  return p.DelegationToken
}
func (p *TRenewDelegationTokenReq) IsSetSessionHandle() bool {
  return p.SessionHandle != nil
}

func (p *TRenewDelegationTokenReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetSessionHandle bool = false;
  var issetDelegationToken bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetSessionHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetDelegationToken = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetSessionHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set"));
  }
  if !issetDelegationToken{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set"));
  }
  return nil
}

func (p *TRenewDelegationTokenReq)  ReadField1(iprot thrift.TProtocol) error {
  p.SessionHandle = &TSessionHandle{}
  if err := p.SessionHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err)
  }
  return nil
}

func (p *TRenewDelegationTokenReq)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DelegationToken = v
}
  return nil
}

func (p *TRenewDelegationTokenReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TRenewDelegationTokenReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TRenewDelegationTokenReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) }
  if err := p.SessionHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) }
  return err
}

func (p *TRenewDelegationTokenReq) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("delegationToken", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) }
  if err := oprot.WriteString(string(p.DelegationToken)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) }
  return err
}

func (p *TRenewDelegationTokenReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p)
}

// Attributes:
//  - Status
type TRenewDelegationTokenResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
}

func NewTRenewDelegationTokenResp() *TRenewDelegationTokenResp {
  return &TRenewDelegationTokenResp{}
}

var TRenewDelegationTokenResp_Status_DEFAULT *TStatus
func (p *TRenewDelegationTokenResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TRenewDelegationTokenResp_Status_DEFAULT
  }
return p.Status
}
func (p *TRenewDelegationTokenResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TRenewDelegationTokenResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  return nil
}

func (p *TRenewDelegationTokenResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TRenewDelegationTokenResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TRenewDelegationTokenResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TRenewDelegationTokenResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TRenewDelegationTokenResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p)
}

// Attributes:
//  - OperationHandle
type TGetLogReq struct {
  OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"`
}

func NewTGetLogReq() *TGetLogReq {
  return &TGetLogReq{}
}

var TGetLogReq_OperationHandle_DEFAULT *TOperationHandle
func (p *TGetLogReq) GetOperationHandle() *TOperationHandle {
  if !p.IsSetOperationHandle() {
    return TGetLogReq_OperationHandle_DEFAULT
  }
return p.OperationHandle
}
func (p *TGetLogReq) IsSetOperationHandle() bool {
  return p.OperationHandle != nil
}

func (p *TGetLogReq) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetOperationHandle bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetOperationHandle = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetOperationHandle{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set"));
  }
  return nil
}

func (p *TGetLogReq)  ReadField1(iprot thrift.TProtocol) error {
  p.OperationHandle = &TOperationHandle{}
  if err := p.OperationHandle.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err)
  }
  return nil
}

func (p *TGetLogReq) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetLogReq"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetLogReq) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) }
  if err := p.OperationHandle.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) }
  return err
}

func (p *TGetLogReq) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetLogReq(%+v)", *p)
}

// Attributes:
//  - Status
//  - Log
type TGetLogResp struct {
  Status *TStatus `thrift:"status,1,required" db:"status" json:"status"`
  Log string `thrift:"log,2,required" db:"log" json:"log"`
}

func NewTGetLogResp() *TGetLogResp {
  return &TGetLogResp{}
}

var TGetLogResp_Status_DEFAULT *TStatus
func (p *TGetLogResp) GetStatus() *TStatus {
  if !p.IsSetStatus() {
    return TGetLogResp_Status_DEFAULT
  }
return p.Status
}

func (p *TGetLogResp) GetLog() string {
  return p.Log
}
func (p *TGetLogResp) IsSetStatus() bool {
  return p.Status != nil
}

func (p *TGetLogResp) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }

  var issetStatus bool = false;
  var issetLog bool = false;

  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
        issetStatus = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
        issetLog = true
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  if !issetStatus{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
  }
  if !issetLog{
    return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Log is not set"));
  }
  return nil
}

func (p *TGetLogResp)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &TStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *TGetLogResp)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Log = v
}
  return nil
}

func (p *TGetLogResp) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("TGetLogResp"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TGetLogResp) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
  if err := p.Status.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
  return err
}

func (p *TGetLogResp) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("log", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:log: ", p), err) }
  if err := oprot.WriteString(string(p.Log)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.log (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:log: ", p), err) }
  return err
}

func (p *TGetLogResp) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TGetLogResp(%+v)", *p)
}

type TCLIService interface {
  // Parameters:
  //  - Req
  OpenSession(ctx context.Context, req *TOpenSessionReq) (r *TOpenSessionResp, err error)
  // Parameters:
  //  - Req
  CloseSession(ctx context.Context, req *TCloseSessionReq) (r *TCloseSessionResp, err error)
  // Parameters:
  //  - Req
  GetInfo(ctx context.Context, req *TGetInfoReq) (r *TGetInfoResp, err error)
  // Parameters:
  //  - Req
  ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (r *TExecuteStatementResp, err error)
  // Parameters:
  //  - Req
  GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (r *TGetTypeInfoResp, err error)
  // Parameters:
  //  - Req
  GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (r *TGetCatalogsResp, err error)
  // Parameters:
  //  - Req
  GetSchemas(ctx context.Context, req *TGetSchemasReq) (r *TGetSchemasResp, err error)
  // Parameters:
  //  - Req
  GetTables(ctx context.Context, req *TGetTablesReq) (r *TGetTablesResp, err error)
  // Parameters:
  //  - Req
  GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (r *TGetTableTypesResp, err error)
  // Parameters:
  //  - Req
  GetColumns(ctx context.Context, req *TGetColumnsReq) (r *TGetColumnsResp, err error)
  // Parameters:
  //  - Req
  GetFunctions(ctx context.Context, req *TGetFunctionsReq) (r *TGetFunctionsResp, err error)
  // Parameters:
  //  - Req
  GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (r *TGetOperationStatusResp, err error)
  // Parameters:
  //  - Req
  CancelOperation(ctx context.Context, req *TCancelOperationReq) (r *TCancelOperationResp, err error)
  // Parameters:
  //  - Req
  CloseOperation(ctx context.Context, req *TCloseOperationReq) (r *TCloseOperationResp, err error)
  // Parameters:
  //  - Req
  GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (r *TGetResultSetMetadataResp, err error)
  // Parameters:
  //  - Req
  FetchResults(ctx context.Context, req *TFetchResultsReq) (r *TFetchResultsResp, err error)
  // Parameters:
  //  - Req
  GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (r *TGetDelegationTokenResp, err error)
  // Parameters:
  //  - Req
  CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (r *TCancelDelegationTokenResp, err error)
  // Parameters:
  //  - Req
  RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (r *TRenewDelegationTokenResp, err error)
  // Parameters:
  //  - Req
  GetLog(ctx context.Context, req *TGetLogReq) (r *TGetLogResp, err error)
}

type TCLIServiceClient struct {
  c thrift.TClient
}

func NewTCLIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TCLIServiceClient {
  return &TCLIServiceClient{
    c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
  }
}

func NewTCLIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TCLIServiceClient {
  return &TCLIServiceClient{
    c: thrift.NewTStandardClient(iprot, oprot),
  }
}

func NewTCLIServiceClient(c thrift.TClient) *TCLIServiceClient {
  return &TCLIServiceClient{
    c: c,
  }
}

func (p *TCLIServiceClient) Client_() thrift.TClient {
  return p.c
}
// Parameters:
//  - Req
func (p *TCLIServiceClient) OpenSession(ctx context.Context, req *TOpenSessionReq) (r *TOpenSessionResp, err error) {
  var _args27 TCLIServiceOpenSessionArgs
  _args27.Req = req
  var _result28 TCLIServiceOpenSessionResult
  if err = p.Client_().Call(ctx, "OpenSession", &_args27, &_result28); err != nil {
    return
  }
  return _result28.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) CloseSession(ctx context.Context, req *TCloseSessionReq) (r *TCloseSessionResp, err error) {
  var _args29 TCLIServiceCloseSessionArgs
  _args29.Req = req
  var _result30 TCLIServiceCloseSessionResult
  if err = p.Client_().Call(ctx, "CloseSession", &_args29, &_result30); err != nil {
    return
  }
  return _result30.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetInfo(ctx context.Context, req *TGetInfoReq) (r *TGetInfoResp, err error) {
  var _args31 TCLIServiceGetInfoArgs
  _args31.Req = req
  var _result32 TCLIServiceGetInfoResult
  if err = p.Client_().Call(ctx, "GetInfo", &_args31, &_result32); err != nil {
    return
  }
  return _result32.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (r *TExecuteStatementResp, err error) {
  var _args33 TCLIServiceExecuteStatementArgs
  _args33.Req = req
  var _result34 TCLIServiceExecuteStatementResult
  if err = p.Client_().Call(ctx, "ExecuteStatement", &_args33, &_result34); err != nil {
    return
  }
  return _result34.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (r *TGetTypeInfoResp, err error) {
  var _args35 TCLIServiceGetTypeInfoArgs
  _args35.Req = req
  var _result36 TCLIServiceGetTypeInfoResult
  if err = p.Client_().Call(ctx, "GetTypeInfo", &_args35, &_result36); err != nil {
    return
  }
  return _result36.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (r *TGetCatalogsResp, err error) {
  var _args37 TCLIServiceGetCatalogsArgs
  _args37.Req = req
  var _result38 TCLIServiceGetCatalogsResult
  if err = p.Client_().Call(ctx, "GetCatalogs", &_args37, &_result38); err != nil {
    return
  }
  return _result38.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetSchemas(ctx context.Context, req *TGetSchemasReq) (r *TGetSchemasResp, err error) {
  var _args39 TCLIServiceGetSchemasArgs
  _args39.Req = req
  var _result40 TCLIServiceGetSchemasResult
  if err = p.Client_().Call(ctx, "GetSchemas", &_args39, &_result40); err != nil {
    return
  }
  return _result40.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetTables(ctx context.Context, req *TGetTablesReq) (r *TGetTablesResp, err error) {
  var _args41 TCLIServiceGetTablesArgs
  _args41.Req = req
  var _result42 TCLIServiceGetTablesResult
  if err = p.Client_().Call(ctx, "GetTables", &_args41, &_result42); err != nil {
    return
  }
  return _result42.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (r *TGetTableTypesResp, err error) {
  var _args43 TCLIServiceGetTableTypesArgs
  _args43.Req = req
  var _result44 TCLIServiceGetTableTypesResult
  if err = p.Client_().Call(ctx, "GetTableTypes", &_args43, &_result44); err != nil {
    return
  }
  return _result44.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetColumns(ctx context.Context, req *TGetColumnsReq) (r *TGetColumnsResp, err error) {
  var _args45 TCLIServiceGetColumnsArgs
  _args45.Req = req
  var _result46 TCLIServiceGetColumnsResult
  if err = p.Client_().Call(ctx, "GetColumns", &_args45, &_result46); err != nil {
    return
  }
  return _result46.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetFunctions(ctx context.Context, req *TGetFunctionsReq) (r *TGetFunctionsResp, err error) {
  var _args47 TCLIServiceGetFunctionsArgs
  _args47.Req = req
  var _result48 TCLIServiceGetFunctionsResult
  if err = p.Client_().Call(ctx, "GetFunctions", &_args47, &_result48); err != nil {
    return
  }
  return _result48.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (r *TGetOperationStatusResp, err error) {
  var _args49 TCLIServiceGetOperationStatusArgs
  _args49.Req = req
  var _result50 TCLIServiceGetOperationStatusResult
  if err = p.Client_().Call(ctx, "GetOperationStatus", &_args49, &_result50); err != nil {
    return
  }
  return _result50.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) CancelOperation(ctx context.Context, req *TCancelOperationReq) (r *TCancelOperationResp, err error) {
  var _args51 TCLIServiceCancelOperationArgs
  _args51.Req = req
  var _result52 TCLIServiceCancelOperationResult
  if err = p.Client_().Call(ctx, "CancelOperation", &_args51, &_result52); err != nil {
    return
  }
  return _result52.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) CloseOperation(ctx context.Context, req *TCloseOperationReq) (r *TCloseOperationResp, err error) {
  var _args53 TCLIServiceCloseOperationArgs
  _args53.Req = req
  var _result54 TCLIServiceCloseOperationResult
  if err = p.Client_().Call(ctx, "CloseOperation", &_args53, &_result54); err != nil {
    return
  }
  return _result54.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (r *TGetResultSetMetadataResp, err error) {
  var _args55 TCLIServiceGetResultSetMetadataArgs
  _args55.Req = req
  var _result56 TCLIServiceGetResultSetMetadataResult
  if err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args55, &_result56); err != nil {
    return
  }
  return _result56.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) FetchResults(ctx context.Context, req *TFetchResultsReq) (r *TFetchResultsResp, err error) {
  var _args57 TCLIServiceFetchResultsArgs
  _args57.Req = req
  var _result58 TCLIServiceFetchResultsResult
  if err = p.Client_().Call(ctx, "FetchResults", &_args57, &_result58); err != nil {
    return
  }
  return _result58.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (r *TGetDelegationTokenResp, err error) {
  var _args59 TCLIServiceGetDelegationTokenArgs
  _args59.Req = req
  var _result60 TCLIServiceGetDelegationTokenResult
  if err = p.Client_().Call(ctx, "GetDelegationToken", &_args59, &_result60); err != nil {
    return
  }
  return _result60.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (r *TCancelDelegationTokenResp, err error) {
  var _args61 TCLIServiceCancelDelegationTokenArgs
  _args61.Req = req
  var _result62 TCLIServiceCancelDelegationTokenResult
  if err = p.Client_().Call(ctx, "CancelDelegationToken", &_args61, &_result62); err != nil {
    return
  }
  return _result62.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (r *TRenewDelegationTokenResp, err error) {
  var _args63 TCLIServiceRenewDelegationTokenArgs
  _args63.Req = req
  var _result64 TCLIServiceRenewDelegationTokenResult
  if err = p.Client_().Call(ctx, "RenewDelegationToken", &_args63, &_result64); err != nil {
    return
  }
  return _result64.GetSuccess(), nil
}

// Parameters:
//  - Req
func (p *TCLIServiceClient) GetLog(ctx context.Context, req *TGetLogReq) (r *TGetLogResp, err error) {
  var _args65 TCLIServiceGetLogArgs
  _args65.Req = req
  var _result66 TCLIServiceGetLogResult
  if err = p.Client_().Call(ctx, "GetLog", &_args65, &_result66); err != nil {
    return
  }
  return _result66.GetSuccess(), nil
}

type TCLIServiceProcessor struct {
  processorMap map[string]thrift.TProcessorFunction
  handler TCLIService
}

func (p *TCLIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
  p.processorMap[key] = processor
}

func (p *TCLIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
  processor, ok = p.processorMap[key]
  return processor, ok
}

func (p *TCLIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
  return p.processorMap
}

func NewTCLIServiceProcessor(handler TCLIService) *TCLIServiceProcessor {

  self67 := &TCLIServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
  self67.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler:handler}
  self67.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler:handler}
  self67.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler:handler}
  self67.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler:handler}
  self67.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler:handler}
  self67.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler:handler}
  self67.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler:handler}
  self67.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler:handler}
  self67.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler:handler}
  self67.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler:handler}
  self67.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler:handler}
  self67.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler:handler}
  self67.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler:handler}
  self67.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler:handler}
  self67.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler:handler}
  self67.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler:handler}
  self67.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler:handler}
  self67.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler:handler}
  self67.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler:handler}
  self67.processorMap["GetLog"] = &tCLIServiceProcessorGetLog{handler:handler}
return self67
}

func (p *TCLIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  name, _, seqId, err := iprot.ReadMessageBegin()
  if err != nil { return false, err }
  if processor, ok := p.GetProcessorFunction(name); ok {
    return processor.Process(ctx, seqId, iprot, oprot)
  }
  iprot.Skip(thrift.STRUCT)
  iprot.ReadMessageEnd()
  x68 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
  oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
  x68.Write(oprot)
  oprot.WriteMessageEnd()
  oprot.Flush(ctx)
  return false, x68

}

type tCLIServiceProcessorOpenSession struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceOpenSessionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("OpenSession", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceOpenSessionResult{}
var retval *TOpenSessionResp
  var err2 error
  if retval, err2 = p.handler.OpenSession(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: " + err2.Error())
    oprot.WriteMessageBegin("OpenSession", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("OpenSession", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorCloseSession struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceCloseSessionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("CloseSession", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceCloseSessionResult{}
var retval *TCloseSessionResp
  var err2 error
  if retval, err2 = p.handler.CloseSession(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: " + err2.Error())
    oprot.WriteMessageBegin("CloseSession", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("CloseSession", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetInfo struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetInfoArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetInfo", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetInfoResult{}
var retval *TGetInfoResp
  var err2 error
  if retval, err2 = p.handler.GetInfo(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: " + err2.Error())
    oprot.WriteMessageBegin("GetInfo", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetInfo", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorExecuteStatement struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceExecuteStatementArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("ExecuteStatement", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceExecuteStatementResult{}
var retval *TExecuteStatementResp
  var err2 error
  if retval, err2 = p.handler.ExecuteStatement(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: " + err2.Error())
    oprot.WriteMessageBegin("ExecuteStatement", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("ExecuteStatement", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetTypeInfo struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetTypeInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetTypeInfoArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetTypeInfo", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetTypeInfoResult{}
var retval *TGetTypeInfoResp
  var err2 error
  if retval, err2 = p.handler.GetTypeInfo(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: " + err2.Error())
    oprot.WriteMessageBegin("GetTypeInfo", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetTypeInfo", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetCatalogs struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetCatalogs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetCatalogsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetCatalogs", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetCatalogsResult{}
var retval *TGetCatalogsResp
  var err2 error
  if retval, err2 = p.handler.GetCatalogs(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: " + err2.Error())
    oprot.WriteMessageBegin("GetCatalogs", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetCatalogs", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetSchemas struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetSchemas) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetSchemasArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetSchemas", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetSchemasResult{}
var retval *TGetSchemasResp
  var err2 error
  if retval, err2 = p.handler.GetSchemas(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: " + err2.Error())
    oprot.WriteMessageBegin("GetSchemas", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetSchemas", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetTables struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetTablesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetTables", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetTablesResult{}
var retval *TGetTablesResp
  var err2 error
  if retval, err2 = p.handler.GetTables(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: " + err2.Error())
    oprot.WriteMessageBegin("GetTables", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetTables", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetTableTypes struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetTableTypes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetTableTypesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetTableTypes", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetTableTypesResult{}
var retval *TGetTableTypesResp
  var err2 error
  if retval, err2 = p.handler.GetTableTypes(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: " + err2.Error())
    oprot.WriteMessageBegin("GetTableTypes", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetTableTypes", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetColumns struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetColumnsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetColumns", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetColumnsResult{}
var retval *TGetColumnsResp
  var err2 error
  if retval, err2 = p.handler.GetColumns(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: " + err2.Error())
    oprot.WriteMessageBegin("GetColumns", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetColumns", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetFunctions struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetFunctions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetFunctionsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetFunctions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetFunctionsResult{}
var retval *TGetFunctionsResp
  var err2 error
  if retval, err2 = p.handler.GetFunctions(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: " + err2.Error())
    oprot.WriteMessageBegin("GetFunctions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetFunctions", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetOperationStatus struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetOperationStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetOperationStatusArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetOperationStatus", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetOperationStatusResult{}
var retval *TGetOperationStatusResp
  var err2 error
  if retval, err2 = p.handler.GetOperationStatus(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: " + err2.Error())
    oprot.WriteMessageBegin("GetOperationStatus", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetOperationStatus", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorCancelOperation struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceCancelOperationArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("CancelOperation", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceCancelOperationResult{}
var retval *TCancelOperationResp
  var err2 error
  if retval, err2 = p.handler.CancelOperation(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: " + err2.Error())
    oprot.WriteMessageBegin("CancelOperation", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("CancelOperation", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorCloseOperation struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceCloseOperationArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("CloseOperation", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceCloseOperationResult{}
var retval *TCloseOperationResp
  var err2 error
  if retval, err2 = p.handler.CloseOperation(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: " + err2.Error())
    oprot.WriteMessageBegin("CloseOperation", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("CloseOperation", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetResultSetMetadata struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetResultSetMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetResultSetMetadataArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetResultSetMetadata", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetResultSetMetadataResult{}
var retval *TGetResultSetMetadataResp
  var err2 error
  if retval, err2 = p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: " + err2.Error())
    oprot.WriteMessageBegin("GetResultSetMetadata", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorFetchResults struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceFetchResultsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("FetchResults", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceFetchResultsResult{}
var retval *TFetchResultsResp
  var err2 error
  if retval, err2 = p.handler.FetchResults(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: " + err2.Error())
    oprot.WriteMessageBegin("FetchResults", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("FetchResults", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetDelegationToken struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetDelegationTokenArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetDelegationToken", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetDelegationTokenResult{}
var retval *TGetDelegationTokenResp
  var err2 error
  if retval, err2 = p.handler.GetDelegationToken(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: " + err2.Error())
    oprot.WriteMessageBegin("GetDelegationToken", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetDelegationToken", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorCancelDelegationToken struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceCancelDelegationTokenArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("CancelDelegationToken", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceCancelDelegationTokenResult{}
var retval *TCancelDelegationTokenResp
  var err2 error
  if retval, err2 = p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: " + err2.Error())
    oprot.WriteMessageBegin("CancelDelegationToken", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("CancelDelegationToken", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorRenewDelegationToken struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceRenewDelegationTokenArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("RenewDelegationToken", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceRenewDelegationTokenResult{}
var retval *TRenewDelegationTokenResp
  var err2 error
  if retval, err2 = p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: " + err2.Error())
    oprot.WriteMessageBegin("RenewDelegationToken", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("RenewDelegationToken", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type tCLIServiceProcessorGetLog struct {
  handler TCLIService
}

func (p *tCLIServiceProcessorGetLog) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := TCLIServiceGetLogArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("GetLog", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := TCLIServiceGetLogResult{}
var retval *TGetLogResp
  var err2 error
  if retval, err2 = p.handler.GetLog(ctx, args.Req); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetLog: " + err2.Error())
    oprot.WriteMessageBegin("GetLog", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("GetLog", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}


// HELPER FUNCTIONS AND STRUCTURES

// Attributes:
//  - Req
type TCLIServiceOpenSessionArgs struct {
  Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceOpenSessionArgs() *TCLIServiceOpenSessionArgs {
  return &TCLIServiceOpenSessionArgs{}
}

var TCLIServiceOpenSessionArgs_Req_DEFAULT *TOpenSessionReq
func (p *TCLIServiceOpenSessionArgs) GetReq() *TOpenSessionReq {
  if !p.IsSetReq() {
    return TCLIServiceOpenSessionArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceOpenSessionArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceOpenSessionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceOpenSessionArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TOpenSessionReq{
  ClientProtocol:   5,
}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceOpenSessionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("OpenSession_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceOpenSessionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceOpenSessionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceOpenSessionResult struct {
  Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceOpenSessionResult() *TCLIServiceOpenSessionResult {
  return &TCLIServiceOpenSessionResult{}
}

var TCLIServiceOpenSessionResult_Success_DEFAULT *TOpenSessionResp
func (p *TCLIServiceOpenSessionResult) GetSuccess() *TOpenSessionResp {
  if !p.IsSetSuccess() {
    return TCLIServiceOpenSessionResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceOpenSessionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceOpenSessionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceOpenSessionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TOpenSessionResp{
  ServerProtocolVersion:   5,
}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceOpenSessionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("OpenSession_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceOpenSessionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceOpenSessionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceCloseSessionArgs struct {
  Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceCloseSessionArgs() *TCLIServiceCloseSessionArgs {
  return &TCLIServiceCloseSessionArgs{}
}

var TCLIServiceCloseSessionArgs_Req_DEFAULT *TCloseSessionReq
func (p *TCLIServiceCloseSessionArgs) GetReq() *TCloseSessionReq {
  if !p.IsSetReq() {
    return TCLIServiceCloseSessionArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceCloseSessionArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceCloseSessionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCloseSessionArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TCloseSessionReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceCloseSessionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CloseSession_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCloseSessionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceCloseSessionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceCloseSessionResult struct {
  Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceCloseSessionResult() *TCLIServiceCloseSessionResult {
  return &TCLIServiceCloseSessionResult{}
}

var TCLIServiceCloseSessionResult_Success_DEFAULT *TCloseSessionResp
func (p *TCLIServiceCloseSessionResult) GetSuccess() *TCloseSessionResp {
  if !p.IsSetSuccess() {
    return TCLIServiceCloseSessionResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceCloseSessionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceCloseSessionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCloseSessionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TCloseSessionResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceCloseSessionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CloseSession_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCloseSessionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceCloseSessionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetInfoArgs struct {
  Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetInfoArgs() *TCLIServiceGetInfoArgs {
  return &TCLIServiceGetInfoArgs{}
}

var TCLIServiceGetInfoArgs_Req_DEFAULT *TGetInfoReq
func (p *TCLIServiceGetInfoArgs) GetReq() *TGetInfoReq {
  if !p.IsSetReq() {
    return TCLIServiceGetInfoArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetInfoArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetInfoArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetInfoArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetInfoReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetInfoArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetInfo_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetInfoArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetInfoArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetInfoResult struct {
  Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetInfoResult() *TCLIServiceGetInfoResult {
  return &TCLIServiceGetInfoResult{}
}

var TCLIServiceGetInfoResult_Success_DEFAULT *TGetInfoResp
func (p *TCLIServiceGetInfoResult) GetSuccess() *TGetInfoResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetInfoResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetInfoResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetInfoResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetInfoResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetInfoResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetInfoResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetInfo_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetInfoResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetInfoResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceExecuteStatementArgs struct {
  Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceExecuteStatementArgs() *TCLIServiceExecuteStatementArgs {
  return &TCLIServiceExecuteStatementArgs{}
}

var TCLIServiceExecuteStatementArgs_Req_DEFAULT *TExecuteStatementReq
func (p *TCLIServiceExecuteStatementArgs) GetReq() *TExecuteStatementReq {
  if !p.IsSetReq() {
    return TCLIServiceExecuteStatementArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceExecuteStatementArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceExecuteStatementArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceExecuteStatementArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TExecuteStatementReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceExecuteStatementArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ExecuteStatement_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceExecuteStatementArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceExecuteStatementArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceExecuteStatementResult struct {
  Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceExecuteStatementResult() *TCLIServiceExecuteStatementResult {
  return &TCLIServiceExecuteStatementResult{}
}

var TCLIServiceExecuteStatementResult_Success_DEFAULT *TExecuteStatementResp
func (p *TCLIServiceExecuteStatementResult) GetSuccess() *TExecuteStatementResp {
  if !p.IsSetSuccess() {
    return TCLIServiceExecuteStatementResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceExecuteStatementResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceExecuteStatementResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceExecuteStatementResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TExecuteStatementResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceExecuteStatementResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ExecuteStatement_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceExecuteStatementResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceExecuteStatementResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetTypeInfoArgs struct {
  Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetTypeInfoArgs() *TCLIServiceGetTypeInfoArgs {
  return &TCLIServiceGetTypeInfoArgs{}
}

var TCLIServiceGetTypeInfoArgs_Req_DEFAULT *TGetTypeInfoReq
func (p *TCLIServiceGetTypeInfoArgs) GetReq() *TGetTypeInfoReq {
  if !p.IsSetReq() {
    return TCLIServiceGetTypeInfoArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetTypeInfoArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetTypeInfoArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetTypeInfoArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetTypeInfoReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetTypeInfoArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetTypeInfo_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetTypeInfoArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetTypeInfoArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetTypeInfoResult struct {
  Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetTypeInfoResult() *TCLIServiceGetTypeInfoResult {
  return &TCLIServiceGetTypeInfoResult{}
}

var TCLIServiceGetTypeInfoResult_Success_DEFAULT *TGetTypeInfoResp
func (p *TCLIServiceGetTypeInfoResult) GetSuccess() *TGetTypeInfoResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetTypeInfoResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetTypeInfoResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetTypeInfoResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetTypeInfoResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetTypeInfoResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetTypeInfoResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetTypeInfo_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetTypeInfoResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetTypeInfoResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetCatalogsArgs struct {
  Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetCatalogsArgs() *TCLIServiceGetCatalogsArgs {
  return &TCLIServiceGetCatalogsArgs{}
}

var TCLIServiceGetCatalogsArgs_Req_DEFAULT *TGetCatalogsReq
func (p *TCLIServiceGetCatalogsArgs) GetReq() *TGetCatalogsReq {
  if !p.IsSetReq() {
    return TCLIServiceGetCatalogsArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetCatalogsArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetCatalogsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetCatalogsArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetCatalogsReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetCatalogsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetCatalogs_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetCatalogsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetCatalogsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetCatalogsResult struct {
  Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetCatalogsResult() *TCLIServiceGetCatalogsResult {
  return &TCLIServiceGetCatalogsResult{}
}

var TCLIServiceGetCatalogsResult_Success_DEFAULT *TGetCatalogsResp
func (p *TCLIServiceGetCatalogsResult) GetSuccess() *TGetCatalogsResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetCatalogsResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetCatalogsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetCatalogsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetCatalogsResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetCatalogsResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetCatalogsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetCatalogs_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetCatalogsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetCatalogsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetSchemasArgs struct {
  Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetSchemasArgs() *TCLIServiceGetSchemasArgs {
  return &TCLIServiceGetSchemasArgs{}
}

var TCLIServiceGetSchemasArgs_Req_DEFAULT *TGetSchemasReq
func (p *TCLIServiceGetSchemasArgs) GetReq() *TGetSchemasReq {
  if !p.IsSetReq() {
    return TCLIServiceGetSchemasArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetSchemasArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetSchemasArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetSchemasArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetSchemasReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetSchemasArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetSchemas_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetSchemasArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetSchemasArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetSchemasResult struct {
  Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetSchemasResult() *TCLIServiceGetSchemasResult {
  return &TCLIServiceGetSchemasResult{}
}

var TCLIServiceGetSchemasResult_Success_DEFAULT *TGetSchemasResp
func (p *TCLIServiceGetSchemasResult) GetSuccess() *TGetSchemasResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetSchemasResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetSchemasResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetSchemasResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetSchemasResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetSchemasResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetSchemasResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetSchemas_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetSchemasResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetSchemasResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetTablesArgs struct {
  Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetTablesArgs() *TCLIServiceGetTablesArgs {
  return &TCLIServiceGetTablesArgs{}
}

var TCLIServiceGetTablesArgs_Req_DEFAULT *TGetTablesReq
func (p *TCLIServiceGetTablesArgs) GetReq() *TGetTablesReq {
  if !p.IsSetReq() {
    return TCLIServiceGetTablesArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetTablesArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetTablesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetTablesArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetTablesReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetTablesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetTables_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetTablesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetTablesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetTablesResult struct {
  Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetTablesResult() *TCLIServiceGetTablesResult {
  return &TCLIServiceGetTablesResult{}
}

var TCLIServiceGetTablesResult_Success_DEFAULT *TGetTablesResp
func (p *TCLIServiceGetTablesResult) GetSuccess() *TGetTablesResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetTablesResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetTablesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetTablesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetTablesResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetTablesResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetTablesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetTables_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetTablesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetTablesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetTableTypesArgs struct {
  Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetTableTypesArgs() *TCLIServiceGetTableTypesArgs {
  return &TCLIServiceGetTableTypesArgs{}
}

var TCLIServiceGetTableTypesArgs_Req_DEFAULT *TGetTableTypesReq
func (p *TCLIServiceGetTableTypesArgs) GetReq() *TGetTableTypesReq {
  if !p.IsSetReq() {
    return TCLIServiceGetTableTypesArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetTableTypesArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetTableTypesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetTableTypesArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetTableTypesReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetTableTypesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetTableTypes_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetTableTypesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetTableTypesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetTableTypesResult struct {
  Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetTableTypesResult() *TCLIServiceGetTableTypesResult {
  return &TCLIServiceGetTableTypesResult{}
}

var TCLIServiceGetTableTypesResult_Success_DEFAULT *TGetTableTypesResp
func (p *TCLIServiceGetTableTypesResult) GetSuccess() *TGetTableTypesResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetTableTypesResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetTableTypesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetTableTypesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetTableTypesResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetTableTypesResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetTableTypesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetTableTypes_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetTableTypesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetTableTypesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetColumnsArgs struct {
  Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetColumnsArgs() *TCLIServiceGetColumnsArgs {
  return &TCLIServiceGetColumnsArgs{}
}

var TCLIServiceGetColumnsArgs_Req_DEFAULT *TGetColumnsReq
func (p *TCLIServiceGetColumnsArgs) GetReq() *TGetColumnsReq {
  if !p.IsSetReq() {
    return TCLIServiceGetColumnsArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetColumnsArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetColumnsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetColumnsArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetColumnsReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetColumnsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetColumns_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetColumnsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetColumnsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetColumnsResult struct {
  Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetColumnsResult() *TCLIServiceGetColumnsResult {
  return &TCLIServiceGetColumnsResult{}
}

var TCLIServiceGetColumnsResult_Success_DEFAULT *TGetColumnsResp
func (p *TCLIServiceGetColumnsResult) GetSuccess() *TGetColumnsResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetColumnsResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetColumnsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetColumnsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetColumnsResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetColumnsResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetColumnsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetColumns_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetColumnsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetColumnsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetFunctionsArgs struct {
  Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetFunctionsArgs() *TCLIServiceGetFunctionsArgs {
  return &TCLIServiceGetFunctionsArgs{}
}

var TCLIServiceGetFunctionsArgs_Req_DEFAULT *TGetFunctionsReq
func (p *TCLIServiceGetFunctionsArgs) GetReq() *TGetFunctionsReq {
  if !p.IsSetReq() {
    return TCLIServiceGetFunctionsArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetFunctionsArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetFunctionsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetFunctionsArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetFunctionsReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetFunctionsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetFunctions_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetFunctionsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetFunctionsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetFunctionsResult struct {
  Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetFunctionsResult() *TCLIServiceGetFunctionsResult {
  return &TCLIServiceGetFunctionsResult{}
}

var TCLIServiceGetFunctionsResult_Success_DEFAULT *TGetFunctionsResp
func (p *TCLIServiceGetFunctionsResult) GetSuccess() *TGetFunctionsResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetFunctionsResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetFunctionsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetFunctionsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetFunctionsResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetFunctionsResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetFunctionsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetFunctions_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetFunctionsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetFunctionsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetOperationStatusArgs struct {
  Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetOperationStatusArgs() *TCLIServiceGetOperationStatusArgs {
  return &TCLIServiceGetOperationStatusArgs{}
}

var TCLIServiceGetOperationStatusArgs_Req_DEFAULT *TGetOperationStatusReq
func (p *TCLIServiceGetOperationStatusArgs) GetReq() *TGetOperationStatusReq {
  if !p.IsSetReq() {
    return TCLIServiceGetOperationStatusArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetOperationStatusArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetOperationStatusArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetOperationStatusArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetOperationStatusReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetOperationStatusArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetOperationStatus_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetOperationStatusArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetOperationStatusArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetOperationStatusResult struct {
  Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetOperationStatusResult() *TCLIServiceGetOperationStatusResult {
  return &TCLIServiceGetOperationStatusResult{}
}

var TCLIServiceGetOperationStatusResult_Success_DEFAULT *TGetOperationStatusResp
func (p *TCLIServiceGetOperationStatusResult) GetSuccess() *TGetOperationStatusResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetOperationStatusResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetOperationStatusResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetOperationStatusResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetOperationStatusResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetOperationStatusResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetOperationStatusResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetOperationStatus_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetOperationStatusResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetOperationStatusResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceCancelOperationArgs struct {
  Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceCancelOperationArgs() *TCLIServiceCancelOperationArgs {
  return &TCLIServiceCancelOperationArgs{}
}

var TCLIServiceCancelOperationArgs_Req_DEFAULT *TCancelOperationReq
func (p *TCLIServiceCancelOperationArgs) GetReq() *TCancelOperationReq {
  if !p.IsSetReq() {
    return TCLIServiceCancelOperationArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceCancelOperationArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceCancelOperationArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCancelOperationArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TCancelOperationReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceCancelOperationArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CancelOperation_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCancelOperationArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceCancelOperationArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceCancelOperationResult struct {
  Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceCancelOperationResult() *TCLIServiceCancelOperationResult {
  return &TCLIServiceCancelOperationResult{}
}

var TCLIServiceCancelOperationResult_Success_DEFAULT *TCancelOperationResp
func (p *TCLIServiceCancelOperationResult) GetSuccess() *TCancelOperationResp {
  if !p.IsSetSuccess() {
    return TCLIServiceCancelOperationResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceCancelOperationResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceCancelOperationResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCancelOperationResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TCancelOperationResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceCancelOperationResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CancelOperation_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCancelOperationResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceCancelOperationResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceCloseOperationArgs struct {
  Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceCloseOperationArgs() *TCLIServiceCloseOperationArgs {
  return &TCLIServiceCloseOperationArgs{}
}

var TCLIServiceCloseOperationArgs_Req_DEFAULT *TCloseOperationReq
func (p *TCLIServiceCloseOperationArgs) GetReq() *TCloseOperationReq {
  if !p.IsSetReq() {
    return TCLIServiceCloseOperationArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceCloseOperationArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceCloseOperationArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCloseOperationArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TCloseOperationReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceCloseOperationArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CloseOperation_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCloseOperationArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceCloseOperationArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceCloseOperationResult struct {
  Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceCloseOperationResult() *TCLIServiceCloseOperationResult {
  return &TCLIServiceCloseOperationResult{}
}

var TCLIServiceCloseOperationResult_Success_DEFAULT *TCloseOperationResp
func (p *TCLIServiceCloseOperationResult) GetSuccess() *TCloseOperationResp {
  if !p.IsSetSuccess() {
    return TCLIServiceCloseOperationResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceCloseOperationResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceCloseOperationResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCloseOperationResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TCloseOperationResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceCloseOperationResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CloseOperation_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCloseOperationResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceCloseOperationResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetResultSetMetadataArgs struct {
  Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetResultSetMetadataArgs() *TCLIServiceGetResultSetMetadataArgs {
  return &TCLIServiceGetResultSetMetadataArgs{}
}

var TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT *TGetResultSetMetadataReq
func (p *TCLIServiceGetResultSetMetadataArgs) GetReq() *TGetResultSetMetadataReq {
  if !p.IsSetReq() {
    return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetResultSetMetadataArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetResultSetMetadataArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetResultSetMetadataArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetResultSetMetadataReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetResultSetMetadataArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetResultSetMetadata_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetResultSetMetadataArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetResultSetMetadataArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetResultSetMetadataResult struct {
  Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetResultSetMetadataResult() *TCLIServiceGetResultSetMetadataResult {
  return &TCLIServiceGetResultSetMetadataResult{}
}

var TCLIServiceGetResultSetMetadataResult_Success_DEFAULT *TGetResultSetMetadataResp
func (p *TCLIServiceGetResultSetMetadataResult) GetSuccess() *TGetResultSetMetadataResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetResultSetMetadataResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetResultSetMetadataResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetResultSetMetadataResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetResultSetMetadataResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetResultSetMetadataResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetResultSetMetadata_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetResultSetMetadataResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetResultSetMetadataResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceFetchResultsArgs struct {
  Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceFetchResultsArgs() *TCLIServiceFetchResultsArgs {
  return &TCLIServiceFetchResultsArgs{}
}

var TCLIServiceFetchResultsArgs_Req_DEFAULT *TFetchResultsReq
func (p *TCLIServiceFetchResultsArgs) GetReq() *TFetchResultsReq {
  if !p.IsSetReq() {
    return TCLIServiceFetchResultsArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceFetchResultsArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceFetchResultsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceFetchResultsArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TFetchResultsReq{
  Orientation:   0,
}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceFetchResultsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("FetchResults_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceFetchResultsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceFetchResultsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceFetchResultsResult struct {
  Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceFetchResultsResult() *TCLIServiceFetchResultsResult {
  return &TCLIServiceFetchResultsResult{}
}

var TCLIServiceFetchResultsResult_Success_DEFAULT *TFetchResultsResp
func (p *TCLIServiceFetchResultsResult) GetSuccess() *TFetchResultsResp {
  if !p.IsSetSuccess() {
    return TCLIServiceFetchResultsResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceFetchResultsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceFetchResultsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceFetchResultsResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TFetchResultsResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceFetchResultsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("FetchResults_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceFetchResultsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceFetchResultsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetDelegationTokenArgs struct {
  Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetDelegationTokenArgs() *TCLIServiceGetDelegationTokenArgs {
  return &TCLIServiceGetDelegationTokenArgs{}
}

var TCLIServiceGetDelegationTokenArgs_Req_DEFAULT *TGetDelegationTokenReq
func (p *TCLIServiceGetDelegationTokenArgs) GetReq() *TGetDelegationTokenReq {
  if !p.IsSetReq() {
    return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetDelegationTokenArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetDelegationTokenArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetDelegationTokenArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetDelegationTokenReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetDelegationTokenArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetDelegationToken_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetDelegationTokenArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetDelegationTokenResult struct {
  Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetDelegationTokenResult() *TCLIServiceGetDelegationTokenResult {
  return &TCLIServiceGetDelegationTokenResult{}
}

var TCLIServiceGetDelegationTokenResult_Success_DEFAULT *TGetDelegationTokenResp
func (p *TCLIServiceGetDelegationTokenResult) GetSuccess() *TGetDelegationTokenResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetDelegationTokenResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetDelegationTokenResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetDelegationTokenResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetDelegationTokenResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetDelegationTokenResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetDelegationTokenResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetDelegationToken_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetDelegationTokenResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceCancelDelegationTokenArgs struct {
  Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceCancelDelegationTokenArgs() *TCLIServiceCancelDelegationTokenArgs {
  return &TCLIServiceCancelDelegationTokenArgs{}
}

var TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT *TCancelDelegationTokenReq
func (p *TCLIServiceCancelDelegationTokenArgs) GetReq() *TCancelDelegationTokenReq {
  if !p.IsSetReq() {
    return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceCancelDelegationTokenArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceCancelDelegationTokenArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCancelDelegationTokenArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TCancelDelegationTokenReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceCancelDelegationTokenArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CancelDelegationToken_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCancelDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceCancelDelegationTokenArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceCancelDelegationTokenResult struct {
  Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceCancelDelegationTokenResult() *TCLIServiceCancelDelegationTokenResult {
  return &TCLIServiceCancelDelegationTokenResult{}
}

var TCLIServiceCancelDelegationTokenResult_Success_DEFAULT *TCancelDelegationTokenResp
func (p *TCLIServiceCancelDelegationTokenResult) GetSuccess() *TCancelDelegationTokenResp {
  if !p.IsSetSuccess() {
    return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceCancelDelegationTokenResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceCancelDelegationTokenResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceCancelDelegationTokenResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TCancelDelegationTokenResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceCancelDelegationTokenResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("CancelDelegationToken_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceCancelDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceCancelDelegationTokenResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceRenewDelegationTokenArgs struct {
  Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceRenewDelegationTokenArgs() *TCLIServiceRenewDelegationTokenArgs {
  return &TCLIServiceRenewDelegationTokenArgs{}
}

var TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT *TRenewDelegationTokenReq
func (p *TCLIServiceRenewDelegationTokenArgs) GetReq() *TRenewDelegationTokenReq {
  if !p.IsSetReq() {
    return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceRenewDelegationTokenArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceRenewDelegationTokenArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceRenewDelegationTokenArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TRenewDelegationTokenReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceRenewDelegationTokenArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("RenewDelegationToken_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceRenewDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceRenewDelegationTokenArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceRenewDelegationTokenResult struct {
  Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceRenewDelegationTokenResult() *TCLIServiceRenewDelegationTokenResult {
  return &TCLIServiceRenewDelegationTokenResult{}
}

var TCLIServiceRenewDelegationTokenResult_Success_DEFAULT *TRenewDelegationTokenResp
func (p *TCLIServiceRenewDelegationTokenResult) GetSuccess() *TRenewDelegationTokenResp {
  if !p.IsSetSuccess() {
    return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceRenewDelegationTokenResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceRenewDelegationTokenResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceRenewDelegationTokenResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TRenewDelegationTokenResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceRenewDelegationTokenResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("RenewDelegationToken_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceRenewDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceRenewDelegationTokenResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p)
}

// Attributes:
//  - Req
type TCLIServiceGetLogArgs struct {
  Req *TGetLogReq `thrift:"req,1" db:"req" json:"req"`
}

func NewTCLIServiceGetLogArgs() *TCLIServiceGetLogArgs {
  return &TCLIServiceGetLogArgs{}
}

var TCLIServiceGetLogArgs_Req_DEFAULT *TGetLogReq
func (p *TCLIServiceGetLogArgs) GetReq() *TGetLogReq {
  if !p.IsSetReq() {
    return TCLIServiceGetLogArgs_Req_DEFAULT
  }
return p.Req
}
func (p *TCLIServiceGetLogArgs) IsSetReq() bool {
  return p.Req != nil
}

func (p *TCLIServiceGetLogArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetLogArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Req = &TGetLogReq{}
  if err := p.Req.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err)
  }
  return nil
}

func (p *TCLIServiceGetLogArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetLog_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetLogArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) }
  if err := p.Req.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) }
  return err
}

func (p *TCLIServiceGetLogArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetLogArgs(%+v)", *p)
}

// Attributes:
//  - Success
type TCLIServiceGetLogResult struct {
  Success *TGetLogResp `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewTCLIServiceGetLogResult() *TCLIServiceGetLogResult {
  return &TCLIServiceGetLogResult{}
}

var TCLIServiceGetLogResult_Success_DEFAULT *TGetLogResp
func (p *TCLIServiceGetLogResult) GetSuccess() *TGetLogResp {
  if !p.IsSetSuccess() {
    return TCLIServiceGetLogResult_Success_DEFAULT
  }
return p.Success
}
func (p *TCLIServiceGetLogResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *TCLIServiceGetLogResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *TCLIServiceGetLogResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &TGetLogResp{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *TCLIServiceGetLogResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("GetLog_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *TCLIServiceGetLogResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *TCLIServiceGetLogResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("TCLIServiceGetLogResult(%+v)", *p)
}


