{-# LANGUAGE DeriveDataTypeable #-}
-----------------------------------------------------------------
-- Autogenerated by Thrift                                     --
--                                                             --
-- DO NOT EDIT UNLESS YOU ARE SURE YOU KNOW WHAT YOU ARE DOING --
-----------------------------------------------------------------

module Database.Cassandra.Thrift.Cassandra where
import Thrift
import Data.Typeable ( Typeable )
import Control.Exception
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Int
import Database.Cassandra.Thrift.Cassandra_Types
import qualified Database.Cassandra.Thrift.Cassandra_Iface as Iface
-- HELPER FUNCTIONS AND STRUCTURES --

data Login_args = Login_args{f_Login_args_keyspace :: Maybe String,f_Login_args_auth_request :: Maybe AuthenticationRequest} deriving (Show,Eq,Ord,Typeable)
write_Login_args oprot rec = do
  writeStructBegin oprot "Login_args"
  case f_Login_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Login_args_auth_request rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("auth_request",T_STRUCT,2)
    write_AuthenticationRequest oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Login_args_fields iprot rec = do
  (_,_t129,_id130) <- readFieldBegin iprot
  if _t129 == T_STOP then return rec else
    case _id130 of 
      1 -> if _t129 == T_STRING then do
        s <- readString iprot
        read_Login_args_fields iprot rec{f_Login_args_keyspace=Just s}
        else do
          skip iprot _t129
          read_Login_args_fields iprot rec
      2 -> if _t129 == T_STRUCT then do
        s <- (read_AuthenticationRequest iprot)
        read_Login_args_fields iprot rec{f_Login_args_auth_request=Just s}
        else do
          skip iprot _t129
          read_Login_args_fields iprot rec
      _ -> do
        skip iprot _t129
        readFieldEnd iprot
        read_Login_args_fields iprot rec
read_Login_args iprot = do
  readStructBegin iprot
  rec <- read_Login_args_fields iprot (Login_args{f_Login_args_keyspace=Nothing,f_Login_args_auth_request=Nothing})
  readStructEnd iprot
  return rec
data Login_result = Login_result{f_Login_result_authnx :: Maybe AuthenticationException,f_Login_result_authzx :: Maybe AuthorizationException} deriving (Show,Eq,Ord,Typeable)
write_Login_result oprot rec = do
  writeStructBegin oprot "Login_result"
  case f_Login_result_authnx rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("authnx",T_STRUCT,1)
    write_AuthenticationException oprot _v
    writeFieldEnd oprot}
  case f_Login_result_authzx rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("authzx",T_STRUCT,2)
    write_AuthorizationException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Login_result_fields iprot rec = do
  (_,_t134,_id135) <- readFieldBegin iprot
  if _t134 == T_STOP then return rec else
    case _id135 of 
      1 -> if _t134 == T_STRUCT then do
        s <- (read_AuthenticationException iprot)
        read_Login_result_fields iprot rec{f_Login_result_authnx=Just s}
        else do
          skip iprot _t134
          read_Login_result_fields iprot rec
      2 -> if _t134 == T_STRUCT then do
        s <- (read_AuthorizationException iprot)
        read_Login_result_fields iprot rec{f_Login_result_authzx=Just s}
        else do
          skip iprot _t134
          read_Login_result_fields iprot rec
      _ -> do
        skip iprot _t134
        readFieldEnd iprot
        read_Login_result_fields iprot rec
read_Login_result iprot = do
  readStructBegin iprot
  rec <- read_Login_result_fields iprot (Login_result{f_Login_result_authnx=Nothing,f_Login_result_authzx=Nothing})
  readStructEnd iprot
  return rec
data Get_args = Get_args{f_Get_args_keyspace :: Maybe String,f_Get_args_key :: Maybe String,f_Get_args_column_path :: Maybe ColumnPath,f_Get_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Get_args oprot rec = do
  writeStructBegin oprot "Get_args"
  case f_Get_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_args_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("key",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_args_column_path rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_path",T_STRUCT,3)
    write_ColumnPath oprot _v
    writeFieldEnd oprot}
  case f_Get_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,4)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_args_fields iprot rec = do
  (_,_t139,_id140) <- readFieldBegin iprot
  if _t139 == T_STOP then return rec else
    case _id140 of 
      1 -> if _t139 == T_STRING then do
        s <- readString iprot
        read_Get_args_fields iprot rec{f_Get_args_keyspace=Just s}
        else do
          skip iprot _t139
          read_Get_args_fields iprot rec
      2 -> if _t139 == T_STRING then do
        s <- readString iprot
        read_Get_args_fields iprot rec{f_Get_args_key=Just s}
        else do
          skip iprot _t139
          read_Get_args_fields iprot rec
      3 -> if _t139 == T_STRUCT then do
        s <- (read_ColumnPath iprot)
        read_Get_args_fields iprot rec{f_Get_args_column_path=Just s}
        else do
          skip iprot _t139
          read_Get_args_fields iprot rec
      4 -> if _t139 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Get_args_fields iprot rec{f_Get_args_consistency_level=Just s}
        else do
          skip iprot _t139
          read_Get_args_fields iprot rec
      _ -> do
        skip iprot _t139
        readFieldEnd iprot
        read_Get_args_fields iprot rec
read_Get_args iprot = do
  readStructBegin iprot
  rec <- read_Get_args_fields iprot (Get_args{f_Get_args_keyspace=Nothing,f_Get_args_key=Nothing,f_Get_args_column_path=Nothing,f_Get_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Get_result = Get_result{f_Get_result_success :: Maybe ColumnOrSuperColumn,f_Get_result_ire :: Maybe InvalidRequestException,f_Get_result_nfe :: Maybe NotFoundException,f_Get_result_ue :: Maybe UnavailableException,f_Get_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Get_result oprot rec = do
  writeStructBegin oprot "Get_result"
  case f_Get_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_STRUCT,0)
    write_ColumnOrSuperColumn oprot _v
    writeFieldEnd oprot}
  case f_Get_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Get_result_nfe rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("nfe",T_STRUCT,2)
    write_NotFoundException oprot _v
    writeFieldEnd oprot}
  case f_Get_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,3)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Get_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,4)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_result_fields iprot rec = do
  (_,_t144,_id145) <- readFieldBegin iprot
  if _t144 == T_STOP then return rec else
    case _id145 of 
      0 -> if _t144 == T_STRUCT then do
        s <- (read_ColumnOrSuperColumn iprot)
        read_Get_result_fields iprot rec{f_Get_result_success=Just s}
        else do
          skip iprot _t144
          read_Get_result_fields iprot rec
      1 -> if _t144 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Get_result_fields iprot rec{f_Get_result_ire=Just s}
        else do
          skip iprot _t144
          read_Get_result_fields iprot rec
      2 -> if _t144 == T_STRUCT then do
        s <- (read_NotFoundException iprot)
        read_Get_result_fields iprot rec{f_Get_result_nfe=Just s}
        else do
          skip iprot _t144
          read_Get_result_fields iprot rec
      3 -> if _t144 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Get_result_fields iprot rec{f_Get_result_ue=Just s}
        else do
          skip iprot _t144
          read_Get_result_fields iprot rec
      4 -> if _t144 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Get_result_fields iprot rec{f_Get_result_te=Just s}
        else do
          skip iprot _t144
          read_Get_result_fields iprot rec
      _ -> do
        skip iprot _t144
        readFieldEnd iprot
        read_Get_result_fields iprot rec
read_Get_result iprot = do
  readStructBegin iprot
  rec <- read_Get_result_fields iprot (Get_result{f_Get_result_success=Nothing,f_Get_result_ire=Nothing,f_Get_result_nfe=Nothing,f_Get_result_ue=Nothing,f_Get_result_te=Nothing})
  readStructEnd iprot
  return rec
data Get_slice_args = Get_slice_args{f_Get_slice_args_keyspace :: Maybe String,f_Get_slice_args_key :: Maybe String,f_Get_slice_args_column_parent :: Maybe ColumnParent,f_Get_slice_args_predicate :: Maybe SlicePredicate,f_Get_slice_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Get_slice_args oprot rec = do
  writeStructBegin oprot "Get_slice_args"
  case f_Get_slice_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_slice_args_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("key",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_slice_args_column_parent rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_parent",T_STRUCT,3)
    write_ColumnParent oprot _v
    writeFieldEnd oprot}
  case f_Get_slice_args_predicate rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("predicate",T_STRUCT,4)
    write_SlicePredicate oprot _v
    writeFieldEnd oprot}
  case f_Get_slice_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,5)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_slice_args_fields iprot rec = do
  (_,_t149,_id150) <- readFieldBegin iprot
  if _t149 == T_STOP then return rec else
    case _id150 of 
      1 -> if _t149 == T_STRING then do
        s <- readString iprot
        read_Get_slice_args_fields iprot rec{f_Get_slice_args_keyspace=Just s}
        else do
          skip iprot _t149
          read_Get_slice_args_fields iprot rec
      2 -> if _t149 == T_STRING then do
        s <- readString iprot
        read_Get_slice_args_fields iprot rec{f_Get_slice_args_key=Just s}
        else do
          skip iprot _t149
          read_Get_slice_args_fields iprot rec
      3 -> if _t149 == T_STRUCT then do
        s <- (read_ColumnParent iprot)
        read_Get_slice_args_fields iprot rec{f_Get_slice_args_column_parent=Just s}
        else do
          skip iprot _t149
          read_Get_slice_args_fields iprot rec
      4 -> if _t149 == T_STRUCT then do
        s <- (read_SlicePredicate iprot)
        read_Get_slice_args_fields iprot rec{f_Get_slice_args_predicate=Just s}
        else do
          skip iprot _t149
          read_Get_slice_args_fields iprot rec
      5 -> if _t149 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Get_slice_args_fields iprot rec{f_Get_slice_args_consistency_level=Just s}
        else do
          skip iprot _t149
          read_Get_slice_args_fields iprot rec
      _ -> do
        skip iprot _t149
        readFieldEnd iprot
        read_Get_slice_args_fields iprot rec
read_Get_slice_args iprot = do
  readStructBegin iprot
  rec <- read_Get_slice_args_fields iprot (Get_slice_args{f_Get_slice_args_keyspace=Nothing,f_Get_slice_args_key=Nothing,f_Get_slice_args_column_parent=Nothing,f_Get_slice_args_predicate=Nothing,f_Get_slice_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Get_slice_result = Get_slice_result{f_Get_slice_result_success :: Maybe [ColumnOrSuperColumn],f_Get_slice_result_ire :: Maybe InvalidRequestException,f_Get_slice_result_ue :: Maybe UnavailableException,f_Get_slice_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Get_slice_result oprot rec = do
  writeStructBegin oprot "Get_slice_result"
  case f_Get_slice_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_LIST,0)
    (let {f [] = return (); f (_viter153:t) = do {write_ColumnOrSuperColumn oprot _viter153;f t}} in do {writeListBegin oprot (T_STRUCT,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  case f_Get_slice_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Get_slice_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Get_slice_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_slice_result_fields iprot rec = do
  (_,_t155,_id156) <- readFieldBegin iprot
  if _t155 == T_STOP then return rec else
    case _id156 of 
      0 -> if _t155 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- (read_ColumnOrSuperColumn iprot);r <- f (n-1); return $ v:r}} in do {(_etype160,_size157) <- readListBegin iprot; f _size157})
        read_Get_slice_result_fields iprot rec{f_Get_slice_result_success=Just s}
        else do
          skip iprot _t155
          read_Get_slice_result_fields iprot rec
      1 -> if _t155 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Get_slice_result_fields iprot rec{f_Get_slice_result_ire=Just s}
        else do
          skip iprot _t155
          read_Get_slice_result_fields iprot rec
      2 -> if _t155 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Get_slice_result_fields iprot rec{f_Get_slice_result_ue=Just s}
        else do
          skip iprot _t155
          read_Get_slice_result_fields iprot rec
      3 -> if _t155 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Get_slice_result_fields iprot rec{f_Get_slice_result_te=Just s}
        else do
          skip iprot _t155
          read_Get_slice_result_fields iprot rec
      _ -> do
        skip iprot _t155
        readFieldEnd iprot
        read_Get_slice_result_fields iprot rec
read_Get_slice_result iprot = do
  readStructBegin iprot
  rec <- read_Get_slice_result_fields iprot (Get_slice_result{f_Get_slice_result_success=Nothing,f_Get_slice_result_ire=Nothing,f_Get_slice_result_ue=Nothing,f_Get_slice_result_te=Nothing})
  readStructEnd iprot
  return rec
data Multiget_args = Multiget_args{f_Multiget_args_keyspace :: Maybe String,f_Multiget_args_keys :: Maybe [String],f_Multiget_args_column_path :: Maybe ColumnPath,f_Multiget_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Multiget_args oprot rec = do
  writeStructBegin oprot "Multiget_args"
  case f_Multiget_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Multiget_args_keys rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keys",T_LIST,2)
    (let {f [] = return (); f (_viter164:t) = do {writeString oprot _viter164;f t}} in do {writeListBegin oprot (T_STRING,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  case f_Multiget_args_column_path rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_path",T_STRUCT,3)
    write_ColumnPath oprot _v
    writeFieldEnd oprot}
  case f_Multiget_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,4)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Multiget_args_fields iprot rec = do
  (_,_t166,_id167) <- readFieldBegin iprot
  if _t166 == T_STOP then return rec else
    case _id167 of 
      1 -> if _t166 == T_STRING then do
        s <- readString iprot
        read_Multiget_args_fields iprot rec{f_Multiget_args_keyspace=Just s}
        else do
          skip iprot _t166
          read_Multiget_args_fields iprot rec
      2 -> if _t166 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- readString iprot;r <- f (n-1); return $ v:r}} in do {(_etype171,_size168) <- readListBegin iprot; f _size168})
        read_Multiget_args_fields iprot rec{f_Multiget_args_keys=Just s}
        else do
          skip iprot _t166
          read_Multiget_args_fields iprot rec
      3 -> if _t166 == T_STRUCT then do
        s <- (read_ColumnPath iprot)
        read_Multiget_args_fields iprot rec{f_Multiget_args_column_path=Just s}
        else do
          skip iprot _t166
          read_Multiget_args_fields iprot rec
      4 -> if _t166 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Multiget_args_fields iprot rec{f_Multiget_args_consistency_level=Just s}
        else do
          skip iprot _t166
          read_Multiget_args_fields iprot rec
      _ -> do
        skip iprot _t166
        readFieldEnd iprot
        read_Multiget_args_fields iprot rec
read_Multiget_args iprot = do
  readStructBegin iprot
  rec <- read_Multiget_args_fields iprot (Multiget_args{f_Multiget_args_keyspace=Nothing,f_Multiget_args_keys=Nothing,f_Multiget_args_column_path=Nothing,f_Multiget_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Multiget_result = Multiget_result{f_Multiget_result_success :: Maybe (Map.Map String ColumnOrSuperColumn),f_Multiget_result_ire :: Maybe InvalidRequestException,f_Multiget_result_ue :: Maybe UnavailableException,f_Multiget_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Multiget_result oprot rec = do
  writeStructBegin oprot "Multiget_result"
  case f_Multiget_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_MAP,0)
    (let {f [] = return (); f ((_kiter175,_viter176):t) = do {do {writeString oprot _kiter175;write_ColumnOrSuperColumn oprot _viter176};f t}} in do {writeMapBegin oprot (T_STRING,T_STRUCT,Map.size _v); f (Map.toList _v);writeMapEnd oprot})
    writeFieldEnd oprot}
  case f_Multiget_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Multiget_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Multiget_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Multiget_result_fields iprot rec = do
  (_,_t178,_id179) <- readFieldBegin iprot
  if _t178 == T_STOP then return rec else
    case _id179 of 
      0 -> if _t178 == T_MAP then do
        s <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- (read_ColumnOrSuperColumn iprot);r <- f (n-1); return $ (k,v):r}} in do {(_ktype181,_vtype182,_size180) <- readMapBegin iprot; l <- f _size180; return $ Map.fromList l})
        read_Multiget_result_fields iprot rec{f_Multiget_result_success=Just s}
        else do
          skip iprot _t178
          read_Multiget_result_fields iprot rec
      1 -> if _t178 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Multiget_result_fields iprot rec{f_Multiget_result_ire=Just s}
        else do
          skip iprot _t178
          read_Multiget_result_fields iprot rec
      2 -> if _t178 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Multiget_result_fields iprot rec{f_Multiget_result_ue=Just s}
        else do
          skip iprot _t178
          read_Multiget_result_fields iprot rec
      3 -> if _t178 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Multiget_result_fields iprot rec{f_Multiget_result_te=Just s}
        else do
          skip iprot _t178
          read_Multiget_result_fields iprot rec
      _ -> do
        skip iprot _t178
        readFieldEnd iprot
        read_Multiget_result_fields iprot rec
read_Multiget_result iprot = do
  readStructBegin iprot
  rec <- read_Multiget_result_fields iprot (Multiget_result{f_Multiget_result_success=Nothing,f_Multiget_result_ire=Nothing,f_Multiget_result_ue=Nothing,f_Multiget_result_te=Nothing})
  readStructEnd iprot
  return rec
data Multiget_slice_args = Multiget_slice_args{f_Multiget_slice_args_keyspace :: Maybe String,f_Multiget_slice_args_keys :: Maybe [String],f_Multiget_slice_args_column_parent :: Maybe ColumnParent,f_Multiget_slice_args_predicate :: Maybe SlicePredicate,f_Multiget_slice_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Multiget_slice_args oprot rec = do
  writeStructBegin oprot "Multiget_slice_args"
  case f_Multiget_slice_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Multiget_slice_args_keys rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keys",T_LIST,2)
    (let {f [] = return (); f (_viter187:t) = do {writeString oprot _viter187;f t}} in do {writeListBegin oprot (T_STRING,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  case f_Multiget_slice_args_column_parent rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_parent",T_STRUCT,3)
    write_ColumnParent oprot _v
    writeFieldEnd oprot}
  case f_Multiget_slice_args_predicate rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("predicate",T_STRUCT,4)
    write_SlicePredicate oprot _v
    writeFieldEnd oprot}
  case f_Multiget_slice_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,5)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Multiget_slice_args_fields iprot rec = do
  (_,_t189,_id190) <- readFieldBegin iprot
  if _t189 == T_STOP then return rec else
    case _id190 of 
      1 -> if _t189 == T_STRING then do
        s <- readString iprot
        read_Multiget_slice_args_fields iprot rec{f_Multiget_slice_args_keyspace=Just s}
        else do
          skip iprot _t189
          read_Multiget_slice_args_fields iprot rec
      2 -> if _t189 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- readString iprot;r <- f (n-1); return $ v:r}} in do {(_etype194,_size191) <- readListBegin iprot; f _size191})
        read_Multiget_slice_args_fields iprot rec{f_Multiget_slice_args_keys=Just s}
        else do
          skip iprot _t189
          read_Multiget_slice_args_fields iprot rec
      3 -> if _t189 == T_STRUCT then do
        s <- (read_ColumnParent iprot)
        read_Multiget_slice_args_fields iprot rec{f_Multiget_slice_args_column_parent=Just s}
        else do
          skip iprot _t189
          read_Multiget_slice_args_fields iprot rec
      4 -> if _t189 == T_STRUCT then do
        s <- (read_SlicePredicate iprot)
        read_Multiget_slice_args_fields iprot rec{f_Multiget_slice_args_predicate=Just s}
        else do
          skip iprot _t189
          read_Multiget_slice_args_fields iprot rec
      5 -> if _t189 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Multiget_slice_args_fields iprot rec{f_Multiget_slice_args_consistency_level=Just s}
        else do
          skip iprot _t189
          read_Multiget_slice_args_fields iprot rec
      _ -> do
        skip iprot _t189
        readFieldEnd iprot
        read_Multiget_slice_args_fields iprot rec
read_Multiget_slice_args iprot = do
  readStructBegin iprot
  rec <- read_Multiget_slice_args_fields iprot (Multiget_slice_args{f_Multiget_slice_args_keyspace=Nothing,f_Multiget_slice_args_keys=Nothing,f_Multiget_slice_args_column_parent=Nothing,f_Multiget_slice_args_predicate=Nothing,f_Multiget_slice_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Multiget_slice_result = Multiget_slice_result{f_Multiget_slice_result_success :: Maybe (Map.Map String [ColumnOrSuperColumn]),f_Multiget_slice_result_ire :: Maybe InvalidRequestException,f_Multiget_slice_result_ue :: Maybe UnavailableException,f_Multiget_slice_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Multiget_slice_result oprot rec = do
  writeStructBegin oprot "Multiget_slice_result"
  case f_Multiget_slice_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_MAP,0)
    (let {f [] = return (); f ((_kiter198,_viter199):t) = do {do {writeString oprot _kiter198;(let {f [] = return (); f (_viter200:t) = do {write_ColumnOrSuperColumn oprot _viter200;f t}} in do {writeListBegin oprot (T_STRUCT,length _viter199); f _viter199;writeListEnd oprot})};f t}} in do {writeMapBegin oprot (T_STRING,T_LIST,Map.size _v); f (Map.toList _v);writeMapEnd oprot})
    writeFieldEnd oprot}
  case f_Multiget_slice_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Multiget_slice_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Multiget_slice_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Multiget_slice_result_fields iprot rec = do
  (_,_t202,_id203) <- readFieldBegin iprot
  if _t202 == T_STOP then return rec else
    case _id203 of 
      0 -> if _t202 == T_MAP then do
        s <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- (let {f 0 = return []; f n = do {v <- (read_ColumnOrSuperColumn iprot);r <- f (n-1); return $ v:r}} in do {(_etype212,_size209) <- readListBegin iprot; f _size209});r <- f (n-1); return $ (k,v):r}} in do {(_ktype205,_vtype206,_size204) <- readMapBegin iprot; l <- f _size204; return $ Map.fromList l})
        read_Multiget_slice_result_fields iprot rec{f_Multiget_slice_result_success=Just s}
        else do
          skip iprot _t202
          read_Multiget_slice_result_fields iprot rec
      1 -> if _t202 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Multiget_slice_result_fields iprot rec{f_Multiget_slice_result_ire=Just s}
        else do
          skip iprot _t202
          read_Multiget_slice_result_fields iprot rec
      2 -> if _t202 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Multiget_slice_result_fields iprot rec{f_Multiget_slice_result_ue=Just s}
        else do
          skip iprot _t202
          read_Multiget_slice_result_fields iprot rec
      3 -> if _t202 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Multiget_slice_result_fields iprot rec{f_Multiget_slice_result_te=Just s}
        else do
          skip iprot _t202
          read_Multiget_slice_result_fields iprot rec
      _ -> do
        skip iprot _t202
        readFieldEnd iprot
        read_Multiget_slice_result_fields iprot rec
read_Multiget_slice_result iprot = do
  readStructBegin iprot
  rec <- read_Multiget_slice_result_fields iprot (Multiget_slice_result{f_Multiget_slice_result_success=Nothing,f_Multiget_slice_result_ire=Nothing,f_Multiget_slice_result_ue=Nothing,f_Multiget_slice_result_te=Nothing})
  readStructEnd iprot
  return rec
data Get_count_args = Get_count_args{f_Get_count_args_keyspace :: Maybe String,f_Get_count_args_key :: Maybe String,f_Get_count_args_column_parent :: Maybe ColumnParent,f_Get_count_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Get_count_args oprot rec = do
  writeStructBegin oprot "Get_count_args"
  case f_Get_count_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_count_args_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("key",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_count_args_column_parent rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_parent",T_STRUCT,3)
    write_ColumnParent oprot _v
    writeFieldEnd oprot}
  case f_Get_count_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,4)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_count_args_fields iprot rec = do
  (_,_t217,_id218) <- readFieldBegin iprot
  if _t217 == T_STOP then return rec else
    case _id218 of 
      1 -> if _t217 == T_STRING then do
        s <- readString iprot
        read_Get_count_args_fields iprot rec{f_Get_count_args_keyspace=Just s}
        else do
          skip iprot _t217
          read_Get_count_args_fields iprot rec
      2 -> if _t217 == T_STRING then do
        s <- readString iprot
        read_Get_count_args_fields iprot rec{f_Get_count_args_key=Just s}
        else do
          skip iprot _t217
          read_Get_count_args_fields iprot rec
      3 -> if _t217 == T_STRUCT then do
        s <- (read_ColumnParent iprot)
        read_Get_count_args_fields iprot rec{f_Get_count_args_column_parent=Just s}
        else do
          skip iprot _t217
          read_Get_count_args_fields iprot rec
      4 -> if _t217 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Get_count_args_fields iprot rec{f_Get_count_args_consistency_level=Just s}
        else do
          skip iprot _t217
          read_Get_count_args_fields iprot rec
      _ -> do
        skip iprot _t217
        readFieldEnd iprot
        read_Get_count_args_fields iprot rec
read_Get_count_args iprot = do
  readStructBegin iprot
  rec <- read_Get_count_args_fields iprot (Get_count_args{f_Get_count_args_keyspace=Nothing,f_Get_count_args_key=Nothing,f_Get_count_args_column_parent=Nothing,f_Get_count_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Get_count_result = Get_count_result{f_Get_count_result_success :: Maybe Int,f_Get_count_result_ire :: Maybe InvalidRequestException,f_Get_count_result_ue :: Maybe UnavailableException,f_Get_count_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Get_count_result oprot rec = do
  writeStructBegin oprot "Get_count_result"
  case f_Get_count_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_I32,0)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_Get_count_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Get_count_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Get_count_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_count_result_fields iprot rec = do
  (_,_t222,_id223) <- readFieldBegin iprot
  if _t222 == T_STOP then return rec else
    case _id223 of 
      0 -> if _t222 == T_I32 then do
        s <- readI32 iprot
        read_Get_count_result_fields iprot rec{f_Get_count_result_success=Just s}
        else do
          skip iprot _t222
          read_Get_count_result_fields iprot rec
      1 -> if _t222 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Get_count_result_fields iprot rec{f_Get_count_result_ire=Just s}
        else do
          skip iprot _t222
          read_Get_count_result_fields iprot rec
      2 -> if _t222 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Get_count_result_fields iprot rec{f_Get_count_result_ue=Just s}
        else do
          skip iprot _t222
          read_Get_count_result_fields iprot rec
      3 -> if _t222 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Get_count_result_fields iprot rec{f_Get_count_result_te=Just s}
        else do
          skip iprot _t222
          read_Get_count_result_fields iprot rec
      _ -> do
        skip iprot _t222
        readFieldEnd iprot
        read_Get_count_result_fields iprot rec
read_Get_count_result iprot = do
  readStructBegin iprot
  rec <- read_Get_count_result_fields iprot (Get_count_result{f_Get_count_result_success=Nothing,f_Get_count_result_ire=Nothing,f_Get_count_result_ue=Nothing,f_Get_count_result_te=Nothing})
  readStructEnd iprot
  return rec
data Get_range_slice_args = Get_range_slice_args{f_Get_range_slice_args_keyspace :: Maybe String,f_Get_range_slice_args_column_parent :: Maybe ColumnParent,f_Get_range_slice_args_predicate :: Maybe SlicePredicate,f_Get_range_slice_args_start_key :: Maybe String,f_Get_range_slice_args_finish_key :: Maybe String,f_Get_range_slice_args_row_count :: Maybe Int,f_Get_range_slice_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Get_range_slice_args oprot rec = do
  writeStructBegin oprot "Get_range_slice_args"
  case f_Get_range_slice_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_args_column_parent rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_parent",T_STRUCT,2)
    write_ColumnParent oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_args_predicate rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("predicate",T_STRUCT,3)
    write_SlicePredicate oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_args_start_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("start_key",T_STRING,4)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_args_finish_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("finish_key",T_STRING,5)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_args_row_count rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("row_count",T_I32,6)
    writeI32 oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,7)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_range_slice_args_fields iprot rec = do
  (_,_t227,_id228) <- readFieldBegin iprot
  if _t227 == T_STOP then return rec else
    case _id228 of 
      1 -> if _t227 == T_STRING then do
        s <- readString iprot
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_keyspace=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      2 -> if _t227 == T_STRUCT then do
        s <- (read_ColumnParent iprot)
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_column_parent=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      3 -> if _t227 == T_STRUCT then do
        s <- (read_SlicePredicate iprot)
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_predicate=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      4 -> if _t227 == T_STRING then do
        s <- readString iprot
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_start_key=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      5 -> if _t227 == T_STRING then do
        s <- readString iprot
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_finish_key=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      6 -> if _t227 == T_I32 then do
        s <- readI32 iprot
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_row_count=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      7 -> if _t227 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Get_range_slice_args_fields iprot rec{f_Get_range_slice_args_consistency_level=Just s}
        else do
          skip iprot _t227
          read_Get_range_slice_args_fields iprot rec
      _ -> do
        skip iprot _t227
        readFieldEnd iprot
        read_Get_range_slice_args_fields iprot rec
read_Get_range_slice_args iprot = do
  readStructBegin iprot
  rec <- read_Get_range_slice_args_fields iprot (Get_range_slice_args{f_Get_range_slice_args_keyspace=Nothing,f_Get_range_slice_args_column_parent=Nothing,f_Get_range_slice_args_predicate=Nothing,f_Get_range_slice_args_start_key=Nothing,f_Get_range_slice_args_finish_key=Nothing,f_Get_range_slice_args_row_count=Nothing,f_Get_range_slice_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Get_range_slice_result = Get_range_slice_result{f_Get_range_slice_result_success :: Maybe [KeySlice],f_Get_range_slice_result_ire :: Maybe InvalidRequestException,f_Get_range_slice_result_ue :: Maybe UnavailableException,f_Get_range_slice_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Get_range_slice_result oprot rec = do
  writeStructBegin oprot "Get_range_slice_result"
  case f_Get_range_slice_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_LIST,0)
    (let {f [] = return (); f (_viter231:t) = do {write_KeySlice oprot _viter231;f t}} in do {writeListBegin oprot (T_STRUCT,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  case f_Get_range_slice_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slice_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_range_slice_result_fields iprot rec = do
  (_,_t233,_id234) <- readFieldBegin iprot
  if _t233 == T_STOP then return rec else
    case _id234 of 
      0 -> if _t233 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- (read_KeySlice iprot);r <- f (n-1); return $ v:r}} in do {(_etype238,_size235) <- readListBegin iprot; f _size235})
        read_Get_range_slice_result_fields iprot rec{f_Get_range_slice_result_success=Just s}
        else do
          skip iprot _t233
          read_Get_range_slice_result_fields iprot rec
      1 -> if _t233 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Get_range_slice_result_fields iprot rec{f_Get_range_slice_result_ire=Just s}
        else do
          skip iprot _t233
          read_Get_range_slice_result_fields iprot rec
      2 -> if _t233 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Get_range_slice_result_fields iprot rec{f_Get_range_slice_result_ue=Just s}
        else do
          skip iprot _t233
          read_Get_range_slice_result_fields iprot rec
      3 -> if _t233 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Get_range_slice_result_fields iprot rec{f_Get_range_slice_result_te=Just s}
        else do
          skip iprot _t233
          read_Get_range_slice_result_fields iprot rec
      _ -> do
        skip iprot _t233
        readFieldEnd iprot
        read_Get_range_slice_result_fields iprot rec
read_Get_range_slice_result iprot = do
  readStructBegin iprot
  rec <- read_Get_range_slice_result_fields iprot (Get_range_slice_result{f_Get_range_slice_result_success=Nothing,f_Get_range_slice_result_ire=Nothing,f_Get_range_slice_result_ue=Nothing,f_Get_range_slice_result_te=Nothing})
  readStructEnd iprot
  return rec
data Get_range_slices_args = Get_range_slices_args{f_Get_range_slices_args_keyspace :: Maybe String,f_Get_range_slices_args_column_parent :: Maybe ColumnParent,f_Get_range_slices_args_predicate :: Maybe SlicePredicate,f_Get_range_slices_args_range :: Maybe KeyRange,f_Get_range_slices_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Get_range_slices_args oprot rec = do
  writeStructBegin oprot "Get_range_slices_args"
  case f_Get_range_slices_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slices_args_column_parent rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_parent",T_STRUCT,2)
    write_ColumnParent oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slices_args_predicate rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("predicate",T_STRUCT,3)
    write_SlicePredicate oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slices_args_range rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("range",T_STRUCT,4)
    write_KeyRange oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slices_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,5)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_range_slices_args_fields iprot rec = do
  (_,_t243,_id244) <- readFieldBegin iprot
  if _t243 == T_STOP then return rec else
    case _id244 of 
      1 -> if _t243 == T_STRING then do
        s <- readString iprot
        read_Get_range_slices_args_fields iprot rec{f_Get_range_slices_args_keyspace=Just s}
        else do
          skip iprot _t243
          read_Get_range_slices_args_fields iprot rec
      2 -> if _t243 == T_STRUCT then do
        s <- (read_ColumnParent iprot)
        read_Get_range_slices_args_fields iprot rec{f_Get_range_slices_args_column_parent=Just s}
        else do
          skip iprot _t243
          read_Get_range_slices_args_fields iprot rec
      3 -> if _t243 == T_STRUCT then do
        s <- (read_SlicePredicate iprot)
        read_Get_range_slices_args_fields iprot rec{f_Get_range_slices_args_predicate=Just s}
        else do
          skip iprot _t243
          read_Get_range_slices_args_fields iprot rec
      4 -> if _t243 == T_STRUCT then do
        s <- (read_KeyRange iprot)
        read_Get_range_slices_args_fields iprot rec{f_Get_range_slices_args_range=Just s}
        else do
          skip iprot _t243
          read_Get_range_slices_args_fields iprot rec
      5 -> if _t243 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Get_range_slices_args_fields iprot rec{f_Get_range_slices_args_consistency_level=Just s}
        else do
          skip iprot _t243
          read_Get_range_slices_args_fields iprot rec
      _ -> do
        skip iprot _t243
        readFieldEnd iprot
        read_Get_range_slices_args_fields iprot rec
read_Get_range_slices_args iprot = do
  readStructBegin iprot
  rec <- read_Get_range_slices_args_fields iprot (Get_range_slices_args{f_Get_range_slices_args_keyspace=Nothing,f_Get_range_slices_args_column_parent=Nothing,f_Get_range_slices_args_predicate=Nothing,f_Get_range_slices_args_range=Nothing,f_Get_range_slices_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Get_range_slices_result = Get_range_slices_result{f_Get_range_slices_result_success :: Maybe [KeySlice],f_Get_range_slices_result_ire :: Maybe InvalidRequestException,f_Get_range_slices_result_ue :: Maybe UnavailableException,f_Get_range_slices_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Get_range_slices_result oprot rec = do
  writeStructBegin oprot "Get_range_slices_result"
  case f_Get_range_slices_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_LIST,0)
    (let {f [] = return (); f (_viter247:t) = do {write_KeySlice oprot _viter247;f t}} in do {writeListBegin oprot (T_STRUCT,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  case f_Get_range_slices_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slices_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Get_range_slices_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_range_slices_result_fields iprot rec = do
  (_,_t249,_id250) <- readFieldBegin iprot
  if _t249 == T_STOP then return rec else
    case _id250 of 
      0 -> if _t249 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- (read_KeySlice iprot);r <- f (n-1); return $ v:r}} in do {(_etype254,_size251) <- readListBegin iprot; f _size251})
        read_Get_range_slices_result_fields iprot rec{f_Get_range_slices_result_success=Just s}
        else do
          skip iprot _t249
          read_Get_range_slices_result_fields iprot rec
      1 -> if _t249 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Get_range_slices_result_fields iprot rec{f_Get_range_slices_result_ire=Just s}
        else do
          skip iprot _t249
          read_Get_range_slices_result_fields iprot rec
      2 -> if _t249 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Get_range_slices_result_fields iprot rec{f_Get_range_slices_result_ue=Just s}
        else do
          skip iprot _t249
          read_Get_range_slices_result_fields iprot rec
      3 -> if _t249 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Get_range_slices_result_fields iprot rec{f_Get_range_slices_result_te=Just s}
        else do
          skip iprot _t249
          read_Get_range_slices_result_fields iprot rec
      _ -> do
        skip iprot _t249
        readFieldEnd iprot
        read_Get_range_slices_result_fields iprot rec
read_Get_range_slices_result iprot = do
  readStructBegin iprot
  rec <- read_Get_range_slices_result_fields iprot (Get_range_slices_result{f_Get_range_slices_result_success=Nothing,f_Get_range_slices_result_ire=Nothing,f_Get_range_slices_result_ue=Nothing,f_Get_range_slices_result_te=Nothing})
  readStructEnd iprot
  return rec
data Insert_args = Insert_args{f_Insert_args_keyspace :: Maybe String,f_Insert_args_key :: Maybe String,f_Insert_args_column_path :: Maybe ColumnPath,f_Insert_args_value :: Maybe String,f_Insert_args_timestamp :: Maybe Int64,f_Insert_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Insert_args oprot rec = do
  writeStructBegin oprot "Insert_args"
  case f_Insert_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Insert_args_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("key",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Insert_args_column_path rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_path",T_STRUCT,3)
    write_ColumnPath oprot _v
    writeFieldEnd oprot}
  case f_Insert_args_value rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("value",T_STRING,4)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Insert_args_timestamp rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("timestamp",T_I64,5)
    writeI64 oprot _v
    writeFieldEnd oprot}
  case f_Insert_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,6)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Insert_args_fields iprot rec = do
  (_,_t259,_id260) <- readFieldBegin iprot
  if _t259 == T_STOP then return rec else
    case _id260 of 
      1 -> if _t259 == T_STRING then do
        s <- readString iprot
        read_Insert_args_fields iprot rec{f_Insert_args_keyspace=Just s}
        else do
          skip iprot _t259
          read_Insert_args_fields iprot rec
      2 -> if _t259 == T_STRING then do
        s <- readString iprot
        read_Insert_args_fields iprot rec{f_Insert_args_key=Just s}
        else do
          skip iprot _t259
          read_Insert_args_fields iprot rec
      3 -> if _t259 == T_STRUCT then do
        s <- (read_ColumnPath iprot)
        read_Insert_args_fields iprot rec{f_Insert_args_column_path=Just s}
        else do
          skip iprot _t259
          read_Insert_args_fields iprot rec
      4 -> if _t259 == T_STRING then do
        s <- readString iprot
        read_Insert_args_fields iprot rec{f_Insert_args_value=Just s}
        else do
          skip iprot _t259
          read_Insert_args_fields iprot rec
      5 -> if _t259 == T_I64 then do
        s <- readI64 iprot
        read_Insert_args_fields iprot rec{f_Insert_args_timestamp=Just s}
        else do
          skip iprot _t259
          read_Insert_args_fields iprot rec
      6 -> if _t259 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Insert_args_fields iprot rec{f_Insert_args_consistency_level=Just s}
        else do
          skip iprot _t259
          read_Insert_args_fields iprot rec
      _ -> do
        skip iprot _t259
        readFieldEnd iprot
        read_Insert_args_fields iprot rec
read_Insert_args iprot = do
  readStructBegin iprot
  rec <- read_Insert_args_fields iprot (Insert_args{f_Insert_args_keyspace=Nothing,f_Insert_args_key=Nothing,f_Insert_args_column_path=Nothing,f_Insert_args_value=Nothing,f_Insert_args_timestamp=Nothing,f_Insert_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Insert_result = Insert_result{f_Insert_result_ire :: Maybe InvalidRequestException,f_Insert_result_ue :: Maybe UnavailableException,f_Insert_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Insert_result oprot rec = do
  writeStructBegin oprot "Insert_result"
  case f_Insert_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Insert_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Insert_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Insert_result_fields iprot rec = do
  (_,_t264,_id265) <- readFieldBegin iprot
  if _t264 == T_STOP then return rec else
    case _id265 of 
      1 -> if _t264 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Insert_result_fields iprot rec{f_Insert_result_ire=Just s}
        else do
          skip iprot _t264
          read_Insert_result_fields iprot rec
      2 -> if _t264 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Insert_result_fields iprot rec{f_Insert_result_ue=Just s}
        else do
          skip iprot _t264
          read_Insert_result_fields iprot rec
      3 -> if _t264 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Insert_result_fields iprot rec{f_Insert_result_te=Just s}
        else do
          skip iprot _t264
          read_Insert_result_fields iprot rec
      _ -> do
        skip iprot _t264
        readFieldEnd iprot
        read_Insert_result_fields iprot rec
read_Insert_result iprot = do
  readStructBegin iprot
  rec <- read_Insert_result_fields iprot (Insert_result{f_Insert_result_ire=Nothing,f_Insert_result_ue=Nothing,f_Insert_result_te=Nothing})
  readStructEnd iprot
  return rec
data Batch_insert_args = Batch_insert_args{f_Batch_insert_args_keyspace :: Maybe String,f_Batch_insert_args_key :: Maybe String,f_Batch_insert_args_cfmap :: Maybe (Map.Map String [ColumnOrSuperColumn]),f_Batch_insert_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Batch_insert_args oprot rec = do
  writeStructBegin oprot "Batch_insert_args"
  case f_Batch_insert_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Batch_insert_args_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("key",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Batch_insert_args_cfmap rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("cfmap",T_MAP,3)
    (let {f [] = return (); f ((_kiter268,_viter269):t) = do {do {writeString oprot _kiter268;(let {f [] = return (); f (_viter270:t) = do {write_ColumnOrSuperColumn oprot _viter270;f t}} in do {writeListBegin oprot (T_STRUCT,length _viter269); f _viter269;writeListEnd oprot})};f t}} in do {writeMapBegin oprot (T_STRING,T_LIST,Map.size _v); f (Map.toList _v);writeMapEnd oprot})
    writeFieldEnd oprot}
  case f_Batch_insert_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,4)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Batch_insert_args_fields iprot rec = do
  (_,_t272,_id273) <- readFieldBegin iprot
  if _t272 == T_STOP then return rec else
    case _id273 of 
      1 -> if _t272 == T_STRING then do
        s <- readString iprot
        read_Batch_insert_args_fields iprot rec{f_Batch_insert_args_keyspace=Just s}
        else do
          skip iprot _t272
          read_Batch_insert_args_fields iprot rec
      2 -> if _t272 == T_STRING then do
        s <- readString iprot
        read_Batch_insert_args_fields iprot rec{f_Batch_insert_args_key=Just s}
        else do
          skip iprot _t272
          read_Batch_insert_args_fields iprot rec
      3 -> if _t272 == T_MAP then do
        s <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- (let {f 0 = return []; f n = do {v <- (read_ColumnOrSuperColumn iprot);r <- f (n-1); return $ v:r}} in do {(_etype282,_size279) <- readListBegin iprot; f _size279});r <- f (n-1); return $ (k,v):r}} in do {(_ktype275,_vtype276,_size274) <- readMapBegin iprot; l <- f _size274; return $ Map.fromList l})
        read_Batch_insert_args_fields iprot rec{f_Batch_insert_args_cfmap=Just s}
        else do
          skip iprot _t272
          read_Batch_insert_args_fields iprot rec
      4 -> if _t272 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Batch_insert_args_fields iprot rec{f_Batch_insert_args_consistency_level=Just s}
        else do
          skip iprot _t272
          read_Batch_insert_args_fields iprot rec
      _ -> do
        skip iprot _t272
        readFieldEnd iprot
        read_Batch_insert_args_fields iprot rec
read_Batch_insert_args iprot = do
  readStructBegin iprot
  rec <- read_Batch_insert_args_fields iprot (Batch_insert_args{f_Batch_insert_args_keyspace=Nothing,f_Batch_insert_args_key=Nothing,f_Batch_insert_args_cfmap=Nothing,f_Batch_insert_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Batch_insert_result = Batch_insert_result{f_Batch_insert_result_ire :: Maybe InvalidRequestException,f_Batch_insert_result_ue :: Maybe UnavailableException,f_Batch_insert_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Batch_insert_result oprot rec = do
  writeStructBegin oprot "Batch_insert_result"
  case f_Batch_insert_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Batch_insert_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Batch_insert_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Batch_insert_result_fields iprot rec = do
  (_,_t287,_id288) <- readFieldBegin iprot
  if _t287 == T_STOP then return rec else
    case _id288 of 
      1 -> if _t287 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Batch_insert_result_fields iprot rec{f_Batch_insert_result_ire=Just s}
        else do
          skip iprot _t287
          read_Batch_insert_result_fields iprot rec
      2 -> if _t287 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Batch_insert_result_fields iprot rec{f_Batch_insert_result_ue=Just s}
        else do
          skip iprot _t287
          read_Batch_insert_result_fields iprot rec
      3 -> if _t287 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Batch_insert_result_fields iprot rec{f_Batch_insert_result_te=Just s}
        else do
          skip iprot _t287
          read_Batch_insert_result_fields iprot rec
      _ -> do
        skip iprot _t287
        readFieldEnd iprot
        read_Batch_insert_result_fields iprot rec
read_Batch_insert_result iprot = do
  readStructBegin iprot
  rec <- read_Batch_insert_result_fields iprot (Batch_insert_result{f_Batch_insert_result_ire=Nothing,f_Batch_insert_result_ue=Nothing,f_Batch_insert_result_te=Nothing})
  readStructEnd iprot
  return rec
data Remove_args = Remove_args{f_Remove_args_keyspace :: Maybe String,f_Remove_args_key :: Maybe String,f_Remove_args_column_path :: Maybe ColumnPath,f_Remove_args_timestamp :: Maybe Int64,f_Remove_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Remove_args oprot rec = do
  writeStructBegin oprot "Remove_args"
  case f_Remove_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Remove_args_key rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("key",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Remove_args_column_path rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("column_path",T_STRUCT,3)
    write_ColumnPath oprot _v
    writeFieldEnd oprot}
  case f_Remove_args_timestamp rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("timestamp",T_I64,4)
    writeI64 oprot _v
    writeFieldEnd oprot}
  case f_Remove_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,5)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Remove_args_fields iprot rec = do
  (_,_t292,_id293) <- readFieldBegin iprot
  if _t292 == T_STOP then return rec else
    case _id293 of 
      1 -> if _t292 == T_STRING then do
        s <- readString iprot
        read_Remove_args_fields iprot rec{f_Remove_args_keyspace=Just s}
        else do
          skip iprot _t292
          read_Remove_args_fields iprot rec
      2 -> if _t292 == T_STRING then do
        s <- readString iprot
        read_Remove_args_fields iprot rec{f_Remove_args_key=Just s}
        else do
          skip iprot _t292
          read_Remove_args_fields iprot rec
      3 -> if _t292 == T_STRUCT then do
        s <- (read_ColumnPath iprot)
        read_Remove_args_fields iprot rec{f_Remove_args_column_path=Just s}
        else do
          skip iprot _t292
          read_Remove_args_fields iprot rec
      4 -> if _t292 == T_I64 then do
        s <- readI64 iprot
        read_Remove_args_fields iprot rec{f_Remove_args_timestamp=Just s}
        else do
          skip iprot _t292
          read_Remove_args_fields iprot rec
      5 -> if _t292 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Remove_args_fields iprot rec{f_Remove_args_consistency_level=Just s}
        else do
          skip iprot _t292
          read_Remove_args_fields iprot rec
      _ -> do
        skip iprot _t292
        readFieldEnd iprot
        read_Remove_args_fields iprot rec
read_Remove_args iprot = do
  readStructBegin iprot
  rec <- read_Remove_args_fields iprot (Remove_args{f_Remove_args_keyspace=Nothing,f_Remove_args_key=Nothing,f_Remove_args_column_path=Nothing,f_Remove_args_timestamp=Nothing,f_Remove_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Remove_result = Remove_result{f_Remove_result_ire :: Maybe InvalidRequestException,f_Remove_result_ue :: Maybe UnavailableException,f_Remove_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Remove_result oprot rec = do
  writeStructBegin oprot "Remove_result"
  case f_Remove_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Remove_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Remove_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Remove_result_fields iprot rec = do
  (_,_t297,_id298) <- readFieldBegin iprot
  if _t297 == T_STOP then return rec else
    case _id298 of 
      1 -> if _t297 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Remove_result_fields iprot rec{f_Remove_result_ire=Just s}
        else do
          skip iprot _t297
          read_Remove_result_fields iprot rec
      2 -> if _t297 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Remove_result_fields iprot rec{f_Remove_result_ue=Just s}
        else do
          skip iprot _t297
          read_Remove_result_fields iprot rec
      3 -> if _t297 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Remove_result_fields iprot rec{f_Remove_result_te=Just s}
        else do
          skip iprot _t297
          read_Remove_result_fields iprot rec
      _ -> do
        skip iprot _t297
        readFieldEnd iprot
        read_Remove_result_fields iprot rec
read_Remove_result iprot = do
  readStructBegin iprot
  rec <- read_Remove_result_fields iprot (Remove_result{f_Remove_result_ire=Nothing,f_Remove_result_ue=Nothing,f_Remove_result_te=Nothing})
  readStructEnd iprot
  return rec
data Batch_mutate_args = Batch_mutate_args{f_Batch_mutate_args_keyspace :: Maybe String,f_Batch_mutate_args_mutation_map :: Maybe (Map.Map String (Map.Map String [Mutation])),f_Batch_mutate_args_consistency_level :: Maybe ConsistencyLevel} deriving (Show,Eq,Ord,Typeable)
write_Batch_mutate_args oprot rec = do
  writeStructBegin oprot "Batch_mutate_args"
  case f_Batch_mutate_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Batch_mutate_args_mutation_map rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("mutation_map",T_MAP,2)
    (let {f [] = return (); f ((_kiter301,_viter302):t) = do {do {writeString oprot _kiter301;(let {f [] = return (); f ((_kiter303,_viter304):t) = do {do {writeString oprot _kiter303;(let {f [] = return (); f (_viter305:t) = do {write_Mutation oprot _viter305;f t}} in do {writeListBegin oprot (T_STRUCT,length _viter304); f _viter304;writeListEnd oprot})};f t}} in do {writeMapBegin oprot (T_STRING,T_LIST,Map.size _viter302); f (Map.toList _viter302);writeMapEnd oprot})};f t}} in do {writeMapBegin oprot (T_STRING,T_MAP,Map.size _v); f (Map.toList _v);writeMapEnd oprot})
    writeFieldEnd oprot}
  case f_Batch_mutate_args_consistency_level rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("consistency_level",T_I32,3)
    writeI32 oprot (fromEnum _v)
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Batch_mutate_args_fields iprot rec = do
  (_,_t307,_id308) <- readFieldBegin iprot
  if _t307 == T_STOP then return rec else
    case _id308 of 
      1 -> if _t307 == T_STRING then do
        s <- readString iprot
        read_Batch_mutate_args_fields iprot rec{f_Batch_mutate_args_keyspace=Just s}
        else do
          skip iprot _t307
          read_Batch_mutate_args_fields iprot rec
      2 -> if _t307 == T_MAP then do
        s <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- (let {f 0 = return []; f n = do {v <- (read_Mutation iprot);r <- f (n-1); return $ v:r}} in do {(_etype322,_size319) <- readListBegin iprot; f _size319});r <- f (n-1); return $ (k,v):r}} in do {(_ktype315,_vtype316,_size314) <- readMapBegin iprot; l <- f _size314; return $ Map.fromList l});r <- f (n-1); return $ (k,v):r}} in do {(_ktype310,_vtype311,_size309) <- readMapBegin iprot; l <- f _size309; return $ Map.fromList l})
        read_Batch_mutate_args_fields iprot rec{f_Batch_mutate_args_mutation_map=Just s}
        else do
          skip iprot _t307
          read_Batch_mutate_args_fields iprot rec
      3 -> if _t307 == T_I32 then do
        s <- (do {i <- readI32 iprot; return (toEnum i :: ConsistencyLevel)})
        read_Batch_mutate_args_fields iprot rec{f_Batch_mutate_args_consistency_level=Just s}
        else do
          skip iprot _t307
          read_Batch_mutate_args_fields iprot rec
      _ -> do
        skip iprot _t307
        readFieldEnd iprot
        read_Batch_mutate_args_fields iprot rec
read_Batch_mutate_args iprot = do
  readStructBegin iprot
  rec <- read_Batch_mutate_args_fields iprot (Batch_mutate_args{f_Batch_mutate_args_keyspace=Nothing,f_Batch_mutate_args_mutation_map=Nothing,f_Batch_mutate_args_consistency_level=Nothing})
  readStructEnd iprot
  return rec
data Batch_mutate_result = Batch_mutate_result{f_Batch_mutate_result_ire :: Maybe InvalidRequestException,f_Batch_mutate_result_ue :: Maybe UnavailableException,f_Batch_mutate_result_te :: Maybe TimedOutException} deriving (Show,Eq,Ord,Typeable)
write_Batch_mutate_result oprot rec = do
  writeStructBegin oprot "Batch_mutate_result"
  case f_Batch_mutate_result_ire rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ire",T_STRUCT,1)
    write_InvalidRequestException oprot _v
    writeFieldEnd oprot}
  case f_Batch_mutate_result_ue rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("ue",T_STRUCT,2)
    write_UnavailableException oprot _v
    writeFieldEnd oprot}
  case f_Batch_mutate_result_te rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("te",T_STRUCT,3)
    write_TimedOutException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Batch_mutate_result_fields iprot rec = do
  (_,_t327,_id328) <- readFieldBegin iprot
  if _t327 == T_STOP then return rec else
    case _id328 of 
      1 -> if _t327 == T_STRUCT then do
        s <- (read_InvalidRequestException iprot)
        read_Batch_mutate_result_fields iprot rec{f_Batch_mutate_result_ire=Just s}
        else do
          skip iprot _t327
          read_Batch_mutate_result_fields iprot rec
      2 -> if _t327 == T_STRUCT then do
        s <- (read_UnavailableException iprot)
        read_Batch_mutate_result_fields iprot rec{f_Batch_mutate_result_ue=Just s}
        else do
          skip iprot _t327
          read_Batch_mutate_result_fields iprot rec
      3 -> if _t327 == T_STRUCT then do
        s <- (read_TimedOutException iprot)
        read_Batch_mutate_result_fields iprot rec{f_Batch_mutate_result_te=Just s}
        else do
          skip iprot _t327
          read_Batch_mutate_result_fields iprot rec
      _ -> do
        skip iprot _t327
        readFieldEnd iprot
        read_Batch_mutate_result_fields iprot rec
read_Batch_mutate_result iprot = do
  readStructBegin iprot
  rec <- read_Batch_mutate_result_fields iprot (Batch_mutate_result{f_Batch_mutate_result_ire=Nothing,f_Batch_mutate_result_ue=Nothing,f_Batch_mutate_result_te=Nothing})
  readStructEnd iprot
  return rec
data Get_string_property_args = Get_string_property_args{f_Get_string_property_args_property :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Get_string_property_args oprot rec = do
  writeStructBegin oprot "Get_string_property_args"
  case f_Get_string_property_args_property rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("property",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_string_property_args_fields iprot rec = do
  (_,_t332,_id333) <- readFieldBegin iprot
  if _t332 == T_STOP then return rec else
    case _id333 of 
      1 -> if _t332 == T_STRING then do
        s <- readString iprot
        read_Get_string_property_args_fields iprot rec{f_Get_string_property_args_property=Just s}
        else do
          skip iprot _t332
          read_Get_string_property_args_fields iprot rec
      _ -> do
        skip iprot _t332
        readFieldEnd iprot
        read_Get_string_property_args_fields iprot rec
read_Get_string_property_args iprot = do
  readStructBegin iprot
  rec <- read_Get_string_property_args_fields iprot (Get_string_property_args{f_Get_string_property_args_property=Nothing})
  readStructEnd iprot
  return rec
data Get_string_property_result = Get_string_property_result{f_Get_string_property_result_success :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Get_string_property_result oprot rec = do
  writeStructBegin oprot "Get_string_property_result"
  case f_Get_string_property_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_STRING,0)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_string_property_result_fields iprot rec = do
  (_,_t337,_id338) <- readFieldBegin iprot
  if _t337 == T_STOP then return rec else
    case _id338 of 
      0 -> if _t337 == T_STRING then do
        s <- readString iprot
        read_Get_string_property_result_fields iprot rec{f_Get_string_property_result_success=Just s}
        else do
          skip iprot _t337
          read_Get_string_property_result_fields iprot rec
      _ -> do
        skip iprot _t337
        readFieldEnd iprot
        read_Get_string_property_result_fields iprot rec
read_Get_string_property_result iprot = do
  readStructBegin iprot
  rec <- read_Get_string_property_result_fields iprot (Get_string_property_result{f_Get_string_property_result_success=Nothing})
  readStructEnd iprot
  return rec
data Get_string_list_property_args = Get_string_list_property_args{f_Get_string_list_property_args_property :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Get_string_list_property_args oprot rec = do
  writeStructBegin oprot "Get_string_list_property_args"
  case f_Get_string_list_property_args_property rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("property",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_string_list_property_args_fields iprot rec = do
  (_,_t342,_id343) <- readFieldBegin iprot
  if _t342 == T_STOP then return rec else
    case _id343 of 
      1 -> if _t342 == T_STRING then do
        s <- readString iprot
        read_Get_string_list_property_args_fields iprot rec{f_Get_string_list_property_args_property=Just s}
        else do
          skip iprot _t342
          read_Get_string_list_property_args_fields iprot rec
      _ -> do
        skip iprot _t342
        readFieldEnd iprot
        read_Get_string_list_property_args_fields iprot rec
read_Get_string_list_property_args iprot = do
  readStructBegin iprot
  rec <- read_Get_string_list_property_args_fields iprot (Get_string_list_property_args{f_Get_string_list_property_args_property=Nothing})
  readStructEnd iprot
  return rec
data Get_string_list_property_result = Get_string_list_property_result{f_Get_string_list_property_result_success :: Maybe [String]} deriving (Show,Eq,Ord,Typeable)
write_Get_string_list_property_result oprot rec = do
  writeStructBegin oprot "Get_string_list_property_result"
  case f_Get_string_list_property_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_LIST,0)
    (let {f [] = return (); f (_viter346:t) = do {writeString oprot _viter346;f t}} in do {writeListBegin oprot (T_STRING,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Get_string_list_property_result_fields iprot rec = do
  (_,_t348,_id349) <- readFieldBegin iprot
  if _t348 == T_STOP then return rec else
    case _id349 of 
      0 -> if _t348 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- readString iprot;r <- f (n-1); return $ v:r}} in do {(_etype353,_size350) <- readListBegin iprot; f _size350})
        read_Get_string_list_property_result_fields iprot rec{f_Get_string_list_property_result_success=Just s}
        else do
          skip iprot _t348
          read_Get_string_list_property_result_fields iprot rec
      _ -> do
        skip iprot _t348
        readFieldEnd iprot
        read_Get_string_list_property_result_fields iprot rec
read_Get_string_list_property_result iprot = do
  readStructBegin iprot
  rec <- read_Get_string_list_property_result_fields iprot (Get_string_list_property_result{f_Get_string_list_property_result_success=Nothing})
  readStructEnd iprot
  return rec
data Describe_keyspaces_args = Describe_keyspaces_args deriving (Show,Eq,Ord,Typeable)
write_Describe_keyspaces_args oprot rec = do
  writeStructBegin oprot "Describe_keyspaces_args"
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_keyspaces_args_fields iprot rec = do
  (_,_t358,_id359) <- readFieldBegin iprot
  if _t358 == T_STOP then return rec else
    case _id359 of 
      _ -> do
        skip iprot _t358
        readFieldEnd iprot
        read_Describe_keyspaces_args_fields iprot rec
read_Describe_keyspaces_args iprot = do
  readStructBegin iprot
  rec <- read_Describe_keyspaces_args_fields iprot (Describe_keyspaces_args{})
  readStructEnd iprot
  return rec
data Describe_keyspaces_result = Describe_keyspaces_result{f_Describe_keyspaces_result_success :: Maybe (Set.Set String)} deriving (Show,Eq,Ord,Typeable)
write_Describe_keyspaces_result oprot rec = do
  writeStructBegin oprot "Describe_keyspaces_result"
  case f_Describe_keyspaces_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_SET,0)
    (let {f [] = return (); f (_viter362:t) = do {writeString oprot _viter362;f t}} in do {writeSetBegin oprot (T_STRING,Set.size _v); f (Set.toList _v);writeSetEnd oprot})
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_keyspaces_result_fields iprot rec = do
  (_,_t364,_id365) <- readFieldBegin iprot
  if _t364 == T_STOP then return rec else
    case _id365 of 
      0 -> if _t364 == T_SET then do
        s <- (let {f 0 = return []; f n = do {v <- readString iprot;r <- f (n-1); return $ v:r}} in do {(_etype369,_size366) <- readSetBegin iprot; l <- f _size366; return $ Set.fromList l})
        read_Describe_keyspaces_result_fields iprot rec{f_Describe_keyspaces_result_success=Just s}
        else do
          skip iprot _t364
          read_Describe_keyspaces_result_fields iprot rec
      _ -> do
        skip iprot _t364
        readFieldEnd iprot
        read_Describe_keyspaces_result_fields iprot rec
read_Describe_keyspaces_result iprot = do
  readStructBegin iprot
  rec <- read_Describe_keyspaces_result_fields iprot (Describe_keyspaces_result{f_Describe_keyspaces_result_success=Nothing})
  readStructEnd iprot
  return rec
data Describe_cluster_name_args = Describe_cluster_name_args deriving (Show,Eq,Ord,Typeable)
write_Describe_cluster_name_args oprot rec = do
  writeStructBegin oprot "Describe_cluster_name_args"
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_cluster_name_args_fields iprot rec = do
  (_,_t374,_id375) <- readFieldBegin iprot
  if _t374 == T_STOP then return rec else
    case _id375 of 
      _ -> do
        skip iprot _t374
        readFieldEnd iprot
        read_Describe_cluster_name_args_fields iprot rec
read_Describe_cluster_name_args iprot = do
  readStructBegin iprot
  rec <- read_Describe_cluster_name_args_fields iprot (Describe_cluster_name_args{})
  readStructEnd iprot
  return rec
data Describe_cluster_name_result = Describe_cluster_name_result{f_Describe_cluster_name_result_success :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Describe_cluster_name_result oprot rec = do
  writeStructBegin oprot "Describe_cluster_name_result"
  case f_Describe_cluster_name_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_STRING,0)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_cluster_name_result_fields iprot rec = do
  (_,_t379,_id380) <- readFieldBegin iprot
  if _t379 == T_STOP then return rec else
    case _id380 of 
      0 -> if _t379 == T_STRING then do
        s <- readString iprot
        read_Describe_cluster_name_result_fields iprot rec{f_Describe_cluster_name_result_success=Just s}
        else do
          skip iprot _t379
          read_Describe_cluster_name_result_fields iprot rec
      _ -> do
        skip iprot _t379
        readFieldEnd iprot
        read_Describe_cluster_name_result_fields iprot rec
read_Describe_cluster_name_result iprot = do
  readStructBegin iprot
  rec <- read_Describe_cluster_name_result_fields iprot (Describe_cluster_name_result{f_Describe_cluster_name_result_success=Nothing})
  readStructEnd iprot
  return rec
data Describe_version_args = Describe_version_args deriving (Show,Eq,Ord,Typeable)
write_Describe_version_args oprot rec = do
  writeStructBegin oprot "Describe_version_args"
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_version_args_fields iprot rec = do
  (_,_t384,_id385) <- readFieldBegin iprot
  if _t384 == T_STOP then return rec else
    case _id385 of 
      _ -> do
        skip iprot _t384
        readFieldEnd iprot
        read_Describe_version_args_fields iprot rec
read_Describe_version_args iprot = do
  readStructBegin iprot
  rec <- read_Describe_version_args_fields iprot (Describe_version_args{})
  readStructEnd iprot
  return rec
data Describe_version_result = Describe_version_result{f_Describe_version_result_success :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Describe_version_result oprot rec = do
  writeStructBegin oprot "Describe_version_result"
  case f_Describe_version_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_STRING,0)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_version_result_fields iprot rec = do
  (_,_t389,_id390) <- readFieldBegin iprot
  if _t389 == T_STOP then return rec else
    case _id390 of 
      0 -> if _t389 == T_STRING then do
        s <- readString iprot
        read_Describe_version_result_fields iprot rec{f_Describe_version_result_success=Just s}
        else do
          skip iprot _t389
          read_Describe_version_result_fields iprot rec
      _ -> do
        skip iprot _t389
        readFieldEnd iprot
        read_Describe_version_result_fields iprot rec
read_Describe_version_result iprot = do
  readStructBegin iprot
  rec <- read_Describe_version_result_fields iprot (Describe_version_result{f_Describe_version_result_success=Nothing})
  readStructEnd iprot
  return rec
data Describe_ring_args = Describe_ring_args{f_Describe_ring_args_keyspace :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Describe_ring_args oprot rec = do
  writeStructBegin oprot "Describe_ring_args"
  case f_Describe_ring_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_ring_args_fields iprot rec = do
  (_,_t394,_id395) <- readFieldBegin iprot
  if _t394 == T_STOP then return rec else
    case _id395 of 
      1 -> if _t394 == T_STRING then do
        s <- readString iprot
        read_Describe_ring_args_fields iprot rec{f_Describe_ring_args_keyspace=Just s}
        else do
          skip iprot _t394
          read_Describe_ring_args_fields iprot rec
      _ -> do
        skip iprot _t394
        readFieldEnd iprot
        read_Describe_ring_args_fields iprot rec
read_Describe_ring_args iprot = do
  readStructBegin iprot
  rec <- read_Describe_ring_args_fields iprot (Describe_ring_args{f_Describe_ring_args_keyspace=Nothing})
  readStructEnd iprot
  return rec
data Describe_ring_result = Describe_ring_result{f_Describe_ring_result_success :: Maybe [TokenRange]} deriving (Show,Eq,Ord,Typeable)
write_Describe_ring_result oprot rec = do
  writeStructBegin oprot "Describe_ring_result"
  case f_Describe_ring_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_LIST,0)
    (let {f [] = return (); f (_viter398:t) = do {write_TokenRange oprot _viter398;f t}} in do {writeListBegin oprot (T_STRUCT,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_ring_result_fields iprot rec = do
  (_,_t400,_id401) <- readFieldBegin iprot
  if _t400 == T_STOP then return rec else
    case _id401 of 
      0 -> if _t400 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- (read_TokenRange iprot);r <- f (n-1); return $ v:r}} in do {(_etype405,_size402) <- readListBegin iprot; f _size402})
        read_Describe_ring_result_fields iprot rec{f_Describe_ring_result_success=Just s}
        else do
          skip iprot _t400
          read_Describe_ring_result_fields iprot rec
      _ -> do
        skip iprot _t400
        readFieldEnd iprot
        read_Describe_ring_result_fields iprot rec
read_Describe_ring_result iprot = do
  readStructBegin iprot
  rec <- read_Describe_ring_result_fields iprot (Describe_ring_result{f_Describe_ring_result_success=Nothing})
  readStructEnd iprot
  return rec
data Describe_keyspace_args = Describe_keyspace_args{f_Describe_keyspace_args_keyspace :: Maybe String} deriving (Show,Eq,Ord,Typeable)
write_Describe_keyspace_args oprot rec = do
  writeStructBegin oprot "Describe_keyspace_args"
  case f_Describe_keyspace_args_keyspace rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keyspace",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_keyspace_args_fields iprot rec = do
  (_,_t410,_id411) <- readFieldBegin iprot
  if _t410 == T_STOP then return rec else
    case _id411 of 
      1 -> if _t410 == T_STRING then do
        s <- readString iprot
        read_Describe_keyspace_args_fields iprot rec{f_Describe_keyspace_args_keyspace=Just s}
        else do
          skip iprot _t410
          read_Describe_keyspace_args_fields iprot rec
      _ -> do
        skip iprot _t410
        readFieldEnd iprot
        read_Describe_keyspace_args_fields iprot rec
read_Describe_keyspace_args iprot = do
  readStructBegin iprot
  rec <- read_Describe_keyspace_args_fields iprot (Describe_keyspace_args{f_Describe_keyspace_args_keyspace=Nothing})
  readStructEnd iprot
  return rec
data Describe_keyspace_result = Describe_keyspace_result{f_Describe_keyspace_result_success :: Maybe (Map.Map String (Map.Map String String)),f_Describe_keyspace_result_nfe :: Maybe NotFoundException} deriving (Show,Eq,Ord,Typeable)
write_Describe_keyspace_result oprot rec = do
  writeStructBegin oprot "Describe_keyspace_result"
  case f_Describe_keyspace_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_MAP,0)
    (let {f [] = return (); f ((_kiter414,_viter415):t) = do {do {writeString oprot _kiter414;(let {f [] = return (); f ((_kiter416,_viter417):t) = do {do {writeString oprot _kiter416;writeString oprot _viter417};f t}} in do {writeMapBegin oprot (T_STRING,T_STRING,Map.size _viter415); f (Map.toList _viter415);writeMapEnd oprot})};f t}} in do {writeMapBegin oprot (T_STRING,T_MAP,Map.size _v); f (Map.toList _v);writeMapEnd oprot})
    writeFieldEnd oprot}
  case f_Describe_keyspace_result_nfe rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("nfe",T_STRUCT,1)
    write_NotFoundException oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_keyspace_result_fields iprot rec = do
  (_,_t419,_id420) <- readFieldBegin iprot
  if _t419 == T_STOP then return rec else
    case _id420 of 
      0 -> if _t419 == T_MAP then do
        s <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- (let {f 0 = return []; f n = do {k <- readString iprot; v <- readString iprot;r <- f (n-1); return $ (k,v):r}} in do {(_ktype427,_vtype428,_size426) <- readMapBegin iprot; l <- f _size426; return $ Map.fromList l});r <- f (n-1); return $ (k,v):r}} in do {(_ktype422,_vtype423,_size421) <- readMapBegin iprot; l <- f _size421; return $ Map.fromList l})
        read_Describe_keyspace_result_fields iprot rec{f_Describe_keyspace_result_success=Just s}
        else do
          skip iprot _t419
          read_Describe_keyspace_result_fields iprot rec
      1 -> if _t419 == T_STRUCT then do
        s <- (read_NotFoundException iprot)
        read_Describe_keyspace_result_fields iprot rec{f_Describe_keyspace_result_nfe=Just s}
        else do
          skip iprot _t419
          read_Describe_keyspace_result_fields iprot rec
      _ -> do
        skip iprot _t419
        readFieldEnd iprot
        read_Describe_keyspace_result_fields iprot rec
read_Describe_keyspace_result iprot = do
  readStructBegin iprot
  rec <- read_Describe_keyspace_result_fields iprot (Describe_keyspace_result{f_Describe_keyspace_result_success=Nothing,f_Describe_keyspace_result_nfe=Nothing})
  readStructEnd iprot
  return rec
data Describe_splits_args = Describe_splits_args{f_Describe_splits_args_start_token :: Maybe String,f_Describe_splits_args_end_token :: Maybe String,f_Describe_splits_args_keys_per_split :: Maybe Int} deriving (Show,Eq,Ord,Typeable)
write_Describe_splits_args oprot rec = do
  writeStructBegin oprot "Describe_splits_args"
  case f_Describe_splits_args_start_token rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("start_token",T_STRING,1)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Describe_splits_args_end_token rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("end_token",T_STRING,2)
    writeString oprot _v
    writeFieldEnd oprot}
  case f_Describe_splits_args_keys_per_split rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("keys_per_split",T_I32,3)
    writeI32 oprot _v
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_splits_args_fields iprot rec = do
  (_,_t434,_id435) <- readFieldBegin iprot
  if _t434 == T_STOP then return rec else
    case _id435 of 
      1 -> if _t434 == T_STRING then do
        s <- readString iprot
        read_Describe_splits_args_fields iprot rec{f_Describe_splits_args_start_token=Just s}
        else do
          skip iprot _t434
          read_Describe_splits_args_fields iprot rec
      2 -> if _t434 == T_STRING then do
        s <- readString iprot
        read_Describe_splits_args_fields iprot rec{f_Describe_splits_args_end_token=Just s}
        else do
          skip iprot _t434
          read_Describe_splits_args_fields iprot rec
      3 -> if _t434 == T_I32 then do
        s <- readI32 iprot
        read_Describe_splits_args_fields iprot rec{f_Describe_splits_args_keys_per_split=Just s}
        else do
          skip iprot _t434
          read_Describe_splits_args_fields iprot rec
      _ -> do
        skip iprot _t434
        readFieldEnd iprot
        read_Describe_splits_args_fields iprot rec
read_Describe_splits_args iprot = do
  readStructBegin iprot
  rec <- read_Describe_splits_args_fields iprot (Describe_splits_args{f_Describe_splits_args_start_token=Nothing,f_Describe_splits_args_end_token=Nothing,f_Describe_splits_args_keys_per_split=Nothing})
  readStructEnd iprot
  return rec
data Describe_splits_result = Describe_splits_result{f_Describe_splits_result_success :: Maybe [String]} deriving (Show,Eq,Ord,Typeable)
write_Describe_splits_result oprot rec = do
  writeStructBegin oprot "Describe_splits_result"
  case f_Describe_splits_result_success rec of {Nothing -> return (); Just _v -> do
    writeFieldBegin oprot ("success",T_LIST,0)
    (let {f [] = return (); f (_viter438:t) = do {writeString oprot _viter438;f t}} in do {writeListBegin oprot (T_STRING,length _v); f _v;writeListEnd oprot})
    writeFieldEnd oprot}
  writeFieldStop oprot
  writeStructEnd oprot
read_Describe_splits_result_fields iprot rec = do
  (_,_t440,_id441) <- readFieldBegin iprot
  if _t440 == T_STOP then return rec else
    case _id441 of 
      0 -> if _t440 == T_LIST then do
        s <- (let {f 0 = return []; f n = do {v <- readString iprot;r <- f (n-1); return $ v:r}} in do {(_etype445,_size442) <- readListBegin iprot; f _size442})
        read_Describe_splits_result_fields iprot rec{f_Describe_splits_result_success=Just s}
        else do
          skip iprot _t440
          read_Describe_splits_result_fields iprot rec
      _ -> do
        skip iprot _t440
        readFieldEnd iprot
        read_Describe_splits_result_fields iprot rec
read_Describe_splits_result iprot = do
  readStructBegin iprot
  rec <- read_Describe_splits_result_fields iprot (Describe_splits_result{f_Describe_splits_result_success=Nothing})
  readStructEnd iprot
  return rec
process_login (seqid, iprot, oprot, handler) = do
  args <- read_Login_args iprot
  readMessageEnd iprot
  rs <- return (Login_result Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (do
        Iface.login handler (f_Login_args_keyspace args) (f_Login_args_auth_request args)
        return rs)
      (\e  -> 
        return rs{f_Login_result_authnx =Just e}))
    (\e  -> 
      return rs{f_Login_result_authzx =Just e}))
  writeMessageBegin oprot ("login", M_REPLY, seqid);
  write_Login_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get (seqid, iprot, oprot, handler) = do
  args <- read_Get_args iprot
  readMessageEnd iprot
  rs <- return (Get_result Nothing Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (Control.Exception.catch
          (do
            res <- Iface.get handler (f_Get_args_keyspace args) (f_Get_args_key args) (f_Get_args_column_path args) (f_Get_args_consistency_level args)
            return rs{f_Get_result_success= Just res})
          (\e  -> 
            return rs{f_Get_result_ire =Just e}))
        (\e  -> 
          return rs{f_Get_result_nfe =Just e}))
      (\e  -> 
        return rs{f_Get_result_ue =Just e}))
    (\e  -> 
      return rs{f_Get_result_te =Just e}))
  writeMessageBegin oprot ("get", M_REPLY, seqid);
  write_Get_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get_slice (seqid, iprot, oprot, handler) = do
  args <- read_Get_slice_args iprot
  readMessageEnd iprot
  rs <- return (Get_slice_result Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          res <- Iface.get_slice handler (f_Get_slice_args_keyspace args) (f_Get_slice_args_key args) (f_Get_slice_args_column_parent args) (f_Get_slice_args_predicate args) (f_Get_slice_args_consistency_level args)
          return rs{f_Get_slice_result_success= Just res})
        (\e  -> 
          return rs{f_Get_slice_result_ire =Just e}))
      (\e  -> 
        return rs{f_Get_slice_result_ue =Just e}))
    (\e  -> 
      return rs{f_Get_slice_result_te =Just e}))
  writeMessageBegin oprot ("get_slice", M_REPLY, seqid);
  write_Get_slice_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_multiget (seqid, iprot, oprot, handler) = do
  args <- read_Multiget_args iprot
  readMessageEnd iprot
  rs <- return (Multiget_result Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          res <- Iface.multiget handler (f_Multiget_args_keyspace args) (f_Multiget_args_keys args) (f_Multiget_args_column_path args) (f_Multiget_args_consistency_level args)
          return rs{f_Multiget_result_success= Just res})
        (\e  -> 
          return rs{f_Multiget_result_ire =Just e}))
      (\e  -> 
        return rs{f_Multiget_result_ue =Just e}))
    (\e  -> 
      return rs{f_Multiget_result_te =Just e}))
  writeMessageBegin oprot ("multiget", M_REPLY, seqid);
  write_Multiget_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_multiget_slice (seqid, iprot, oprot, handler) = do
  args <- read_Multiget_slice_args iprot
  readMessageEnd iprot
  rs <- return (Multiget_slice_result Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          res <- Iface.multiget_slice handler (f_Multiget_slice_args_keyspace args) (f_Multiget_slice_args_keys args) (f_Multiget_slice_args_column_parent args) (f_Multiget_slice_args_predicate args) (f_Multiget_slice_args_consistency_level args)
          return rs{f_Multiget_slice_result_success= Just res})
        (\e  -> 
          return rs{f_Multiget_slice_result_ire =Just e}))
      (\e  -> 
        return rs{f_Multiget_slice_result_ue =Just e}))
    (\e  -> 
      return rs{f_Multiget_slice_result_te =Just e}))
  writeMessageBegin oprot ("multiget_slice", M_REPLY, seqid);
  write_Multiget_slice_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get_count (seqid, iprot, oprot, handler) = do
  args <- read_Get_count_args iprot
  readMessageEnd iprot
  rs <- return (Get_count_result Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          res <- Iface.get_count handler (f_Get_count_args_keyspace args) (f_Get_count_args_key args) (f_Get_count_args_column_parent args) (f_Get_count_args_consistency_level args)
          return rs{f_Get_count_result_success= Just res})
        (\e  -> 
          return rs{f_Get_count_result_ire =Just e}))
      (\e  -> 
        return rs{f_Get_count_result_ue =Just e}))
    (\e  -> 
      return rs{f_Get_count_result_te =Just e}))
  writeMessageBegin oprot ("get_count", M_REPLY, seqid);
  write_Get_count_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get_range_slice (seqid, iprot, oprot, handler) = do
  args <- read_Get_range_slice_args iprot
  readMessageEnd iprot
  rs <- return (Get_range_slice_result Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          res <- Iface.get_range_slice handler (f_Get_range_slice_args_keyspace args) (f_Get_range_slice_args_column_parent args) (f_Get_range_slice_args_predicate args) (f_Get_range_slice_args_start_key args) (f_Get_range_slice_args_finish_key args) (f_Get_range_slice_args_row_count args) (f_Get_range_slice_args_consistency_level args)
          return rs{f_Get_range_slice_result_success= Just res})
        (\e  -> 
          return rs{f_Get_range_slice_result_ire =Just e}))
      (\e  -> 
        return rs{f_Get_range_slice_result_ue =Just e}))
    (\e  -> 
      return rs{f_Get_range_slice_result_te =Just e}))
  writeMessageBegin oprot ("get_range_slice", M_REPLY, seqid);
  write_Get_range_slice_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get_range_slices (seqid, iprot, oprot, handler) = do
  args <- read_Get_range_slices_args iprot
  readMessageEnd iprot
  rs <- return (Get_range_slices_result Nothing Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          res <- Iface.get_range_slices handler (f_Get_range_slices_args_keyspace args) (f_Get_range_slices_args_column_parent args) (f_Get_range_slices_args_predicate args) (f_Get_range_slices_args_range args) (f_Get_range_slices_args_consistency_level args)
          return rs{f_Get_range_slices_result_success= Just res})
        (\e  -> 
          return rs{f_Get_range_slices_result_ire =Just e}))
      (\e  -> 
        return rs{f_Get_range_slices_result_ue =Just e}))
    (\e  -> 
      return rs{f_Get_range_slices_result_te =Just e}))
  writeMessageBegin oprot ("get_range_slices", M_REPLY, seqid);
  write_Get_range_slices_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_insert (seqid, iprot, oprot, handler) = do
  args <- read_Insert_args iprot
  readMessageEnd iprot
  rs <- return (Insert_result Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          Iface.insert handler (f_Insert_args_keyspace args) (f_Insert_args_key args) (f_Insert_args_column_path args) (f_Insert_args_value args) (f_Insert_args_timestamp args) (f_Insert_args_consistency_level args)
          return rs)
        (\e  -> 
          return rs{f_Insert_result_ire =Just e}))
      (\e  -> 
        return rs{f_Insert_result_ue =Just e}))
    (\e  -> 
      return rs{f_Insert_result_te =Just e}))
  writeMessageBegin oprot ("insert", M_REPLY, seqid);
  write_Insert_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_batch_insert (seqid, iprot, oprot, handler) = do
  args <- read_Batch_insert_args iprot
  readMessageEnd iprot
  rs <- return (Batch_insert_result Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          Iface.batch_insert handler (f_Batch_insert_args_keyspace args) (f_Batch_insert_args_key args) (f_Batch_insert_args_cfmap args) (f_Batch_insert_args_consistency_level args)
          return rs)
        (\e  -> 
          return rs{f_Batch_insert_result_ire =Just e}))
      (\e  -> 
        return rs{f_Batch_insert_result_ue =Just e}))
    (\e  -> 
      return rs{f_Batch_insert_result_te =Just e}))
  writeMessageBegin oprot ("batch_insert", M_REPLY, seqid);
  write_Batch_insert_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_remove (seqid, iprot, oprot, handler) = do
  args <- read_Remove_args iprot
  readMessageEnd iprot
  rs <- return (Remove_result Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          Iface.remove handler (f_Remove_args_keyspace args) (f_Remove_args_key args) (f_Remove_args_column_path args) (f_Remove_args_timestamp args) (f_Remove_args_consistency_level args)
          return rs)
        (\e  -> 
          return rs{f_Remove_result_ire =Just e}))
      (\e  -> 
        return rs{f_Remove_result_ue =Just e}))
    (\e  -> 
      return rs{f_Remove_result_te =Just e}))
  writeMessageBegin oprot ("remove", M_REPLY, seqid);
  write_Remove_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_batch_mutate (seqid, iprot, oprot, handler) = do
  args <- read_Batch_mutate_args iprot
  readMessageEnd iprot
  rs <- return (Batch_mutate_result Nothing Nothing Nothing)
  res <- (Control.Exception.catch
    (Control.Exception.catch
      (Control.Exception.catch
        (do
          Iface.batch_mutate handler (f_Batch_mutate_args_keyspace args) (f_Batch_mutate_args_mutation_map args) (f_Batch_mutate_args_consistency_level args)
          return rs)
        (\e  -> 
          return rs{f_Batch_mutate_result_ire =Just e}))
      (\e  -> 
        return rs{f_Batch_mutate_result_ue =Just e}))
    (\e  -> 
      return rs{f_Batch_mutate_result_te =Just e}))
  writeMessageBegin oprot ("batch_mutate", M_REPLY, seqid);
  write_Batch_mutate_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get_string_property (seqid, iprot, oprot, handler) = do
  args <- read_Get_string_property_args iprot
  readMessageEnd iprot
  rs <- return (Get_string_property_result Nothing)
  res <- (do
    res <- Iface.get_string_property handler (f_Get_string_property_args_property args)
    return rs{f_Get_string_property_result_success= Just res})
  writeMessageBegin oprot ("get_string_property", M_REPLY, seqid);
  write_Get_string_property_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_get_string_list_property (seqid, iprot, oprot, handler) = do
  args <- read_Get_string_list_property_args iprot
  readMessageEnd iprot
  rs <- return (Get_string_list_property_result Nothing)
  res <- (do
    res <- Iface.get_string_list_property handler (f_Get_string_list_property_args_property args)
    return rs{f_Get_string_list_property_result_success= Just res})
  writeMessageBegin oprot ("get_string_list_property", M_REPLY, seqid);
  write_Get_string_list_property_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_describe_keyspaces (seqid, iprot, oprot, handler) = do
  args <- read_Describe_keyspaces_args iprot
  readMessageEnd iprot
  rs <- return (Describe_keyspaces_result Nothing)
  res <- (do
    res <- Iface.describe_keyspaces handler
    return rs{f_Describe_keyspaces_result_success= Just res})
  writeMessageBegin oprot ("describe_keyspaces", M_REPLY, seqid);
  write_Describe_keyspaces_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_describe_cluster_name (seqid, iprot, oprot, handler) = do
  args <- read_Describe_cluster_name_args iprot
  readMessageEnd iprot
  rs <- return (Describe_cluster_name_result Nothing)
  res <- (do
    res <- Iface.describe_cluster_name handler
    return rs{f_Describe_cluster_name_result_success= Just res})
  writeMessageBegin oprot ("describe_cluster_name", M_REPLY, seqid);
  write_Describe_cluster_name_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_describe_version (seqid, iprot, oprot, handler) = do
  args <- read_Describe_version_args iprot
  readMessageEnd iprot
  rs <- return (Describe_version_result Nothing)
  res <- (do
    res <- Iface.describe_version handler
    return rs{f_Describe_version_result_success= Just res})
  writeMessageBegin oprot ("describe_version", M_REPLY, seqid);
  write_Describe_version_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_describe_ring (seqid, iprot, oprot, handler) = do
  args <- read_Describe_ring_args iprot
  readMessageEnd iprot
  rs <- return (Describe_ring_result Nothing)
  res <- (do
    res <- Iface.describe_ring handler (f_Describe_ring_args_keyspace args)
    return rs{f_Describe_ring_result_success= Just res})
  writeMessageBegin oprot ("describe_ring", M_REPLY, seqid);
  write_Describe_ring_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_describe_keyspace (seqid, iprot, oprot, handler) = do
  args <- read_Describe_keyspace_args iprot
  readMessageEnd iprot
  rs <- return (Describe_keyspace_result Nothing Nothing)
  res <- (Control.Exception.catch
    (do
      res <- Iface.describe_keyspace handler (f_Describe_keyspace_args_keyspace args)
      return rs{f_Describe_keyspace_result_success= Just res})
    (\e  -> 
      return rs{f_Describe_keyspace_result_nfe =Just e}))
  writeMessageBegin oprot ("describe_keyspace", M_REPLY, seqid);
  write_Describe_keyspace_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
process_describe_splits (seqid, iprot, oprot, handler) = do
  args <- read_Describe_splits_args iprot
  readMessageEnd iprot
  rs <- return (Describe_splits_result Nothing)
  res <- (do
    res <- Iface.describe_splits handler (f_Describe_splits_args_start_token args) (f_Describe_splits_args_end_token args) (f_Describe_splits_args_keys_per_split args)
    return rs{f_Describe_splits_result_success= Just res})
  writeMessageBegin oprot ("describe_splits", M_REPLY, seqid);
  write_Describe_splits_result oprot res
  writeMessageEnd oprot
  tFlush (getTransport oprot)
proc handler (iprot,oprot) (name,typ,seqid) = case name of
  "login" -> process_login (seqid,iprot,oprot,handler)
  "get" -> process_get (seqid,iprot,oprot,handler)
  "get_slice" -> process_get_slice (seqid,iprot,oprot,handler)
  "multiget" -> process_multiget (seqid,iprot,oprot,handler)
  "multiget_slice" -> process_multiget_slice (seqid,iprot,oprot,handler)
  "get_count" -> process_get_count (seqid,iprot,oprot,handler)
  "get_range_slice" -> process_get_range_slice (seqid,iprot,oprot,handler)
  "get_range_slices" -> process_get_range_slices (seqid,iprot,oprot,handler)
  "insert" -> process_insert (seqid,iprot,oprot,handler)
  "batch_insert" -> process_batch_insert (seqid,iprot,oprot,handler)
  "remove" -> process_remove (seqid,iprot,oprot,handler)
  "batch_mutate" -> process_batch_mutate (seqid,iprot,oprot,handler)
  "get_string_property" -> process_get_string_property (seqid,iprot,oprot,handler)
  "get_string_list_property" -> process_get_string_list_property (seqid,iprot,oprot,handler)
  "describe_keyspaces" -> process_describe_keyspaces (seqid,iprot,oprot,handler)
  "describe_cluster_name" -> process_describe_cluster_name (seqid,iprot,oprot,handler)
  "describe_version" -> process_describe_version (seqid,iprot,oprot,handler)
  "describe_ring" -> process_describe_ring (seqid,iprot,oprot,handler)
  "describe_keyspace" -> process_describe_keyspace (seqid,iprot,oprot,handler)
  "describe_splits" -> process_describe_splits (seqid,iprot,oprot,handler)
  _ -> do
    skip iprot T_STRUCT
    readMessageEnd iprot
    writeMessageBegin oprot (name,M_EXCEPTION,seqid)
    writeAppExn oprot (AppExn AE_UNKNOWN_METHOD ("Unknown function " ++ name))
    writeMessageEnd oprot
    tFlush (getTransport oprot)
process handler (iprot, oprot) = do
  (name, typ, seqid) <- readMessageBegin iprot
  proc handler (iprot,oprot) (name,typ,seqid)
  return True