diff --git a/go.mod b/go.mod index d1c6c88..4d28bea 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,9 @@ module github.com/beltran/gohive go 1.14 require ( - github.com/apache/thrift v0.14.0 + github.com/apache/thrift v0.12.0 github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 + github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab // indirect github.com/go-zookeeper/zk v1.0.1 github.com/pkg/errors v0.9.1 ) diff --git a/go.sum b/go.sum index 6f19fca..10d0231 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,17 @@ -github.com/apache/thrift v0.14.0 h1:vqZ2DP42i8th2OsgCcYZkirtbzvpZEFx53LiWDJXIAs= -github.com/apache/thrift v0.14.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beltran/gosasl v0.0.0-20181023043315-01c4c2ce6a51 h1:4GvVCQFfMBsrCaTYR7E506OkKBZ/1AI+rc+oIgl2rm4= +github.com/beltran/gosasl v0.0.0-20181023043315-01c4c2ce6a51/go.mod h1:4bpdWW6Q7hC2xAn+KT/ueCo1FoklhOMmEeHLhZso7po= +github.com/beltran/gosasl v0.0.0-20200324154900-112336fc0fc0 h1:7RimtNV6sZKfAfwWGB4qmqw3YhkR2w1c7pgn6TdqmAM= +github.com/beltran/gosasl v0.0.0-20200324154900-112336fc0fc0/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= +github.com/beltran/gosasl v0.0.0-20200326175049-9dfbcb61a4b3 h1:q832ARlau2fGuPSJe3Cuahdf4iS4LdQOYWPINojTSLc= +github.com/beltran/gosasl v0.0.0-20200326175049-9dfbcb61a4b3/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= +github.com/beltran/gosasl v0.0.0-20200513032552-d3700baa7593 h1:+CofSOeu+dXtANvH0VGR0K2dswnEUR6BOcGb3uXxOvk= +github.com/beltran/gosasl v0.0.0-20200513032552-d3700baa7593/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= +github.com/beltran/gosasl v0.0.0-20200713231802-2742ac7deace h1:5o/MYI4CyKBcJytl3KqY8hhyXMRY+eNXObQ1aUz6e/M= +github.com/beltran/gosasl v0.0.0-20200713231802-2742ac7deace/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= +github.com/beltran/gosasl v0.0.0-20200714231811-33ad42746c69 h1:ocijwEPgolsEfR8/+LNKKLYuj+fZKFpnZJ3TjdHNCBI= +github.com/beltran/gosasl v0.0.0-20200714231811-33ad42746c69/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 h1:1wRvU44e78w7zJoynLqrXLKSI+VEFEaWmzyq5JdUx7I= github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab h1:ayfcn60tXOSYy5zUN1AMSTQo4nJCf7hrdzAVchpPst4= diff --git a/hiveserver/GoUnusedProtection__.go b/hiveserver/GoUnusedProtection__.go index 3853c5d..926a433 100644 --- a/hiveserver/GoUnusedProtection__.go +++ b/hiveserver/GoUnusedProtection__.go @@ -1,6 +1,6 @@ -// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. +// Autogenerated by Thrift Compiler (1.0.0-dev) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING package hiveserver -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/hiveserver/HiveServer-consts.go b/hiveserver/HiveServer-consts.go index 1a14349..7498705 100644 --- a/hiveserver/HiveServer-consts.go +++ b/hiveserver/HiveServer-consts.go @@ -1,12 +1,14 @@ -// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. +// Autogenerated by Thrift Compiler (1.0.0-dev) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING package hiveserver -import( +import ( "bytes" "context" "fmt" - "time" + "reflect" + "github.com/apache/thrift/lib/go/thrift" ) @@ -14,51 +16,51 @@ import( var _ = thrift.ZERO var _ = fmt.Printf var _ = context.Background -var _ = time.Now +var _ = reflect.DeepEqual var _ = bytes.Equal var PRIMITIVE_TYPES []TTypeId var COMPLEX_TYPES []TTypeId var COLLECTION_TYPES []TTypeId var TYPE_NAMES map[TTypeId]string + const CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" const PRECISION = "precision" const SCALE = "scale" func init() { -PRIMITIVE_TYPES = []TTypeId{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22, } + PRIMITIVE_TYPES = []TTypeId{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22} -COMPLEX_TYPES = []TTypeId{ - 10, 11, 12, 13, 14, } + COMPLEX_TYPES = []TTypeId{ + 10, 11, 12, 13, 14} -COLLECTION_TYPES = []TTypeId{ - 10, 11, } + COLLECTION_TYPES = []TTypeId{ + 10, 11} -TYPE_NAMES = map[TTypeId]string{ - 10: "ARRAY", - 4: "BIGINT", - 9: "BINARY", - 0: "BOOLEAN", - 19: "CHAR", - 17: "DATE", - 15: "DECIMAL", - 6: "DOUBLE", - 5: "FLOAT", - 21: "INTERVAL_DAY_TIME", - 20: "INTERVAL_YEAR_MONTH", - 3: "INT", - 11: "MAP", - 16: "NULL", - 2: "SMALLINT", - 7: "STRING", - 12: "STRUCT", - 22: "TIMESTAMP WITH LOCAL TIME ZONE", - 8: "TIMESTAMP", - 1: "TINYINT", - 13: "UNIONTYPE", - 18: "VARCHAR", -} + TYPE_NAMES = map[TTypeId]string{ + 10: "ARRAY", + 4: "BIGINT", + 9: "BINARY", + 0: "BOOLEAN", + 19: "CHAR", + 17: "DATE", + 15: "DECIMAL", + 6: "DOUBLE", + 5: "FLOAT", + 21: "INTERVAL_DAY_TIME", + 20: "INTERVAL_YEAR_MONTH", + 3: "INT", + 11: "MAP", + 16: "NULL", + 2: "SMALLINT", + 7: "STRING", + 12: "STRUCT", + 22: "TIMESTAMP WITH LOCAL TIME ZONE", + 8: "TIMESTAMP", + 1: "TINYINT", + 13: "UNIONTYPE", + 18: "VARCHAR", + } } - diff --git a/hiveserver/HiveServer.go b/hiveserver/HiveServer.go index 2f722d3..b69602c 100644 --- a/hiveserver/HiveServer.go +++ b/hiveserver/HiveServer.go @@ -1,14 +1,16 @@ -// Code generated by Thrift Compiler (0.14.0). DO NOT EDIT. +// Autogenerated by Thrift Compiler (1.0.0-dev) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING package hiveserver -import( +import ( "bytes" "context" "database/sql/driver" "errors" "fmt" - "time" + "reflect" + "github.com/apache/thrift/lib/go/thrift" ) @@ -16,727 +18,963 @@ import( var _ = thrift.ZERO var _ = fmt.Printf var _ = context.Background -var _ = time.Now +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 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11 TProtocolVersion = 10 + 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 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11 TProtocolVersion = 10 ) 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" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: return "HIVE_CLI_SERVICE_PROTOCOL_V8" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: return "HIVE_CLI_SERVICE_PROTOCOL_V9" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: return "HIVE_CLI_SERVICE_PROTOCOL_V10" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11: return "HIVE_CLI_SERVICE_PROTOCOL_V11" - } - return "" + 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" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: + return "HIVE_CLI_SERVICE_PROTOCOL_V8" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: + return "HIVE_CLI_SERVICE_PROTOCOL_V9" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: + return "HIVE_CLI_SERVICE_PROTOCOL_V10" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11: + return "HIVE_CLI_SERVICE_PROTOCOL_V11" + } + return "" } 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 - case "HIVE_CLI_SERVICE_PROTOCOL_V8": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V9": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V10": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V11": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11, nil - } - return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string") + 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 + case "HIVE_CLI_SERVICE_PROTOCOL_V8": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V9": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V10": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V11": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11, 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 + 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 + 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 + 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 +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 - TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 - TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 - TTypeId_TIMESTAMPLOCALTZ_TYPE TTypeId = 22 + 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 + TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 + TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 + TTypeId_TIMESTAMPLOCALTZ_TYPE TTypeId = 22 ) 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" - case TTypeId_INTERVAL_YEAR_MONTH_TYPE: return "INTERVAL_YEAR_MONTH_TYPE" - case TTypeId_INTERVAL_DAY_TIME_TYPE: return "INTERVAL_DAY_TIME_TYPE" - case TTypeId_TIMESTAMPLOCALTZ_TYPE: return "TIMESTAMPLOCALTZ_TYPE" - } - return "" + 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" + case TTypeId_INTERVAL_YEAR_MONTH_TYPE: + return "INTERVAL_YEAR_MONTH_TYPE" + case TTypeId_INTERVAL_DAY_TIME_TYPE: + return "INTERVAL_DAY_TIME_TYPE" + case TTypeId_TIMESTAMPLOCALTZ_TYPE: + return "TIMESTAMPLOCALTZ_TYPE" + } + return "" } 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 - case "INTERVAL_YEAR_MONTH_TYPE": return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil - case "INTERVAL_DAY_TIME_TYPE": return TTypeId_INTERVAL_DAY_TIME_TYPE, nil - case "TIMESTAMPLOCALTZ_TYPE": return TTypeId_TIMESTAMPLOCALTZ_TYPE, nil - } - return TTypeId(0), fmt.Errorf("not a valid TTypeId string") + 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 + case "INTERVAL_YEAR_MONTH_TYPE": + return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil + case "INTERVAL_DAY_TIME_TYPE": + return TTypeId_INTERVAL_DAY_TIME_TYPE, nil + case "TIMESTAMPLOCALTZ_TYPE": + return TTypeId_TIMESTAMPLOCALTZ_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 + 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 + 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 + 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 +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 + 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 "" + 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 "" } 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") + 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 + 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 + 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 + 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 +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 - TOperationState_TIMEDOUT_STATE TOperationState = 8 + 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 + TOperationState_TIMEDOUT_STATE TOperationState = 8 ) 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" - case TOperationState_TIMEDOUT_STATE: return "TIMEDOUT_STATE" - } - return "" + 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" + case TOperationState_TIMEDOUT_STATE: + return "TIMEDOUT_STATE" + } + return "" } 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 - case "TIMEDOUT_STATE": return TOperationState_TIMEDOUT_STATE, nil - } - return TOperationState(0), fmt.Errorf("not a valid TOperationState string") + 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 + case "TIMEDOUT_STATE": + return TOperationState_TIMEDOUT_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 + 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 + 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 + 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 +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 + 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 "" + 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 "" } 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") + 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 + 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 + 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 + 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 +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 - TGetInfoType_CLI_ODBC_KEYWORDS TGetInfoType = 10006 + 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 + TGetInfoType_CLI_ODBC_KEYWORDS TGetInfoType = 10006 ) 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" - case TGetInfoType_CLI_ODBC_KEYWORDS: return "CLI_ODBC_KEYWORDS" - } - return "" + 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" + case TGetInfoType_CLI_ODBC_KEYWORDS: + return "CLI_ODBC_KEYWORDS" + } + return "" } 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 - case "CLI_ODBC_KEYWORDS": return TGetInfoType_CLI_ODBC_KEYWORDS, nil - } - return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string") + 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 + case "CLI_ODBC_KEYWORDS": + return TGetInfoType_CLI_ODBC_KEYWORDS, 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 + 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 + 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 + 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 +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 + 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 "" + 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 "" } 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") + 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 + 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 + 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 + 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 +func (p *TFetchOrientation) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TJobExecutionStatus int64 + const ( - TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 - TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 - TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 + TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 + TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 + TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 ) func (p TJobExecutionStatus) String() string { - switch p { - case TJobExecutionStatus_IN_PROGRESS: return "IN_PROGRESS" - case TJobExecutionStatus_COMPLETE: return "COMPLETE" - case TJobExecutionStatus_NOT_AVAILABLE: return "NOT_AVAILABLE" - } - return "" + switch p { + case TJobExecutionStatus_IN_PROGRESS: + return "IN_PROGRESS" + case TJobExecutionStatus_COMPLETE: + return "COMPLETE" + case TJobExecutionStatus_NOT_AVAILABLE: + return "NOT_AVAILABLE" + } + return "" } func TJobExecutionStatusFromString(s string) (TJobExecutionStatus, error) { - switch s { - case "IN_PROGRESS": return TJobExecutionStatus_IN_PROGRESS, nil - case "COMPLETE": return TJobExecutionStatus_COMPLETE, nil - case "NOT_AVAILABLE": return TJobExecutionStatus_NOT_AVAILABLE, nil - } - return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") + switch s { + case "IN_PROGRESS": + return TJobExecutionStatus_IN_PROGRESS, nil + case "COMPLETE": + return TJobExecutionStatus_COMPLETE, nil + case "NOT_AVAILABLE": + return TJobExecutionStatus_NOT_AVAILABLE, nil + } + return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") } - func TJobExecutionStatusPtr(v TJobExecutionStatus) *TJobExecutionStatus { return &v } func (p TJobExecutionStatus) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TJobExecutionStatus) UnmarshalText(text []byte) error { -q, err := TJobExecutionStatusFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TJobExecutionStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TJobExecutionStatus) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TJobExecutionStatus(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TJobExecutionStatus(v) + return nil } -func (p * TJobExecutionStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TJobExecutionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TTypeEntryPtr int32 func TTypeEntryPtrPtr(v TTypeEntryPtr) *TTypeEntryPtr { return &v } @@ -757,1115 +995,1103 @@ func TPatternOrIdentifierPtr(v TPatternOrIdentifier) *TPatternOrIdentifier { ret // - 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"` + 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{} + return &TTypeQualifierValue{} } var TTypeQualifierValue_I32Value_DEFAULT int32 + func (p *TTypeQualifierValue) GetI32Value() int32 { - if !p.IsSetI32Value() { - return TTypeQualifierValue_I32Value_DEFAULT - } -return *p.I32Value + 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 + 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 + count := 0 + if p.IsSetI32Value() { + count++ + } + if p.IsSetStringValue() { + count++ + } + return count } func (p *TTypeQualifierValue) IsSetI32Value() bool { - return p.I32Value != nil + return p.I32Value != nil } func (p *TTypeQualifierValue) IsSetStringValue() bool { - return p.StringValue != nil -} - -func (p *TTypeQualifierValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TTypeQualifierValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.I32Value = &v -} - return nil -} - -func (p *TTypeQualifierValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.StringValue = &v -} - return nil -} - -func (p *TTypeQualifierValue) Write(ctx context.Context, 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(ctx, "TTypeQualifierValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TTypeQualifierValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Value() { - if err := oprot.WriteFieldBegin(ctx, "i32Value", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.I32Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) } - } - return err -} - -func (p *TTypeQualifierValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) } - } - return err -} - -func (p *TTypeQualifierValue) Equals(other *TTypeQualifierValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.I32Value != other.I32Value { - if p.I32Value == nil || other.I32Value == nil { - return false - } - if (*p.I32Value) != (*other.I32Value) { return false } - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TTypeQualifierValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeQualifierValue(%+v)", *p) } // Attributes: // - Qualifiers type TTypeQualifiers struct { - Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"` + Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"` } func NewTTypeQualifiers() *TTypeQualifiers { - return &TTypeQualifiers{} + return &TTypeQualifiers{} } - func (p *TTypeQualifiers) GetQualifiers() map[string]*TTypeQualifierValue { - return p.Qualifiers -} -func (p *TTypeQualifiers) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetQualifiers bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetQualifiers = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key0 = v -} - _val1 := &TTypeQualifierValue{} - if err := _val1.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err) - } - p.Qualifiers[_key0] = _val1 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TTypeQualifiers) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTypeQualifiers"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TTypeQualifiers) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "qualifiers", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) } - return err -} - -func (p *TTypeQualifiers) Equals(other *TTypeQualifiers) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Qualifiers) != len(other.Qualifiers) { return false } - for k, _tgt := range p.Qualifiers { - _src2 := other.Qualifiers[k] - if !_tgt.Equals(_src2) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetQualifiers = true + 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 "" - } - return fmt.Sprintf("TTypeQualifiers(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TPrimitiveTypeEntry{} } - func (p *TPrimitiveTypeEntry) GetType() TTypeId { - return p.Type + return p.Type } + var TPrimitiveTypeEntry_TypeQualifiers_DEFAULT *TTypeQualifiers + func (p *TPrimitiveTypeEntry) GetTypeQualifiers() *TTypeQualifiers { - if !p.IsSetTypeQualifiers() { - return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT - } -return p.TypeQualifiers + if !p.IsSetTypeQualifiers() { + return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT + } + return p.TypeQualifiers } func (p *TPrimitiveTypeEntry) IsSetTypeQualifiers() bool { - return p.TypeQualifiers != nil -} - -func (p *TPrimitiveTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetType bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TTypeId(v) - p.Type = temp -} - return nil -} - -func (p *TPrimitiveTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.TypeQualifiers = &TTypeQualifiers{} - if err := p.TypeQualifiers.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err) - } - return nil -} - -func (p *TPrimitiveTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TPrimitiveTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TPrimitiveTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } - return err -} - -func (p *TPrimitiveTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTypeQualifiers() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) } - } - return err -} - -func (p *TPrimitiveTypeEntry) Equals(other *TPrimitiveTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Type != other.Type { return false } - if !p.TypeQualifiers.Equals(other.TypeQualifiers) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetType = true + 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 "" - } - return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p) } // Attributes: // - ObjectTypePtr type TArrayTypeEntry struct { - ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"` + ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"` } func NewTArrayTypeEntry() *TArrayTypeEntry { - return &TArrayTypeEntry{} + return &TArrayTypeEntry{} } - func (p *TArrayTypeEntry) GetObjectTypePtr() TTypeEntryPtr { - return p.ObjectTypePtr -} -func (p *TArrayTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetObjectTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetObjectTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TTypeEntryPtr(v) - p.ObjectTypePtr = temp -} - return nil -} - -func (p *TArrayTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TArrayTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TArrayTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "objectTypePtr", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ObjectTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) } - return err -} - -func (p *TArrayTypeEntry) Equals(other *TArrayTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ObjectTypePtr != other.ObjectTypePtr { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetObjectTypePtr = true + 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 "" - } - return fmt.Sprintf("TArrayTypeEntry(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TMapTypeEntry{} } - func (p *TMapTypeEntry) GetKeyTypePtr() TTypeEntryPtr { - return p.KeyTypePtr + return p.KeyTypePtr } func (p *TMapTypeEntry) GetValueTypePtr() TTypeEntryPtr { - return p.ValueTypePtr -} -func (p *TMapTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetKeyTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetValueTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TTypeEntryPtr(v) - p.KeyTypePtr = temp -} - return nil -} - -func (p *TMapTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TTypeEntryPtr(v) - p.ValueTypePtr = temp -} - return nil -} - -func (p *TMapTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TMapTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TMapTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "keyTypePtr", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.KeyTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) } - return err -} - -func (p *TMapTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "valueTypePtr", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ValueTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) } - return err -} - -func (p *TMapTypeEntry) Equals(other *TMapTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.KeyTypePtr != other.KeyTypePtr { return false } - if p.ValueTypePtr != other.ValueTypePtr { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetKeyTypePtr = true + 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 + } + } + issetValueTypePtr = true + 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 "" - } - return fmt.Sprintf("TMapTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TMapTypeEntry(%+v)", *p) } // Attributes: // - NameToTypePtr type TStructTypeEntry struct { - NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` + NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` } func NewTStructTypeEntry() *TStructTypeEntry { - return &TStructTypeEntry{} + return &TStructTypeEntry{} } - func (p *TStructTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { - return p.NameToTypePtr -} -func (p *TStructTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetNameToTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetNameToTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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 _key3 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key3 = v -} -var _val4 TTypeEntryPtr - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := TTypeEntryPtr(v) - _val4 = temp -} - p.NameToTypePtr[_key3] = _val4 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TStructTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStructTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TStructTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } - return err -} - -func (p *TStructTypeEntry) Equals(other *TStructTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } - for k, _tgt := range p.NameToTypePtr { - _src5 := other.NameToTypePtr[k] - if _tgt != _src5 { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetNameToTypePtr = true + 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 "" - } - return fmt.Sprintf("TStructTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStructTypeEntry(%+v)", *p) } // Attributes: // - NameToTypePtr type TUnionTypeEntry struct { - NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` + NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` } func NewTUnionTypeEntry() *TUnionTypeEntry { - return &TUnionTypeEntry{} + return &TUnionTypeEntry{} } - func (p *TUnionTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { - return p.NameToTypePtr -} -func (p *TUnionTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetNameToTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetNameToTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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 _key6 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key6 = v -} -var _val7 TTypeEntryPtr - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := TTypeEntryPtr(v) - _val7 = temp -} - p.NameToTypePtr[_key6] = _val7 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TUnionTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TUnionTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TUnionTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } - return err -} - -func (p *TUnionTypeEntry) Equals(other *TUnionTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } - for k, _tgt := range p.NameToTypePtr { - _src8 := other.NameToTypePtr[k] - if _tgt != _src8 { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetNameToTypePtr = true + 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 "" - } - return fmt.Sprintf("TUnionTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TUnionTypeEntry(%+v)", *p) } // Attributes: // - TypeClassName type TUserDefinedTypeEntry struct { - TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"` + TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"` } func NewTUserDefinedTypeEntry() *TUserDefinedTypeEntry { - return &TUserDefinedTypeEntry{} + return &TUserDefinedTypeEntry{} } - func (p *TUserDefinedTypeEntry) GetTypeClassName() string { - return p.TypeClassName -} -func (p *TUserDefinedTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTypeClassName bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetTypeClassName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.TypeClassName = v -} - return nil -} - -func (p *TUserDefinedTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TUserDefinedTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TUserDefinedTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "typeClassName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.TypeClassName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) } - return err -} - -func (p *TUserDefinedTypeEntry) Equals(other *TUserDefinedTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TypeClassName != other.TypeClassName { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetTypeClassName = true + 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 "" - } - return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p) } // Attributes: @@ -1876,493 +2102,511 @@ func (p *TUserDefinedTypeEntry) String() string { // - 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"` + 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{} + return &TTypeEntry{} } var TTypeEntry_PrimitiveEntry_DEFAULT *TPrimitiveTypeEntry + func (p *TTypeEntry) GetPrimitiveEntry() *TPrimitiveTypeEntry { - if !p.IsSetPrimitiveEntry() { - return TTypeEntry_PrimitiveEntry_DEFAULT - } -return p.PrimitiveEntry + 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 + 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 + 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 + 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 + 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 + 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 + 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 + return p.PrimitiveEntry != nil } func (p *TTypeEntry) IsSetArrayEntry() bool { - return p.ArrayEntry != nil + return p.ArrayEntry != nil } func (p *TTypeEntry) IsSetMapEntry() bool { - return p.MapEntry != nil + return p.MapEntry != nil } func (p *TTypeEntry) IsSetStructEntry() bool { - return p.StructEntry != nil + return p.StructEntry != nil } func (p *TTypeEntry) IsSetUnionEntry() bool { - return p.UnionEntry != nil + return p.UnionEntry != nil } func (p *TTypeEntry) IsSetUserDefinedTypeEntry() bool { - return p.UserDefinedTypeEntry != nil -} - -func (p *TTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.PrimitiveEntry = &TPrimitiveTypeEntry{} - if err := p.PrimitiveEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ArrayEntry = &TArrayTypeEntry{} - if err := p.ArrayEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.MapEntry = &TMapTypeEntry{} - if err := p.MapEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.StructEntry = &TStructTypeEntry{} - if err := p.StructEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.UnionEntry = &TUnionTypeEntry{} - if err := p.UnionEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{} - if err := p.UserDefinedTypeEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err) - } - return nil -} - -func (p *TTypeEntry) Write(ctx context.Context, 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(ctx, "TTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetPrimitiveEntry() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) } - } - return err -} - -func (p *TTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrayEntry() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) } - } - return err -} - -func (p *TTypeEntry) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMapEntry() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) } - } - return err -} - -func (p *TTypeEntry) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStructEntry() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) } - } - return err -} - -func (p *TTypeEntry) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUnionEntry() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) } - } - return err -} - -func (p *TTypeEntry) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUserDefinedTypeEntry() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) } - } - return err -} - -func (p *TTypeEntry) Equals(other *TTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.PrimitiveEntry.Equals(other.PrimitiveEntry) { return false } - if !p.ArrayEntry.Equals(other.ArrayEntry) { return false } - if !p.MapEntry.Equals(other.MapEntry) { return false } - if !p.StructEntry.Equals(other.StructEntry) { return false } - if !p.UnionEntry.Equals(other.UnionEntry) { return false } - if !p.UserDefinedTypeEntry.Equals(other.UserDefinedTypeEntry) { return false } - return true + 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 "" - } - return fmt.Sprintf("TTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeEntry(%+v)", *p) } // Attributes: // - Types type TTypeDesc struct { - Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"` + Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"` } func NewTTypeDesc() *TTypeDesc { - return &TTypeDesc{} + return &TTypeDesc{} } - func (p *TTypeDesc) GetTypes() []*TTypeEntry { - return p.Types -} -func (p *TTypeDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTypes bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetTypes = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 ++ { - _elem9 := &TTypeEntry{} - if err := _elem9.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) - } - p.Types = append(p.Types, _elem9) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TTypeDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTypeDesc"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TTypeDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "types", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Types)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Types { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) } - return err -} - -func (p *TTypeDesc) Equals(other *TTypeDesc) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Types) != len(other.Types) { return false } - for i, _tgt := range p.Types { - _src10 := other.Types[i] - if !_tgt.Equals(_src10) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetTypes = true + 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 "" - } - return fmt.Sprintf("TTypeDesc(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeDesc(%+v)", *p) } // Attributes: @@ -2371,1182 +2615,1150 @@ func (p *TTypeDesc) String() string { // - 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"` + 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{} + return &TColumnDesc{} } - func (p *TColumnDesc) GetColumnName() string { - return p.ColumnName + return p.ColumnName } + var TColumnDesc_TypeDesc_DEFAULT *TTypeDesc + func (p *TColumnDesc) GetTypeDesc() *TTypeDesc { - if !p.IsSetTypeDesc() { - return TColumnDesc_TypeDesc_DEFAULT - } -return p.TypeDesc + if !p.IsSetTypeDesc() { + return TColumnDesc_TypeDesc_DEFAULT + } + return p.TypeDesc } func (p *TColumnDesc) GetPosition() int32 { - return p.Position + return p.Position } + var TColumnDesc_Comment_DEFAULT string + func (p *TColumnDesc) GetComment() string { - if !p.IsSetComment() { - return TColumnDesc_Comment_DEFAULT - } -return *p.Comment + if !p.IsSetComment() { + return TColumnDesc_Comment_DEFAULT + } + return *p.Comment } func (p *TColumnDesc) IsSetTypeDesc() bool { - return p.TypeDesc != nil + return p.TypeDesc != nil } func (p *TColumnDesc) IsSetComment() bool { - return p.Comment != nil -} - -func (p *TColumnDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetColumnName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetTypeDesc = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetPosition = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ColumnName = v -} - return nil -} - -func (p *TColumnDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.TypeDesc = &TTypeDesc{} - if err := p.TypeDesc.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err) - } - return nil -} - -func (p *TColumnDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Position = v -} - return nil -} - -func (p *TColumnDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.Comment = &v -} - return nil -} - -func (p *TColumnDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TColumnDesc"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TColumnDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ColumnName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) } - return err -} - -func (p *TColumnDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) } - return err -} - -func (p *TColumnDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "position", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Position)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) } - return err -} - -func (p *TColumnDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetComment() { - if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Comment)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) } - } - return err -} - -func (p *TColumnDesc) Equals(other *TColumnDesc) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ColumnName != other.ColumnName { return false } - if !p.TypeDesc.Equals(other.TypeDesc) { return false } - if p.Position != other.Position { return false } - if p.Comment != other.Comment { - if p.Comment == nil || other.Comment == nil { - return false - } - if (*p.Comment) != (*other.Comment) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetColumnName = true + 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 + } + } + issetTypeDesc = true + 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 + } + } + issetPosition = true + 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 "" - } - return fmt.Sprintf("TColumnDesc(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumnDesc(%+v)", *p) } // Attributes: // - Columns type TTableSchema struct { - Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"` + Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"` } func NewTTableSchema() *TTableSchema { - return &TTableSchema{} + return &TTableSchema{} } - func (p *TTableSchema) GetColumns() []*TColumnDesc { - return p.Columns -} -func (p *TTableSchema) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColumns bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetColumns = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 ++ { - _elem11 := &TColumnDesc{} - if err := _elem11.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) - } - p.Columns = append(p.Columns, _elem11) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TTableSchema) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTableSchema"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TTableSchema) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Columns { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) } - return err -} - -func (p *TTableSchema) Equals(other *TTableSchema) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Columns) != len(other.Columns) { return false } - for i, _tgt := range p.Columns { - _src12 := other.Columns[i] - if !_tgt.Equals(_src12) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetColumns = true + 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 "" - } - return fmt.Sprintf("TTableSchema(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTableSchema(%+v)", *p) } // Attributes: // - Value type TBoolValue struct { - Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTBoolValue() *TBoolValue { - return &TBoolValue{} + return &TBoolValue{} } var TBoolValue_Value_DEFAULT bool + func (p *TBoolValue) GetValue() bool { - if !p.IsSetValue() { - return TBoolValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TBoolValue_Value_DEFAULT + } + return *p.Value } func (p *TBoolValue) IsSetValue() bool { - return p.Value != nil -} - -func (p *TBoolValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TBoolValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TBoolValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBoolValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TBoolValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TBoolValue) Equals(other *TBoolValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TBoolValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBoolValue(%+v)", *p) } // Attributes: // - Value type TByteValue struct { - Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTByteValue() *TByteValue { - return &TByteValue{} + return &TByteValue{} } var TByteValue_Value_DEFAULT int8 + func (p *TByteValue) GetValue() int8 { - if !p.IsSetValue() { - return TByteValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TByteValue_Value_DEFAULT + } + return *p.Value } func (p *TByteValue) IsSetValue() bool { - return p.Value != nil -} - -func (p *TByteValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TByteValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadByte(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := int8(v) - p.Value = &temp -} - return nil -} - -func (p *TByteValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TByteValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TByteValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.BYTE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteByte(ctx, int8(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TByteValue) Equals(other *TByteValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TByteValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TByteValue(%+v)", *p) } // Attributes: // - Value type TI16Value struct { - Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI16Value() *TI16Value { - return &TI16Value{} + return &TI16Value{} } var TI16Value_Value_DEFAULT int16 + func (p *TI16Value) GetValue() int16 { - if !p.IsSetValue() { - return TI16Value_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TI16Value_Value_DEFAULT + } + return *p.Value } func (p *TI16Value) IsSetValue() bool { - return p.Value != nil -} - -func (p *TI16Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI16Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TI16Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI16Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TI16Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I16, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI16(ctx, int16(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TI16Value) Equals(other *TI16Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TI16Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI16Value(%+v)", *p) } // Attributes: // - Value type TI32Value struct { - Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI32Value() *TI32Value { - return &TI32Value{} + return &TI32Value{} } var TI32Value_Value_DEFAULT int32 + func (p *TI32Value) GetValue() int32 { - if !p.IsSetValue() { - return TI32Value_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TI32Value_Value_DEFAULT + } + return *p.Value } func (p *TI32Value) IsSetValue() bool { - return p.Value != nil -} - -func (p *TI32Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI32Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TI32Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI32Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TI32Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TI32Value) Equals(other *TI32Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TI32Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI32Value(%+v)", *p) } // Attributes: // - Value type TI64Value struct { - Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI64Value() *TI64Value { - return &TI64Value{} + return &TI64Value{} } var TI64Value_Value_DEFAULT int64 + func (p *TI64Value) GetValue() int64 { - if !p.IsSetValue() { - return TI64Value_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TI64Value_Value_DEFAULT + } + return *p.Value } func (p *TI64Value) IsSetValue() bool { - return p.Value != nil -} - -func (p *TI64Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI64Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TI64Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI64Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TI64Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TI64Value) Equals(other *TI64Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TI64Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI64Value(%+v)", *p) } // Attributes: // - Value type TDoubleValue struct { - Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTDoubleValue() *TDoubleValue { - return &TDoubleValue{} + return &TDoubleValue{} } var TDoubleValue_Value_DEFAULT float64 + func (p *TDoubleValue) GetValue() float64 { - if !p.IsSetValue() { - return TDoubleValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TDoubleValue_Value_DEFAULT + } + return *p.Value } func (p *TDoubleValue) IsSetValue() bool { - return p.Value != nil -} - -func (p *TDoubleValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDoubleValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TDoubleValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDoubleValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TDoubleValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TDoubleValue) Equals(other *TDoubleValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TDoubleValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDoubleValue(%+v)", *p) } // Attributes: // - Value type TStringValue struct { - Value *string `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *string `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTStringValue() *TStringValue { - return &TStringValue{} + return &TStringValue{} } var TStringValue_Value_DEFAULT string + func (p *TStringValue) GetValue() string { - if !p.IsSetValue() { - return TStringValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TStringValue_Value_DEFAULT + } + return *p.Value } func (p *TStringValue) IsSetValue() bool { - return p.Value != nil -} - -func (p *TStringValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TStringValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TStringValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStringValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TStringValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err -} - -func (p *TStringValue) Equals(other *TStringValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TStringValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStringValue(%+v)", *p) } // Attributes: @@ -3558,1926 +3770,1941 @@ func (p *TStringValue) String() string { // - 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"` + 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{} + return &TColumnValue{} } var TColumnValue_BoolVal_DEFAULT *TBoolValue + func (p *TColumnValue) GetBoolVal() *TBoolValue { - if !p.IsSetBoolVal() { - return TColumnValue_BoolVal_DEFAULT - } -return p.BoolVal + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + return p.BoolVal != nil } func (p *TColumnValue) IsSetByteVal() bool { - return p.ByteVal != nil + return p.ByteVal != nil } func (p *TColumnValue) IsSetI16Val() bool { - return p.I16Val != nil + return p.I16Val != nil } func (p *TColumnValue) IsSetI32Val() bool { - return p.I32Val != nil + return p.I32Val != nil } func (p *TColumnValue) IsSetI64Val() bool { - return p.I64Val != nil + return p.I64Val != nil } func (p *TColumnValue) IsSetDoubleVal() bool { - return p.DoubleVal != nil + return p.DoubleVal != nil } func (p *TColumnValue) IsSetStringVal() bool { - return p.StringVal != nil -} - -func (p *TColumnValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TColumnValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.BoolVal = &TBoolValue{} - if err := p.BoolVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ByteVal = &TByteValue{} - if err := p.ByteVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.I16Val = &TI16Value{} - if err := p.I16Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.I32Val = &TI32Value{} - if err := p.I32Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.I64Val = &TI64Value{} - if err := p.I64Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.DoubleVal = &TDoubleValue{} - if err := p.DoubleVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - p.StringVal = &TStringValue{} - if err := p.StringVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) - } - return nil -} - -func (p *TColumnValue) Write(ctx context.Context, 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(ctx, "TColumnValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TColumnValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } - } - return err -} - -func (p *TColumnValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } - } - return err -} - -func (p *TColumnValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } - } - return err -} - -func (p *TColumnValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } - } - return err -} - -func (p *TColumnValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } - } - return err -} - -func (p *TColumnValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } - } - return err -} - -func (p *TColumnValue) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } - } - return err -} - -func (p *TColumnValue) Equals(other *TColumnValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.BoolVal.Equals(other.BoolVal) { return false } - if !p.ByteVal.Equals(other.ByteVal) { return false } - if !p.I16Val.Equals(other.I16Val) { return false } - if !p.I32Val.Equals(other.I32Val) { return false } - if !p.I64Val.Equals(other.I64Val) { return false } - if !p.DoubleVal.Equals(other.DoubleVal) { return false } - if !p.StringVal.Equals(other.StringVal) { return false } - return true + 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 "" - } - return fmt.Sprintf("TColumnValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumnValue(%+v)", *p) } // Attributes: // - ColVals type TRow struct { - ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"` + ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"` } func NewTRow() *TRow { - return &TRow{} + return &TRow{} } - func (p *TRow) GetColVals() []*TColumnValue { - return p.ColVals -} -func (p *TRow) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColVals bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetColVals = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 ++ { - _elem13 := &TColumnValue{} - if err := _elem13.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) - } - p.ColVals = append(p.ColVals, _elem13) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRow) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRow"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TRow) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "colVals", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColVals)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ColVals { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) } - return err -} - -func (p *TRow) Equals(other *TRow) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.ColVals) != len(other.ColVals) { return false } - for i, _tgt := range p.ColVals { - _src14 := other.ColVals[i] - if !_tgt.Equals(_src14) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetColVals = true + 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 "" - } - return fmt.Sprintf("TRow(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TBoolColumn{} } - func (p *TBoolColumn) GetValues() []bool { - return p.Values + return p.Values } func (p *TBoolColumn) GetNulls() []byte { - return p.Nulls -} -func (p *TBoolColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem15 bool - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem15 = v -} - p.Values = append(p.Values, _elem15) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TBoolColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TBoolColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBoolColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TBoolColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteBool(ctx, bool(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TBoolColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TBoolColumn) Equals(other *TBoolColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src16 := other.Values[i] - if _tgt != _src16 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TBoolColumn(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TByteColumn{} } - func (p *TByteColumn) GetValues() []int8 { - return p.Values + return p.Values } func (p *TByteColumn) GetNulls() []byte { - return p.Nulls -} -func (p *TByteColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem17 int8 - if v, err := iprot.ReadByte(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := int8(v) - _elem17 = temp -} - p.Values = append(p.Values, _elem17) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TByteColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TByteColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TByteColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TByteColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.BYTE, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteByte(ctx, int8(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TByteColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TByteColumn) Equals(other *TByteColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src18 := other.Values[i] - if _tgt != _src18 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TByteColumn(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TI16Column{} } - func (p *TI16Column) GetValues() []int16 { - return p.Values + return p.Values } func (p *TI16Column) GetNulls() []byte { - return p.Nulls -} -func (p *TI16Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem19 int16 - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem19 = v -} - p.Values = append(p.Values, _elem19) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI16Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TI16Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI16Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TI16Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I16, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI16(ctx, int16(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TI16Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TI16Column) Equals(other *TI16Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src20 := other.Values[i] - if _tgt != _src20 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TI16Column(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TI32Column{} } - func (p *TI32Column) GetValues() []int32 { - return p.Values + return p.Values } func (p *TI32Column) GetNulls() []byte { - return p.Nulls -} -func (p *TI32Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem21 int32 - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem21 = v -} - p.Values = append(p.Values, _elem21) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI32Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TI32Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI32Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TI32Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TI32Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TI32Column) Equals(other *TI32Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src22 := other.Values[i] - if _tgt != _src22 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TI32Column(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TI64Column{} } - func (p *TI64Column) GetValues() []int64 { - return p.Values + return p.Values } func (p *TI64Column) GetNulls() []byte { - return p.Nulls -} -func (p *TI64Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem23 int64 - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem23 = v -} - p.Values = append(p.Values, _elem23) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI64Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TI64Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI64Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TI64Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI64(ctx, int64(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TI64Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TI64Column) Equals(other *TI64Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src24 := other.Values[i] - if _tgt != _src24 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TI64Column(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TDoubleColumn{} } - func (p *TDoubleColumn) GetValues() []float64 { - return p.Values + return p.Values } func (p *TDoubleColumn) GetNulls() []byte { - return p.Nulls -} -func (p *TDoubleColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem25 float64 - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem25 = v -} - p.Values = append(p.Values, _elem25) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TDoubleColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TDoubleColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDoubleColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TDoubleColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteDouble(ctx, float64(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TDoubleColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TDoubleColumn) Equals(other *TDoubleColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src26 := other.Values[i] - if _tgt != _src26 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TDoubleColumn(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TStringColumn{} } - func (p *TStringColumn) GetValues() []string { - return p.Values + return p.Values } func (p *TStringColumn) GetNulls() []byte { - return p.Nulls -} -func (p *TStringColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem27 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem27 = v -} - p.Values = append(p.Values, _elem27) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TStringColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TStringColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStringColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TStringColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TStringColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TStringColumn) Equals(other *TStringColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src28 := other.Values[i] - if _tgt != _src28 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TStringColumn(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TBinaryColumn{} } - func (p *TBinaryColumn) GetValues() [][]byte { - return p.Values + return p.Values } func (p *TBinaryColumn) GetNulls() []byte { - return p.Nulls -} -func (p *TBinaryColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem29 []byte - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem29 = v -} - p.Values = append(p.Values, _elem29) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TBinaryColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil -} - -func (p *TBinaryColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBinaryColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TBinaryColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteBinary(ctx, v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err -} - -func (p *TBinaryColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err -} - -func (p *TBinaryColumn) Equals(other *TBinaryColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src30 := other.Values[i] - if bytes.Compare(_tgt, _src30) != 0 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetValues = true + 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 + } + } + issetNulls = true + 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 "" - } - return fmt.Sprintf("TBinaryColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBinaryColumn(%+v)", *p) } // Attributes: @@ -5490,459 +5717,493 @@ func (p *TBinaryColumn) String() string { // - 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"` + 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{} + return &TColumn{} } var TColumn_BoolVal_DEFAULT *TBoolColumn + func (p *TColumn) GetBoolVal() *TBoolColumn { - if !p.IsSetBoolVal() { - return TColumn_BoolVal_DEFAULT - } -return p.BoolVal + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + return p.BoolVal != nil } func (p *TColumn) IsSetByteVal() bool { - return p.ByteVal != nil + return p.ByteVal != nil } func (p *TColumn) IsSetI16Val() bool { - return p.I16Val != nil + return p.I16Val != nil } func (p *TColumn) IsSetI32Val() bool { - return p.I32Val != nil + return p.I32Val != nil } func (p *TColumn) IsSetI64Val() bool { - return p.I64Val != nil + return p.I64Val != nil } func (p *TColumn) IsSetDoubleVal() bool { - return p.DoubleVal != nil + return p.DoubleVal != nil } func (p *TColumn) IsSetStringVal() bool { - return p.StringVal != nil + return p.StringVal != nil } func (p *TColumn) IsSetBinaryVal() bool { - return p.BinaryVal != nil -} - -func (p *TColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.BoolVal = &TBoolColumn{} - if err := p.BoolVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) - } - return nil -} - -func (p *TColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ByteVal = &TByteColumn{} - if err := p.ByteVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) - } - return nil -} - -func (p *TColumn) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.I16Val = &TI16Column{} - if err := p.I16Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) - } - return nil -} - -func (p *TColumn) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.I32Val = &TI32Column{} - if err := p.I32Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) - } - return nil -} - -func (p *TColumn) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.I64Val = &TI64Column{} - if err := p.I64Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) - } - return nil -} - -func (p *TColumn) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.DoubleVal = &TDoubleColumn{} - if err := p.DoubleVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) - } - return nil -} - -func (p *TColumn) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - p.StringVal = &TStringColumn{} - if err := p.StringVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) - } - return nil -} - -func (p *TColumn) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - p.BinaryVal = &TBinaryColumn{} - if err := p.BinaryVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err) - } - return nil -} - -func (p *TColumn) Write(ctx context.Context, 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(ctx, "TColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - if err := p.writeField8(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } - } - return err -} - -func (p *TColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } - } - return err -} - -func (p *TColumn) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } - } - return err -} - -func (p *TColumn) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } - } - return err -} - -func (p *TColumn) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } - } - return err -} - -func (p *TColumn) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } - } - return err -} - -func (p *TColumn) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } - } - return err -} - -func (p *TColumn) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryVal() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) } - } - return err -} - -func (p *TColumn) Equals(other *TColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.BoolVal.Equals(other.BoolVal) { return false } - if !p.ByteVal.Equals(other.ByteVal) { return false } - if !p.I16Val.Equals(other.I16Val) { return false } - if !p.I32Val.Equals(other.I32Val) { return false } - if !p.I64Val.Equals(other.I64Val) { return false } - if !p.DoubleVal.Equals(other.DoubleVal) { return false } - if !p.StringVal.Equals(other.StringVal) { return false } - if !p.BinaryVal.Equals(other.BinaryVal) { return false } - return true + 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 "" - } - return fmt.Sprintf("TColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumn(%+v)", *p) } // Attributes: @@ -5952,332 +6213,336 @@ func (p *TColumn) String() string { // - BinaryColumns // - ColumnCount 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"` - BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` - ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` + 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"` + BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` + ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` } func NewTRowSet() *TRowSet { - return &TRowSet{} + return &TRowSet{} } - func (p *TRowSet) GetStartRowOffset() int64 { - return p.StartRowOffset + return p.StartRowOffset } func (p *TRowSet) GetRows() []*TRow { - return p.Rows + return p.Rows } + var TRowSet_Columns_DEFAULT []*TColumn func (p *TRowSet) GetColumns() []*TColumn { - return p.Columns + return p.Columns } + var TRowSet_BinaryColumns_DEFAULT []byte func (p *TRowSet) GetBinaryColumns() []byte { - return p.BinaryColumns + return p.BinaryColumns } + var TRowSet_ColumnCount_DEFAULT int32 + func (p *TRowSet) GetColumnCount() int32 { - if !p.IsSetColumnCount() { - return TRowSet_ColumnCount_DEFAULT - } -return *p.ColumnCount + if !p.IsSetColumnCount() { + return TRowSet_ColumnCount_DEFAULT + } + return *p.ColumnCount } func (p *TRowSet) IsSetColumns() bool { - return p.Columns != nil + return p.Columns != nil } func (p *TRowSet) IsSetBinaryColumns() bool { - return p.BinaryColumns != nil + return p.BinaryColumns != nil } func (p *TRowSet) IsSetColumnCount() bool { - return p.ColumnCount != nil -} - -func (p *TRowSet) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStartRowOffset = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I32 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.StartRowOffset = v -} - return nil -} - -func (p *TRowSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 ++ { - _elem31 := &TRow{} - if err := _elem31.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) - } - p.Rows = append(p.Rows, _elem31) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 ++ { - _elem32 := &TColumn{} - if err := _elem32.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) - } - p.Columns = append(p.Columns, _elem32) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.BinaryColumns = v -} - return nil -} - -func (p *TRowSet) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ColumnCount = &v -} - return nil -} - -func (p *TRowSet) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRowSet"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TRowSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) } - return err -} - -func (p *TRowSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Rows { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } - return err -} - -func (p *TRowSet) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumns() { - if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Columns { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) } - } - return err -} - -func (p *TRowSet) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryColumns() { - if err := oprot.WriteFieldBegin(ctx, "binaryColumns", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) } - if err := oprot.WriteBinary(ctx, p.BinaryColumns); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) } - } - return err -} - -func (p *TRowSet) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumnCount() { - if err := oprot.WriteFieldBegin(ctx, "columnCount", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ColumnCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) } - } - return err -} - -func (p *TRowSet) Equals(other *TRowSet) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StartRowOffset != other.StartRowOffset { return false } - if len(p.Rows) != len(other.Rows) { return false } - for i, _tgt := range p.Rows { - _src33 := other.Rows[i] - if !_tgt.Equals(_src33) { return false } - } - if len(p.Columns) != len(other.Columns) { return false } - for i, _tgt := range p.Columns { - _src34 := other.Columns[i] - if !_tgt.Equals(_src34) { return false } - } - if bytes.Compare(p.BinaryColumns, other.BinaryColumns) != 0 { return false } - if p.ColumnCount != other.ColumnCount { - if p.ColumnCount == nil || other.ColumnCount == nil { - return false - } - if (*p.ColumnCount) != (*other.ColumnCount) { return false } - } - return true + return p.ColumnCount != 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStartRowOffset = true + 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 + } + } + issetRows = true + 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 + } + } + 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.I32 { + 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 !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) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.BinaryColumns = v + } + return nil +} + +func (p *TRowSet) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ColumnCount = &v + } + 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 := 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 *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) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetBinaryColumns() { + if err := oprot.WriteFieldBegin("binaryColumns", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) + } + if err := oprot.WriteBinary(p.BinaryColumns); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) + } + } + return err +} + +func (p *TRowSet) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetColumnCount() { + if err := oprot.WriteFieldBegin("columnCount", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) + } + if err := oprot.WriteI32(int32(*p.ColumnCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) + } + } + return err } func (p *TRowSet) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRowSet(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRowSet(%+v)", *p) } // Attributes: @@ -6287,587 +6552,593 @@ func (p *TRowSet) String() string { // - 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"` + 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{} + return &TStatus{} } - func (p *TStatus) GetStatusCode() TStatusCode { - return p.StatusCode + return p.StatusCode } + var TStatus_InfoMessages_DEFAULT []string func (p *TStatus) GetInfoMessages() []string { - return p.InfoMessages + return p.InfoMessages } + var TStatus_SqlState_DEFAULT string + func (p *TStatus) GetSqlState() string { - if !p.IsSetSqlState() { - return TStatus_SqlState_DEFAULT - } -return *p.SqlState + 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 + 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 + if !p.IsSetErrorMessage() { + return TStatus_ErrorMessage_DEFAULT + } + return *p.ErrorMessage } func (p *TStatus) IsSetInfoMessages() bool { - return p.InfoMessages != nil + return p.InfoMessages != nil } func (p *TStatus) IsSetSqlState() bool { - return p.SqlState != nil + return p.SqlState != nil } func (p *TStatus) IsSetErrorCode() bool { - return p.ErrorCode != nil + return p.ErrorCode != nil } func (p *TStatus) IsSetErrorMessage() bool { - return p.ErrorMessage != nil -} - -func (p *TStatus) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatusCode bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatusCode = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TStatusCode(v) - p.StatusCode = temp -} - return nil -} - -func (p *TStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem35 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem35 = v -} - p.InfoMessages = append(p.InfoMessages, _elem35) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TStatus) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.SqlState = &v -} - return nil -} - -func (p *TStatus) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ErrorCode = &v -} - return nil -} - -func (p *TStatus) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ErrorMessage = &v -} - return nil -} - -func (p *TStatus) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStatus"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TStatus) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "statusCode", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.StatusCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) } - return err -} - -func (p *TStatus) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInfoMessages() { - if err := oprot.WriteFieldBegin(ctx, "infoMessages", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.InfoMessages)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.InfoMessages { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) } - } - return err -} - -func (p *TStatus) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } - } - return err -} - -func (p *TStatus) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } - } - return err -} - -func (p *TStatus) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } - } - return err -} - -func (p *TStatus) Equals(other *TStatus) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StatusCode != other.StatusCode { return false } - if len(p.InfoMessages) != len(other.InfoMessages) { return false } - for i, _tgt := range p.InfoMessages { - _src36 := other.InfoMessages[i] - if _tgt != _src36 { return false } - } - if p.SqlState != other.SqlState { - if p.SqlState == nil || other.SqlState == nil { - return false - } - if (*p.SqlState) != (*other.SqlState) { return false } - } - if p.ErrorCode != other.ErrorCode { - if p.ErrorCode == nil || other.ErrorCode == nil { - return false - } - if (*p.ErrorCode) != (*other.ErrorCode) { return false } - } - if p.ErrorMessage != other.ErrorMessage { - if p.ErrorMessage == nil || other.ErrorMessage == nil { - return false - } - if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatusCode = true + 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 "" - } - return fmt.Sprintf("TStatus(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &THandleIdentifier{} } - func (p *THandleIdentifier) GetGUID() []byte { - return p.GUID + return p.GUID } func (p *THandleIdentifier) GetSecret() []byte { - return p.Secret -} -func (p *THandleIdentifier) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetGUID = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetSecret = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.GUID = v -} - return nil -} - -func (p *THandleIdentifier) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Secret = v -} - return nil -} - -func (p *THandleIdentifier) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "THandleIdentifier"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *THandleIdentifier) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "guid", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) } - if err := oprot.WriteBinary(ctx, p.GUID); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) } - return err -} - -func (p *THandleIdentifier) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Secret); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) } - return err -} - -func (p *THandleIdentifier) Equals(other *THandleIdentifier) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if bytes.Compare(p.GUID, other.GUID) != 0 { return false } - if bytes.Compare(p.Secret, other.Secret) != 0 { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetGUID = true + 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 + } + } + issetSecret = true + 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 "" - } - return fmt.Sprintf("THandleIdentifier(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("THandleIdentifier(%+v)", *p) } // Attributes: // - SessionId type TSessionHandle struct { - SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` + SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` } func NewTSessionHandle() *TSessionHandle { - return &TSessionHandle{} + return &TSessionHandle{} } var TSessionHandle_SessionId_DEFAULT *THandleIdentifier + func (p *TSessionHandle) GetSessionId() *THandleIdentifier { - if !p.IsSetSessionId() { - return TSessionHandle_SessionId_DEFAULT - } -return p.SessionId + if !p.IsSetSessionId() { + return TSessionHandle_SessionId_DEFAULT + } + return p.SessionId } func (p *TSessionHandle) IsSetSessionId() bool { - return p.SessionId != nil -} - -func (p *TSessionHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionId bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionId = &THandleIdentifier{} - if err := p.SessionId.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err) - } - return nil -} - -func (p *TSessionHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSessionHandle"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TSessionHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } - return err -} - -func (p *TSessionHandle) Equals(other *TSessionHandle) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionId.Equals(other.SessionId) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionId = true + 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 "" - } - return fmt.Sprintf("TSessionHandle(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSessionHandle(%+v)", *p) } // Attributes: @@ -6876,247 +7147,256 @@ func (p *TSessionHandle) String() string { // - 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"` + 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{} + return &TOperationHandle{} } var TOperationHandle_OperationId_DEFAULT *THandleIdentifier + func (p *TOperationHandle) GetOperationId() *THandleIdentifier { - if !p.IsSetOperationId() { - return TOperationHandle_OperationId_DEFAULT - } -return p.OperationId + if !p.IsSetOperationId() { + return TOperationHandle_OperationId_DEFAULT + } + return p.OperationId } func (p *TOperationHandle) GetOperationType() TOperationType { - return p.OperationType + return p.OperationType } func (p *TOperationHandle) GetHasResultSet() bool { - return p.HasResultSet + return p.HasResultSet } + var TOperationHandle_ModifiedRowCount_DEFAULT float64 + func (p *TOperationHandle) GetModifiedRowCount() float64 { - if !p.IsSetModifiedRowCount() { - return TOperationHandle_ModifiedRowCount_DEFAULT - } -return *p.ModifiedRowCount + if !p.IsSetModifiedRowCount() { + return TOperationHandle_ModifiedRowCount_DEFAULT + } + return *p.ModifiedRowCount } func (p *TOperationHandle) IsSetOperationId() bool { - return p.OperationId != nil + return p.OperationId != nil } func (p *TOperationHandle) IsSetModifiedRowCount() bool { - return p.ModifiedRowCount != nil -} - -func (p *TOperationHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOperationType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetHasResultSet = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationId = &THandleIdentifier{} - if err := p.OperationId.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err) - } - return nil -} - -func (p *TOperationHandle) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TOperationType(v) - p.OperationType = temp -} - return nil -} - -func (p *TOperationHandle) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.HasResultSet = v -} - return nil -} - -func (p *TOperationHandle) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ModifiedRowCount = &v -} - return nil -} - -func (p *TOperationHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOperationHandle"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TOperationHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) } - return err -} - -func (p *TOperationHandle) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.OperationType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) } - return err -} - -func (p *TOperationHandle) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) } - return err -} - -func (p *TOperationHandle) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetModifiedRowCount() { - if err := oprot.WriteFieldBegin(ctx, "modifiedRowCount", thrift.DOUBLE, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.ModifiedRowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) } - } - return err -} - -func (p *TOperationHandle) Equals(other *TOperationHandle) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationId.Equals(other.OperationId) { return false } - if p.OperationType != other.OperationType { return false } - if p.HasResultSet != other.HasResultSet { return false } - if p.ModifiedRowCount != other.ModifiedRowCount { - if p.ModifiedRowCount == nil || other.ModifiedRowCount == nil { - return false - } - if (*p.ModifiedRowCount) != (*other.ModifiedRowCount) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationId = true + 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 + } + } + issetOperationType = true + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetHasResultSet = true + 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 "" - } - return fmt.Sprintf("TOperationHandle(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOperationHandle(%+v)", *p) } // Attributes: @@ -7125,286 +7405,289 @@ func (p *TOperationHandle) String() string { // - 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"` + 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: 9, + return &TOpenSessionReq{ + ClientProtocol: 9, + } } -} - func (p *TOpenSessionReq) GetClientProtocol() TProtocolVersion { - return p.ClientProtocol + return p.ClientProtocol } + var TOpenSessionReq_Username_DEFAULT string + func (p *TOpenSessionReq) GetUsername() string { - if !p.IsSetUsername() { - return TOpenSessionReq_Username_DEFAULT - } -return *p.Username + 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 + 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 + return p.Configuration } func (p *TOpenSessionReq) IsSetUsername() bool { - return p.Username != nil + return p.Username != nil } func (p *TOpenSessionReq) IsSetPassword() bool { - return p.Password != nil + return p.Password != nil } func (p *TOpenSessionReq) IsSetConfiguration() bool { - return p.Configuration != nil -} - -func (p *TOpenSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetClientProtocol bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetClientProtocol = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.MAP { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TProtocolVersion(v) - p.ClientProtocol = temp -} - return nil -} - -func (p *TOpenSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Username = &v -} - return nil -} - -func (p *TOpenSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Password = &v -} - return nil -} - -func (p *TOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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 _key37 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key37 = v -} -var _val38 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val38 = v -} - p.Configuration[_key37] = _val38 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOpenSessionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TOpenSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.ClientProtocol)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) } - return err -} - -func (p *TOpenSessionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUsername() { - if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Username)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) } - } - return err -} - -func (p *TOpenSessionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetPassword() { - if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Password)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) } - } - return err -} - -func (p *TOpenSessionReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } - } - return err -} - -func (p *TOpenSessionReq) Equals(other *TOpenSessionReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ClientProtocol != other.ClientProtocol { return false } - if p.Username != other.Username { - if p.Username == nil || other.Username == nil { - return false - } - if (*p.Username) != (*other.Username) { return false } - } - if p.Password != other.Password { - if p.Password == nil || other.Password == nil { - return false - } - if (*p.Password) != (*other.Password) { return false } - } - if len(p.Configuration) != len(other.Configuration) { return false } - for k, _tgt := range p.Configuration { - _src39 := other.Configuration[k] - if _tgt != _src39 { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetClientProtocol = true + 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 "" - } - return fmt.Sprintf("TOpenSessionReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOpenSessionReq(%+v)", *p) } // Attributes: @@ -7413,808 +7696,821 @@ func (p *TOpenSessionReq) String() string { // - 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"` + 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: 9, -} + return &TOpenSessionResp{ + ServerProtocolVersion: 9, + } } var TOpenSessionResp_Status_DEFAULT *TStatus + func (p *TOpenSessionResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TOpenSessionResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TOpenSessionResp_Status_DEFAULT + } + return p.Status } func (p *TOpenSessionResp) GetServerProtocolVersion() TProtocolVersion { - return p.ServerProtocolVersion + return p.ServerProtocolVersion } + var TOpenSessionResp_SessionHandle_DEFAULT *TSessionHandle + func (p *TOpenSessionResp) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TOpenSessionResp_SessionHandle_DEFAULT - } -return p.SessionHandle + 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 + return p.Configuration } func (p *TOpenSessionResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TOpenSessionResp) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TOpenSessionResp) IsSetConfiguration() bool { - return p.Configuration != nil -} - -func (p *TOpenSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetServerProtocolVersion = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.MAP { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TProtocolVersion(v) - p.ServerProtocolVersion = temp -} - return nil -} - -func (p *TOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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 _key40 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key40 = v -} -var _val41 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val41 = v -} - p.Configuration[_key40] = _val41 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOpenSessionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TOpenSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TOpenSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) } - return err -} - -func (p *TOpenSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSessionHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) } - } - return err -} - -func (p *TOpenSessionResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } - } - return err -} - -func (p *TOpenSessionResp) Equals(other *TOpenSessionResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.ServerProtocolVersion != other.ServerProtocolVersion { return false } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if len(p.Configuration) != len(other.Configuration) { return false } - for k, _tgt := range p.Configuration { - _src42 := other.Configuration[k] - if _tgt != _src42 { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 + } + } + issetServerProtocolVersion = true + 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 "" - } - return fmt.Sprintf("TOpenSessionResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOpenSessionResp(%+v)", *p) } // Attributes: // - SessionHandle // - Configuration type TSetClientInfoReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - Configuration map[string]string `thrift:"configuration,2" db:"configuration" json:"configuration,omitempty"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Configuration map[string]string `thrift:"configuration,2" db:"configuration" json:"configuration,omitempty"` } func NewTSetClientInfoReq() *TSetClientInfoReq { - return &TSetClientInfoReq{} + return &TSetClientInfoReq{} } var TSetClientInfoReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TSetClientInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TSetClientInfoReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TSetClientInfoReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TSetClientInfoReq_Configuration_DEFAULT map[string]string func (p *TSetClientInfoReq) GetConfiguration() map[string]string { - return p.Configuration + return p.Configuration } func (p *TSetClientInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TSetClientInfoReq) IsSetConfiguration() bool { - return p.Configuration != nil -} - -func (p *TSetClientInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.MAP { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TSetClientInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TSetClientInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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 _key43 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key43 = v -} -var _val44 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val44 = v -} - p.Configuration[_key43] = _val44 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TSetClientInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSetClientInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TSetClientInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TSetClientInfoReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:configuration: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:configuration: ", p), err) } - } - return err -} - -func (p *TSetClientInfoReq) Equals(other *TSetClientInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if len(p.Configuration) != len(other.Configuration) { return false } - for k, _tgt := range p.Configuration { - _src45 := other.Configuration[k] - if _tgt != _src45 { return false } - } - return true + return p.Configuration != nil +} + +func (p *TSetClientInfoReq) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + case 2: + if fieldTypeId == thrift.MAP { + 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 !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TSetClientInfoReq) 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 *TSetClientInfoReq) ReadField2(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 _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.Configuration[_key24] = _val25 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TSetClientInfoReq) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TSetClientInfoReq"); 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 *TSetClientInfoReq) 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 *TSetClientInfoReq) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetConfiguration() { + if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2: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 2:configuration: ", p), err) + } + } + return err } func (p *TSetClientInfoReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSetClientInfoReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSetClientInfoReq(%+v)", *p) } // Attributes: // - Status type TSetClientInfoResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTSetClientInfoResp() *TSetClientInfoResp { - return &TSetClientInfoResp{} + return &TSetClientInfoResp{} } var TSetClientInfoResp_Status_DEFAULT *TStatus + func (p *TSetClientInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TSetClientInfoResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TSetClientInfoResp_Status_DEFAULT + } + return p.Status } func (p *TSetClientInfoResp) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TSetClientInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TSetClientInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TSetClientInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSetClientInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TSetClientInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TSetClientInfoResp) Equals(other *TSetClientInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + return p.Status != nil +} + +func (p *TSetClientInfoResp) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 *TSetClientInfoResp) 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 *TSetClientInfoResp) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TSetClientInfoResp"); 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 *TSetClientInfoResp) 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 *TSetClientInfoResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSetClientInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSetClientInfoResp(%+v)", *p) } // Attributes: // - SessionHandle type TCloseSessionReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` } func NewTCloseSessionReq() *TCloseSessionReq { - return &TCloseSessionReq{} + return &TCloseSessionReq{} } var TCloseSessionReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TCloseSessionReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCloseSessionReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TCloseSessionReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TCloseSessionReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TCloseSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TCloseSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseSessionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCloseSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TCloseSessionReq) Equals(other *TCloseSessionReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 "" - } - return fmt.Sprintf("TCloseSessionReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseSessionReq(%+v)", *p) } // Attributes: // - Status type TCloseSessionResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCloseSessionResp() *TCloseSessionResp { - return &TCloseSessionResp{} + return &TCloseSessionResp{} } var TCloseSessionResp_Status_DEFAULT *TStatus + func (p *TCloseSessionResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCloseSessionResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCloseSessionResp_Status_DEFAULT + } + return p.Status } func (p *TCloseSessionResp) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TCloseSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TCloseSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseSessionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCloseSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TCloseSessionResp) Equals(other *TCloseSessionResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TCloseSessionResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseSessionResp(%+v)", *p) } // Attributes: @@ -8225,711 +8521,720 @@ func (p *TCloseSessionResp) String() string { // - 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"` + 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{} + return &TGetInfoValue{} } var TGetInfoValue_StringValue_DEFAULT string + func (p *TGetInfoValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TGetInfoValue_StringValue_DEFAULT - } -return *p.StringValue + 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 + 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 + 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 + 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 + 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 + 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 + 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 + return p.StringValue != nil } func (p *TGetInfoValue) IsSetSmallIntValue() bool { - return p.SmallIntValue != nil + return p.SmallIntValue != nil } func (p *TGetInfoValue) IsSetIntegerBitmask() bool { - return p.IntegerBitmask != nil + return p.IntegerBitmask != nil } func (p *TGetInfoValue) IsSetIntegerFlag() bool { - return p.IntegerFlag != nil + return p.IntegerFlag != nil } func (p *TGetInfoValue) IsSetBinaryValue() bool { - return p.BinaryValue != nil + return p.BinaryValue != nil } func (p *TGetInfoValue) IsSetLenValue() bool { - return p.LenValue != nil -} - -func (p *TGetInfoValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I16 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I32 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TGetInfoValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.StringValue = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.SmallIntValue = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.IntegerBitmask = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.IntegerFlag = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.BinaryValue = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.LenValue = &v -} - return nil -} - -func (p *TGetInfoValue) Write(ctx context.Context, 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(ctx, "TGetInfoValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetInfoValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) } - } - return err -} - -func (p *TGetInfoValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSmallIntValue() { - if err := oprot.WriteFieldBegin(ctx, "smallIntValue", thrift.I16, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) } - if err := oprot.WriteI16(ctx, int16(*p.SmallIntValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) } - } - return err -} - -func (p *TGetInfoValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntegerBitmask() { - if err := oprot.WriteFieldBegin(ctx, "integerBitmask", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.IntegerBitmask)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) } - } - return err -} - -func (p *TGetInfoValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntegerFlag() { - if err := oprot.WriteFieldBegin(ctx, "integerFlag", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.IntegerFlag)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) } - } - return err -} - -func (p *TGetInfoValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryValue() { - if err := oprot.WriteFieldBegin(ctx, "binaryValue", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.BinaryValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) } - } - return err -} - -func (p *TGetInfoValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetLenValue() { - if err := oprot.WriteFieldBegin(ctx, "lenValue", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.LenValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) } - } - return err -} - -func (p *TGetInfoValue) Equals(other *TGetInfoValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { return false } - } - if p.SmallIntValue != other.SmallIntValue { - if p.SmallIntValue == nil || other.SmallIntValue == nil { - return false - } - if (*p.SmallIntValue) != (*other.SmallIntValue) { return false } - } - if p.IntegerBitmask != other.IntegerBitmask { - if p.IntegerBitmask == nil || other.IntegerBitmask == nil { - return false - } - if (*p.IntegerBitmask) != (*other.IntegerBitmask) { return false } - } - if p.IntegerFlag != other.IntegerFlag { - if p.IntegerFlag == nil || other.IntegerFlag == nil { - return false - } - if (*p.IntegerFlag) != (*other.IntegerFlag) { return false } - } - if p.BinaryValue != other.BinaryValue { - if p.BinaryValue == nil || other.BinaryValue == nil { - return false - } - if (*p.BinaryValue) != (*other.BinaryValue) { return false } - } - if p.LenValue != other.LenValue { - if p.LenValue == nil || other.LenValue == nil { - return false - } - if (*p.LenValue) != (*other.LenValue) { return false } - } - return true + 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 "" - } - return fmt.Sprintf("TGetInfoValue(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetInfoReq{} } var TGetInfoReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetInfoReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetInfoReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetInfoReq) GetInfoType() TGetInfoType { - return p.InfoType + return p.InfoType } func (p *TGetInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TGetInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetInfoType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TGetInfoType(v) - p.InfoType = temp -} - return nil -} - -func (p *TGetInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetInfoReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "infoType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.InfoType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) } - return err -} - -func (p *TGetInfoReq) Equals(other *TGetInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.InfoType != other.InfoType { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + issetInfoType = true + 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 "" - } - return fmt.Sprintf("TGetInfoReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetInfoResp{} } var TGetInfoResp_Status_DEFAULT *TStatus + func (p *TGetInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetInfoResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetInfoValue() { + return TGetInfoResp_InfoValue_DEFAULT + } + return p.InfoValue } func (p *TGetInfoResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetInfoResp) IsSetInfoValue() bool { - return p.InfoValue != nil -} - -func (p *TGetInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetInfoValue = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.InfoValue = &TGetInfoValue{} - if err := p.InfoValue.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err) - } - return nil -} - -func (p *TGetInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) } - return err -} - -func (p *TGetInfoResp) Equals(other *TGetInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.InfoValue.Equals(other.InfoValue) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 + } + } + issetInfoValue = true + 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 "" - } - return fmt.Sprintf("TGetInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoResp(%+v)", *p) } // Attributes: @@ -8939,1020 +9244,1051 @@ func (p *TGetInfoResp) String() string { // - RunAsync // - QueryTimeout 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"` - QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout"` + 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"` + QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout,omitempty"` } func NewTExecuteStatementReq() *TExecuteStatementReq { - return &TExecuteStatementReq{} + return &TExecuteStatementReq{} } var TExecuteStatementReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TExecuteStatementReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TExecuteStatementReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TExecuteStatementReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TExecuteStatementReq) GetStatement() string { - return p.Statement + return p.Statement } + var TExecuteStatementReq_ConfOverlay_DEFAULT map[string]string func (p *TExecuteStatementReq) GetConfOverlay() map[string]string { - return p.ConfOverlay + return p.ConfOverlay } + var TExecuteStatementReq_RunAsync_DEFAULT bool = false func (p *TExecuteStatementReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } + var TExecuteStatementReq_QueryTimeout_DEFAULT int64 = 0 func (p *TExecuteStatementReq) GetQueryTimeout() int64 { - return p.QueryTimeout + return p.QueryTimeout } func (p *TExecuteStatementReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TExecuteStatementReq) IsSetConfOverlay() bool { - return p.ConfOverlay != nil + return p.ConfOverlay != nil } func (p *TExecuteStatementReq) IsSetRunAsync() bool { - return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT + return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT } func (p *TExecuteStatementReq) IsSetQueryTimeout() bool { - return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_DEFAULT -} - -func (p *TExecuteStatementReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetStatement = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.MAP { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Statement = v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - 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 _key46 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key46 = v -} -var _val47 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val47 = v -} - p.ConfOverlay[_key46] = _val47 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.RunAsync = v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.QueryTimeout = v -} - return nil -} - -func (p *TExecuteStatementReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TExecuteStatementReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TExecuteStatementReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TExecuteStatementReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Statement)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) } - return err -} - -func (p *TExecuteStatementReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfOverlay() { - if err := oprot.WriteFieldBegin(ctx, "confOverlay", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) } - if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) } - } - return err -} - -func (p *TExecuteStatementReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) } - } - return err -} - -func (p *TExecuteStatementReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetQueryTimeout() { - if err := oprot.WriteFieldBegin(ctx, "queryTimeout", thrift.I64, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.QueryTimeout)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) } - } - return err -} - -func (p *TExecuteStatementReq) Equals(other *TExecuteStatementReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.Statement != other.Statement { return false } - if len(p.ConfOverlay) != len(other.ConfOverlay) { return false } - for k, _tgt := range p.ConfOverlay { - _src48 := other.ConfOverlay[k] - if _tgt != _src48 { return false } - } - if p.RunAsync != other.RunAsync { return false } - if p.QueryTimeout != other.QueryTimeout { return false } - return true + return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + issetStatement = true + 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 + } + } + case 5: + if fieldTypeId == thrift.I64 { + 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")) + } + 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 _key26 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key26 = v + } + var _val27 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val27 = v + } + p.ConfOverlay[_key26] = _val27 + } + 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) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.QueryTimeout = 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 := 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 *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) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetQueryTimeout() { + if err := oprot.WriteFieldBegin("queryTimeout", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) + } + if err := oprot.WriteI64(int64(p.QueryTimeout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TExecuteStatementResp{} } var TExecuteStatementResp_Status_DEFAULT *TStatus + func (p *TExecuteStatementResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TExecuteStatementResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TExecuteStatementResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TExecuteStatementResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TExecuteStatementResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TExecuteStatementResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TExecuteStatementResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TExecuteStatementResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TExecuteStatementResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TExecuteStatementResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TExecuteStatementResp) Equals(other *TExecuteStatementResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TExecuteStatementResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TExecuteStatementResp(%+v)", *p) } // Attributes: // - SessionHandle type TGetTypeInfoReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` } func NewTGetTypeInfoReq() *TGetTypeInfoReq { - return &TGetTypeInfoReq{} + return &TGetTypeInfoReq{} } var TGetTypeInfoReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetTypeInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTypeInfoReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTypeInfoReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetTypeInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TGetTypeInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTypeInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetTypeInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetTypeInfoReq) Equals(other *TGetTypeInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 "" - } - return fmt.Sprintf("TGetTypeInfoReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetTypeInfoResp{} } var TGetTypeInfoResp_Status_DEFAULT *TStatus + func (p *TGetTypeInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTypeInfoResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetTypeInfoResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetTypeInfoResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTypeInfoResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetTypeInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTypeInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetTypeInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetTypeInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetTypeInfoResp) Equals(other *TGetTypeInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p) } // Attributes: // - SessionHandle type TGetCatalogsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` } func NewTGetCatalogsReq() *TGetCatalogsReq { - return &TGetCatalogsReq{} + return &TGetCatalogsReq{} } var TGetCatalogsReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetCatalogsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetCatalogsReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetCatalogsReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetCatalogsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TGetCatalogsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetCatalogsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCatalogsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetCatalogsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetCatalogsReq) Equals(other *TGetCatalogsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 "" - } - return fmt.Sprintf("TGetCatalogsReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetCatalogsResp{} } var TGetCatalogsResp_Status_DEFAULT *TStatus + func (p *TGetCatalogsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetCatalogsResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetCatalogsResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetCatalogsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetCatalogsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetCatalogsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetCatalogsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetCatalogsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCatalogsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetCatalogsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetCatalogsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetCatalogsResp) Equals(other *TGetCatalogsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetCatalogsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCatalogsResp(%+v)", *p) } // Attributes: @@ -9960,375 +10296,382 @@ func (p *TGetCatalogsResp) String() string { // - 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"` + 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{} + return &TGetSchemasReq{} } var TGetSchemasReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetSchemasReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetSchemasReq_SessionHandle_DEFAULT - } -return p.SessionHandle + 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 + 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 + if !p.IsSetSchemaName() { + return TGetSchemasReq_SchemaName_DEFAULT + } + return *p.SchemaName } func (p *TGetSchemasReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetSchemasReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetSchemasReq) IsSetSchemaName() bool { - return p.SchemaName != nil -} - -func (p *TGetSchemasReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetSchemasReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetSchemasReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetSchemasReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetSchemasReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetSchemasReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetSchemasReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err -} - -func (p *TGetSchemasReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err -} - -func (p *TGetSchemasReq) Equals(other *TGetSchemasReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 "" - } - return fmt.Sprintf("TGetSchemasReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetSchemasResp{} } var TGetSchemasResp_Status_DEFAULT *TStatus + func (p *TGetSchemasResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetSchemasResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetSchemasResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetSchemasResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetSchemasResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetSchemasResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetSchemasResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetSchemasResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetSchemasResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetSchemasResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetSchemasResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetSchemasResp) Equals(other *TGetSchemasResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetSchemasResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetSchemasResp(%+v)", *p) } // Attributes: @@ -10338,766 +10681,780 @@ func (p *TGetSchemasResp) String() string { // - 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"` + 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{} + return &TGetTablesReq{} } var TGetTablesReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetTablesReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTablesReq_SessionHandle_DEFAULT - } -return p.SessionHandle + 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 + 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 + 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 + if !p.IsSetTableName() { + return TGetTablesReq_TableName_DEFAULT + } + return *p.TableName } + var TGetTablesReq_TableTypes_DEFAULT []string func (p *TGetTablesReq) GetTableTypes() []string { - return p.TableTypes + return p.TableTypes } func (p *TGetTablesReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTablesReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetTablesReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetTablesReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetTablesReq) IsSetTableTypes() bool { - return p.TableTypes != nil -} - -func (p *TGetTablesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.LIST { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTablesReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetTablesReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetTablesReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.TableName = &temp -} - return nil -} - -func (p *TGetTablesReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - 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 _elem49 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem49 = v -} - p.TableTypes = append(p.TableTypes, _elem49) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TGetTablesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTablesReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetTablesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetTablesReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err -} - -func (p *TGetTablesReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err -} - -func (p *TGetTablesReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } - } - return err -} - -func (p *TGetTablesReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableTypes() { - if err := oprot.WriteFieldBegin(ctx, "tableTypes", thrift.LIST, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TableTypes)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.TableTypes { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) } - } - return err -} - -func (p *TGetTablesReq) Equals(other *TGetTablesReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { return false } - } - if len(p.TableTypes) != len(other.TableTypes) { return false } - for i, _tgt := range p.TableTypes { - _src50 := other.TableTypes[i] - if _tgt != _src50 { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 _elem28 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem28 = v + } + p.TableTypes = append(p.TableTypes, _elem28) + } + 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 "" - } - return fmt.Sprintf("TGetTablesReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetTablesResp{} } var TGetTablesResp_Status_DEFAULT *TStatus + func (p *TGetTablesResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTablesResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetTablesResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetTablesResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTablesResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetTablesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTablesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTablesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTablesResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetTablesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetTablesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetTablesResp) Equals(other *TGetTablesResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetTablesResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTablesResp(%+v)", *p) } // Attributes: // - SessionHandle type TGetTableTypesReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` } func NewTGetTableTypesReq() *TGetTableTypesReq { - return &TGetTableTypesReq{} + return &TGetTableTypesReq{} } var TGetTableTypesReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetTableTypesReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTableTypesReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTableTypesReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetTableTypesReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TGetTableTypesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTableTypesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTableTypesReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetTableTypesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetTableTypesReq) Equals(other *TGetTableTypesReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 "" - } - return fmt.Sprintf("TGetTableTypesReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetTableTypesResp{} } var TGetTableTypesResp_Status_DEFAULT *TStatus + func (p *TGetTableTypesResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTableTypesResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetTableTypesResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetTableTypesResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTableTypesResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetTableTypesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTableTypesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTableTypesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTableTypesResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetTableTypesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetTableTypesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetTableTypesResp) Equals(other *TGetTableTypesResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetTableTypesResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTableTypesResp(%+v)", *p) } // Attributes: @@ -11107,477 +11464,486 @@ func (p *TGetTableTypesResp) String() string { // - 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"` + 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{} + return &TGetColumnsReq{} } var TGetColumnsReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetColumnsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetColumnsReq_SessionHandle_DEFAULT - } -return p.SessionHandle + 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 + 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 + 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 + 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 + if !p.IsSetColumnName() { + return TGetColumnsReq_ColumnName_DEFAULT + } + return *p.ColumnName } func (p *TGetColumnsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetColumnsReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetColumnsReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetColumnsReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetColumnsReq) IsSetColumnName() bool { - return p.ColumnName != nil -} - -func (p *TGetColumnsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetColumnsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.TableName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.ColumnName = &temp -} - return nil -} - -func (p *TGetColumnsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetColumnsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetColumnsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetColumnsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err -} - -func (p *TGetColumnsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err -} - -func (p *TGetColumnsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } - } - return err -} - -func (p *TGetColumnsReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumnName() { - if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ColumnName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) } - } - return err -} - -func (p *TGetColumnsReq) Equals(other *TGetColumnsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { return false } - } - if p.ColumnName != other.ColumnName { - if p.ColumnName == nil || other.ColumnName == nil { - return false - } - if (*p.ColumnName) != (*other.ColumnName) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 "" - } - return fmt.Sprintf("TGetColumnsReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetColumnsResp{} } var TGetColumnsResp_Status_DEFAULT *TStatus + func (p *TGetColumnsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetColumnsResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetColumnsResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetColumnsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetColumnsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetColumnsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetColumnsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetColumnsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetColumnsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetColumnsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetColumnsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetColumnsResp) Equals(other *TGetColumnsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetColumnsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetColumnsResp(%+v)", *p) } // Attributes: @@ -11586,417 +11952,428 @@ func (p *TGetColumnsResp) String() string { // - 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"` + 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{} + return &TGetFunctionsReq{} } var TGetFunctionsReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetFunctionsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetFunctionsReq_SessionHandle_DEFAULT - } -return p.SessionHandle + 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 + 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 + if !p.IsSetSchemaName() { + return TGetFunctionsReq_SchemaName_DEFAULT + } + return *p.SchemaName } func (p *TGetFunctionsReq) GetFunctionName() TPatternOrIdentifier { - return p.FunctionName + return p.FunctionName } func (p *TGetFunctionsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetFunctionsReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetFunctionsReq) IsSetSchemaName() bool { - return p.SchemaName != nil -} - -func (p *TGetFunctionsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetFunctionName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetFunctionsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetFunctionsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetFunctionsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.FunctionName = temp -} - return nil -} - -func (p *TGetFunctionsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetFunctionsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetFunctionsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetFunctionsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err -} - -func (p *TGetFunctionsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err -} - -func (p *TGetFunctionsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "functionName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.FunctionName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) } - return err -} - -func (p *TGetFunctionsReq) Equals(other *TGetFunctionsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.FunctionName != other.FunctionName { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + issetFunctionName = true + 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 "" - } - return fmt.Sprintf("TGetFunctionsReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetFunctionsResp{} } var TGetFunctionsResp_Status_DEFAULT *TStatus + func (p *TGetFunctionsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetFunctionsResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetOperationHandle() { + return TGetFunctionsResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetFunctionsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetFunctionsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetFunctionsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetFunctionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetFunctionsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetFunctionsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetFunctionsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetFunctionsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetFunctionsResp) Equals(other *TGetFunctionsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) } // Attributes: @@ -12005,426 +12382,434 @@ func (p *TGetFunctionsResp) String() string { // - SchemaName // - TableName type TGetPrimaryKeysReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` } func NewTGetPrimaryKeysReq() *TGetPrimaryKeysReq { - return &TGetPrimaryKeysReq{} + return &TGetPrimaryKeysReq{} } var TGetPrimaryKeysReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetPrimaryKeysReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetPrimaryKeysReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetPrimaryKeysReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetPrimaryKeysReq_CatalogName_DEFAULT TIdentifier + func (p *TGetPrimaryKeysReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetPrimaryKeysReq_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetPrimaryKeysReq_CatalogName_DEFAULT + } + return *p.CatalogName } + var TGetPrimaryKeysReq_SchemaName_DEFAULT TIdentifier + func (p *TGetPrimaryKeysReq) GetSchemaName() TIdentifier { - if !p.IsSetSchemaName() { - return TGetPrimaryKeysReq_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetPrimaryKeysReq_SchemaName_DEFAULT + } + return *p.SchemaName } + var TGetPrimaryKeysReq_TableName_DEFAULT TIdentifier + func (p *TGetPrimaryKeysReq) GetTableName() TIdentifier { - if !p.IsSetTableName() { - return TGetPrimaryKeysReq_TableName_DEFAULT - } -return *p.TableName + if !p.IsSetTableName() { + return TGetPrimaryKeysReq_TableName_DEFAULT + } + return *p.TableName } func (p *TGetPrimaryKeysReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetPrimaryKeysReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetPrimaryKeysReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetPrimaryKeysReq) IsSetTableName() bool { - return p.TableName != nil -} - -func (p *TGetPrimaryKeysReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TGetPrimaryKeysReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TIdentifier(v) - p.TableName = &temp -} - return nil -} - -func (p *TGetPrimaryKeysReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetPrimaryKeysReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetPrimaryKeysReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err -} - -func (p *TGetPrimaryKeysReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err -} - -func (p *TGetPrimaryKeysReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } - } - return err -} - -func (p *TGetPrimaryKeysReq) Equals(other *TGetPrimaryKeysReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { return false } - } - return true + return p.TableName != nil +} + +func (p *TGetPrimaryKeysReq) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + 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 *TGetPrimaryKeysReq) 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 *TGetPrimaryKeysReq) 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 *TGetPrimaryKeysReq) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TIdentifier(v) + p.SchemaName = &temp + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TIdentifier(v) + p.TableName = &temp + } + return nil +} + +func (p *TGetPrimaryKeysReq) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TGetPrimaryKeysReq"); 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 *TGetPrimaryKeysReq) 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 *TGetPrimaryKeysReq) 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 *TGetPrimaryKeysReq) 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 *TGetPrimaryKeysReq) 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 *TGetPrimaryKeysReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) } // Attributes: // - Status // - OperationHandle type TGetPrimaryKeysResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` } func NewTGetPrimaryKeysResp() *TGetPrimaryKeysResp { - return &TGetPrimaryKeysResp{} + return &TGetPrimaryKeysResp{} } var TGetPrimaryKeysResp_Status_DEFAULT *TStatus + func (p *TGetPrimaryKeysResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetPrimaryKeysResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetPrimaryKeysResp_Status_DEFAULT + } + return p.Status } + var TGetPrimaryKeysResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetPrimaryKeysResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetPrimaryKeysResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetPrimaryKeysResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetPrimaryKeysResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetPrimaryKeysResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetPrimaryKeysResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TGetPrimaryKeysResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetPrimaryKeysResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetPrimaryKeysResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetPrimaryKeysResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetPrimaryKeysResp) Equals(other *TGetPrimaryKeysResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + return p.OperationHandle != nil +} + +func (p *TGetPrimaryKeysResp) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 *TGetPrimaryKeysResp) 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 *TGetPrimaryKeysResp) 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 *TGetPrimaryKeysResp) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TGetPrimaryKeysResp"); 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 *TGetPrimaryKeysResp) 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 *TGetPrimaryKeysResp) 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 *TGetPrimaryKeysResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) } // Attributes: @@ -12436,743 +12821,755 @@ func (p *TGetPrimaryKeysResp) String() string { // - ForeignSchemaName // - ForeignTableName type TGetCrossReferenceReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` - ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` - ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` - ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` - ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` - ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` + ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` + ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` + ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` + ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` + ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` } func NewTGetCrossReferenceReq() *TGetCrossReferenceReq { - return &TGetCrossReferenceReq{} + return &TGetCrossReferenceReq{} } var TGetCrossReferenceReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetCrossReferenceReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetCrossReferenceReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetCrossReferenceReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetCrossReferenceReq_ParentCatalogName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetParentCatalogName() TIdentifier { - if !p.IsSetParentCatalogName() { - return TGetCrossReferenceReq_ParentCatalogName_DEFAULT - } -return *p.ParentCatalogName + if !p.IsSetParentCatalogName() { + return TGetCrossReferenceReq_ParentCatalogName_DEFAULT + } + return *p.ParentCatalogName } + var TGetCrossReferenceReq_ParentSchemaName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetParentSchemaName() TIdentifier { - if !p.IsSetParentSchemaName() { - return TGetCrossReferenceReq_ParentSchemaName_DEFAULT - } -return *p.ParentSchemaName + if !p.IsSetParentSchemaName() { + return TGetCrossReferenceReq_ParentSchemaName_DEFAULT + } + return *p.ParentSchemaName } + var TGetCrossReferenceReq_ParentTableName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetParentTableName() TIdentifier { - if !p.IsSetParentTableName() { - return TGetCrossReferenceReq_ParentTableName_DEFAULT - } -return *p.ParentTableName + if !p.IsSetParentTableName() { + return TGetCrossReferenceReq_ParentTableName_DEFAULT + } + return *p.ParentTableName } + var TGetCrossReferenceReq_ForeignCatalogName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetForeignCatalogName() TIdentifier { - if !p.IsSetForeignCatalogName() { - return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT - } -return *p.ForeignCatalogName + if !p.IsSetForeignCatalogName() { + return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT + } + return *p.ForeignCatalogName } + var TGetCrossReferenceReq_ForeignSchemaName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetForeignSchemaName() TIdentifier { - if !p.IsSetForeignSchemaName() { - return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT - } -return *p.ForeignSchemaName + if !p.IsSetForeignSchemaName() { + return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT + } + return *p.ForeignSchemaName } + var TGetCrossReferenceReq_ForeignTableName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetForeignTableName() TIdentifier { - if !p.IsSetForeignTableName() { - return TGetCrossReferenceReq_ForeignTableName_DEFAULT - } -return *p.ForeignTableName + if !p.IsSetForeignTableName() { + return TGetCrossReferenceReq_ForeignTableName_DEFAULT + } + return *p.ForeignTableName } func (p *TGetCrossReferenceReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetCrossReferenceReq) IsSetParentCatalogName() bool { - return p.ParentCatalogName != nil + return p.ParentCatalogName != nil } func (p *TGetCrossReferenceReq) IsSetParentSchemaName() bool { - return p.ParentSchemaName != nil + return p.ParentSchemaName != nil } func (p *TGetCrossReferenceReq) IsSetParentTableName() bool { - return p.ParentTableName != nil + return p.ParentTableName != nil } func (p *TGetCrossReferenceReq) IsSetForeignCatalogName() bool { - return p.ForeignCatalogName != nil + return p.ForeignCatalogName != nil } func (p *TGetCrossReferenceReq) IsSetForeignSchemaName() bool { - return p.ForeignSchemaName != nil + return p.ForeignSchemaName != nil } func (p *TGetCrossReferenceReq) IsSetForeignTableName() bool { - return p.ForeignTableName != nil -} - -func (p *TGetCrossReferenceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRING { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TGetCrossReferenceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.ParentCatalogName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TIdentifier(v) - p.ParentSchemaName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TIdentifier(v) - p.ParentTableName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - temp := TIdentifier(v) - p.ForeignCatalogName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - temp := TIdentifier(v) - p.ForeignSchemaName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) -} else { - temp := TIdentifier(v) - p.ForeignTableName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetCrossReferenceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetCrossReferenceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "parentCatalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ParentCatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "parentSchemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ParentSchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentTableName() { - if err := oprot.WriteFieldBegin(ctx, "parentTableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ParentTableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "foreignCatalogName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ForeignCatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "foreignSchemaName", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ForeignSchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignTableName() { - if err := oprot.WriteFieldBegin(ctx, "foreignTableName", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ForeignTableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceReq) Equals(other *TGetCrossReferenceReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.ParentCatalogName != other.ParentCatalogName { - if p.ParentCatalogName == nil || other.ParentCatalogName == nil { - return false - } - if (*p.ParentCatalogName) != (*other.ParentCatalogName) { return false } - } - if p.ParentSchemaName != other.ParentSchemaName { - if p.ParentSchemaName == nil || other.ParentSchemaName == nil { - return false - } - if (*p.ParentSchemaName) != (*other.ParentSchemaName) { return false } - } - if p.ParentTableName != other.ParentTableName { - if p.ParentTableName == nil || other.ParentTableName == nil { - return false - } - if (*p.ParentTableName) != (*other.ParentTableName) { return false } - } - if p.ForeignCatalogName != other.ForeignCatalogName { - if p.ForeignCatalogName == nil || other.ForeignCatalogName == nil { - return false - } - if (*p.ForeignCatalogName) != (*other.ForeignCatalogName) { return false } - } - if p.ForeignSchemaName != other.ForeignSchemaName { - if p.ForeignSchemaName == nil || other.ForeignSchemaName == nil { - return false - } - if (*p.ForeignSchemaName) != (*other.ForeignSchemaName) { return false } - } - if p.ForeignTableName != other.ForeignTableName { - if p.ForeignTableName == nil || other.ForeignTableName == nil { - return false - } - if (*p.ForeignTableName) != (*other.ForeignTableName) { return false } - } - return true + return p.ForeignTableName != nil +} + +func (p *TGetCrossReferenceReq) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + 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) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetCrossReferenceReq) 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 *TGetCrossReferenceReq) 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.ParentCatalogName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TIdentifier(v) + p.ParentSchemaName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TIdentifier(v) + p.ParentTableName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := TIdentifier(v) + p.ForeignCatalogName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + temp := TIdentifier(v) + p.ForeignSchemaName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := TIdentifier(v) + p.ForeignTableName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TGetCrossReferenceReq"); 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 *TGetCrossReferenceReq) 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 *TGetCrossReferenceReq) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetParentCatalogName() { + if err := oprot.WriteFieldBegin("parentCatalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) + } + if err := oprot.WriteString(string(*p.ParentCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) + } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetParentSchemaName() { + if err := oprot.WriteFieldBegin("parentSchemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) + } + if err := oprot.WriteString(string(*p.ParentSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) + } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetParentTableName() { + if err := oprot.WriteFieldBegin("parentTableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) + } + if err := oprot.WriteString(string(*p.ParentTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) + } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetForeignCatalogName() { + if err := oprot.WriteFieldBegin("foreignCatalogName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) + } + if err := oprot.WriteString(string(*p.ForeignCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) + } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetForeignSchemaName() { + if err := oprot.WriteFieldBegin("foreignSchemaName", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) + } + if err := oprot.WriteString(string(*p.ForeignSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) + } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetForeignTableName() { + if err := oprot.WriteFieldBegin("foreignTableName", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) + } + if err := oprot.WriteString(string(*p.ForeignTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) } // Attributes: // - Status // - OperationHandle type TGetCrossReferenceResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` } func NewTGetCrossReferenceResp() *TGetCrossReferenceResp { - return &TGetCrossReferenceResp{} + return &TGetCrossReferenceResp{} } var TGetCrossReferenceResp_Status_DEFAULT *TStatus + func (p *TGetCrossReferenceResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetCrossReferenceResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetCrossReferenceResp_Status_DEFAULT + } + return p.Status } + var TGetCrossReferenceResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetCrossReferenceResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetCrossReferenceResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetCrossReferenceResp_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetCrossReferenceResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetCrossReferenceResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetCrossReferenceResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TGetCrossReferenceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetCrossReferenceResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetCrossReferenceResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetCrossReferenceResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err -} - -func (p *TGetCrossReferenceResp) Equals(other *TGetCrossReferenceResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + return p.OperationHandle != nil +} + +func (p *TGetCrossReferenceResp) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 *TGetCrossReferenceResp) 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 *TGetCrossReferenceResp) 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 *TGetCrossReferenceResp) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TGetCrossReferenceResp"); 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 *TGetCrossReferenceResp) 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 *TGetCrossReferenceResp) 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 *TGetCrossReferenceResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) } // Attributes: // - OperationHandle // - GetProgressUpdate type TGetOperationStatusReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` - GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` } func NewTGetOperationStatusReq() *TGetOperationStatusReq { - return &TGetOperationStatusReq{} + return &TGetOperationStatusReq{} } var TGetOperationStatusReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetOperationStatusReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetOperationStatusReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetOperationStatusReq_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetOperationStatusReq_GetProgressUpdate_DEFAULT bool + func (p *TGetOperationStatusReq) GetGetProgressUpdate() bool { - if !p.IsSetGetProgressUpdate() { - return TGetOperationStatusReq_GetProgressUpdate_DEFAULT - } -return *p.GetProgressUpdate + if !p.IsSetGetProgressUpdate() { + return TGetOperationStatusReq_GetProgressUpdate_DEFAULT + } + return *p.GetProgressUpdate } func (p *TGetOperationStatusReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetOperationStatusReq) IsSetGetProgressUpdate() bool { - return p.GetProgressUpdate != nil -} - -func (p *TGetOperationStatusReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetOperationStatusReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.GetProgressUpdate = &v -} - return nil -} - -func (p *TGetOperationStatusReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetOperationStatusReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err -} - -func (p *TGetOperationStatusReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetProgressUpdate() { - if err := oprot.WriteFieldBegin(ctx, "getProgressUpdate", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.GetProgressUpdate)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusReq) Equals(other *TGetOperationStatusReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if p.GetProgressUpdate != other.GetProgressUpdate { - if p.GetProgressUpdate == nil || other.GetProgressUpdate == nil { - return false - } - if (*p.GetProgressUpdate) != (*other.GetProgressUpdate) { return false } - } - return true + return p.GetProgressUpdate != 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationHandle = true + 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 + } + } + 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) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.GetProgressUpdate = &v + } + 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 := 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 *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) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetGetProgressUpdate() { + if err := oprot.WriteFieldBegin("getProgressUpdate", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) + } + if err := oprot.WriteBool(bool(*p.GetProgressUpdate)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) + } + } + return err } func (p *TGetOperationStatusReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) } // Attributes: @@ -13188,1334 +13585,1353 @@ func (p *TGetOperationStatusReq) String() string { // - ProgressUpdateResponse // - NumModifiedRows 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"` - TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` - OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` - OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` - HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` - ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` - NumModifiedRows *int64 `thrift:"numModifiedRows,11" db:"numModifiedRows" json:"numModifiedRows,omitempty"` + 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"` + TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` + OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` + OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` + HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` + ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` + NumModifiedRows *int64 `thrift:"numModifiedRows,11" db:"numModifiedRows" json:"numModifiedRows,omitempty"` } func NewTGetOperationStatusResp() *TGetOperationStatusResp { - return &TGetOperationStatusResp{} + return &TGetOperationStatusResp{} } var TGetOperationStatusResp_Status_DEFAULT *TStatus + func (p *TGetOperationStatusResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetOperationStatusResp_Status_DEFAULT - } -return p.Status + 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 + 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 + 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 + 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 + if !p.IsSetErrorMessage() { + return TGetOperationStatusResp_ErrorMessage_DEFAULT + } + return *p.ErrorMessage } + var TGetOperationStatusResp_TaskStatus_DEFAULT string + func (p *TGetOperationStatusResp) GetTaskStatus() string { - if !p.IsSetTaskStatus() { - return TGetOperationStatusResp_TaskStatus_DEFAULT - } -return *p.TaskStatus + if !p.IsSetTaskStatus() { + return TGetOperationStatusResp_TaskStatus_DEFAULT + } + return *p.TaskStatus } + var TGetOperationStatusResp_OperationStarted_DEFAULT int64 + func (p *TGetOperationStatusResp) GetOperationStarted() int64 { - if !p.IsSetOperationStarted() { - return TGetOperationStatusResp_OperationStarted_DEFAULT - } -return *p.OperationStarted + if !p.IsSetOperationStarted() { + return TGetOperationStatusResp_OperationStarted_DEFAULT + } + return *p.OperationStarted } + var TGetOperationStatusResp_OperationCompleted_DEFAULT int64 + func (p *TGetOperationStatusResp) GetOperationCompleted() int64 { - if !p.IsSetOperationCompleted() { - return TGetOperationStatusResp_OperationCompleted_DEFAULT - } -return *p.OperationCompleted + if !p.IsSetOperationCompleted() { + return TGetOperationStatusResp_OperationCompleted_DEFAULT + } + return *p.OperationCompleted } + var TGetOperationStatusResp_HasResultSet_DEFAULT bool + func (p *TGetOperationStatusResp) GetHasResultSet() bool { - if !p.IsSetHasResultSet() { - return TGetOperationStatusResp_HasResultSet_DEFAULT - } -return *p.HasResultSet + if !p.IsSetHasResultSet() { + return TGetOperationStatusResp_HasResultSet_DEFAULT + } + return *p.HasResultSet } + var TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT *TProgressUpdateResp + func (p *TGetOperationStatusResp) GetProgressUpdateResponse() *TProgressUpdateResp { - if !p.IsSetProgressUpdateResponse() { - return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT - } -return p.ProgressUpdateResponse + if !p.IsSetProgressUpdateResponse() { + return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT + } + return p.ProgressUpdateResponse } + var TGetOperationStatusResp_NumModifiedRows_DEFAULT int64 + func (p *TGetOperationStatusResp) GetNumModifiedRows() int64 { - if !p.IsSetNumModifiedRows() { - return TGetOperationStatusResp_NumModifiedRows_DEFAULT - } -return *p.NumModifiedRows + if !p.IsSetNumModifiedRows() { + return TGetOperationStatusResp_NumModifiedRows_DEFAULT + } + return *p.NumModifiedRows } func (p *TGetOperationStatusResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetOperationStatusResp) IsSetOperationState() bool { - return p.OperationState != nil + return p.OperationState != nil } func (p *TGetOperationStatusResp) IsSetSqlState() bool { - return p.SqlState != nil + return p.SqlState != nil } func (p *TGetOperationStatusResp) IsSetErrorCode() bool { - return p.ErrorCode != nil + return p.ErrorCode != nil } func (p *TGetOperationStatusResp) IsSetErrorMessage() bool { - return p.ErrorMessage != nil + return p.ErrorMessage != nil } func (p *TGetOperationStatusResp) IsSetTaskStatus() bool { - return p.TaskStatus != nil + return p.TaskStatus != nil } func (p *TGetOperationStatusResp) IsSetOperationStarted() bool { - return p.OperationStarted != nil + return p.OperationStarted != nil } func (p *TGetOperationStatusResp) IsSetOperationCompleted() bool { - return p.OperationCompleted != nil + return p.OperationCompleted != nil } func (p *TGetOperationStatusResp) IsSetHasResultSet() bool { - return p.HasResultSet != nil + return p.HasResultSet != nil } func (p *TGetOperationStatusResp) IsSetProgressUpdateResponse() bool { - return p.ProgressUpdateResponse != nil + return p.ProgressUpdateResponse != nil } func (p *TGetOperationStatusResp) IsSetNumModifiedRows() bool { - return p.NumModifiedRows != nil -} - -func (p *TGetOperationStatusResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.I64 { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.I64 { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 9: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField9(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 10: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField10(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 11: - if fieldTypeId == thrift.I64 { - if err := p.ReadField11(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TOperationState(v) - p.OperationState = &temp -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.SqlState = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ErrorCode = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ErrorMessage = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.TaskStatus = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) -} else { - p.OperationStarted = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 8: ", err) -} else { - p.OperationCompleted = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 9: ", err) -} else { - p.HasResultSet = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { - p.ProgressUpdateResponse = &TProgressUpdateResp{} - if err := p.ProgressUpdateResponse.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 11: ", err) -} else { - p.NumModifiedRows = &v -} - return nil -} - -func (p *TGetOperationStatusResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - if err := p.writeField8(ctx, oprot); err != nil { return err } - if err := p.writeField9(ctx, oprot); err != nil { return err } - if err := p.writeField10(ctx, oprot); err != nil { return err } - if err := p.writeField11(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetOperationStatusResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetOperationStatusResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationState() { - if err := oprot.WriteFieldBegin(ctx, "operationState", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.OperationState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTaskStatus() { - if err := oprot.WriteFieldBegin(ctx, "taskStatus", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TaskStatus)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationStarted() { - if err := oprot.WriteFieldBegin(ctx, "operationStarted", thrift.I64, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.OperationStarted)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationCompleted() { - if err := oprot.WriteFieldBegin(ctx, "operationCompleted", thrift.I64, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.OperationCompleted)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHasResultSet() { - if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.HasResultSet)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetProgressUpdateResponse() { - if err := oprot.WriteFieldBegin(ctx, "progressUpdateResponse", thrift.STRUCT, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) } - if err := p.ProgressUpdateResponse.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetNumModifiedRows() { - if err := oprot.WriteFieldBegin(ctx, "numModifiedRows", thrift.I64, 11); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:numModifiedRows: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.NumModifiedRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.numModifiedRows (11) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 11:numModifiedRows: ", p), err) } - } - return err -} - -func (p *TGetOperationStatusResp) Equals(other *TGetOperationStatusResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.OperationState != other.OperationState { - if p.OperationState == nil || other.OperationState == nil { - return false - } - if (*p.OperationState) != (*other.OperationState) { return false } - } - if p.SqlState != other.SqlState { - if p.SqlState == nil || other.SqlState == nil { - return false - } - if (*p.SqlState) != (*other.SqlState) { return false } - } - if p.ErrorCode != other.ErrorCode { - if p.ErrorCode == nil || other.ErrorCode == nil { - return false - } - if (*p.ErrorCode) != (*other.ErrorCode) { return false } - } - if p.ErrorMessage != other.ErrorMessage { - if p.ErrorMessage == nil || other.ErrorMessage == nil { - return false - } - if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } - } - if p.TaskStatus != other.TaskStatus { - if p.TaskStatus == nil || other.TaskStatus == nil { - return false - } - if (*p.TaskStatus) != (*other.TaskStatus) { return false } - } - if p.OperationStarted != other.OperationStarted { - if p.OperationStarted == nil || other.OperationStarted == nil { - return false - } - if (*p.OperationStarted) != (*other.OperationStarted) { return false } - } - if p.OperationCompleted != other.OperationCompleted { - if p.OperationCompleted == nil || other.OperationCompleted == nil { - return false - } - if (*p.OperationCompleted) != (*other.OperationCompleted) { return false } - } - if p.HasResultSet != other.HasResultSet { - if p.HasResultSet == nil || other.HasResultSet == nil { - return false - } - if (*p.HasResultSet) != (*other.HasResultSet) { return false } - } - if !p.ProgressUpdateResponse.Equals(other.ProgressUpdateResponse) { return false } - if p.NumModifiedRows != other.NumModifiedRows { - if p.NumModifiedRows == nil || other.NumModifiedRows == nil { - return false - } - if (*p.NumModifiedRows) != (*other.NumModifiedRows) { return false } - } - return true + return p.NumModifiedRows != 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I64 { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.I64 { + if err := p.ReadField11(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) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.TaskStatus = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.OperationStarted = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.OperationCompleted = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField9(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.HasResultSet = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField10(iprot thrift.TProtocol) error { + p.ProgressUpdateResponse = &TProgressUpdateResp{} + if err := p.ProgressUpdateResponse.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField11(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 11: ", err) + } else { + p.NumModifiedRows = &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 := 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 := p.writeField9(oprot); err != nil { + return err + } + if err := p.writeField10(oprot); err != nil { + return err + } + if err := p.writeField11(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) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetTaskStatus() { + if err := oprot.WriteFieldBegin("taskStatus", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) + } + if err := oprot.WriteString(string(*p.TaskStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) + } + } + return err +} + +func (p *TGetOperationStatusResp) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetOperationStarted() { + if err := oprot.WriteFieldBegin("operationStarted", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) + } + if err := oprot.WriteI64(int64(*p.OperationStarted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) + } + } + return err +} + +func (p *TGetOperationStatusResp) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetOperationCompleted() { + if err := oprot.WriteFieldBegin("operationCompleted", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) + } + if err := oprot.WriteI64(int64(*p.OperationCompleted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) + } + } + return err +} + +func (p *TGetOperationStatusResp) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetHasResultSet() { + if err := oprot.WriteFieldBegin("hasResultSet", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) + } + if err := oprot.WriteBool(bool(*p.HasResultSet)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) + } + } + return err +} + +func (p *TGetOperationStatusResp) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetProgressUpdateResponse() { + if err := oprot.WriteFieldBegin("progressUpdateResponse", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) + } + if err := p.ProgressUpdateResponse.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) + } + } + return err +} + +func (p *TGetOperationStatusResp) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetNumModifiedRows() { + if err := oprot.WriteFieldBegin("numModifiedRows", thrift.I64, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:numModifiedRows: ", p), err) + } + if err := oprot.WriteI64(int64(*p.NumModifiedRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.numModifiedRows (11) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:numModifiedRows: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) } // Attributes: // - OperationHandle type TCancelOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTCancelOperationReq() *TCancelOperationReq { - return &TCancelOperationReq{} + return &TCancelOperationReq{} } var TCancelOperationReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TCancelOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCancelOperationReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TCancelOperationReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TCancelOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TCancelOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TCancelOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelOperationReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCancelOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err -} - -func (p *TCancelOperationReq) Equals(other *TCancelOperationReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationHandle = true + 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 "" - } - return fmt.Sprintf("TCancelOperationReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelOperationReq(%+v)", *p) } // Attributes: // - Status type TCancelOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCancelOperationResp() *TCancelOperationResp { - return &TCancelOperationResp{} + return &TCancelOperationResp{} } var TCancelOperationResp_Status_DEFAULT *TStatus + func (p *TCancelOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelOperationResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCancelOperationResp_Status_DEFAULT + } + return p.Status } func (p *TCancelOperationResp) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TCancelOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TCancelOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCancelOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TCancelOperationResp) Equals(other *TCancelOperationResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TCancelOperationResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelOperationResp(%+v)", *p) } // Attributes: // - OperationHandle type TCloseOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTCloseOperationReq() *TCloseOperationReq { - return &TCloseOperationReq{} + return &TCloseOperationReq{} } var TCloseOperationReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TCloseOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCloseOperationReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TCloseOperationReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TCloseOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TCloseOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TCloseOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseOperationReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCloseOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err -} - -func (p *TCloseOperationReq) Equals(other *TCloseOperationReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationHandle = true + 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 "" - } - return fmt.Sprintf("TCloseOperationReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseOperationReq(%+v)", *p) } // Attributes: // - Status type TCloseOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCloseOperationResp() *TCloseOperationResp { - return &TCloseOperationResp{} + return &TCloseOperationResp{} } var TCloseOperationResp_Status_DEFAULT *TStatus + func (p *TCloseOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCloseOperationResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCloseOperationResp_Status_DEFAULT + } + return p.Status } func (p *TCloseOperationResp) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TCloseOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TCloseOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCloseOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TCloseOperationResp) Equals(other *TCloseOperationResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TCloseOperationResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseOperationResp(%+v)", *p) } // Attributes: // - OperationHandle type TGetResultSetMetadataReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTGetResultSetMetadataReq() *TGetResultSetMetadataReq { - return &TGetResultSetMetadataReq{} + return &TGetResultSetMetadataReq{} } var TGetResultSetMetadataReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetResultSetMetadataReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetResultSetMetadataReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetResultSetMetadataReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetResultSetMetadataReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetResultSetMetadataReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetResultSetMetadataReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetResultSetMetadataReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err -} - -func (p *TGetResultSetMetadataReq) Equals(other *TGetResultSetMetadataReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationHandle = true + 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 "" - } - return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetResultSetMetadataResp{} } var TGetResultSetMetadataResp_Status_DEFAULT *TStatus + func (p *TGetResultSetMetadataResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetResultSetMetadataResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetSchema() { + return TGetResultSetMetadataResp_Schema_DEFAULT + } + return p.Schema } func (p *TGetResultSetMetadataResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetResultSetMetadataResp) IsSetSchema() bool { - return p.Schema != nil -} - -func (p *TGetResultSetMetadataResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.Schema = &TTableSchema{} - if err := p.Schema.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) - } - return nil -} - -func (p *TGetResultSetMetadataResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetResultSetMetadataResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetResultSetMetadataResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchema() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } - } - return err -} - -func (p *TGetResultSetMetadataResp) Equals(other *TGetResultSetMetadataResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.Schema.Equals(other.Schema) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) } // Attributes: @@ -14524,242 +14940,255 @@ func (p *TGetResultSetMetadataResp) String() string { // - MaxRows // - FetchType 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"` - FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType"` + 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"` + FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType,omitempty"` } func NewTFetchResultsReq() *TFetchResultsReq { - return &TFetchResultsReq{ -Orientation: 0, -} + return &TFetchResultsReq{ + Orientation: 0, + } } var TFetchResultsReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TFetchResultsReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TFetchResultsReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TFetchResultsReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TFetchResultsReq) GetOrientation() TFetchOrientation { - return p.Orientation + return p.Orientation } func (p *TFetchResultsReq) GetMaxRows() int64 { - return p.MaxRows + return p.MaxRows } + var TFetchResultsReq_FetchType_DEFAULT int16 = 0 func (p *TFetchResultsReq) GetFetchType() int16 { - return p.FetchType + return p.FetchType } func (p *TFetchResultsReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TFetchResultsReq) IsSetFetchType() bool { - return p.FetchType != TFetchResultsReq_FetchType_DEFAULT -} - -func (p *TFetchResultsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOrientation = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetMaxRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I16 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TFetchResultsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TFetchOrientation(v) - p.Orientation = temp -} - return nil -} - -func (p *TFetchResultsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.MaxRows = v -} - return nil -} - -func (p *TFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.FetchType = v -} - return nil -} - -func (p *TFetchResultsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TFetchResultsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TFetchResultsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err -} - -func (p *TFetchResultsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "orientation", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Orientation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) } - return err -} - -func (p *TFetchResultsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) } - return err -} - -func (p *TFetchResultsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetFetchType() { - if err := oprot.WriteFieldBegin(ctx, "fetchType", thrift.I16, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) } - if err := oprot.WriteI16(ctx, int16(p.FetchType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) } - } - return err -} - -func (p *TFetchResultsReq) Equals(other *TFetchResultsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if p.Orientation != other.Orientation { return false } - if p.MaxRows != other.MaxRows { return false } - if p.FetchType != other.FetchType { return false } - return true + return p.FetchType != TFetchResultsReq_FetchType_DEFAULT +} + +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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationHandle = true + 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 + } + } + issetOrientation = true + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetMaxRows = true + case 4: + if fieldTypeId == thrift.I16 { + 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 !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) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.FetchType = 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 := 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 *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) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetFetchType() { + if err := oprot.WriteFieldBegin("fetchType", thrift.I16, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) + } + if err := oprot.WriteI16(int16(p.FetchType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) + } + } + return err } func (p *TFetchResultsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TFetchResultsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsReq(%+v)", *p) } // Attributes: @@ -14767,209 +15196,215 @@ func (p *TFetchResultsReq) String() string { // - 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"` + 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{} + return &TFetchResultsResp{} } var TFetchResultsResp_Status_DEFAULT *TStatus + func (p *TFetchResultsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TFetchResultsResp_Status_DEFAULT - } -return p.Status + 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 + 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 + if !p.IsSetResults() { + return TFetchResultsResp_Results_DEFAULT + } + return p.Results } func (p *TFetchResultsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TFetchResultsResp) IsSetHasMoreRows() bool { - return p.HasMoreRows != nil + return p.HasMoreRows != nil } func (p *TFetchResultsResp) IsSetResults() bool { - return p.Results != nil -} - -func (p *TFetchResultsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TFetchResultsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.HasMoreRows = &v -} - return nil -} - -func (p *TFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.Results = &TRowSet{} - if err := p.Results.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) - } - return nil -} - -func (p *TFetchResultsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TFetchResultsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TFetchResultsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TFetchResultsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHasMoreRows() { - if err := oprot.WriteFieldBegin(ctx, "hasMoreRows", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.HasMoreRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) } - } - return err -} - -func (p *TFetchResultsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResults() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) } - } - return err -} - -func (p *TFetchResultsResp) Equals(other *TFetchResultsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.HasMoreRows != other.HasMoreRows { - if p.HasMoreRows == nil || other.HasMoreRows == nil { - return false - } - if (*p.HasMoreRows) != (*other.HasMoreRows) { return false } - } - if !p.Results.Equals(other.Results) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TFetchResultsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsResp(%+v)", *p) } // Attributes: @@ -14977,896 +15412,913 @@ func (p *TFetchResultsResp) String() string { // - 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"` + 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{} + return &TGetDelegationTokenReq{} } var TGetDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetDelegationTokenReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetDelegationTokenReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetDelegationTokenReq) GetOwner() string { - return p.Owner + return p.Owner } func (p *TGetDelegationTokenReq) GetRenewer() string { - return p.Renewer + return p.Renewer } func (p *TGetDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TGetDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOwner = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetRenewer = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Owner = v -} - return nil -} - -func (p *TGetDelegationTokenReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Renewer = v -} - return nil -} - -func (p *TGetDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "owner", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Owner)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) } - return err -} - -func (p *TGetDelegationTokenReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "renewer", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Renewer)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) } - return err -} - -func (p *TGetDelegationTokenReq) Equals(other *TGetDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.Owner != other.Owner { return false } - if p.Renewer != other.Renewer { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + issetOwner = true + 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 + } + } + issetRenewer = true + 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 "" - } - return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TGetDelegationTokenResp{} } var TGetDelegationTokenResp_Status_DEFAULT *TStatus + func (p *TGetDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetDelegationTokenResp_Status_DEFAULT - } -return p.Status + 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 + if !p.IsSetDelegationToken() { + return TGetDelegationTokenResp_DelegationToken_DEFAULT + } + return *p.DelegationToken } func (p *TGetDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetDelegationTokenResp) IsSetDelegationToken() bool { - return p.DelegationToken != nil -} - -func (p *TGetDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetDelegationTokenResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = &v -} - return nil -} - -func (p *TGetDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TGetDelegationTokenResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDelegationToken() { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - } - return err -} - -func (p *TGetDelegationTokenResp) Equals(other *TGetDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.DelegationToken != other.DelegationToken { - if p.DelegationToken == nil || other.DelegationToken == nil { - return false - } - if (*p.DelegationToken) != (*other.DelegationToken) { return false } - } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TCancelDelegationTokenReq{} } var TCancelDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TCancelDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCancelDelegationTokenReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TCancelDelegationTokenReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TCancelDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken + return p.DelegationToken } func (p *TCancelDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TCancelDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDelegationToken = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TCancelDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = v -} - return nil -} - -func (p *TCancelDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCancelDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TCancelDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - return err -} - -func (p *TCancelDelegationTokenReq) Equals(other *TCancelDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.DelegationToken != other.DelegationToken { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + issetDelegationToken = true + 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 "" - } - return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) } // Attributes: // - Status type TCancelDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCancelDelegationTokenResp() *TCancelDelegationTokenResp { - return &TCancelDelegationTokenResp{} + return &TCancelDelegationTokenResp{} } var TCancelDelegationTokenResp_Status_DEFAULT *TStatus + func (p *TCancelDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelDelegationTokenResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCancelDelegationTokenResp_Status_DEFAULT + } + return p.Status } func (p *TCancelDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TCancelDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TCancelDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCancelDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TCancelDelegationTokenResp) Equals(other *TCancelDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + 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"` + 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{} + return &TRenewDelegationTokenReq{} } var TRenewDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TRenewDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TRenewDelegationTokenReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TRenewDelegationTokenReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TRenewDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken + return p.DelegationToken } func (p *TRenewDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil -} - -func (p *TRenewDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); 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(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDelegationToken = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TRenewDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = v -} - return nil -} - -func (p *TRenewDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TRenewDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TRenewDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - return err -} - -func (p *TRenewDelegationTokenReq) Equals(other *TRenewDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.DelegationToken != other.DelegationToken { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetSessionHandle = true + 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 + } + } + issetDelegationToken = true + 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 "" - } - return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) } // Attributes: // - Status type TRenewDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTRenewDelegationTokenResp() *TRenewDelegationTokenResp { - return &TRenewDelegationTokenResp{} + return &TRenewDelegationTokenResp{} } var TRenewDelegationTokenResp_Status_DEFAULT *TStatus + func (p *TRenewDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TRenewDelegationTokenResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TRenewDelegationTokenResp_Status_DEFAULT + } + return p.Status } func (p *TRenewDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TRenewDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TRenewDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TRenewDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TRenewDelegationTokenResp) Equals(other *TRenewDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetStatus = true + 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 "" - } - return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) } // Attributes: @@ -15877,7502 +16329,7130 @@ func (p *TRenewDelegationTokenResp) String() string { // - FooterSummary // - StartTime type TProgressUpdateResp struct { - HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` - Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` - ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` - Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` - FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` - StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` + HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` + Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` + ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` + Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` + FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` + StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` } func NewTProgressUpdateResp() *TProgressUpdateResp { - return &TProgressUpdateResp{} + return &TProgressUpdateResp{} } - func (p *TProgressUpdateResp) GetHeaderNames() []string { - return p.HeaderNames + return p.HeaderNames } func (p *TProgressUpdateResp) GetRows() [][]string { - return p.Rows + return p.Rows } func (p *TProgressUpdateResp) GetProgressedPercentage() float64 { - return p.ProgressedPercentage + return p.ProgressedPercentage } func (p *TProgressUpdateResp) GetStatus() TJobExecutionStatus { - return p.Status + return p.Status } func (p *TProgressUpdateResp) GetFooterSummary() string { - return p.FooterSummary + return p.FooterSummary } func (p *TProgressUpdateResp) GetStartTime() int64 { - return p.StartTime -} -func (p *TProgressUpdateResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetHeaderNames bool = false; - var issetRows bool = false; - var issetProgressedPercentage bool = false; - var issetStatus bool = false; - var issetFooterSummary bool = false; - var issetStartTime bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetHeaderNames = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetProgressedPercentage = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - issetFooterSummary = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - issetStartTime = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetHeaderNames{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")); - } - if !issetRows{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); - } - if !issetProgressedPercentage{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")); - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - if !issetFooterSummary{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")); - } - if !issetStartTime{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")); - } - return nil -} - -func (p *TProgressUpdateResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.HeaderNames = tSlice - for i := 0; i < size; i ++ { -var _elem51 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem51 = v -} - p.HeaderNames = append(p.HeaderNames, _elem51) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]string, 0, size) - p.Rows = tSlice - for i := 0; i < size; i ++ { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - _elem52 := tSlice - for i := 0; i < size; i ++ { -var _elem53 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem53 = v -} - _elem52 = append(_elem52, _elem53) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Rows = append(p.Rows, _elem52) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.ProgressedPercentage = v -} - return nil -} - -func (p *TProgressUpdateResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TJobExecutionStatus(v) - p.Status = temp -} - return nil -} - -func (p *TProgressUpdateResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.FooterSummary = v -} - return nil -} - -func (p *TProgressUpdateResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.StartTime = v -} - return nil -} - -func (p *TProgressUpdateResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TProgressUpdateResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TProgressUpdateResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "headerNames", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.HeaderNames)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.HeaderNames { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:headerNames: ", p), err) } - return err -} - -func (p *TProgressUpdateResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.Rows)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Rows { - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range v { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } - return err -} - -func (p *TProgressUpdateResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "progressedPercentage", thrift.DOUBLE, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.ProgressedPercentage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) } - return err -} - -func (p *TProgressUpdateResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } - return err -} - -func (p *TProgressUpdateResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "footerSummary", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) } - if err := oprot.WriteString(ctx, string(p.FooterSummary)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) } - return err -} - -func (p *TProgressUpdateResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) } - return err -} - -func (p *TProgressUpdateResp) Equals(other *TProgressUpdateResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.HeaderNames) != len(other.HeaderNames) { return false } - for i, _tgt := range p.HeaderNames { - _src54 := other.HeaderNames[i] - if _tgt != _src54 { return false } - } - if len(p.Rows) != len(other.Rows) { return false } - for i, _tgt := range p.Rows { - _src55 := other.Rows[i] - if len(_tgt) != len(_src55) { return false } - for i, _tgt := range _tgt { - _src56 := _src55[i] - if _tgt != _src56 { return false } - } - } - if p.ProgressedPercentage != other.ProgressedPercentage { return false } - if p.Status != other.Status { return false } - if p.FooterSummary != other.FooterSummary { return false } - if p.StartTime != other.StartTime { return false } - return true + return p.StartTime +} +func (p *TProgressUpdateResp) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHeaderNames bool = false + var issetRows bool = false + var issetProgressedPercentage bool = false + var issetStatus bool = false + var issetFooterSummary bool = false + var issetStartTime 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetHeaderNames = true + 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 + } + } + issetRows = true + case 3: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetProgressedPercentage = true + 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 + } + } + issetStatus = true + 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 + } + } + issetFooterSummary = true + 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 + } + } + issetStartTime = true + 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 !issetHeaderNames { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")) + } + if !issetRows { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")) + } + if !issetProgressedPercentage { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + if !issetFooterSummary { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")) + } + if !issetStartTime { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) + } + return nil +} + +func (p *TProgressUpdateResp) 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.HeaderNames = tSlice + for i := 0; i < size; i++ { + var _elem29 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem29 = v + } + p.HeaderNames = append(p.HeaderNames, _elem29) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) 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.Rows = tSlice + for i := 0; i < size; i++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + _elem30 := tSlice + for i := 0; i < size; i++ { + var _elem31 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem31 = v + } + _elem30 = append(_elem30, _elem31) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Rows = append(p.Rows, _elem30) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ProgressedPercentage = v + } + return nil +} + +func (p *TProgressUpdateResp) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TJobExecutionStatus(v) + p.Status = temp + } + return nil +} + +func (p *TProgressUpdateResp) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.FooterSummary = v + } + return nil +} + +func (p *TProgressUpdateResp) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.StartTime = v + } + return nil +} + +func (p *TProgressUpdateResp) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TProgressUpdateResp"); 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 *TProgressUpdateResp) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("headerNames", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.HeaderNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HeaderNames { + 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:headerNames: ", p), err) + } + return err +} + +func (p *TProgressUpdateResp) 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.LIST, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + 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.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 *TProgressUpdateResp) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("progressedPercentage", thrift.DOUBLE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) + } + if err := oprot.WriteDouble(float64(p.ProgressedPercentage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) + } + return err +} + +func (p *TProgressUpdateResp) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err +} + +func (p *TProgressUpdateResp) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("footerSummary", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) + } + if err := oprot.WriteString(string(p.FooterSummary)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) + } + return err +} + +func (p *TProgressUpdateResp) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("startTime", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) + } + if err := oprot.WriteI64(int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) + } + return err } func (p *TProgressUpdateResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) } // Attributes: // - OperationHandle type TGetQueryIdReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTGetQueryIdReq() *TGetQueryIdReq { - return &TGetQueryIdReq{} + return &TGetQueryIdReq{} } var TGetQueryIdReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetQueryIdReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetQueryIdReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetQueryIdReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetQueryIdReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetQueryIdReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); 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 *TGetQueryIdReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetQueryIdReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetQueryIdReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetQueryIdReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err -} - -func (p *TGetQueryIdReq) Equals(other *TGetQueryIdReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + return p.OperationHandle != nil +} + +func (p *TGetQueryIdReq) 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetOperationHandle = true + 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 *TGetQueryIdReq) 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 *TGetQueryIdReq) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TGetQueryIdReq"); 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 *TGetQueryIdReq) 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 *TGetQueryIdReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetQueryIdReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetQueryIdReq(%+v)", *p) } // Attributes: // - QueryId type TGetQueryIdResp struct { - QueryId string `thrift:"queryId,1,required" db:"queryId" json:"queryId"` + QueryId string `thrift:"queryId,1,required" db:"queryId" json:"queryId"` } func NewTGetQueryIdResp() *TGetQueryIdResp { - return &TGetQueryIdResp{} + return &TGetQueryIdResp{} } - func (p *TGetQueryIdResp) GetQueryId() string { - return p.QueryId -} -func (p *TGetQueryIdResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetQueryId bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - issetQueryId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetQueryId{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set")); - } - return nil -} - -func (p *TGetQueryIdResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.QueryId = v -} - return nil -} - -func (p *TGetQueryIdResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetQueryIdResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetQueryIdResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:queryId: ", p), err) } - if err := oprot.WriteString(ctx, string(p.QueryId)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.queryId (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:queryId: ", p), err) } - return err -} - -func (p *TGetQueryIdResp) Equals(other *TGetQueryIdResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.QueryId != other.QueryId { return false } - return true + return p.QueryId +} +func (p *TGetQueryIdResp) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetQueryId 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 + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + issetQueryId = true + 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 !issetQueryId { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set")) + } + return nil +} + +func (p *TGetQueryIdResp) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.QueryId = v + } + return nil +} + +func (p *TGetQueryIdResp) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("TGetQueryIdResp"); 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 *TGetQueryIdResp) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("queryId", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:queryId: ", p), err) + } + if err := oprot.WriteString(string(p.QueryId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.queryId (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:queryId: ", p), err) + } + return err } func (p *TGetQueryIdResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetQueryIdResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetQueryIdResp(%+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 - GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (r *TGetPrimaryKeysResp, err error) - // Parameters: - // - Req - GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (r *TGetCrossReferenceResp, 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 - GetQueryId(ctx context.Context, req *TGetQueryIdReq) (r *TGetQueryIdResp, err error) - // Parameters: - // - Req - SetClientInfo(ctx context.Context, req *TSetClientInfoReq) (r *TSetClientInfoResp, err error) + // 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 + GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (r *TGetPrimaryKeysResp, err error) + // Parameters: + // - Req + GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (r *TGetCrossReferenceResp, 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 + GetQueryId(ctx context.Context, req *TGetQueryIdReq) (r *TGetQueryIdResp, err error) + // Parameters: + // - Req + SetClientInfo(ctx context.Context, req *TSetClientInfoReq) (r *TSetClientInfoResp, err error) } type TCLIServiceClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient } func NewTCLIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + 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), - } + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewTCLIServiceClient(c thrift.TClient) *TCLIServiceClient { - return &TCLIServiceClient{ - c: c, - } + return &TCLIServiceClient{ + c: c, + } } func (p *TCLIServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *TCLIServiceClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta -} - -func (p *TCLIServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + return p.c } // Parameters: // - Req func (p *TCLIServiceClient) OpenSession(ctx context.Context, req *TOpenSessionReq) (r *TOpenSessionResp, err error) { - var _args57 TCLIServiceOpenSessionArgs - _args57.Req = req - var _result58 TCLIServiceOpenSessionResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "OpenSession", &_args57, &_result58) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result58.GetSuccess(), nil + var _args32 TCLIServiceOpenSessionArgs + _args32.Req = req + var _result33 TCLIServiceOpenSessionResult + if err = p.Client_().Call(ctx, "OpenSession", &_args32, &_result33); err != nil { + return + } + return _result33.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) CloseSession(ctx context.Context, req *TCloseSessionReq) (r *TCloseSessionResp, err error) { - var _args59 TCLIServiceCloseSessionArgs - _args59.Req = req - var _result60 TCLIServiceCloseSessionResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "CloseSession", &_args59, &_result60) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result60.GetSuccess(), nil + var _args34 TCLIServiceCloseSessionArgs + _args34.Req = req + var _result35 TCLIServiceCloseSessionResult + if err = p.Client_().Call(ctx, "CloseSession", &_args34, &_result35); err != nil { + return + } + return _result35.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetInfo(ctx context.Context, req *TGetInfoReq) (r *TGetInfoResp, err error) { - var _args61 TCLIServiceGetInfoArgs - _args61.Req = req - var _result62 TCLIServiceGetInfoResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetInfo", &_args61, &_result62) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result62.GetSuccess(), nil + var _args36 TCLIServiceGetInfoArgs + _args36.Req = req + var _result37 TCLIServiceGetInfoResult + if err = p.Client_().Call(ctx, "GetInfo", &_args36, &_result37); err != nil { + return + } + return _result37.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (r *TExecuteStatementResp, err error) { - var _args63 TCLIServiceExecuteStatementArgs - _args63.Req = req - var _result64 TCLIServiceExecuteStatementResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "ExecuteStatement", &_args63, &_result64) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result64.GetSuccess(), nil + var _args38 TCLIServiceExecuteStatementArgs + _args38.Req = req + var _result39 TCLIServiceExecuteStatementResult + if err = p.Client_().Call(ctx, "ExecuteStatement", &_args38, &_result39); err != nil { + return + } + return _result39.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (r *TGetTypeInfoResp, err error) { - var _args65 TCLIServiceGetTypeInfoArgs - _args65.Req = req - var _result66 TCLIServiceGetTypeInfoResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetTypeInfo", &_args65, &_result66) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result66.GetSuccess(), nil + var _args40 TCLIServiceGetTypeInfoArgs + _args40.Req = req + var _result41 TCLIServiceGetTypeInfoResult + if err = p.Client_().Call(ctx, "GetTypeInfo", &_args40, &_result41); err != nil { + return + } + return _result41.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (r *TGetCatalogsResp, err error) { - var _args67 TCLIServiceGetCatalogsArgs - _args67.Req = req - var _result68 TCLIServiceGetCatalogsResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetCatalogs", &_args67, &_result68) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result68.GetSuccess(), nil + var _args42 TCLIServiceGetCatalogsArgs + _args42.Req = req + var _result43 TCLIServiceGetCatalogsResult + if err = p.Client_().Call(ctx, "GetCatalogs", &_args42, &_result43); err != nil { + return + } + return _result43.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetSchemas(ctx context.Context, req *TGetSchemasReq) (r *TGetSchemasResp, err error) { - var _args69 TCLIServiceGetSchemasArgs - _args69.Req = req - var _result70 TCLIServiceGetSchemasResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetSchemas", &_args69, &_result70) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result70.GetSuccess(), nil + var _args44 TCLIServiceGetSchemasArgs + _args44.Req = req + var _result45 TCLIServiceGetSchemasResult + if err = p.Client_().Call(ctx, "GetSchemas", &_args44, &_result45); err != nil { + return + } + return _result45.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetTables(ctx context.Context, req *TGetTablesReq) (r *TGetTablesResp, err error) { - var _args71 TCLIServiceGetTablesArgs - _args71.Req = req - var _result72 TCLIServiceGetTablesResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetTables", &_args71, &_result72) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result72.GetSuccess(), nil + var _args46 TCLIServiceGetTablesArgs + _args46.Req = req + var _result47 TCLIServiceGetTablesResult + if err = p.Client_().Call(ctx, "GetTables", &_args46, &_result47); err != nil { + return + } + return _result47.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (r *TGetTableTypesResp, err error) { - var _args73 TCLIServiceGetTableTypesArgs - _args73.Req = req - var _result74 TCLIServiceGetTableTypesResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetTableTypes", &_args73, &_result74) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result74.GetSuccess(), nil + var _args48 TCLIServiceGetTableTypesArgs + _args48.Req = req + var _result49 TCLIServiceGetTableTypesResult + if err = p.Client_().Call(ctx, "GetTableTypes", &_args48, &_result49); err != nil { + return + } + return _result49.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetColumns(ctx context.Context, req *TGetColumnsReq) (r *TGetColumnsResp, err error) { - var _args75 TCLIServiceGetColumnsArgs - _args75.Req = req - var _result76 TCLIServiceGetColumnsResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetColumns", &_args75, &_result76) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result76.GetSuccess(), nil + var _args50 TCLIServiceGetColumnsArgs + _args50.Req = req + var _result51 TCLIServiceGetColumnsResult + if err = p.Client_().Call(ctx, "GetColumns", &_args50, &_result51); err != nil { + return + } + return _result51.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetFunctions(ctx context.Context, req *TGetFunctionsReq) (r *TGetFunctionsResp, err error) { - var _args77 TCLIServiceGetFunctionsArgs - _args77.Req = req - var _result78 TCLIServiceGetFunctionsResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetFunctions", &_args77, &_result78) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result78.GetSuccess(), nil + var _args52 TCLIServiceGetFunctionsArgs + _args52.Req = req + var _result53 TCLIServiceGetFunctionsResult + if err = p.Client_().Call(ctx, "GetFunctions", &_args52, &_result53); err != nil { + return + } + return _result53.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (r *TGetPrimaryKeysResp, err error) { - var _args79 TCLIServiceGetPrimaryKeysArgs - _args79.Req = req - var _result80 TCLIServiceGetPrimaryKeysResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args79, &_result80) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result80.GetSuccess(), nil + var _args54 TCLIServiceGetPrimaryKeysArgs + _args54.Req = req + var _result55 TCLIServiceGetPrimaryKeysResult + if err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args54, &_result55); err != nil { + return + } + return _result55.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (r *TGetCrossReferenceResp, err error) { - var _args81 TCLIServiceGetCrossReferenceArgs - _args81.Req = req - var _result82 TCLIServiceGetCrossReferenceResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetCrossReference", &_args81, &_result82) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result82.GetSuccess(), nil + var _args56 TCLIServiceGetCrossReferenceArgs + _args56.Req = req + var _result57 TCLIServiceGetCrossReferenceResult + if err = p.Client_().Call(ctx, "GetCrossReference", &_args56, &_result57); err != nil { + return + } + return _result57.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (r *TGetOperationStatusResp, err error) { - var _args83 TCLIServiceGetOperationStatusArgs - _args83.Req = req - var _result84 TCLIServiceGetOperationStatusResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetOperationStatus", &_args83, &_result84) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result84.GetSuccess(), nil + var _args58 TCLIServiceGetOperationStatusArgs + _args58.Req = req + var _result59 TCLIServiceGetOperationStatusResult + if err = p.Client_().Call(ctx, "GetOperationStatus", &_args58, &_result59); err != nil { + return + } + return _result59.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) CancelOperation(ctx context.Context, req *TCancelOperationReq) (r *TCancelOperationResp, err error) { - var _args85 TCLIServiceCancelOperationArgs - _args85.Req = req - var _result86 TCLIServiceCancelOperationResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "CancelOperation", &_args85, &_result86) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result86.GetSuccess(), nil + var _args60 TCLIServiceCancelOperationArgs + _args60.Req = req + var _result61 TCLIServiceCancelOperationResult + if err = p.Client_().Call(ctx, "CancelOperation", &_args60, &_result61); err != nil { + return + } + return _result61.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) CloseOperation(ctx context.Context, req *TCloseOperationReq) (r *TCloseOperationResp, err error) { - var _args87 TCLIServiceCloseOperationArgs - _args87.Req = req - var _result88 TCLIServiceCloseOperationResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "CloseOperation", &_args87, &_result88) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result88.GetSuccess(), nil + var _args62 TCLIServiceCloseOperationArgs + _args62.Req = req + var _result63 TCLIServiceCloseOperationResult + if err = p.Client_().Call(ctx, "CloseOperation", &_args62, &_result63); err != nil { + return + } + return _result63.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (r *TGetResultSetMetadataResp, err error) { - var _args89 TCLIServiceGetResultSetMetadataArgs - _args89.Req = req - var _result90 TCLIServiceGetResultSetMetadataResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args89, &_result90) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result90.GetSuccess(), nil + var _args64 TCLIServiceGetResultSetMetadataArgs + _args64.Req = req + var _result65 TCLIServiceGetResultSetMetadataResult + if err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args64, &_result65); err != nil { + return + } + return _result65.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) FetchResults(ctx context.Context, req *TFetchResultsReq) (r *TFetchResultsResp, err error) { - var _args91 TCLIServiceFetchResultsArgs - _args91.Req = req - var _result92 TCLIServiceFetchResultsResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "FetchResults", &_args91, &_result92) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result92.GetSuccess(), nil + var _args66 TCLIServiceFetchResultsArgs + _args66.Req = req + var _result67 TCLIServiceFetchResultsResult + if err = p.Client_().Call(ctx, "FetchResults", &_args66, &_result67); err != nil { + return + } + return _result67.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (r *TGetDelegationTokenResp, err error) { - var _args93 TCLIServiceGetDelegationTokenArgs - _args93.Req = req - var _result94 TCLIServiceGetDelegationTokenResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetDelegationToken", &_args93, &_result94) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result94.GetSuccess(), nil + var _args68 TCLIServiceGetDelegationTokenArgs + _args68.Req = req + var _result69 TCLIServiceGetDelegationTokenResult + if err = p.Client_().Call(ctx, "GetDelegationToken", &_args68, &_result69); err != nil { + return + } + return _result69.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (r *TCancelDelegationTokenResp, err error) { - var _args95 TCLIServiceCancelDelegationTokenArgs - _args95.Req = req - var _result96 TCLIServiceCancelDelegationTokenResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "CancelDelegationToken", &_args95, &_result96) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result96.GetSuccess(), nil + var _args70 TCLIServiceCancelDelegationTokenArgs + _args70.Req = req + var _result71 TCLIServiceCancelDelegationTokenResult + if err = p.Client_().Call(ctx, "CancelDelegationToken", &_args70, &_result71); err != nil { + return + } + return _result71.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (r *TRenewDelegationTokenResp, err error) { - var _args97 TCLIServiceRenewDelegationTokenArgs - _args97.Req = req - var _result98 TCLIServiceRenewDelegationTokenResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "RenewDelegationToken", &_args97, &_result98) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result98.GetSuccess(), nil + var _args72 TCLIServiceRenewDelegationTokenArgs + _args72.Req = req + var _result73 TCLIServiceRenewDelegationTokenResult + if err = p.Client_().Call(ctx, "RenewDelegationToken", &_args72, &_result73); err != nil { + return + } + return _result73.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) GetQueryId(ctx context.Context, req *TGetQueryIdReq) (r *TGetQueryIdResp, err error) { - var _args99 TCLIServiceGetQueryIdArgs - _args99.Req = req - var _result100 TCLIServiceGetQueryIdResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "GetQueryId", &_args99, &_result100) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result100.GetSuccess(), nil + var _args74 TCLIServiceGetQueryIdArgs + _args74.Req = req + var _result75 TCLIServiceGetQueryIdResult + if err = p.Client_().Call(ctx, "GetQueryId", &_args74, &_result75); err != nil { + return + } + return _result75.GetSuccess(), nil } // Parameters: // - Req func (p *TCLIServiceClient) SetClientInfo(ctx context.Context, req *TSetClientInfoReq) (r *TSetClientInfoResp, err error) { - var _args101 TCLIServiceSetClientInfoArgs - _args101.Req = req - var _result102 TCLIServiceSetClientInfoResult - var meta thrift.ResponseMeta - meta, err = p.Client_().Call(ctx, "SetClientInfo", &_args101, &_result102) - p.SetLastResponseMeta_(meta) - if err != nil { - return - } - return _result102.GetSuccess(), nil + var _args76 TCLIServiceSetClientInfoArgs + _args76.Req = req + var _result77 TCLIServiceSetClientInfoResult + if err = p.Client_().Call(ctx, "SetClientInfo", &_args76, &_result77); err != nil { + return + } + return _result77.GetSuccess(), nil } type TCLIServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler TCLIService + processorMap map[string]thrift.TProcessorFunction + handler TCLIService } func (p *TCLIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *TCLIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *TCLIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewTCLIServiceProcessor(handler TCLIService) *TCLIServiceProcessor { - self103 := &TCLIServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self103.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler:handler} - self103.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler:handler} - self103.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler:handler} - self103.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler:handler} - self103.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler:handler} - self103.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler:handler} - self103.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler:handler} - self103.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler:handler} - self103.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler:handler} - self103.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler:handler} - self103.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler:handler} - self103.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler:handler} - self103.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler:handler} - self103.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler:handler} - self103.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler:handler} - self103.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler:handler} - self103.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler:handler} - self103.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler:handler} - self103.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler:handler} - self103.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler:handler} - self103.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler:handler} - self103.processorMap["GetQueryId"] = &tCLIServiceProcessorGetQueryId{handler:handler} - self103.processorMap["SetClientInfo"] = &tCLIServiceProcessorSetClientInfo{handler:handler} -return self103 + self78 := &TCLIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self78.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler: handler} + self78.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler: handler} + self78.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler: handler} + self78.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler: handler} + self78.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler: handler} + self78.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler: handler} + self78.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler: handler} + self78.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler: handler} + self78.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler: handler} + self78.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler: handler} + self78.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler: handler} + self78.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler: handler} + self78.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler: handler} + self78.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler: handler} + self78.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler: handler} + self78.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler: handler} + self78.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler: handler} + self78.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler: handler} + self78.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler: handler} + self78.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler: handler} + self78.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler: handler} + self78.processorMap["GetQueryId"] = &tCLIServiceProcessorGetQueryId{handler: handler} + self78.processorMap["SetClientInfo"] = &tCLIServiceProcessorSetClientInfo{handler: handler} + return self78 } func (p *TCLIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x104 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x104.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x104 + 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() + x79 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x79.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x79 } type tCLIServiceProcessorOpenSession struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceOpenSessionArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceOpenSessionResult{} - var retval *TOpenSessionResp - if retval, err2 = p.handler.OpenSession(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "OpenSession", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCloseSessionArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCloseSessionResult{} - var retval *TCloseSessionResp - if retval, err2 = p.handler.CloseSession(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "CloseSession", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetInfoArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetInfoResult{} - var retval *TGetInfoResp - if retval, err2 = p.handler.GetInfo(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetInfo", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceExecuteStatementArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceExecuteStatementResult{} - var retval *TExecuteStatementResp - if retval, err2 = p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetTypeInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetTypeInfoArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTypeInfoResult{} - var retval *TGetTypeInfoResp - if retval, err2 = p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetCatalogs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetCatalogsArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetCatalogsResult{} - var retval *TGetCatalogsResp - if retval, err2 = p.handler.GetCatalogs(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetSchemas) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetSchemasArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetSchemasResult{} - var retval *TGetSchemasResp - if retval, err2 = p.handler.GetSchemas(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetTablesArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTablesResult{} - var retval *TGetTablesResp - if retval, err2 = p.handler.GetTables(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetTables", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetTableTypes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetTableTypesArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTableTypesResult{} - var retval *TGetTableTypesResp - if retval, err2 = p.handler.GetTableTypes(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetColumnsArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetColumnsResult{} - var retval *TGetColumnsResp - if retval, err2 = p.handler.GetColumns(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetColumns", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetFunctions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetFunctionsArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetFunctionsResult{} - var retval *TGetFunctionsResp - if retval, err2 = p.handler.GetFunctions(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 tCLIServiceProcessorGetPrimaryKeys struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetPrimaryKeys) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetPrimaryKeysArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetPrimaryKeysResult{} - var retval *TGetPrimaryKeysResp - if retval, err2 = p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := TCLIServiceGetPrimaryKeysArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetPrimaryKeys", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := TCLIServiceGetPrimaryKeysResult{} + var retval *TGetPrimaryKeysResp + var err2 error + if retval, err2 = p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: "+err2.Error()) + oprot.WriteMessageBegin("GetPrimaryKeys", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetPrimaryKeys", 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 tCLIServiceProcessorGetCrossReference struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetCrossReference) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetCrossReferenceArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetCrossReferenceResult{} - var retval *TGetCrossReferenceResp - if retval, err2 = p.handler.GetCrossReference(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := TCLIServiceGetCrossReferenceArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetCrossReference", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := TCLIServiceGetCrossReferenceResult{} + var retval *TGetCrossReferenceResp + var err2 error + if retval, err2 = p.handler.GetCrossReference(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: "+err2.Error()) + oprot.WriteMessageBegin("GetCrossReference", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetCrossReference", 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 + handler TCLIService } func (p *tCLIServiceProcessorGetOperationStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetOperationStatusArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetOperationStatusResult{} - var retval *TGetOperationStatusResp - if retval, err2 = p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCancelOperationArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCancelOperationResult{} - var retval *TCancelOperationResp - if retval, err2 = p.handler.CancelOperation(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCloseOperationArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCloseOperationResult{} - var retval *TCloseOperationResp - if retval, err2 = p.handler.CloseOperation(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetResultSetMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetResultSetMetadataArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetResultSetMetadataResult{} - var retval *TGetResultSetMetadataResp - if retval, err2 = p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceFetchResultsArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceFetchResultsResult{} - var retval *TFetchResultsResp - if retval, err2 = p.handler.FetchResults(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "FetchResults", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetDelegationTokenArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetDelegationTokenResult{} - var retval *TGetDelegationTokenResp - if retval, err2 = p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCancelDelegationTokenArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCancelDelegationTokenResult{} - var retval *TCancelDelegationTokenResp - if retval, err2 = p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 + handler TCLIService } func (p *tCLIServiceProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceRenewDelegationTokenArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceRenewDelegationTokenResult{} - var retval *TRenewDelegationTokenResp - if retval, err2 = p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + 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 tCLIServiceProcessorGetQueryId struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetQueryId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetQueryIdArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetQueryId", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetQueryIdResult{} - var retval *TGetQueryIdResp - if retval, err2 = p.handler.GetQueryId(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetQueryId: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "GetQueryId", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "GetQueryId", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := TCLIServiceGetQueryIdArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetQueryId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := TCLIServiceGetQueryIdResult{} + var retval *TGetQueryIdResp + var err2 error + if retval, err2 = p.handler.GetQueryId(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetQueryId: "+err2.Error()) + oprot.WriteMessageBegin("GetQueryId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetQueryId", 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 tCLIServiceProcessorSetClientInfo struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorSetClientInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceSetClientInfoArgs{} - var err2 error - if err2 = args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "SetClientInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel() - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceSetClientInfoResult{} - var retval *TSetClientInfoResp - if retval, err2 = p.handler.SetClientInfo(ctx, args.Req); err2 != nil { - tickerCancel() - if err2 == thrift.ErrAbandonRequest { - return false, thrift.WrapTException(err2) - } - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetClientInfo: " + err2.Error()) - oprot.WriteMessageBegin(ctx, "SetClientInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return true, thrift.WrapTException(err2) - } else { - result.Success = retval - } - tickerCancel() - if err2 = oprot.WriteMessageBegin(ctx, "SetClientInfo", thrift.REPLY, seqId); err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = thrift.WrapTException(err2) - } - if err != nil { - return - } - return true, err + args := TCLIServiceSetClientInfoArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("SetClientInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := TCLIServiceSetClientInfoResult{} + var retval *TSetClientInfoResp + var err2 error + if retval, err2 = p.handler.SetClientInfo(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetClientInfo: "+err2.Error()) + oprot.WriteMessageBegin("SetClientInfo", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("SetClientInfo", 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"` + Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceOpenSessionArgs() *TCLIServiceOpenSessionArgs { - return &TCLIServiceOpenSessionArgs{} + return &TCLIServiceOpenSessionArgs{} } var TCLIServiceOpenSessionArgs_Req_DEFAULT *TOpenSessionReq + func (p *TCLIServiceOpenSessionArgs) GetReq() *TOpenSessionReq { - if !p.IsSetReq() { - return TCLIServiceOpenSessionArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceOpenSessionArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceOpenSessionArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceOpenSessionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TOpenSessionReq{ - ClientProtocol: 9, -} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OpenSession_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceOpenSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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: 9, + } + 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 "" - } - return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceOpenSessionResult struct { - Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceOpenSessionResult() *TCLIServiceOpenSessionResult { - return &TCLIServiceOpenSessionResult{} + return &TCLIServiceOpenSessionResult{} } var TCLIServiceOpenSessionResult_Success_DEFAULT *TOpenSessionResp + func (p *TCLIServiceOpenSessionResult) GetSuccess() *TOpenSessionResp { - if !p.IsSetSuccess() { - return TCLIServiceOpenSessionResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceOpenSessionResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceOpenSessionResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceOpenSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TOpenSessionResp{ - ServerProtocolVersion: 9, -} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OpenSession_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceOpenSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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: 9, + } + 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 "" - } - return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceCloseSessionArgs struct { - Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` + Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCloseSessionArgs() *TCLIServiceCloseSessionArgs { - return &TCLIServiceCloseSessionArgs{} + return &TCLIServiceCloseSessionArgs{} } var TCLIServiceCloseSessionArgs_Req_DEFAULT *TCloseSessionReq + func (p *TCLIServiceCloseSessionArgs) GetReq() *TCloseSessionReq { - if !p.IsSetReq() { - return TCLIServiceCloseSessionArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCloseSessionArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCloseSessionArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceCloseSessionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCloseSessionReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseSession_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCloseSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceCloseSessionResult struct { - Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCloseSessionResult() *TCLIServiceCloseSessionResult { - return &TCLIServiceCloseSessionResult{} + return &TCLIServiceCloseSessionResult{} } var TCLIServiceCloseSessionResult_Success_DEFAULT *TCloseSessionResp + func (p *TCLIServiceCloseSessionResult) GetSuccess() *TCloseSessionResp { - if !p.IsSetSuccess() { - return TCLIServiceCloseSessionResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCloseSessionResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCloseSessionResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceCloseSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCloseSessionResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseSession_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCloseSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetInfoArgs struct { - Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetInfoArgs() *TCLIServiceGetInfoArgs { - return &TCLIServiceGetInfoArgs{} + return &TCLIServiceGetInfoArgs{} } var TCLIServiceGetInfoArgs_Req_DEFAULT *TGetInfoReq + func (p *TCLIServiceGetInfoArgs) GetReq() *TGetInfoReq { - if !p.IsSetReq() { - return TCLIServiceGetInfoArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetInfoArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetInfoArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetInfoResult struct { - Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetInfoResult() *TCLIServiceGetInfoResult { - return &TCLIServiceGetInfoResult{} + return &TCLIServiceGetInfoResult{} } var TCLIServiceGetInfoResult_Success_DEFAULT *TGetInfoResp + func (p *TCLIServiceGetInfoResult) GetSuccess() *TGetInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceGetInfoResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetInfoResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetInfoResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceExecuteStatementArgs struct { - Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` + Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceExecuteStatementArgs() *TCLIServiceExecuteStatementArgs { - return &TCLIServiceExecuteStatementArgs{} + return &TCLIServiceExecuteStatementArgs{} } var TCLIServiceExecuteStatementArgs_Req_DEFAULT *TExecuteStatementReq + func (p *TCLIServiceExecuteStatementArgs) GetReq() *TExecuteStatementReq { - if !p.IsSetReq() { - return TCLIServiceExecuteStatementArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceExecuteStatementArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceExecuteStatementArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceExecuteStatementArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TExecuteStatementReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceExecuteStatementArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceExecuteStatementResult struct { - Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceExecuteStatementResult() *TCLIServiceExecuteStatementResult { - return &TCLIServiceExecuteStatementResult{} + return &TCLIServiceExecuteStatementResult{} } var TCLIServiceExecuteStatementResult_Success_DEFAULT *TExecuteStatementResp + func (p *TCLIServiceExecuteStatementResult) GetSuccess() *TExecuteStatementResp { - if !p.IsSetSuccess() { - return TCLIServiceExecuteStatementResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceExecuteStatementResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceExecuteStatementResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceExecuteStatementResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TExecuteStatementResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceExecuteStatementResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetTypeInfoArgs struct { - Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTypeInfoArgs() *TCLIServiceGetTypeInfoArgs { - return &TCLIServiceGetTypeInfoArgs{} + return &TCLIServiceGetTypeInfoArgs{} } var TCLIServiceGetTypeInfoArgs_Req_DEFAULT *TGetTypeInfoReq + func (p *TCLIServiceGetTypeInfoArgs) GetReq() *TGetTypeInfoReq { - if !p.IsSetReq() { - return TCLIServiceGetTypeInfoArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTypeInfoArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetTypeInfoArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetTypeInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTypeInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetTypeInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetTypeInfoResult struct { - Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTypeInfoResult() *TCLIServiceGetTypeInfoResult { - return &TCLIServiceGetTypeInfoResult{} + return &TCLIServiceGetTypeInfoResult{} } var TCLIServiceGetTypeInfoResult_Success_DEFAULT *TGetTypeInfoResp + func (p *TCLIServiceGetTypeInfoResult) GetSuccess() *TGetTypeInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTypeInfoResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTypeInfoResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetTypeInfoResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetTypeInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTypeInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetTypeInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetCatalogsArgs struct { - Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetCatalogsArgs() *TCLIServiceGetCatalogsArgs { - return &TCLIServiceGetCatalogsArgs{} + return &TCLIServiceGetCatalogsArgs{} } var TCLIServiceGetCatalogsArgs_Req_DEFAULT *TGetCatalogsReq + func (p *TCLIServiceGetCatalogsArgs) GetReq() *TGetCatalogsReq { - if !p.IsSetReq() { - return TCLIServiceGetCatalogsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetCatalogsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetCatalogsArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetCatalogsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetCatalogsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCatalogs_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetCatalogsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetCatalogsResult struct { - Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetCatalogsResult() *TCLIServiceGetCatalogsResult { - return &TCLIServiceGetCatalogsResult{} + return &TCLIServiceGetCatalogsResult{} } var TCLIServiceGetCatalogsResult_Success_DEFAULT *TGetCatalogsResp + func (p *TCLIServiceGetCatalogsResult) GetSuccess() *TGetCatalogsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetCatalogsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetCatalogsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetCatalogsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetCatalogsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetCatalogsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCatalogs_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetCatalogsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetSchemasArgs struct { - Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetSchemasArgs() *TCLIServiceGetSchemasArgs { - return &TCLIServiceGetSchemasArgs{} + return &TCLIServiceGetSchemasArgs{} } var TCLIServiceGetSchemasArgs_Req_DEFAULT *TGetSchemasReq + func (p *TCLIServiceGetSchemasArgs) GetReq() *TGetSchemasReq { - if !p.IsSetReq() { - return TCLIServiceGetSchemasArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetSchemasArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetSchemasArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetSchemasArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetSchemasReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetSchemas_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetSchemasArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetSchemasResult struct { - Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetSchemasResult() *TCLIServiceGetSchemasResult { - return &TCLIServiceGetSchemasResult{} + return &TCLIServiceGetSchemasResult{} } var TCLIServiceGetSchemasResult_Success_DEFAULT *TGetSchemasResp + func (p *TCLIServiceGetSchemasResult) GetSuccess() *TGetSchemasResp { - if !p.IsSetSuccess() { - return TCLIServiceGetSchemasResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetSchemasResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetSchemasResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetSchemasResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetSchemasResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetSchemas_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetSchemasResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetTablesArgs struct { - Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTablesArgs() *TCLIServiceGetTablesArgs { - return &TCLIServiceGetTablesArgs{} + return &TCLIServiceGetTablesArgs{} } var TCLIServiceGetTablesArgs_Req_DEFAULT *TGetTablesReq + func (p *TCLIServiceGetTablesArgs) GetReq() *TGetTablesReq { - if !p.IsSetReq() { - return TCLIServiceGetTablesArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTablesArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetTablesArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetTablesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTablesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTablesReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetTablesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTables_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetTablesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetTablesResult struct { - Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTablesResult() *TCLIServiceGetTablesResult { - return &TCLIServiceGetTablesResult{} + return &TCLIServiceGetTablesResult{} } var TCLIServiceGetTablesResult_Success_DEFAULT *TGetTablesResp + func (p *TCLIServiceGetTablesResult) GetSuccess() *TGetTablesResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTablesResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTablesResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetTablesResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetTablesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTablesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTablesResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetTablesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTables_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetTablesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetTableTypesArgs struct { - Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTableTypesArgs() *TCLIServiceGetTableTypesArgs { - return &TCLIServiceGetTableTypesArgs{} + return &TCLIServiceGetTableTypesArgs{} } var TCLIServiceGetTableTypesArgs_Req_DEFAULT *TGetTableTypesReq + func (p *TCLIServiceGetTableTypesArgs) GetReq() *TGetTableTypesReq { - if !p.IsSetReq() { - return TCLIServiceGetTableTypesArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTableTypesArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetTableTypesArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetTableTypesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTableTypesReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTableTypes_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetTableTypesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetTableTypesResult struct { - Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTableTypesResult() *TCLIServiceGetTableTypesResult { - return &TCLIServiceGetTableTypesResult{} + return &TCLIServiceGetTableTypesResult{} } var TCLIServiceGetTableTypesResult_Success_DEFAULT *TGetTableTypesResp + func (p *TCLIServiceGetTableTypesResult) GetSuccess() *TGetTableTypesResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTableTypesResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTableTypesResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetTableTypesResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetTableTypesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTableTypesResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTableTypes_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetTableTypesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetColumnsArgs struct { - Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetColumnsArgs() *TCLIServiceGetColumnsArgs { - return &TCLIServiceGetColumnsArgs{} + return &TCLIServiceGetColumnsArgs{} } var TCLIServiceGetColumnsArgs_Req_DEFAULT *TGetColumnsReq + func (p *TCLIServiceGetColumnsArgs) GetReq() *TGetColumnsReq { - if !p.IsSetReq() { - return TCLIServiceGetColumnsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetColumnsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetColumnsArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetColumnsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetColumnsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetColumns_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetColumnsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetColumnsResult struct { - Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetColumnsResult() *TCLIServiceGetColumnsResult { - return &TCLIServiceGetColumnsResult{} + return &TCLIServiceGetColumnsResult{} } var TCLIServiceGetColumnsResult_Success_DEFAULT *TGetColumnsResp + func (p *TCLIServiceGetColumnsResult) GetSuccess() *TGetColumnsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetColumnsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetColumnsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetColumnsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetColumnsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetColumnsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetColumns_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetColumnsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetFunctionsArgs struct { - Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetFunctionsArgs() *TCLIServiceGetFunctionsArgs { - return &TCLIServiceGetFunctionsArgs{} + return &TCLIServiceGetFunctionsArgs{} } var TCLIServiceGetFunctionsArgs_Req_DEFAULT *TGetFunctionsReq + func (p *TCLIServiceGetFunctionsArgs) GetReq() *TGetFunctionsReq { - if !p.IsSetReq() { - return TCLIServiceGetFunctionsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetFunctionsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetFunctionsArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetFunctionsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetFunctionsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetFunctions_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetFunctionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetFunctionsResult struct { - Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetFunctionsResult() *TCLIServiceGetFunctionsResult { - return &TCLIServiceGetFunctionsResult{} + return &TCLIServiceGetFunctionsResult{} } var TCLIServiceGetFunctionsResult_Success_DEFAULT *TGetFunctionsResp + func (p *TCLIServiceGetFunctionsResult) GetSuccess() *TGetFunctionsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetFunctionsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetFunctionsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetFunctionsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetFunctionsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetFunctionsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetFunctions_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetFunctionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetPrimaryKeysArgs struct { - Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetPrimaryKeysArgs() *TCLIServiceGetPrimaryKeysArgs { - return &TCLIServiceGetPrimaryKeysArgs{} + return &TCLIServiceGetPrimaryKeysArgs{} } var TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT *TGetPrimaryKeysReq + func (p *TCLIServiceGetPrimaryKeysArgs) GetReq() *TGetPrimaryKeysReq { - if !p.IsSetReq() { - return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetPrimaryKeysArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetPrimaryKeysArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetPrimaryKeysReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + return p.Req != nil +} + +func (p *TCLIServiceGetPrimaryKeysArgs) 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 *TCLIServiceGetPrimaryKeysArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &TGetPrimaryKeysReq{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *TCLIServiceGetPrimaryKeysArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetPrimaryKeys_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 *TCLIServiceGetPrimaryKeysArgs) 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 *TCLIServiceGetPrimaryKeysArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetPrimaryKeysResult struct { - Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetPrimaryKeysResult() *TCLIServiceGetPrimaryKeysResult { - return &TCLIServiceGetPrimaryKeysResult{} + return &TCLIServiceGetPrimaryKeysResult{} } var TCLIServiceGetPrimaryKeysResult_Success_DEFAULT *TGetPrimaryKeysResp + func (p *TCLIServiceGetPrimaryKeysResult) GetSuccess() *TGetPrimaryKeysResp { - if !p.IsSetSuccess() { - return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetPrimaryKeysResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetPrimaryKeysResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetPrimaryKeysResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + return p.Success != nil +} + +func (p *TCLIServiceGetPrimaryKeysResult) 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 *TCLIServiceGetPrimaryKeysResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &TGetPrimaryKeysResp{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *TCLIServiceGetPrimaryKeysResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetPrimaryKeys_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 *TCLIServiceGetPrimaryKeysResult) 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 *TCLIServiceGetPrimaryKeysResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetCrossReferenceArgs struct { - Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetCrossReferenceArgs() *TCLIServiceGetCrossReferenceArgs { - return &TCLIServiceGetCrossReferenceArgs{} + return &TCLIServiceGetCrossReferenceArgs{} } var TCLIServiceGetCrossReferenceArgs_Req_DEFAULT *TGetCrossReferenceReq + func (p *TCLIServiceGetCrossReferenceArgs) GetReq() *TGetCrossReferenceReq { - if !p.IsSetReq() { - return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetCrossReferenceArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetCrossReferenceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetCrossReferenceReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCrossReference_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetCrossReferenceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + return p.Req != nil +} + +func (p *TCLIServiceGetCrossReferenceArgs) 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 *TCLIServiceGetCrossReferenceArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &TGetCrossReferenceReq{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *TCLIServiceGetCrossReferenceArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetCrossReference_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 *TCLIServiceGetCrossReferenceArgs) 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 *TCLIServiceGetCrossReferenceArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetCrossReferenceResult struct { - Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetCrossReferenceResult() *TCLIServiceGetCrossReferenceResult { - return &TCLIServiceGetCrossReferenceResult{} + return &TCLIServiceGetCrossReferenceResult{} } var TCLIServiceGetCrossReferenceResult_Success_DEFAULT *TGetCrossReferenceResp + func (p *TCLIServiceGetCrossReferenceResult) GetSuccess() *TGetCrossReferenceResp { - if !p.IsSetSuccess() { - return TCLIServiceGetCrossReferenceResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetCrossReferenceResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetCrossReferenceResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetCrossReferenceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetCrossReferenceResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCrossReference_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetCrossReferenceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + return p.Success != nil +} + +func (p *TCLIServiceGetCrossReferenceResult) 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 *TCLIServiceGetCrossReferenceResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &TGetCrossReferenceResp{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *TCLIServiceGetCrossReferenceResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetCrossReference_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 *TCLIServiceGetCrossReferenceResult) 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 *TCLIServiceGetCrossReferenceResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetOperationStatusArgs struct { - Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetOperationStatusArgs() *TCLIServiceGetOperationStatusArgs { - return &TCLIServiceGetOperationStatusArgs{} + return &TCLIServiceGetOperationStatusArgs{} } var TCLIServiceGetOperationStatusArgs_Req_DEFAULT *TGetOperationStatusReq + func (p *TCLIServiceGetOperationStatusArgs) GetReq() *TGetOperationStatusReq { - if !p.IsSetReq() { - return TCLIServiceGetOperationStatusArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetOperationStatusArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetOperationStatusArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetOperationStatusArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetOperationStatusReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetOperationStatusArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetOperationStatusResult struct { - Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetOperationStatusResult() *TCLIServiceGetOperationStatusResult { - return &TCLIServiceGetOperationStatusResult{} + return &TCLIServiceGetOperationStatusResult{} } var TCLIServiceGetOperationStatusResult_Success_DEFAULT *TGetOperationStatusResp + func (p *TCLIServiceGetOperationStatusResult) GetSuccess() *TGetOperationStatusResp { - if !p.IsSetSuccess() { - return TCLIServiceGetOperationStatusResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetOperationStatusResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetOperationStatusResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetOperationStatusResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetOperationStatusResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetOperationStatusResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceCancelOperationArgs struct { - Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` + Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCancelOperationArgs() *TCLIServiceCancelOperationArgs { - return &TCLIServiceCancelOperationArgs{} + return &TCLIServiceCancelOperationArgs{} } var TCLIServiceCancelOperationArgs_Req_DEFAULT *TCancelOperationReq + func (p *TCLIServiceCancelOperationArgs) GetReq() *TCancelOperationReq { - if !p.IsSetReq() { - return TCLIServiceCancelOperationArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCancelOperationArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCancelOperationArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceCancelOperationArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCancelOperationReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelOperation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCancelOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceCancelOperationResult struct { - Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCancelOperationResult() *TCLIServiceCancelOperationResult { - return &TCLIServiceCancelOperationResult{} + return &TCLIServiceCancelOperationResult{} } var TCLIServiceCancelOperationResult_Success_DEFAULT *TCancelOperationResp + func (p *TCLIServiceCancelOperationResult) GetSuccess() *TCancelOperationResp { - if !p.IsSetSuccess() { - return TCLIServiceCancelOperationResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCancelOperationResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCancelOperationResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceCancelOperationResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCancelOperationResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelOperation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCancelOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceCloseOperationArgs struct { - Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` + Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCloseOperationArgs() *TCLIServiceCloseOperationArgs { - return &TCLIServiceCloseOperationArgs{} + return &TCLIServiceCloseOperationArgs{} } var TCLIServiceCloseOperationArgs_Req_DEFAULT *TCloseOperationReq + func (p *TCLIServiceCloseOperationArgs) GetReq() *TCloseOperationReq { - if !p.IsSetReq() { - return TCLIServiceCloseOperationArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCloseOperationArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCloseOperationArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceCloseOperationArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCloseOperationReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseOperation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCloseOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceCloseOperationResult struct { - Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCloseOperationResult() *TCLIServiceCloseOperationResult { - return &TCLIServiceCloseOperationResult{} + return &TCLIServiceCloseOperationResult{} } var TCLIServiceCloseOperationResult_Success_DEFAULT *TCloseOperationResp + func (p *TCLIServiceCloseOperationResult) GetSuccess() *TCloseOperationResp { - if !p.IsSetSuccess() { - return TCLIServiceCloseOperationResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCloseOperationResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCloseOperationResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceCloseOperationResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCloseOperationResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseOperation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCloseOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetResultSetMetadataArgs struct { - Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetResultSetMetadataArgs() *TCLIServiceGetResultSetMetadataArgs { - return &TCLIServiceGetResultSetMetadataArgs{} + return &TCLIServiceGetResultSetMetadataArgs{} } var TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT *TGetResultSetMetadataReq + func (p *TCLIServiceGetResultSetMetadataArgs) GetReq() *TGetResultSetMetadataReq { - if !p.IsSetReq() { - return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetResultSetMetadataArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetResultSetMetadataArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetResultSetMetadataReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetResultSetMetadataResult struct { - Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetResultSetMetadataResult() *TCLIServiceGetResultSetMetadataResult { - return &TCLIServiceGetResultSetMetadataResult{} + return &TCLIServiceGetResultSetMetadataResult{} } var TCLIServiceGetResultSetMetadataResult_Success_DEFAULT *TGetResultSetMetadataResp + func (p *TCLIServiceGetResultSetMetadataResult) GetSuccess() *TGetResultSetMetadataResp { - if !p.IsSetSuccess() { - return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetResultSetMetadataResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetResultSetMetadataResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetResultSetMetadataResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceFetchResultsArgs struct { - Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` + Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceFetchResultsArgs() *TCLIServiceFetchResultsArgs { - return &TCLIServiceFetchResultsArgs{} + return &TCLIServiceFetchResultsArgs{} } var TCLIServiceFetchResultsArgs_Req_DEFAULT *TFetchResultsReq + func (p *TCLIServiceFetchResultsArgs) GetReq() *TFetchResultsReq { - if !p.IsSetReq() { - return TCLIServiceFetchResultsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceFetchResultsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceFetchResultsArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceFetchResultsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TFetchResultsReq{ - Orientation: 0, -} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "FetchResults_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceFetchResultsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceFetchResultsResult struct { - Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceFetchResultsResult() *TCLIServiceFetchResultsResult { - return &TCLIServiceFetchResultsResult{} + return &TCLIServiceFetchResultsResult{} } var TCLIServiceFetchResultsResult_Success_DEFAULT *TFetchResultsResp + func (p *TCLIServiceFetchResultsResult) GetSuccess() *TFetchResultsResp { - if !p.IsSetSuccess() { - return TCLIServiceFetchResultsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceFetchResultsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceFetchResultsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceFetchResultsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TFetchResultsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "FetchResults_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceFetchResultsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetDelegationTokenArgs struct { - Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetDelegationTokenArgs() *TCLIServiceGetDelegationTokenArgs { - return &TCLIServiceGetDelegationTokenArgs{} + return &TCLIServiceGetDelegationTokenArgs{} } var TCLIServiceGetDelegationTokenArgs_Req_DEFAULT *TGetDelegationTokenReq + func (p *TCLIServiceGetDelegationTokenArgs) GetReq() *TGetDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetDelegationTokenResult struct { - Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetDelegationTokenResult() *TCLIServiceGetDelegationTokenResult { - return &TCLIServiceGetDelegationTokenResult{} + return &TCLIServiceGetDelegationTokenResult{} } var TCLIServiceGetDelegationTokenResult_Success_DEFAULT *TGetDelegationTokenResp + func (p *TCLIServiceGetDelegationTokenResult) GetSuccess() *TGetDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceGetDelegationTokenResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetDelegationTokenResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceCancelDelegationTokenArgs struct { - Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCancelDelegationTokenArgs() *TCLIServiceCancelDelegationTokenArgs { - return &TCLIServiceCancelDelegationTokenArgs{} + return &TCLIServiceCancelDelegationTokenArgs{} } var TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT *TCancelDelegationTokenReq + func (p *TCLIServiceCancelDelegationTokenArgs) GetReq() *TCancelDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCancelDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceCancelDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCancelDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceCancelDelegationTokenResult struct { - Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCancelDelegationTokenResult() *TCLIServiceCancelDelegationTokenResult { - return &TCLIServiceCancelDelegationTokenResult{} + return &TCLIServiceCancelDelegationTokenResult{} } var TCLIServiceCancelDelegationTokenResult_Success_DEFAULT *TCancelDelegationTokenResp + func (p *TCLIServiceCancelDelegationTokenResult) GetSuccess() *TCancelDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCancelDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceCancelDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCancelDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceRenewDelegationTokenArgs struct { - Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceRenewDelegationTokenArgs() *TCLIServiceRenewDelegationTokenArgs { - return &TCLIServiceRenewDelegationTokenArgs{} + return &TCLIServiceRenewDelegationTokenArgs{} } var TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT *TRenewDelegationTokenReq + func (p *TCLIServiceRenewDelegationTokenArgs) GetReq() *TRenewDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceRenewDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceRenewDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TRenewDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceRenewDelegationTokenResult struct { - Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceRenewDelegationTokenResult() *TCLIServiceRenewDelegationTokenResult { - return &TCLIServiceRenewDelegationTokenResult{} + return &TCLIServiceRenewDelegationTokenResult{} } var TCLIServiceRenewDelegationTokenResult_Success_DEFAULT *TRenewDelegationTokenResp + func (p *TCLIServiceRenewDelegationTokenResult) GetSuccess() *TRenewDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceRenewDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceRenewDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TRenewDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + 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 "" - } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceGetQueryIdArgs struct { - Req *TGetQueryIdReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetQueryIdReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetQueryIdArgs() *TCLIServiceGetQueryIdArgs { - return &TCLIServiceGetQueryIdArgs{} + return &TCLIServiceGetQueryIdArgs{} } var TCLIServiceGetQueryIdArgs_Req_DEFAULT *TGetQueryIdReq + func (p *TCLIServiceGetQueryIdArgs) GetReq() *TGetQueryIdReq { - if !p.IsSetReq() { - return TCLIServiceGetQueryIdArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetQueryIdArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetQueryIdArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceGetQueryIdArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetQueryIdArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetQueryIdReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceGetQueryIdArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetQueryId_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetQueryIdArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + return p.Req != nil +} + +func (p *TCLIServiceGetQueryIdArgs) 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 *TCLIServiceGetQueryIdArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &TGetQueryIdReq{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *TCLIServiceGetQueryIdArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetQueryId_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 *TCLIServiceGetQueryIdArgs) 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 *TCLIServiceGetQueryIdArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetQueryIdArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetQueryIdArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceGetQueryIdResult struct { - Success *TGetQueryIdResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetQueryIdResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetQueryIdResult() *TCLIServiceGetQueryIdResult { - return &TCLIServiceGetQueryIdResult{} + return &TCLIServiceGetQueryIdResult{} } var TCLIServiceGetQueryIdResult_Success_DEFAULT *TGetQueryIdResp + func (p *TCLIServiceGetQueryIdResult) GetSuccess() *TGetQueryIdResp { - if !p.IsSetSuccess() { - return TCLIServiceGetQueryIdResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetQueryIdResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetQueryIdResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceGetQueryIdResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetQueryIdResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetQueryIdResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceGetQueryIdResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetQueryId_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceGetQueryIdResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + return p.Success != nil +} + +func (p *TCLIServiceGetQueryIdResult) 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 *TCLIServiceGetQueryIdResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &TGetQueryIdResp{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *TCLIServiceGetQueryIdResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GetQueryId_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 *TCLIServiceGetQueryIdResult) 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 *TCLIServiceGetQueryIdResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetQueryIdResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetQueryIdResult(%+v)", *p) } // Attributes: // - Req type TCLIServiceSetClientInfoArgs struct { - Req *TSetClientInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TSetClientInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceSetClientInfoArgs() *TCLIServiceSetClientInfoArgs { - return &TCLIServiceSetClientInfoArgs{} + return &TCLIServiceSetClientInfoArgs{} } var TCLIServiceSetClientInfoArgs_Req_DEFAULT *TSetClientInfoReq + func (p *TCLIServiceSetClientInfoArgs) GetReq() *TSetClientInfoReq { - if !p.IsSetReq() { - return TCLIServiceSetClientInfoArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceSetClientInfoArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceSetClientInfoArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *TCLIServiceSetClientInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceSetClientInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TSetClientInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *TCLIServiceSetClientInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "SetClientInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceSetClientInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + return p.Req != nil +} + +func (p *TCLIServiceSetClientInfoArgs) 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 *TCLIServiceSetClientInfoArgs) ReadField1(iprot thrift.TProtocol) error { + p.Req = &TSetClientInfoReq{} + if err := p.Req.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *TCLIServiceSetClientInfoArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("SetClientInfo_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 *TCLIServiceSetClientInfoArgs) 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 *TCLIServiceSetClientInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceSetClientInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceSetClientInfoArgs(%+v)", *p) } // Attributes: // - Success type TCLIServiceSetClientInfoResult struct { - Success *TSetClientInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TSetClientInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceSetClientInfoResult() *TCLIServiceSetClientInfoResult { - return &TCLIServiceSetClientInfoResult{} + return &TCLIServiceSetClientInfoResult{} } var TCLIServiceSetClientInfoResult_Success_DEFAULT *TSetClientInfoResp + func (p *TCLIServiceSetClientInfoResult) GetSuccess() *TSetClientInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceSetClientInfoResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceSetClientInfoResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceSetClientInfoResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *TCLIServiceSetClientInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - 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(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceSetClientInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TSetClientInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *TCLIServiceSetClientInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "SetClientInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TCLIServiceSetClientInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + return p.Success != nil +} + +func (p *TCLIServiceSetClientInfoResult) 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 *TCLIServiceSetClientInfoResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &TSetClientInfoResp{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *TCLIServiceSetClientInfoResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("SetClientInfo_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 *TCLIServiceSetClientInfoResult) 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 *TCLIServiceSetClientInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceSetClientInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceSetClientInfoResult(%+v)", *p) } - -