{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-missing-fields #-}
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-----------------------------------------------------------------
-- Autogenerated by Thrift Compiler (0.9.0)                      --
--                                                             --
-- DO NOT EDIT UNLESS YOU ARE SURE YOU KNOW WHAT YOU ARE DOING --
-----------------------------------------------------------------

module Database.HBase.Internal.Thrift.Hbase_Types where
import Prelude ( Bool(..), Enum, Double, String, Maybe(..),
                 Eq, Show, Ord,
                 return, length, IO, fromIntegral, fromEnum, toEnum,
                 (.), (&&), (||), (==), (++), ($), (-) )

import Control.Exception
import Data.ByteString.Lazy
import Data.Hashable
import Data.Int
import Data.Text.Lazy ( Text )
import qualified Data.Text.Lazy as TL
import Data.Typeable ( Typeable )
import qualified Data.HashMap.Strict as Map
import qualified Data.HashSet as Set
import qualified Data.Vector as Vector

import Thrift
import Thrift.Types ()


type Text = ByteString

type Bytes = ByteString

type ScannerID = Int32

data TCell = TCell{f_TCell_value :: Maybe ByteString,f_TCell_timestamp :: Maybe Int64} deriving (Show,Eq,Typeable)
instance Hashable TCell where
  hashWithSalt salt record = salt   `hashWithSalt` f_TCell_value record   `hashWithSalt` f_TCell_timestamp record  
write_TCell oprot record = do
  writeStructBegin oprot "TCell"
  case f_TCell_value record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("value",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TCell_timestamp record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("timestamp",T_I64,2)
    writeI64 oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_TCell_fields iprot record = do
  (_,_t3,_id4) <- readFieldBegin iprot
  if _t3 == T_STOP then return record else
    case _id4 of 
      1 -> if _t3 == T_STRING then do
        s <- readBinary iprot
        read_TCell_fields iprot record{f_TCell_value=Just s}
        else do
          skip iprot _t3
          read_TCell_fields iprot record
      2 -> if _t3 == T_I64 then do
        s <- readI64 iprot
        read_TCell_fields iprot record{f_TCell_timestamp=Just s}
        else do
          skip iprot _t3
          read_TCell_fields iprot record
      _ -> do
        skip iprot _t3
        readFieldEnd iprot
        read_TCell_fields iprot record
read_TCell iprot = do
  _ <- readStructBegin iprot
  record <- read_TCell_fields iprot (TCell{f_TCell_value=Nothing,f_TCell_timestamp=Nothing})
  readStructEnd iprot
  return record
data ColumnDescriptor = ColumnDescriptor{f_ColumnDescriptor_name :: Maybe ByteString,f_ColumnDescriptor_maxVersions :: Maybe Int32,f_ColumnDescriptor_compression :: Maybe TL.Text,f_ColumnDescriptor_inMemory :: Maybe Bool,f_ColumnDescriptor_bloomFilterType :: Maybe TL.Text,f_ColumnDescriptor_bloomFilterVectorSize :: Maybe Int32,f_ColumnDescriptor_bloomFilterNbHashes :: Maybe Int32,f_ColumnDescriptor_blockCacheEnabled :: Maybe Bool,f_ColumnDescriptor_timeToLive :: Maybe Int32} deriving (Show,Eq,Typeable)
instance Hashable ColumnDescriptor where
  hashWithSalt salt record = salt   `hashWithSalt` f_ColumnDescriptor_name record   `hashWithSalt` f_ColumnDescriptor_maxVersions record   `hashWithSalt` f_ColumnDescriptor_compression record   `hashWithSalt` f_ColumnDescriptor_inMemory record   `hashWithSalt` f_ColumnDescriptor_bloomFilterType record   `hashWithSalt` f_ColumnDescriptor_bloomFilterVectorSize record   `hashWithSalt` f_ColumnDescriptor_bloomFilterNbHashes record   `hashWithSalt` f_ColumnDescriptor_blockCacheEnabled record   `hashWithSalt` f_ColumnDescriptor_timeToLive record  
write_ColumnDescriptor oprot record = do
  writeStructBegin oprot "ColumnDescriptor"
  case f_ColumnDescriptor_name record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("name",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_maxVersions record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("maxVersions",T_I32,2)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_compression record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("compression",T_STRING,3)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_inMemory record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("inMemory",T_BOOL,4)
    writeBool oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_bloomFilterType record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("bloomFilterType",T_STRING,5)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_bloomFilterVectorSize record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("bloomFilterVectorSize",T_I32,6)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_bloomFilterNbHashes record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("bloomFilterNbHashes",T_I32,7)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_blockCacheEnabled record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("blockCacheEnabled",T_BOOL,8)
    writeBool oprot _v
    writeFieldEnd oprot}
  case f_ColumnDescriptor_timeToLive record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("timeToLive",T_I32,9)
    writeI32 oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_ColumnDescriptor_fields iprot record = do
  (_,_t8,_id9) <- readFieldBegin iprot
  if _t8 == T_STOP then return record else
    case _id9 of 
      1 -> if _t8 == T_STRING then do
        s <- readBinary iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_name=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      2 -> if _t8 == T_I32 then do
        s <- readI32 iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_maxVersions=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      3 -> if _t8 == T_STRING then do
        s <- readString iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_compression=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      4 -> if _t8 == T_BOOL then do
        s <- readBool iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_inMemory=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      5 -> if _t8 == T_STRING then do
        s <- readString iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_bloomFilterType=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      6 -> if _t8 == T_I32 then do
        s <- readI32 iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_bloomFilterVectorSize=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      7 -> if _t8 == T_I32 then do
        s <- readI32 iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_bloomFilterNbHashes=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      8 -> if _t8 == T_BOOL then do
        s <- readBool iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_blockCacheEnabled=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      9 -> if _t8 == T_I32 then do
        s <- readI32 iprot
        read_ColumnDescriptor_fields iprot record{f_ColumnDescriptor_timeToLive=Just s}
        else do
          skip iprot _t8
          read_ColumnDescriptor_fields iprot record
      _ -> do
        skip iprot _t8
        readFieldEnd iprot
        read_ColumnDescriptor_fields iprot record
read_ColumnDescriptor iprot = do
  _ <- readStructBegin iprot
  record <- read_ColumnDescriptor_fields iprot (ColumnDescriptor{f_ColumnDescriptor_name=Nothing,f_ColumnDescriptor_maxVersions=Nothing,f_ColumnDescriptor_compression=Nothing,f_ColumnDescriptor_inMemory=Nothing,f_ColumnDescriptor_bloomFilterType=Nothing,f_ColumnDescriptor_bloomFilterVectorSize=Nothing,f_ColumnDescriptor_bloomFilterNbHashes=Nothing,f_ColumnDescriptor_blockCacheEnabled=Nothing,f_ColumnDescriptor_timeToLive=Nothing})
  readStructEnd iprot
  return record
data TRegionInfo = TRegionInfo{f_TRegionInfo_startKey :: Maybe ByteString,f_TRegionInfo_endKey :: Maybe ByteString,f_TRegionInfo_id :: Maybe Int64,f_TRegionInfo_name :: Maybe ByteString,f_TRegionInfo_version :: Maybe Int8,f_TRegionInfo_serverName :: Maybe ByteString,f_TRegionInfo_port :: Maybe Int32} deriving (Show,Eq,Typeable)
instance Hashable TRegionInfo where
  hashWithSalt salt record = salt   `hashWithSalt` f_TRegionInfo_startKey record   `hashWithSalt` f_TRegionInfo_endKey record   `hashWithSalt` f_TRegionInfo_id record   `hashWithSalt` f_TRegionInfo_name record   `hashWithSalt` f_TRegionInfo_version record   `hashWithSalt` f_TRegionInfo_serverName record   `hashWithSalt` f_TRegionInfo_port record  
write_TRegionInfo oprot record = do
  writeStructBegin oprot "TRegionInfo"
  case f_TRegionInfo_startKey record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("startKey",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TRegionInfo_endKey record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("endKey",T_STRING,2)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TRegionInfo_id record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("id",T_I64,3)
    writeI64 oprot _v
    writeFieldEnd oprot}
  case f_TRegionInfo_name record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("name",T_STRING,4)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TRegionInfo_version record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("version",T_BYTE,5)
    writeByte oprot _v
    writeFieldEnd oprot}
  case f_TRegionInfo_serverName record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("serverName",T_STRING,6)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TRegionInfo_port record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("port",T_I32,7)
    writeI32 oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_TRegionInfo_fields iprot record = do
  (_,_t13,_id14) <- readFieldBegin iprot
  if _t13 == T_STOP then return record else
    case _id14 of 
      1 -> if _t13 == T_STRING then do
        s <- readBinary iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_startKey=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      2 -> if _t13 == T_STRING then do
        s <- readBinary iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_endKey=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      3 -> if _t13 == T_I64 then do
        s <- readI64 iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_id=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      4 -> if _t13 == T_STRING then do
        s <- readBinary iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_name=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      5 -> if _t13 == T_BYTE then do
        s <- readByte iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_version=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      6 -> if _t13 == T_STRING then do
        s <- readBinary iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_serverName=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      7 -> if _t13 == T_I32 then do
        s <- readI32 iprot
        read_TRegionInfo_fields iprot record{f_TRegionInfo_port=Just s}
        else do
          skip iprot _t13
          read_TRegionInfo_fields iprot record
      _ -> do
        skip iprot _t13
        readFieldEnd iprot
        read_TRegionInfo_fields iprot record
read_TRegionInfo iprot = do
  _ <- readStructBegin iprot
  record <- read_TRegionInfo_fields iprot (TRegionInfo{f_TRegionInfo_startKey=Nothing,f_TRegionInfo_endKey=Nothing,f_TRegionInfo_id=Nothing,f_TRegionInfo_name=Nothing,f_TRegionInfo_version=Nothing,f_TRegionInfo_serverName=Nothing,f_TRegionInfo_port=Nothing})
  readStructEnd iprot
  return record
data Mutation = Mutation{f_Mutation_isDelete :: Maybe Bool,f_Mutation_column :: Maybe ByteString,f_Mutation_value :: Maybe ByteString,f_Mutation_writeToWAL :: Maybe Bool} deriving (Show,Eq,Typeable)
instance Hashable Mutation where
  hashWithSalt salt record = salt   `hashWithSalt` f_Mutation_isDelete record   `hashWithSalt` f_Mutation_column record   `hashWithSalt` f_Mutation_value record   `hashWithSalt` f_Mutation_writeToWAL record  
write_Mutation oprot record = do
  writeStructBegin oprot "Mutation"
  case f_Mutation_isDelete record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("isDelete",T_BOOL,1)
    writeBool oprot _v
    writeFieldEnd oprot}
  case f_Mutation_column record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column",T_STRING,2)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_Mutation_value record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("value",T_STRING,3)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_Mutation_writeToWAL record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("writeToWAL",T_BOOL,4)
    writeBool oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Mutation_fields iprot record = do
  (_,_t18,_id19) <- readFieldBegin iprot
  if _t18 == T_STOP then return record else
    case _id19 of 
      1 -> if _t18 == T_BOOL then do
        s <- readBool iprot
        read_Mutation_fields iprot record{f_Mutation_isDelete=Just s}
        else do
          skip iprot _t18
          read_Mutation_fields iprot record
      2 -> if _t18 == T_STRING then do
        s <- readBinary iprot
        read_Mutation_fields iprot record{f_Mutation_column=Just s}
        else do
          skip iprot _t18
          read_Mutation_fields iprot record
      3 -> if _t18 == T_STRING then do
        s <- readBinary iprot
        read_Mutation_fields iprot record{f_Mutation_value=Just s}
        else do
          skip iprot _t18
          read_Mutation_fields iprot record
      4 -> if _t18 == T_BOOL then do
        s <- readBool iprot
        read_Mutation_fields iprot record{f_Mutation_writeToWAL=Just s}
        else do
          skip iprot _t18
          read_Mutation_fields iprot record
      _ -> do
        skip iprot _t18
        readFieldEnd iprot
        read_Mutation_fields iprot record
read_Mutation iprot = do
  _ <- readStructBegin iprot
  record <- read_Mutation_fields iprot (Mutation{f_Mutation_isDelete=Nothing,f_Mutation_column=Nothing,f_Mutation_value=Nothing,f_Mutation_writeToWAL=Nothing})
  readStructEnd iprot
  return record
data BatchMutation = BatchMutation{f_BatchMutation_row :: Maybe ByteString,f_BatchMutation_mutations :: Maybe (Vector.Vector Mutation)} deriving (Show,Eq,Typeable)
instance Hashable BatchMutation where
  hashWithSalt salt record = salt   `hashWithSalt` f_BatchMutation_row record   `hashWithSalt` f_BatchMutation_mutations record  
write_BatchMutation oprot record = do
  writeStructBegin oprot "BatchMutation"
  case f_BatchMutation_row record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("row",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_BatchMutation_mutations record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("mutations",T_LIST,2)
    (let f = Vector.mapM_ (\_viter22 -> write_Mutation oprot _viter22) in do {writeListBegin oprot (T_STRUCT,fromIntegral $ Vector.length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_BatchMutation_fields iprot record = do
  (_,_t24,_id25) <- readFieldBegin iprot
  if _t24 == T_STOP then return record else
    case _id25 of 
      1 -> if _t24 == T_STRING then do
        s <- readBinary iprot
        read_BatchMutation_fields iprot record{f_BatchMutation_row=Just s}
        else do
          skip iprot _t24
          read_BatchMutation_fields iprot record
      2 -> if _t24 == T_LIST then do
        s <- (let f n = Vector.replicateM (fromIntegral n) ((read_Mutation iprot)) in do {(_etype29,_size26) <- readListBegin iprot; f _size26})
        read_BatchMutation_fields iprot record{f_BatchMutation_mutations=Just s}
        else do
          skip iprot _t24
          read_BatchMutation_fields iprot record
      _ -> do
        skip iprot _t24
        readFieldEnd iprot
        read_BatchMutation_fields iprot record
read_BatchMutation iprot = do
  _ <- readStructBegin iprot
  record <- read_BatchMutation_fields iprot (BatchMutation{f_BatchMutation_row=Nothing,f_BatchMutation_mutations=Nothing})
  readStructEnd iprot
  return record
data TIncrement = TIncrement{f_TIncrement_table :: Maybe ByteString,f_TIncrement_row :: Maybe ByteString,f_TIncrement_column :: Maybe ByteString,f_TIncrement_ammount :: Maybe Int64} deriving (Show,Eq,Typeable)
instance Hashable TIncrement where
  hashWithSalt salt record = salt   `hashWithSalt` f_TIncrement_table record   `hashWithSalt` f_TIncrement_row record   `hashWithSalt` f_TIncrement_column record   `hashWithSalt` f_TIncrement_ammount record  
write_TIncrement oprot record = do
  writeStructBegin oprot "TIncrement"
  case f_TIncrement_table record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("table",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TIncrement_row record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("row",T_STRING,2)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TIncrement_column record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column",T_STRING,3)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TIncrement_ammount record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ammount",T_I64,4)
    writeI64 oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_TIncrement_fields iprot record = do
  (_,_t34,_id35) <- readFieldBegin iprot
  if _t34 == T_STOP then return record else
    case _id35 of 
      1 -> if _t34 == T_STRING then do
        s <- readBinary iprot
        read_TIncrement_fields iprot record{f_TIncrement_table=Just s}
        else do
          skip iprot _t34
          read_TIncrement_fields iprot record
      2 -> if _t34 == T_STRING then do
        s <- readBinary iprot
        read_TIncrement_fields iprot record{f_TIncrement_row=Just s}
        else do
          skip iprot _t34
          read_TIncrement_fields iprot record
      3 -> if _t34 == T_STRING then do
        s <- readBinary iprot
        read_TIncrement_fields iprot record{f_TIncrement_column=Just s}
        else do
          skip iprot _t34
          read_TIncrement_fields iprot record
      4 -> if _t34 == T_I64 then do
        s <- readI64 iprot
        read_TIncrement_fields iprot record{f_TIncrement_ammount=Just s}
        else do
          skip iprot _t34
          read_TIncrement_fields iprot record
      _ -> do
        skip iprot _t34
        readFieldEnd iprot
        read_TIncrement_fields iprot record
read_TIncrement iprot = do
  _ <- readStructBegin iprot
  record <- read_TIncrement_fields iprot (TIncrement{f_TIncrement_table=Nothing,f_TIncrement_row=Nothing,f_TIncrement_column=Nothing,f_TIncrement_ammount=Nothing})
  readStructEnd iprot
  return record
data TColumn = TColumn{f_TColumn_columnName :: Maybe ByteString,f_TColumn_cell :: Maybe TCell} deriving (Show,Eq,Typeable)
instance Hashable TColumn where
  hashWithSalt salt record = salt   `hashWithSalt` f_TColumn_columnName record   `hashWithSalt` f_TColumn_cell record  
write_TColumn oprot record = do
  writeStructBegin oprot "TColumn"
  case f_TColumn_columnName record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("columnName",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TColumn_cell record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("cell",T_STRUCT,2)
    write_TCell oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_TColumn_fields iprot record = do
  (_,_t39,_id40) <- readFieldBegin iprot
  if _t39 == T_STOP then return record else
    case _id40 of 
      1 -> if _t39 == T_STRING then do
        s <- readBinary iprot
        read_TColumn_fields iprot record{f_TColumn_columnName=Just s}
        else do
          skip iprot _t39
          read_TColumn_fields iprot record
      2 -> if _t39 == T_STRUCT then do
        s <- (read_TCell iprot)
        read_TColumn_fields iprot record{f_TColumn_cell=Just s}
        else do
          skip iprot _t39
          read_TColumn_fields iprot record
      _ -> do
        skip iprot _t39
        readFieldEnd iprot
        read_TColumn_fields iprot record
read_TColumn iprot = do
  _ <- readStructBegin iprot
  record <- read_TColumn_fields iprot (TColumn{f_TColumn_columnName=Nothing,f_TColumn_cell=Nothing})
  readStructEnd iprot
  return record
data TRowResult = TRowResult{f_TRowResult_row :: Maybe ByteString,f_TRowResult_columns :: Maybe (Map.HashMap ByteString TCell),f_TRowResult_sortedColumns :: Maybe (Vector.Vector TColumn)} deriving (Show,Eq,Typeable)
instance Hashable TRowResult where
  hashWithSalt salt record = salt   `hashWithSalt` f_TRowResult_row record   `hashWithSalt` f_TRowResult_columns record   `hashWithSalt` f_TRowResult_sortedColumns record  
write_TRowResult oprot record = do
  writeStructBegin oprot "TRowResult"
  case f_TRowResult_row record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("row",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TRowResult_columns record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("columns",T_MAP,2)
    (let {f [] = return (); f ((_kiter43,_viter44):t) = do {do {writeBinary oprot _kiter43;write_TCell oprot _viter44};f t}} in do {writeMapBegin oprot (T_STRING,T_STRUCT,fromIntegral $ Map.size _v); f (Map.toList _v);writeMapEnd oprot})
    writeFieldEnd oprot}
  case f_TRowResult_sortedColumns record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("sortedColumns",T_LIST,3)
    (let f = Vector.mapM_ (\_viter45 -> write_TColumn oprot _viter45) in do {writeListBegin oprot (T_STRUCT,fromIntegral $ Vector.length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_TRowResult_fields iprot record = do
  (_,_t47,_id48) <- readFieldBegin iprot
  if _t47 == T_STOP then return record else
    case _id48 of 
      1 -> if _t47 == T_STRING then do
        s <- readBinary iprot
        read_TRowResult_fields iprot record{f_TRowResult_row=Just s}
        else do
          skip iprot _t47
          read_TRowResult_fields iprot record
      2 -> if _t47 == T_MAP then do
        s <- (let {f 0 = return []; f n = do {k <- readBinary iprot; v <- (read_TCell iprot);r <- f (n-1); return $ (k,v):r}} in do {(_ktype50,_vtype51,_size49) <- readMapBegin iprot; l <- f _size49; return $ Map.fromList l})
        read_TRowResult_fields iprot record{f_TRowResult_columns=Just s}
        else do
          skip iprot _t47
          read_TRowResult_fields iprot record
      3 -> if _t47 == T_LIST then do
        s <- (let f n = Vector.replicateM (fromIntegral n) ((read_TColumn iprot)) in do {(_etype57,_size54) <- readListBegin iprot; f _size54})
        read_TRowResult_fields iprot record{f_TRowResult_sortedColumns=Just s}
        else do
          skip iprot _t47
          read_TRowResult_fields iprot record
      _ -> do
        skip iprot _t47
        readFieldEnd iprot
        read_TRowResult_fields iprot record
read_TRowResult iprot = do
  _ <- readStructBegin iprot
  record <- read_TRowResult_fields iprot (TRowResult{f_TRowResult_row=Nothing,f_TRowResult_columns=Nothing,f_TRowResult_sortedColumns=Nothing})
  readStructEnd iprot
  return record
data TScan = TScan{f_TScan_startRow :: Maybe ByteString,f_TScan_stopRow :: Maybe ByteString,f_TScan_timestamp :: Maybe Int64,f_TScan_columns :: Maybe (Vector.Vector ByteString),f_TScan_caching :: Maybe Int32,f_TScan_filterString :: Maybe ByteString,f_TScan_batchSize :: Maybe Int32,f_TScan_sortColumns :: Maybe Bool} deriving (Show,Eq,Typeable)
instance Hashable TScan where
  hashWithSalt salt record = salt   `hashWithSalt` f_TScan_startRow record   `hashWithSalt` f_TScan_stopRow record   `hashWithSalt` f_TScan_timestamp record   `hashWithSalt` f_TScan_columns record   `hashWithSalt` f_TScan_caching record   `hashWithSalt` f_TScan_filterString record   `hashWithSalt` f_TScan_batchSize record   `hashWithSalt` f_TScan_sortColumns record  
write_TScan oprot record = do
  writeStructBegin oprot "TScan"
  case f_TScan_startRow record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("startRow",T_STRING,1)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TScan_stopRow record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("stopRow",T_STRING,2)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TScan_timestamp record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("timestamp",T_I64,3)
    writeI64 oprot _v
    writeFieldEnd oprot}
  case f_TScan_columns record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("columns",T_LIST,4)
    (let f = Vector.mapM_ (\_viter61 -> writeBinary oprot _viter61) in do {writeListBegin oprot (T_STRING,fromIntegral $ Vector.length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  case f_TScan_caching record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("caching",T_I32,5)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_TScan_filterString record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("filterString",T_STRING,6)
    writeBinary oprot _v
    writeFieldEnd oprot}
  case f_TScan_batchSize record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("batchSize",T_I32,7)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_TScan_sortColumns record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("sortColumns",T_BOOL,8)
    writeBool oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_TScan_fields iprot record = do
  (_,_t63,_id64) <- readFieldBegin iprot
  if _t63 == T_STOP then return record else
    case _id64 of 
      1 -> if _t63 == T_STRING then do
        s <- readBinary iprot
        read_TScan_fields iprot record{f_TScan_startRow=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      2 -> if _t63 == T_STRING then do
        s <- readBinary iprot
        read_TScan_fields iprot record{f_TScan_stopRow=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      3 -> if _t63 == T_I64 then do
        s <- readI64 iprot
        read_TScan_fields iprot record{f_TScan_timestamp=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      4 -> if _t63 == T_LIST then do
        s <- (let f n = Vector.replicateM (fromIntegral n) (readBinary iprot) in do {(_etype68,_size65) <- readListBegin iprot; f _size65})
        read_TScan_fields iprot record{f_TScan_columns=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      5 -> if _t63 == T_I32 then do
        s <- readI32 iprot
        read_TScan_fields iprot record{f_TScan_caching=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      6 -> if _t63 == T_STRING then do
        s <- readBinary iprot
        read_TScan_fields iprot record{f_TScan_filterString=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      7 -> if _t63 == T_I32 then do
        s <- readI32 iprot
        read_TScan_fields iprot record{f_TScan_batchSize=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      8 -> if _t63 == T_BOOL then do
        s <- readBool iprot
        read_TScan_fields iprot record{f_TScan_sortColumns=Just s}
        else do
          skip iprot _t63
          read_TScan_fields iprot record
      _ -> do
        skip iprot _t63
        readFieldEnd iprot
        read_TScan_fields iprot record
read_TScan iprot = do
  _ <- readStructBegin iprot
  record <- read_TScan_fields iprot (TScan{f_TScan_startRow=Nothing,f_TScan_stopRow=Nothing,f_TScan_timestamp=Nothing,f_TScan_columns=Nothing,f_TScan_caching=Nothing,f_TScan_filterString=Nothing,f_TScan_batchSize=Nothing,f_TScan_sortColumns=Nothing})
  readStructEnd iprot
  return record
data IOError = IOError{f_IOError_message :: Maybe TL.Text} deriving (Show,Eq,Typeable)
instance Exception IOError
instance Hashable IOError where
  hashWithSalt salt record = salt   `hashWithSalt` f_IOError_message record  
write_IOError oprot record = do
  writeStructBegin oprot "IOError"
  case f_IOError_message record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("message",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_IOError_fields iprot record = do
  (_,_t73,_id74) <- readFieldBegin iprot
  if _t73 == T_STOP then return record else
    case _id74 of 
      1 -> if _t73 == T_STRING then do
        s <- readString iprot
        read_IOError_fields iprot record{f_IOError_message=Just s}
        else do
          skip iprot _t73
          read_IOError_fields iprot record
      _ -> do
        skip iprot _t73
        readFieldEnd iprot
        read_IOError_fields iprot record
read_IOError iprot = do
  _ <- readStructBegin iprot
  record <- read_IOError_fields iprot (IOError{f_IOError_message=Nothing})
  readStructEnd iprot
  return record
data IllegalArgument = IllegalArgument{f_IllegalArgument_message :: Maybe TL.Text} deriving (Show,Eq,Typeable)
instance Exception IllegalArgument
instance Hashable IllegalArgument where
  hashWithSalt salt record = salt   `hashWithSalt` f_IllegalArgument_message record  
write_IllegalArgument oprot record = do
  writeStructBegin oprot "IllegalArgument"
  case f_IllegalArgument_message record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("message",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_IllegalArgument_fields iprot record = do
  (_,_t78,_id79) <- readFieldBegin iprot
  if _t78 == T_STOP then return record else
    case _id79 of 
      1 -> if _t78 == T_STRING then do
        s <- readString iprot
        read_IllegalArgument_fields iprot record{f_IllegalArgument_message=Just s}
        else do
          skip iprot _t78
          read_IllegalArgument_fields iprot record
      _ -> do
        skip iprot _t78
        readFieldEnd iprot
        read_IllegalArgument_fields iprot record
read_IllegalArgument iprot = do
  _ <- readStructBegin iprot
  record <- read_IllegalArgument_fields iprot (IllegalArgument{f_IllegalArgument_message=Nothing})
  readStructEnd iprot
  return record
data AlreadyExists = AlreadyExists{f_AlreadyExists_message :: Maybe TL.Text} deriving (Show,Eq,Typeable)
instance Exception AlreadyExists
instance Hashable AlreadyExists where
  hashWithSalt salt record = salt   `hashWithSalt` f_AlreadyExists_message record  
write_AlreadyExists oprot record = do
  writeStructBegin oprot "AlreadyExists"
  case f_AlreadyExists_message record of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("message",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_AlreadyExists_fields iprot record = do
  (_,_t83,_id84) <- readFieldBegin iprot
  if _t83 == T_STOP then return record else
    case _id84 of 
      1 -> if _t83 == T_STRING then do
        s <- readString iprot
        read_AlreadyExists_fields iprot record{f_AlreadyExists_message=Just s}
        else do
          skip iprot _t83
          read_AlreadyExists_fields iprot record
      _ -> do
        skip iprot _t83
        readFieldEnd iprot
        read_AlreadyExists_fields iprot record
read_AlreadyExists iprot = do
  _ <- readStructBegin iprot
  record <- read_AlreadyExists_fields iprot (AlreadyExists{f_AlreadyExists_message=Nothing})
  readStructEnd iprot
  return record
