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

package osquery

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

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

type ExtensionCode int64
const (
  ExtensionCode_EXT_SUCCESS ExtensionCode = 0
  ExtensionCode_EXT_FAILED ExtensionCode = 1
  ExtensionCode_EXT_FATAL ExtensionCode = 2
)

func (p ExtensionCode) String() string {
  switch p {
  case ExtensionCode_EXT_SUCCESS: return "EXT_SUCCESS"
  case ExtensionCode_EXT_FAILED: return "EXT_FAILED"
  case ExtensionCode_EXT_FATAL: return "EXT_FATAL"
  }
  return "<UNSET>"
}

func ExtensionCodeFromString(s string) (ExtensionCode, error) {
  switch s {
  case "EXT_SUCCESS": return ExtensionCode_EXT_SUCCESS, nil 
  case "EXT_FAILED": return ExtensionCode_EXT_FAILED, nil 
  case "EXT_FATAL": return ExtensionCode_EXT_FATAL, nil 
  }
  return ExtensionCode(0), fmt.Errorf("not a valid ExtensionCode string")
}


func ExtensionCodePtr(v ExtensionCode) *ExtensionCode { return &v }

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

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

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

func (p * ExtensionCode) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type ExtensionPluginRequest map[string]string

func ExtensionPluginRequestPtr(v ExtensionPluginRequest) *ExtensionPluginRequest { return &v }

type ExtensionPluginResponse []map[string]string

func ExtensionPluginResponsePtr(v ExtensionPluginResponse) *ExtensionPluginResponse { return &v }

type InternalOptionList map[string]*InternalOptionInfo

func InternalOptionListPtr(v InternalOptionList) *InternalOptionList { return &v }

type ExtensionRouteUUID int64

func ExtensionRouteUUIDPtr(v ExtensionRouteUUID) *ExtensionRouteUUID { return &v }

type ExtensionRouteTable map[string]ExtensionPluginResponse

func ExtensionRouteTablePtr(v ExtensionRouteTable) *ExtensionRouteTable { return &v }

type ExtensionRegistry map[string]ExtensionRouteTable

func ExtensionRegistryPtr(v ExtensionRegistry) *ExtensionRegistry { return &v }

type InternalExtensionList map[ExtensionRouteUUID]*InternalExtensionInfo

func InternalExtensionListPtr(v InternalExtensionList) *InternalExtensionList { return &v }

// Attributes:
//  - Value
//  - DefaultValue
//  - Type
type InternalOptionInfo struct {
  Value string `thrift:"value,1" db:"value" json:"value"`
  DefaultValue string `thrift:"default_value,2" db:"default_value" json:"default_value"`
  Type string `thrift:"type,3" db:"type" json:"type"`
}

func NewInternalOptionInfo() *InternalOptionInfo {
  return &InternalOptionInfo{}
}


func (p *InternalOptionInfo) GetValue() string {
  return p.Value
}

func (p *InternalOptionInfo) GetDefaultValue() string {
  return p.DefaultValue
}

func (p *InternalOptionInfo) GetType() string {
  return p.Type
}
func (p *InternalOptionInfo) 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.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)
  }
  return nil
}

func (p *InternalOptionInfo)  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 *InternalOptionInfo)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DefaultValue = v
}
  return nil
}

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

func (p *InternalOptionInfo) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("InternalOptionInfo"); 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 *InternalOptionInfo) writeField1(oprot thrift.TProtocol) (err error) {
  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 *InternalOptionInfo) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("default_value", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:default_value: ", p), err) }
  if err := oprot.WriteString(string(p.DefaultValue)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.default_value (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:default_value: ", p), err) }
  return err
}

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

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

// Attributes:
//  - Name
//  - Version
//  - SdkVersion
//  - MinSdkVersion
type InternalExtensionInfo struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  Version string `thrift:"version,2" db:"version" json:"version"`
  SdkVersion string `thrift:"sdk_version,3" db:"sdk_version" json:"sdk_version"`
  MinSdkVersion string `thrift:"min_sdk_version,4" db:"min_sdk_version" json:"min_sdk_version"`
}

func NewInternalExtensionInfo() *InternalExtensionInfo {
  return &InternalExtensionInfo{}
}


func (p *InternalExtensionInfo) GetName() string {
  return p.Name
}

func (p *InternalExtensionInfo) GetVersion() string {
  return p.Version
}

func (p *InternalExtensionInfo) GetSdkVersion() string {
  return p.SdkVersion
}

func (p *InternalExtensionInfo) GetMinSdkVersion() string {
  return p.MinSdkVersion
}
func (p *InternalExtensionInfo) 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.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)
  }
  return nil
}

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

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

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

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

func (p *InternalExtensionInfo) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("InternalExtensionInfo"); 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 *InternalExtensionInfo) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

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

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

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

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

// Attributes:
//  - Code
//  - Message
//  - UUID
type ExtensionStatus struct {
  Code int32 `thrift:"code,1" db:"code" json:"code"`
  Message string `thrift:"message,2" db:"message" json:"message"`
  UUID ExtensionRouteUUID `thrift:"uuid,3" db:"uuid" json:"uuid"`
}

func NewExtensionStatus() *ExtensionStatus {
  return &ExtensionStatus{}
}


func (p *ExtensionStatus) GetCode() int32 {
  return p.Code
}

func (p *ExtensionStatus) GetMessage() string {
  return p.Message
}

func (p *ExtensionStatus) GetUUID() ExtensionRouteUUID {
  return p.UUID
}
func (p *ExtensionStatus) 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
        }
      }
    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
        }
      }
    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 *ExtensionStatus)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Code = v
}
  return nil
}

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

func (p *ExtensionStatus)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := ExtensionRouteUUID(v)
  p.UUID = temp
}
  return nil
}

func (p *ExtensionStatus) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ExtensionStatus"); 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 *ExtensionStatus) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) }
  if err := oprot.WriteI32(int32(p.Code)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) }
  return err
}

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

func (p *ExtensionStatus) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("uuid", thrift.I64, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:uuid: ", p), err) }
  if err := oprot.WriteI64(int64(p.UUID)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.uuid (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:uuid: ", p), err) }
  return err
}

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

// Attributes:
//  - Status
//  - Response
type ExtensionResponse struct {
  Status *ExtensionStatus `thrift:"status,1" db:"status" json:"status"`
  Response ExtensionPluginResponse `thrift:"response,2" db:"response" json:"response"`
}

func NewExtensionResponse() *ExtensionResponse {
  return &ExtensionResponse{}
}

var ExtensionResponse_Status_DEFAULT *ExtensionStatus
func (p *ExtensionResponse) GetStatus() *ExtensionStatus {
  if !p.IsSetStatus() {
    return ExtensionResponse_Status_DEFAULT
  }
return p.Status
}

func (p *ExtensionResponse) GetResponse() ExtensionPluginResponse {
  return p.Response
}
func (p *ExtensionResponse) IsSetStatus() bool {
  return p.Status != nil
}

func (p *ExtensionResponse) 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.LIST {
        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 *ExtensionResponse)  ReadField1(iprot thrift.TProtocol) error {
  p.Status = &ExtensionStatus{}
  if err := p.Status.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
  }
  return nil
}

func (p *ExtensionResponse)  ReadField2(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make(ExtensionPluginResponse, 0, size)
  p.Response =  tSlice
  for i := 0; i < size; i ++ {
    _, _, size, err := iprot.ReadMapBegin()
    if err != nil {
      return thrift.PrependError("error reading map begin: ", err)
    }
    tMap := make(map[string]string, size)
    _elem0 :=  tMap
    for i := 0; i < size; i ++ {
var _key1 string
      if v, err := iprot.ReadString(); err != nil {
      return thrift.PrependError("error reading field 0: ", err)
} else {
      _key1 = v
}
var _val2 string
      if v, err := iprot.ReadString(); err != nil {
      return thrift.PrependError("error reading field 0: ", err)
} else {
      _val2 = v
}
      _elem0[_key1] = _val2
    }
    if err := iprot.ReadMapEnd(); err != nil {
      return thrift.PrependError("error reading map end: ", err)
    }
    p.Response = append(p.Response, _elem0)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ExtensionResponse) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ExtensionResponse"); 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 *ExtensionResponse) 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 *ExtensionResponse) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("response", thrift.LIST, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:response: ", p), err) }
  if err := oprot.WriteListBegin(thrift.MAP, len(p.Response)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Response {
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range v {
      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.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:response: ", p), err) }
  return err
}

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

// Attributes:
//  - Code
//  - Message
//  - UUID
type ExtensionException struct {
  Code int32 `thrift:"code,1" db:"code" json:"code"`
  Message string `thrift:"message,2" db:"message" json:"message"`
  UUID ExtensionRouteUUID `thrift:"uuid,3" db:"uuid" json:"uuid"`
}

func NewExtensionException() *ExtensionException {
  return &ExtensionException{}
}


func (p *ExtensionException) GetCode() int32 {
  return p.Code
}

func (p *ExtensionException) GetMessage() string {
  return p.Message
}

func (p *ExtensionException) GetUUID() ExtensionRouteUUID {
  return p.UUID
}
func (p *ExtensionException) 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
        }
      }
    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
        }
      }
    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 *ExtensionException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Code = v
}
  return nil
}

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

func (p *ExtensionException)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := ExtensionRouteUUID(v)
  p.UUID = temp
}
  return nil
}

func (p *ExtensionException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ExtensionException"); 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 *ExtensionException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) }
  if err := oprot.WriteI32(int32(p.Code)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) }
  return err
}

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

func (p *ExtensionException) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("uuid", thrift.I64, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:uuid: ", p), err) }
  if err := oprot.WriteI64(int64(p.UUID)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.uuid (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:uuid: ", p), err) }
  return err
}

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

func (p *ExtensionException) Error() string {
  return p.String()
}

type Extension interface {
  Ping(ctx context.Context) (r *ExtensionStatus, err error)
  // Parameters:
  //  - Registry
  //  - Item
  //  - Request
  Call(ctx context.Context, registry string, item string, request ExtensionPluginRequest) (r *ExtensionResponse, err error)
  Shutdown(ctx context.Context) (err error)
}

type ExtensionClient struct {
  c thrift.TClient
}

func NewExtensionClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ExtensionClient {
  return &ExtensionClient{
    c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
  }
}

func NewExtensionClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ExtensionClient {
  return &ExtensionClient{
    c: thrift.NewTStandardClient(iprot, oprot),
  }
}

func NewExtensionClient(c thrift.TClient) *ExtensionClient {
  return &ExtensionClient{
    c: c,
  }
}

func (p *ExtensionClient) Client_() thrift.TClient {
  return p.c
}
func (p *ExtensionClient) Ping(ctx context.Context) (r *ExtensionStatus, err error) {
  var _args3 ExtensionPingArgs
  var _result4 ExtensionPingResult
  if err = p.Client_().Call(ctx, "ping", &_args3, &_result4); err != nil {
    return
  }
  return _result4.GetSuccess(), nil
}

// Parameters:
//  - Registry
//  - Item
//  - Request
func (p *ExtensionClient) Call(ctx context.Context, registry string, item string, request ExtensionPluginRequest) (r *ExtensionResponse, err error) {
  var _args5 ExtensionCallArgs
  _args5.Registry = registry
  _args5.Item = item
  _args5.Request = request
  var _result6 ExtensionCallResult
  if err = p.Client_().Call(ctx, "call", &_args5, &_result6); err != nil {
    return
  }
  return _result6.GetSuccess(), nil
}

func (p *ExtensionClient) Shutdown(ctx context.Context) (err error) {
  var _args7 ExtensionShutdownArgs
  var _result8 ExtensionShutdownResult
  if err = p.Client_().Call(ctx, "shutdown", &_args7, &_result8); err != nil {
    return
  }
  return nil
}

type ExtensionProcessor struct {
  processorMap map[string]thrift.TProcessorFunction
  handler Extension
}

func (p *ExtensionProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
  p.processorMap[key] = processor
}

func (p *ExtensionProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
  processor, ok = p.processorMap[key]
  return processor, ok
}

func (p *ExtensionProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
  return p.processorMap
}

func NewExtensionProcessor(handler Extension) *ExtensionProcessor {

  self9 := &ExtensionProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
  self9.processorMap["ping"] = &extensionProcessorPing{handler:handler}
  self9.processorMap["call"] = &extensionProcessorCall{handler:handler}
  self9.processorMap["shutdown"] = &extensionProcessorShutdown{handler:handler}
return self9
}

func (p *ExtensionProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  name, _, seqId, err := iprot.ReadMessageBegin()
  if err != nil { return false, err }
  if processor, ok := p.GetProcessorFunction(name); ok {
    return processor.Process(ctx, seqId, iprot, oprot)
  }
  iprot.Skip(thrift.STRUCT)
  iprot.ReadMessageEnd()
  x10 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
  oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
  x10.Write(oprot)
  oprot.WriteMessageEnd()
  oprot.Flush(ctx)
  return false, x10

}

type extensionProcessorPing struct {
  handler Extension
}

func (p *extensionProcessorPing) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionPingArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("ping", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionPingResult{}
var retval *ExtensionStatus
  var err2 error
  if retval, err2 = p.handler.Ping(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ping: " + err2.Error())
    oprot.WriteMessageBegin("ping", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("ping", 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 extensionProcessorCall struct {
  handler Extension
}

func (p *extensionProcessorCall) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionCallArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("call", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionCallResult{}
var retval *ExtensionResponse
  var err2 error
  if retval, err2 = p.handler.Call(ctx, args.Registry, args.Item, args.Request); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing call: " + err2.Error())
    oprot.WriteMessageBegin("call", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("call", 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 extensionProcessorShutdown struct {
  handler Extension
}

func (p *extensionProcessorShutdown) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionShutdownArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("shutdown", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionShutdownResult{}
  var err2 error
  if err2 = p.handler.Shutdown(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing shutdown: " + err2.Error())
    oprot.WriteMessageBegin("shutdown", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  if err2 = oprot.WriteMessageBegin("shutdown", 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

type ExtensionPingArgs struct {
}

func NewExtensionPingArgs() *ExtensionPingArgs {
  return &ExtensionPingArgs{}
}

func (p *ExtensionPingArgs) 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; }
    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 *ExtensionPingArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ping_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  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 *ExtensionPingArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionPingArgs(%+v)", *p)
}

// Attributes:
//  - Success
type ExtensionPingResult struct {
  Success *ExtensionStatus `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionPingResult() *ExtensionPingResult {
  return &ExtensionPingResult{}
}

var ExtensionPingResult_Success_DEFAULT *ExtensionStatus
func (p *ExtensionPingResult) GetSuccess() *ExtensionStatus {
  if !p.IsSetSuccess() {
    return ExtensionPingResult_Success_DEFAULT
  }
return p.Success
}
func (p *ExtensionPingResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionPingResult) 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 *ExtensionPingResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &ExtensionStatus{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ExtensionPingResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ping_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 *ExtensionPingResult) 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 *ExtensionPingResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionPingResult(%+v)", *p)
}

// Attributes:
//  - Registry
//  - Item
//  - Request
type ExtensionCallArgs struct {
  Registry string `thrift:"registry,1" db:"registry" json:"registry"`
  Item string `thrift:"item,2" db:"item" json:"item"`
  Request ExtensionPluginRequest `thrift:"request,3" db:"request" json:"request"`
}

func NewExtensionCallArgs() *ExtensionCallArgs {
  return &ExtensionCallArgs{}
}


func (p *ExtensionCallArgs) GetRegistry() string {
  return p.Registry
}

func (p *ExtensionCallArgs) GetItem() string {
  return p.Item
}

func (p *ExtensionCallArgs) GetRequest() ExtensionPluginRequest {
  return p.Request
}
func (p *ExtensionCallArgs) 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.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.MAP {
        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)
  }
  return nil
}

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

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

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

func (p *ExtensionCallArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("call_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 := 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 *ExtensionCallArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("registry", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:registry: ", p), err) }
  if err := oprot.WriteString(string(p.Registry)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.registry (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:registry: ", p), err) }
  return err
}

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

func (p *ExtensionCallArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("request", thrift.MAP, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:request: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Request)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Request {
    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:request: ", p), err) }
  return err
}

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

// Attributes:
//  - Success
type ExtensionCallResult struct {
  Success *ExtensionResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionCallResult() *ExtensionCallResult {
  return &ExtensionCallResult{}
}

var ExtensionCallResult_Success_DEFAULT *ExtensionResponse
func (p *ExtensionCallResult) GetSuccess() *ExtensionResponse {
  if !p.IsSetSuccess() {
    return ExtensionCallResult_Success_DEFAULT
  }
return p.Success
}
func (p *ExtensionCallResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionCallResult) 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 *ExtensionCallResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &ExtensionResponse{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ExtensionCallResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("call_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 *ExtensionCallResult) 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 *ExtensionCallResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionCallResult(%+v)", *p)
}

type ExtensionShutdownArgs struct {
}

func NewExtensionShutdownArgs() *ExtensionShutdownArgs {
  return &ExtensionShutdownArgs{}
}

func (p *ExtensionShutdownArgs) 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; }
    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 *ExtensionShutdownArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("shutdown_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  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 *ExtensionShutdownArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionShutdownArgs(%+v)", *p)
}

type ExtensionShutdownResult struct {
}

func NewExtensionShutdownResult() *ExtensionShutdownResult {
  return &ExtensionShutdownResult{}
}

func (p *ExtensionShutdownResult) 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; }
    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 *ExtensionShutdownResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("shutdown_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  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 *ExtensionShutdownResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionShutdownResult(%+v)", *p)
}


type ExtensionManager interface {
Extension

  Extensions(ctx context.Context) (r InternalExtensionList, err error)
  Options(ctx context.Context) (r InternalOptionList, err error)
  // Parameters:
  //  - Info
  //  - Registry
  RegisterExtension(ctx context.Context, info *InternalExtensionInfo, registry ExtensionRegistry) (r *ExtensionStatus, err error)
  // Parameters:
  //  - UUID
  DeregisterExtension(ctx context.Context, uuid ExtensionRouteUUID) (r *ExtensionStatus, err error)
  // Parameters:
  //  - Sql
  Query(ctx context.Context, sql string) (r *ExtensionResponse, err error)
  // Parameters:
  //  - Sql
  GetQueryColumns(ctx context.Context, sql string) (r *ExtensionResponse, err error)
}

type ExtensionManagerClient struct {
  *ExtensionClient
}

func NewExtensionManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ExtensionManagerClient {
  return &ExtensionManagerClient{ExtensionClient: NewExtensionClientFactory(t, f)}}

func NewExtensionManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ExtensionManagerClient {
  return &ExtensionManagerClient{ExtensionClient: NewExtensionClientProtocol(t, iprot, oprot)}
}

func NewExtensionManagerClient(c thrift.TClient) *ExtensionManagerClient {
  return &ExtensionManagerClient{
    ExtensionClient: NewExtensionClient(c),
  }
}

func (p *ExtensionManagerClient) Extensions(ctx context.Context) (r InternalExtensionList, err error) {
  var _args21 ExtensionManagerExtensionsArgs
  var _result22 ExtensionManagerExtensionsResult
  if err = p.Client_().Call(ctx, "extensions", &_args21, &_result22); err != nil {
    return
  }
  return _result22.GetSuccess(), nil
}

func (p *ExtensionManagerClient) Options(ctx context.Context) (r InternalOptionList, err error) {
  var _args23 ExtensionManagerOptionsArgs
  var _result24 ExtensionManagerOptionsResult
  if err = p.Client_().Call(ctx, "options", &_args23, &_result24); err != nil {
    return
  }
  return _result24.GetSuccess(), nil
}

// Parameters:
//  - Info
//  - Registry
func (p *ExtensionManagerClient) RegisterExtension(ctx context.Context, info *InternalExtensionInfo, registry ExtensionRegistry) (r *ExtensionStatus, err error) {
  var _args25 ExtensionManagerRegisterExtensionArgs
  _args25.Info = info
  _args25.Registry = registry
  var _result26 ExtensionManagerRegisterExtensionResult
  if err = p.Client_().Call(ctx, "registerExtension", &_args25, &_result26); err != nil {
    return
  }
  return _result26.GetSuccess(), nil
}

// Parameters:
//  - UUID
func (p *ExtensionManagerClient) DeregisterExtension(ctx context.Context, uuid ExtensionRouteUUID) (r *ExtensionStatus, err error) {
  var _args27 ExtensionManagerDeregisterExtensionArgs
  _args27.UUID = uuid
  var _result28 ExtensionManagerDeregisterExtensionResult
  if err = p.Client_().Call(ctx, "deregisterExtension", &_args27, &_result28); err != nil {
    return
  }
  return _result28.GetSuccess(), nil
}

// Parameters:
//  - Sql
func (p *ExtensionManagerClient) Query(ctx context.Context, sql string) (r *ExtensionResponse, err error) {
  var _args29 ExtensionManagerQueryArgs
  _args29.Sql = sql
  var _result30 ExtensionManagerQueryResult
  if err = p.Client_().Call(ctx, "query", &_args29, &_result30); err != nil {
    return
  }
  return _result30.GetSuccess(), nil
}

// Parameters:
//  - Sql
func (p *ExtensionManagerClient) GetQueryColumns(ctx context.Context, sql string) (r *ExtensionResponse, err error) {
  var _args31 ExtensionManagerGetQueryColumnsArgs
  _args31.Sql = sql
  var _result32 ExtensionManagerGetQueryColumnsResult
  if err = p.Client_().Call(ctx, "getQueryColumns", &_args31, &_result32); err != nil {
    return
  }
  return _result32.GetSuccess(), nil
}

type ExtensionManagerProcessor struct {
  *ExtensionProcessor
}

func NewExtensionManagerProcessor(handler ExtensionManager) *ExtensionManagerProcessor {
  self33 := &ExtensionManagerProcessor{NewExtensionProcessor(handler)}
  self33.AddToProcessorMap("extensions", &extensionManagerProcessorExtensions{handler:handler})
  self33.AddToProcessorMap("options", &extensionManagerProcessorOptions{handler:handler})
  self33.AddToProcessorMap("registerExtension", &extensionManagerProcessorRegisterExtension{handler:handler})
  self33.AddToProcessorMap("deregisterExtension", &extensionManagerProcessorDeregisterExtension{handler:handler})
  self33.AddToProcessorMap("query", &extensionManagerProcessorQuery{handler:handler})
  self33.AddToProcessorMap("getQueryColumns", &extensionManagerProcessorGetQueryColumns{handler:handler})
  return self33
}

type extensionManagerProcessorExtensions struct {
  handler ExtensionManager
}

func (p *extensionManagerProcessorExtensions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionManagerExtensionsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("extensions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionManagerExtensionsResult{}
var retval InternalExtensionList
  var err2 error
  if retval, err2 = p.handler.Extensions(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing extensions: " + err2.Error())
    oprot.WriteMessageBegin("extensions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("extensions", 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 extensionManagerProcessorOptions struct {
  handler ExtensionManager
}

func (p *extensionManagerProcessorOptions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionManagerOptionsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("options", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionManagerOptionsResult{}
var retval InternalOptionList
  var err2 error
  if retval, err2 = p.handler.Options(ctx); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing options: " + err2.Error())
    oprot.WriteMessageBegin("options", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("options", 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 extensionManagerProcessorRegisterExtension struct {
  handler ExtensionManager
}

func (p *extensionManagerProcessorRegisterExtension) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionManagerRegisterExtensionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("registerExtension", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionManagerRegisterExtensionResult{}
var retval *ExtensionStatus
  var err2 error
  if retval, err2 = p.handler.RegisterExtension(ctx, args.Info, args.Registry); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing registerExtension: " + err2.Error())
    oprot.WriteMessageBegin("registerExtension", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("registerExtension", 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 extensionManagerProcessorDeregisterExtension struct {
  handler ExtensionManager
}

func (p *extensionManagerProcessorDeregisterExtension) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionManagerDeregisterExtensionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("deregisterExtension", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionManagerDeregisterExtensionResult{}
var retval *ExtensionStatus
  var err2 error
  if retval, err2 = p.handler.DeregisterExtension(ctx, args.UUID); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deregisterExtension: " + err2.Error())
    oprot.WriteMessageBegin("deregisterExtension", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("deregisterExtension", 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 extensionManagerProcessorQuery struct {
  handler ExtensionManager
}

func (p *extensionManagerProcessorQuery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionManagerQueryArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("query", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionManagerQueryResult{}
var retval *ExtensionResponse
  var err2 error
  if retval, err2 = p.handler.Query(ctx, args.Sql); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing query: " + err2.Error())
    oprot.WriteMessageBegin("query", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("query", 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 extensionManagerProcessorGetQueryColumns struct {
  handler ExtensionManager
}

func (p *extensionManagerProcessorGetQueryColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ExtensionManagerGetQueryColumnsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("getQueryColumns", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ExtensionManagerGetQueryColumnsResult{}
var retval *ExtensionResponse
  var err2 error
  if retval, err2 = p.handler.GetQueryColumns(ctx, args.Sql); err2 != nil {
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getQueryColumns: " + err2.Error())
    oprot.WriteMessageBegin("getQueryColumns", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("getQueryColumns", 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

type ExtensionManagerExtensionsArgs struct {
}

func NewExtensionManagerExtensionsArgs() *ExtensionManagerExtensionsArgs {
  return &ExtensionManagerExtensionsArgs{}
}

func (p *ExtensionManagerExtensionsArgs) 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; }
    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 *ExtensionManagerExtensionsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("extensions_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  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 *ExtensionManagerExtensionsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionManagerExtensionsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type ExtensionManagerExtensionsResult struct {
  Success InternalExtensionList `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionManagerExtensionsResult() *ExtensionManagerExtensionsResult {
  return &ExtensionManagerExtensionsResult{}
}

var ExtensionManagerExtensionsResult_Success_DEFAULT InternalExtensionList

func (p *ExtensionManagerExtensionsResult) GetSuccess() InternalExtensionList {
  return p.Success
}
func (p *ExtensionManagerExtensionsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionManagerExtensionsResult) 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.MAP {
        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 *ExtensionManagerExtensionsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(InternalExtensionList, size)
  p.Success =  tMap
  for i := 0; i < size; i ++ {
var _key34 ExtensionRouteUUID
    if v, err := iprot.ReadI64(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    temp := ExtensionRouteUUID(v)
    _key34 = temp
}
    _val35 := &InternalExtensionInfo{}
    if err := _val35.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val35), err)
    }
    p.Success[_key34] = _val35
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *ExtensionManagerExtensionsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("extensions_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 *ExtensionManagerExtensionsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.I64, thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Success {
      if err := oprot.WriteI64(int64(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 0:success: ", p), err) }
  }
  return err
}

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

type ExtensionManagerOptionsArgs struct {
}

func NewExtensionManagerOptionsArgs() *ExtensionManagerOptionsArgs {
  return &ExtensionManagerOptionsArgs{}
}

func (p *ExtensionManagerOptionsArgs) 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; }
    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 *ExtensionManagerOptionsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("options_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  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 *ExtensionManagerOptionsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionManagerOptionsArgs(%+v)", *p)
}

// Attributes:
//  - Success
type ExtensionManagerOptionsResult struct {
  Success InternalOptionList `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionManagerOptionsResult() *ExtensionManagerOptionsResult {
  return &ExtensionManagerOptionsResult{}
}

var ExtensionManagerOptionsResult_Success_DEFAULT InternalOptionList

func (p *ExtensionManagerOptionsResult) GetSuccess() InternalOptionList {
  return p.Success
}
func (p *ExtensionManagerOptionsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionManagerOptionsResult) 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.MAP {
        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 *ExtensionManagerOptionsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(InternalOptionList, size)
  p.Success =  tMap
  for i := 0; i < size; i ++ {
var _key36 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key36 = v
}
    _val37 := &InternalOptionInfo{}
    if err := _val37.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val37), err)
    }
    p.Success[_key36] = _val37
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *ExtensionManagerOptionsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("options_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 *ExtensionManagerOptionsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Success {
      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 0:success: ", p), err) }
  }
  return err
}

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

// Attributes:
//  - Info
//  - Registry
type ExtensionManagerRegisterExtensionArgs struct {
  Info *InternalExtensionInfo `thrift:"info,1" db:"info" json:"info"`
  Registry ExtensionRegistry `thrift:"registry,2" db:"registry" json:"registry"`
}

func NewExtensionManagerRegisterExtensionArgs() *ExtensionManagerRegisterExtensionArgs {
  return &ExtensionManagerRegisterExtensionArgs{}
}

var ExtensionManagerRegisterExtensionArgs_Info_DEFAULT *InternalExtensionInfo
func (p *ExtensionManagerRegisterExtensionArgs) GetInfo() *InternalExtensionInfo {
  if !p.IsSetInfo() {
    return ExtensionManagerRegisterExtensionArgs_Info_DEFAULT
  }
return p.Info
}

func (p *ExtensionManagerRegisterExtensionArgs) GetRegistry() ExtensionRegistry {
  return p.Registry
}
func (p *ExtensionManagerRegisterExtensionArgs) IsSetInfo() bool {
  return p.Info != nil
}

func (p *ExtensionManagerRegisterExtensionArgs) 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.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)
  }
  return nil
}

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

func (p *ExtensionManagerRegisterExtensionArgs)  ReadField2(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(ExtensionRegistry, size)
  p.Registry =  tMap
  for i := 0; i < size; i ++ {
var _key38 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key38 = v
}
    _, _, size, err := iprot.ReadMapBegin()
    if err != nil {
      return thrift.PrependError("error reading map begin: ", err)
    }
    tMap := make(ExtensionRouteTable, size)
    _val39 :=  tMap
    for i := 0; i < size; i ++ {
var _key40 string
      if v, err := iprot.ReadString(); err != nil {
      return thrift.PrependError("error reading field 0: ", err)
} else {
      _key40 = v
}
      _, size, err := iprot.ReadListBegin()
      if err != nil {
        return thrift.PrependError("error reading list begin: ", err)
      }
      tSlice := make(ExtensionPluginResponse, 0, size)
      _val41 :=  tSlice
      for i := 0; i < size; i ++ {
        _, _, size, err := iprot.ReadMapBegin()
        if err != nil {
          return thrift.PrependError("error reading map begin: ", err)
        }
        tMap := make(map[string]string, size)
        _elem42 :=  tMap
        for i := 0; i < size; i ++ {
var _key43 string
          if v, err := iprot.ReadString(); err != nil {
          return thrift.PrependError("error reading field 0: ", err)
} else {
          _key43 = v
}
var _val44 string
          if v, err := iprot.ReadString(); err != nil {
          return thrift.PrependError("error reading field 0: ", err)
} else {
          _val44 = v
}
          _elem42[_key43] = _val44
        }
        if err := iprot.ReadMapEnd(); err != nil {
          return thrift.PrependError("error reading map end: ", err)
        }
        _val41 = append(_val41, _elem42)
      }
      if err := iprot.ReadListEnd(); err != nil {
        return thrift.PrependError("error reading list end: ", err)
      }
      _val39[_key40] = _val41
    }
    if err := iprot.ReadMapEnd(); err != nil {
      return thrift.PrependError("error reading map end: ", err)
    }
    p.Registry[_key38] = _val39
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *ExtensionManagerRegisterExtensionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("registerExtension_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 := 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 *ExtensionManagerRegisterExtensionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("info", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:info: ", p), err) }
  if err := p.Info.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Info), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:info: ", p), err) }
  return err
}

func (p *ExtensionManagerRegisterExtensionArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("registry", thrift.MAP, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:registry: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.MAP, len(p.Registry)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Registry {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(v)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range v {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteListBegin(thrift.MAP, len(v)); err != nil {
        return thrift.PrependError("error writing list begin: ", err)
      }
      for _, v := range v {
        if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(v)); err != nil {
          return thrift.PrependError("error writing map begin: ", err)
        }
        for k, v := range v {
          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.WriteListEnd(); err != nil {
        return thrift.PrependError("error writing list end: ", err)
      }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", 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:registry: ", p), err) }
  return err
}

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

// Attributes:
//  - Success
type ExtensionManagerRegisterExtensionResult struct {
  Success *ExtensionStatus `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionManagerRegisterExtensionResult() *ExtensionManagerRegisterExtensionResult {
  return &ExtensionManagerRegisterExtensionResult{}
}

var ExtensionManagerRegisterExtensionResult_Success_DEFAULT *ExtensionStatus
func (p *ExtensionManagerRegisterExtensionResult) GetSuccess() *ExtensionStatus {
  if !p.IsSetSuccess() {
    return ExtensionManagerRegisterExtensionResult_Success_DEFAULT
  }
return p.Success
}
func (p *ExtensionManagerRegisterExtensionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionManagerRegisterExtensionResult) 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 *ExtensionManagerRegisterExtensionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &ExtensionStatus{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ExtensionManagerRegisterExtensionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("registerExtension_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 *ExtensionManagerRegisterExtensionResult) 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 *ExtensionManagerRegisterExtensionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionManagerRegisterExtensionResult(%+v)", *p)
}

// Attributes:
//  - UUID
type ExtensionManagerDeregisterExtensionArgs struct {
  UUID ExtensionRouteUUID `thrift:"uuid,1" db:"uuid" json:"uuid"`
}

func NewExtensionManagerDeregisterExtensionArgs() *ExtensionManagerDeregisterExtensionArgs {
  return &ExtensionManagerDeregisterExtensionArgs{}
}


func (p *ExtensionManagerDeregisterExtensionArgs) GetUUID() ExtensionRouteUUID {
  return p.UUID
}
func (p *ExtensionManagerDeregisterExtensionArgs) 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 *ExtensionManagerDeregisterExtensionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := ExtensionRouteUUID(v)
  p.UUID = temp
}
  return nil
}

func (p *ExtensionManagerDeregisterExtensionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("deregisterExtension_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 *ExtensionManagerDeregisterExtensionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("uuid", thrift.I64, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:uuid: ", p), err) }
  if err := oprot.WriteI64(int64(p.UUID)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.uuid (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:uuid: ", p), err) }
  return err
}

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

// Attributes:
//  - Success
type ExtensionManagerDeregisterExtensionResult struct {
  Success *ExtensionStatus `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionManagerDeregisterExtensionResult() *ExtensionManagerDeregisterExtensionResult {
  return &ExtensionManagerDeregisterExtensionResult{}
}

var ExtensionManagerDeregisterExtensionResult_Success_DEFAULT *ExtensionStatus
func (p *ExtensionManagerDeregisterExtensionResult) GetSuccess() *ExtensionStatus {
  if !p.IsSetSuccess() {
    return ExtensionManagerDeregisterExtensionResult_Success_DEFAULT
  }
return p.Success
}
func (p *ExtensionManagerDeregisterExtensionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionManagerDeregisterExtensionResult) 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 *ExtensionManagerDeregisterExtensionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &ExtensionStatus{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ExtensionManagerDeregisterExtensionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("deregisterExtension_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 *ExtensionManagerDeregisterExtensionResult) 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 *ExtensionManagerDeregisterExtensionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionManagerDeregisterExtensionResult(%+v)", *p)
}

// Attributes:
//  - Sql
type ExtensionManagerQueryArgs struct {
  Sql string `thrift:"sql,1" db:"sql" json:"sql"`
}

func NewExtensionManagerQueryArgs() *ExtensionManagerQueryArgs {
  return &ExtensionManagerQueryArgs{}
}


func (p *ExtensionManagerQueryArgs) GetSql() string {
  return p.Sql
}
func (p *ExtensionManagerQueryArgs) 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 *ExtensionManagerQueryArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Sql = v
}
  return nil
}

func (p *ExtensionManagerQueryArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("query_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 *ExtensionManagerQueryArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sql", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sql: ", p), err) }
  if err := oprot.WriteString(string(p.Sql)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.sql (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sql: ", p), err) }
  return err
}

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

// Attributes:
//  - Success
type ExtensionManagerQueryResult struct {
  Success *ExtensionResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionManagerQueryResult() *ExtensionManagerQueryResult {
  return &ExtensionManagerQueryResult{}
}

var ExtensionManagerQueryResult_Success_DEFAULT *ExtensionResponse
func (p *ExtensionManagerQueryResult) GetSuccess() *ExtensionResponse {
  if !p.IsSetSuccess() {
    return ExtensionManagerQueryResult_Success_DEFAULT
  }
return p.Success
}
func (p *ExtensionManagerQueryResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionManagerQueryResult) 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 *ExtensionManagerQueryResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &ExtensionResponse{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ExtensionManagerQueryResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("query_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 *ExtensionManagerQueryResult) 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 *ExtensionManagerQueryResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionManagerQueryResult(%+v)", *p)
}

// Attributes:
//  - Sql
type ExtensionManagerGetQueryColumnsArgs struct {
  Sql string `thrift:"sql,1" db:"sql" json:"sql"`
}

func NewExtensionManagerGetQueryColumnsArgs() *ExtensionManagerGetQueryColumnsArgs {
  return &ExtensionManagerGetQueryColumnsArgs{}
}


func (p *ExtensionManagerGetQueryColumnsArgs) GetSql() string {
  return p.Sql
}
func (p *ExtensionManagerGetQueryColumnsArgs) 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 *ExtensionManagerGetQueryColumnsArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Sql = v
}
  return nil
}

func (p *ExtensionManagerGetQueryColumnsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getQueryColumns_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 *ExtensionManagerGetQueryColumnsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sql", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sql: ", p), err) }
  if err := oprot.WriteString(string(p.Sql)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.sql (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sql: ", p), err) }
  return err
}

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

// Attributes:
//  - Success
type ExtensionManagerGetQueryColumnsResult struct {
  Success *ExtensionResponse `thrift:"success,0" db:"success" json:"success,omitempty"`
}

func NewExtensionManagerGetQueryColumnsResult() *ExtensionManagerGetQueryColumnsResult {
  return &ExtensionManagerGetQueryColumnsResult{}
}

var ExtensionManagerGetQueryColumnsResult_Success_DEFAULT *ExtensionResponse
func (p *ExtensionManagerGetQueryColumnsResult) GetSuccess() *ExtensionResponse {
  if !p.IsSetSuccess() {
    return ExtensionManagerGetQueryColumnsResult_Success_DEFAULT
  }
return p.Success
}
func (p *ExtensionManagerGetQueryColumnsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ExtensionManagerGetQueryColumnsResult) 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 *ExtensionManagerGetQueryColumnsResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &ExtensionResponse{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ExtensionManagerGetQueryColumnsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("getQueryColumns_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 *ExtensionManagerGetQueryColumnsResult) 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 *ExtensionManagerGetQueryColumnsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ExtensionManagerGetQueryColumnsResult(%+v)", *p)
}


