----------------------------------------------------------------- -- Autogenerated by Thrift -- -- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -- @generated ----------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -fno-warn-unused-imports#-} {-# OPTIONS_GHC -fno-warn-overlapping-patterns#-} {-# OPTIONS_GHC -fno-warn-incomplete-patterns#-} {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns#-} {-# OPTIONS_GHC -fno-warn-incomplete-record-updates#-} {-# LANGUAGE GADTs #-} module Glean.GleanService.Service (GleanServiceCommand(..), reqName', reqParser', respWriter', methodsInfo') where import qualified Control.Exception as Exception import qualified Control.Monad.ST.Trans as ST import qualified Control.Monad.Trans.Class as Trans import qualified Data.ByteString.Builder as Builder import qualified Data.Default as Default import qualified Data.HashMap.Strict as HashMap import qualified Data.Int as Int import qualified Data.Map.Strict as Map import qualified Data.Proxy as Proxy import qualified Data.Text as Text import qualified Data.Text.Encoding as Text import qualified Facebook.Thrift.Annotation.Cpp.Cpp.Types as Facebook.Thrift.Annotation.Cpp.Cpp import qualified Facebook.Thrift.Annotation.Thrift.Thrift.Types as Facebook.Thrift.Annotation.Thrift.Thrift import qualified Fb303.FacebookService.Service as FacebookService import qualified Fb303.Types as Fb303 import qualified Glean.Types as Types import qualified Prelude as Prelude import qualified Thrift.Binary.Parser as Parser import qualified Thrift.Codegen as Thrift import qualified Thrift.Processor as Thrift import qualified Thrift.Protocol.ApplicationException.Types as Thrift import Control.Applicative ((<*), (*>)) import Data.Monoid ((<>)) import Prelude ((<$>), (<*>), (++), (.), (==)) data GleanServiceCommand a where GetSchemaInfo :: Types.Repo -> Types.GetSchemaInfo -> GleanServiceCommand Types.SchemaInfo GetSchemaInfoForSchema :: Types.GetSchemaInfo -> GleanServiceCommand Types.SchemaInfo ValidateSchema :: Types.ValidateSchema -> GleanServiceCommand () SendBatch :: Types.ComputedBatch -> GleanServiceCommand Types.SendResponse EnqueueBatch :: Types.Repo -> Types.EnqueueBatch -> Types.EnqueueBatchWaitPolicy -> GleanServiceCommand Types.EnqueueBatchResponse FinishBatch :: Types.Handle -> GleanServiceCommand Types.FinishResponse SendJsonBatch :: Types.Repo -> Types.SendJsonBatch -> GleanServiceCommand Types.SendJsonBatchResponse KickOff :: Types.KickOff -> GleanServiceCommand Types.KickOffResponse UpdateProperties :: Types.Repo -> Types.DatabaseProperties -> [Text.Text] -> GleanServiceCommand Types.UpdatePropertiesResponse CompletePredicates :: Types.Repo -> Types.CompletePredicates -> GleanServiceCommand Types.CompletePredicatesResponse Finish :: Types.Repo -> GleanServiceCommand Types.FinishDatabaseResponse Finalize :: Types.Repo -> GleanServiceCommand Types.FinalizeResponse QueryFact :: Types.Repo -> Types.Id -> GleanServiceCommand Types.Fact FactIdRange :: Types.Repo -> GleanServiceCommand Types.FactIdRange PredicateStats :: Types.Repo -> Types.PredicateStatsOpts -> GleanServiceCommand (Map.Map Types.Id Types.PredicateStats) ListDatabases :: Types.ListDatabases -> GleanServiceCommand Types.ListDatabasesResult GetDatabase :: Types.Repo -> GleanServiceCommand Types.GetDatabaseResult DeleteDatabase :: Types.Repo -> GleanServiceCommand Types.DeleteDatabaseResult Restore :: Text.Text -> GleanServiceCommand () UserQueryFacts :: Types.Repo -> Types.UserQueryFacts -> GleanServiceCommand Types.UserQueryResults UserQuery :: Types.Repo -> Types.UserQuery -> GleanServiceCommand Types.UserQueryResults UserQueryBatch :: Types.Repo -> Types.UserQueryBatch -> GleanServiceCommand [Types.UserQueryResultsOrException] DeriveStored :: Types.Repo -> Types.DerivePredicateQuery -> GleanServiceCommand Types.DerivationStatus SuperFacebookService :: FacebookService.FacebookServiceCommand a -> GleanServiceCommand a instance Thrift.Processor GleanServiceCommand where reqName = reqName' reqParser = reqParser' respWriter = respWriter' methodsInfo _ = methodsInfo' reqName' :: GleanServiceCommand a -> Text.Text reqName' (GetSchemaInfo __field__repo __field__get) = "getSchemaInfo" reqName' (GetSchemaInfoForSchema __field__get) = "getSchemaInfoForSchema" reqName' (ValidateSchema __field__v) = "validateSchema" reqName' (SendBatch __field__batch) = "sendBatch" reqName' (EnqueueBatch __field__repo __field__batch __field__waitPolicy) = "enqueueBatch" reqName' (FinishBatch __field__handle) = "finishBatch" reqName' (SendJsonBatch __field__repo __field__s) = "sendJsonBatch" reqName' (KickOff __field__request) = "kickOff" reqName' (UpdateProperties __field__repo __field__set_ __field__unset) = "updateProperties" reqName' (CompletePredicates __field__repo __field__predicates) = "completePredicates" reqName' (Finish __field__repo) = "finish" reqName' (Finalize __field__repo) = "finalize" reqName' (QueryFact __field__repo __field__id) = "queryFact" reqName' (FactIdRange __field__repo) = "factIdRange" reqName' (PredicateStats __field__repo __field__opts) = "predicateStats" reqName' (ListDatabases __field__l) = "listDatabases" reqName' (GetDatabase __field__repo) = "getDatabase" reqName' (DeleteDatabase __field__repo) = "deleteDatabase" reqName' (Restore __field__locator) = "restore" reqName' (UserQueryFacts __field__repo __field__q) = "userQueryFacts" reqName' (UserQuery __field__repo __field__q) = "userQuery" reqName' (UserQueryBatch __field__repo __field__q) = "userQueryBatch" reqName' (DeriveStored __field__repo __field__q) = "deriveStored" reqName' (SuperFacebookService x) = FacebookService.reqName' x reqParser' :: Thrift.Protocol p => Proxy.Proxy p -> Text.Text -> Parser.Parser (Thrift.Some GleanServiceCommand) reqParser' _proxy "getSchemaInfo" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__get <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__get _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__get <- ST.readSTRef __field__get Prelude.pure (Thrift.Some (GetSchemaInfo __val__repo __val__get)) _idMap = HashMap.fromList [("repo", 1), ("get", 2)] _parse 0) reqParser' _proxy "getSchemaInfoForSchema" = ST.runSTT (do Prelude.return () __field__get <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__get _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__get <- ST.readSTRef __field__get Prelude.pure (Thrift.Some (GetSchemaInfoForSchema __val__get)) _idMap = HashMap.fromList [("get", 1)] _parse 0) reqParser' _proxy "validateSchema" = ST.runSTT (do Prelude.return () __field__v <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__v _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__v <- ST.readSTRef __field__v Prelude.pure (Thrift.Some (ValidateSchema __val__v)) _idMap = HashMap.fromList [("v", 1)] _parse 0) reqParser' _proxy "sendBatch" = ST.runSTT (do Prelude.return () __field__batch <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__batch _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__batch <- ST.readSTRef __field__batch Prelude.pure (Thrift.Some (SendBatch __val__batch)) _idMap = HashMap.fromList [("batch", 1)] _parse 0) reqParser' _proxy "enqueueBatch" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__batch <- ST.newSTRef Default.def __field__waitPolicy <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__batch _val 3 | _type == Thrift.getI32Type _proxy -> do !_val <- Trans.lift (Thrift.parseEnum _proxy "EnqueueBatchWaitPolicy") ST.writeSTRef __field__waitPolicy _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__batch <- ST.readSTRef __field__batch !__val__waitPolicy <- ST.readSTRef __field__waitPolicy Prelude.pure (Thrift.Some (EnqueueBatch __val__repo __val__batch __val__waitPolicy)) _idMap = HashMap.fromList [("repo", 1), ("batch", 2), ("waitPolicy", 3)] _parse 0) reqParser' _proxy "finishBatch" = ST.runSTT (do Prelude.return () __field__handle <- ST.newSTRef "" let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStringType _proxy -> do !_val <- Trans.lift (Thrift.parseText _proxy) ST.writeSTRef __field__handle _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__handle <- ST.readSTRef __field__handle Prelude.pure (Thrift.Some (FinishBatch __val__handle)) _idMap = HashMap.fromList [("handle", 1)] _parse 0) reqParser' _proxy "sendJsonBatch" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__s <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__s _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__s <- ST.readSTRef __field__s Prelude.pure (Thrift.Some (SendJsonBatch __val__repo __val__s)) _idMap = HashMap.fromList [("repo", 1), ("s", 2)] _parse 0) reqParser' _proxy "kickOff" = ST.runSTT (do Prelude.return () __field__request <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__request _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__request <- ST.readSTRef __field__request Prelude.pure (Thrift.Some (KickOff __val__request)) _idMap = HashMap.fromList [("request", 1)] _parse 0) reqParser' _proxy "updateProperties" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__set_ <- ST.newSTRef (HashMap.fromList []) __field__unset <- ST.newSTRef [] let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getMapType _proxy -> do !_val <- Trans.lift (HashMap.fromList <$> Thrift.parseMap _proxy (Thrift.parseText _proxy) (Thrift.parseText _proxy) Prelude.True) ST.writeSTRef __field__set_ _val 3 | _type == Thrift.getListType _proxy -> do !_val <- Trans.lift (Prelude.snd <$> Thrift.parseList _proxy (Thrift.parseText _proxy)) ST.writeSTRef __field__unset _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__set_ <- ST.readSTRef __field__set_ !__val__unset <- ST.readSTRef __field__unset Prelude.pure (Thrift.Some (UpdateProperties __val__repo __val__set_ __val__unset)) _idMap = HashMap.fromList [("repo", 1), ("set_", 2), ("unset", 3)] _parse 0) reqParser' _proxy "completePredicates" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__predicates <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__predicates _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__predicates <- ST.readSTRef __field__predicates Prelude.pure (Thrift.Some (CompletePredicates __val__repo __val__predicates)) _idMap = HashMap.fromList [("repo", 1), ("predicates", 2)] _parse 0) reqParser' _proxy "finish" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo Prelude.pure (Thrift.Some (Finish __val__repo)) _idMap = HashMap.fromList [("repo", 1)] _parse 0) reqParser' _proxy "finalize" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo Prelude.pure (Thrift.Some (Finalize __val__repo)) _idMap = HashMap.fromList [("repo", 1)] _parse 0) reqParser' _proxy "queryFact" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__id <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getI64Type _proxy -> do !_val <- Trans.lift (Thrift.parseI64 _proxy) ST.writeSTRef __field__id _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__id <- ST.readSTRef __field__id Prelude.pure (Thrift.Some (QueryFact __val__repo __val__id)) _idMap = HashMap.fromList [("repo", 1), ("id", 2)] _parse 0) reqParser' _proxy "factIdRange" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo Prelude.pure (Thrift.Some (FactIdRange __val__repo)) _idMap = HashMap.fromList [("repo", 1)] _parse 0) reqParser' _proxy "predicateStats" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__opts <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__opts _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__opts <- ST.readSTRef __field__opts Prelude.pure (Thrift.Some (PredicateStats __val__repo __val__opts)) _idMap = HashMap.fromList [("repo", 1), ("opts", 2)] _parse 0) reqParser' _proxy "listDatabases" = ST.runSTT (do Prelude.return () __field__l <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__l _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__l <- ST.readSTRef __field__l Prelude.pure (Thrift.Some (ListDatabases __val__l)) _idMap = HashMap.fromList [("l", 1)] _parse 0) reqParser' _proxy "getDatabase" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo Prelude.pure (Thrift.Some (GetDatabase __val__repo)) _idMap = HashMap.fromList [("repo", 1)] _parse 0) reqParser' _proxy "deleteDatabase" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo Prelude.pure (Thrift.Some (DeleteDatabase __val__repo)) _idMap = HashMap.fromList [("repo", 1)] _parse 0) reqParser' _proxy "restore" = ST.runSTT (do Prelude.return () __field__locator <- ST.newSTRef "" let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStringType _proxy -> do !_val <- Trans.lift (Thrift.parseText _proxy) ST.writeSTRef __field__locator _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__locator <- ST.readSTRef __field__locator Prelude.pure (Thrift.Some (Restore __val__locator)) _idMap = HashMap.fromList [("locator", 1)] _parse 0) reqParser' _proxy "userQueryFacts" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__q <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__q _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__q <- ST.readSTRef __field__q Prelude.pure (Thrift.Some (UserQueryFacts __val__repo __val__q)) _idMap = HashMap.fromList [("repo", 1), ("q", 2)] _parse 0) reqParser' _proxy "userQuery" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__q <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__q _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__q <- ST.readSTRef __field__q Prelude.pure (Thrift.Some (UserQuery __val__repo __val__q)) _idMap = HashMap.fromList [("repo", 1), ("q", 2)] _parse 0) reqParser' _proxy "userQueryBatch" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__q <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__q _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__q <- ST.readSTRef __field__q Prelude.pure (Thrift.Some (UserQueryBatch __val__repo __val__q)) _idMap = HashMap.fromList [("repo", 1), ("q", 2)] _parse 0) reqParser' _proxy "deriveStored" = ST.runSTT (do Prelude.return () __field__repo <- ST.newSTRef Default.def __field__q <- ST.newSTRef Default.def let _parse _lastId = do _fieldBegin <- Trans.lift (Thrift.parseFieldBegin _proxy _lastId _idMap) case _fieldBegin of Thrift.FieldBegin _type _id _bool -> do case _id of 1 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__repo _val 2 | _type == Thrift.getStructType _proxy -> do !_val <- Trans.lift (Thrift.parseStruct _proxy) ST.writeSTRef __field__q _val _ -> Trans.lift (Thrift.parseSkip _proxy _type (Prelude.Just _bool)) _parse _id Thrift.FieldEnd -> do !__val__repo <- ST.readSTRef __field__repo !__val__q <- ST.readSTRef __field__q Prelude.pure (Thrift.Some (DeriveStored __val__repo __val__q)) _idMap = HashMap.fromList [("repo", 1), ("q", 2)] _parse 0) reqParser' _proxy funName = do Thrift.Some x <- FacebookService.reqParser' _proxy funName Prelude.return (Thrift.Some (SuperFacebookService x)) respWriter' :: Thrift.Protocol p => Proxy.Proxy p -> Int.Int32 -> GleanServiceCommand a -> Prelude.Either Exception.SomeException a -> (Builder.Builder, Prelude.Maybe (Exception.SomeException, Thrift.Blame)) respWriter' _proxy _seqNum GetSchemaInfo{} _r = (Thrift.genMsgBegin _proxy "getSchemaInfo" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum GetSchemaInfoForSchema{} _r = (Thrift.genMsgBegin _proxy "getSchemaInfoForSchema" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum ValidateSchema{} _r = (Thrift.genMsgBegin _proxy "validateSchema" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [], Prelude.Nothing) respWriter' _proxy _seqNum SendBatch{} _r = (Thrift.genMsgBegin _proxy "sendBatch" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum EnqueueBatch{} _r = (Thrift.genMsgBegin _proxy "enqueueBatch" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.Retry{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "r" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum FinishBatch{} _r = (Thrift.genMsgBegin _proxy "finishBatch" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.UnknownBatchHandle{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum SendJsonBatch{} _r = (Thrift.genMsgBegin _proxy "sendJsonBatch" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.Retry{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "r" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum KickOff{} _r = (Thrift.genMsgBegin _proxy "kickOff" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.InvalidDependency{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum UpdateProperties{} _r = (Thrift.genMsgBegin _proxy "updateProperties" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum CompletePredicates{} _r = (Thrift.genMsgBegin _proxy "completePredicates" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.Retry{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "r" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 4 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum Finish{} _r = (Thrift.genMsgBegin _proxy "finish" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.DatabaseNotIncomplete{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "c" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum Finalize{} _r = (Thrift.genMsgBegin _proxy "finalize" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.Retry{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "r" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 4 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum QueryFact{} _r = (Thrift.genMsgBegin _proxy "queryFact" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum FactIdRange{} _r = (Thrift.genMsgBegin _proxy "factIdRange" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum PredicateStats{} _r = (Thrift.genMsgBegin _proxy "predicateStats" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getMapType _proxy) 0 0 ((Thrift.genMap _proxy (Thrift.getI64Type _proxy) (Thrift.getStructType _proxy) Prelude.False (Thrift.genI64 _proxy) (Thrift.buildStruct _proxy) . Map.toList) _result)], Prelude.Nothing) respWriter' _proxy _seqNum ListDatabases{} _r = (Thrift.genMsgBegin _proxy "listDatabases" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum GetDatabase{} _r = (Thrift.genMsgBegin _proxy "getDatabase" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum DeleteDatabase{} _r = (Thrift.genMsgBegin _proxy "deleteDatabase" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum Restore{} _r = (Thrift.genMsgBegin _proxy "restore" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.InvalidLocator{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [], Prelude.Nothing) respWriter' _proxy _seqNum UserQueryFacts{} _r = (Thrift.genMsgBegin _proxy "userQueryFacts" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.BadQuery{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "b" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 4 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownSchemaId{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "s" (Thrift.getStructType _proxy) 5 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum UserQuery{} _r = (Thrift.genMsgBegin _proxy "userQuery" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.BadQuery{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "b" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.Retry{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "r" (Thrift.getStructType _proxy) 4 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 5 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownSchemaId{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "s" (Thrift.getStructType _proxy) 6 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum UserQueryBatch{} _r = (Thrift.genMsgBegin _proxy "userQueryBatch" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownDatabase{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 4 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getListType _proxy) 0 0 (Thrift.genList _proxy (Thrift.getStructType _proxy) (Thrift.buildStruct _proxy) _result)], Prelude.Nothing) respWriter' _proxy _seqNum DeriveStored{} _r = (Thrift.genMsgBegin _proxy "deriveStored" _msgType _seqNum <> _msgBody <> Thrift.genMsgEnd _proxy, _msgException) where (_msgType, _msgBody, _msgException) = case _r of Prelude.Left _ex | Prelude.Just _e@Thrift.ApplicationException{} <- Exception.fromException _ex -> (3, Thrift.buildStruct _proxy _e, Prelude.Just (_ex, Thrift.ServerError)) | Prelude.Just _e@Types.Exception{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "e" (Thrift.getStructType _proxy) 1 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.NotAStoredPredicate{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "n" (Thrift.getStructType _proxy) 2 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.UnknownPredicate{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "u" (Thrift.getStructType _proxy) 3 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.Just _e@Types.IncompleteDependencies{} <- Exception.fromException _ex -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "d" (Thrift.getStructType _proxy) 4 0 (Thrift.buildStruct _proxy _e)], Prelude.Just (_ex, Thrift.ClientError)) | Prelude.otherwise -> let _e = Thrift.ApplicationException (Text.pack (Prelude.show _ex)) Thrift.ApplicationExceptionType_InternalError in (3, Thrift.buildStruct _proxy _e, Prelude.Just (Exception.toException _e, Thrift.ServerError)) Prelude.Right _result -> (2, Thrift.genStruct _proxy [Thrift.genField _proxy "" (Thrift.getStructType _proxy) 0 0 (Thrift.buildStruct _proxy _result)], Prelude.Nothing) respWriter' _proxy _seqNum (SuperFacebookService _x) _r = FacebookService.respWriter' _proxy _seqNum _x _r methodsInfo' :: Map.Map Text.Text Thrift.MethodInfo methodsInfo' = Map.union (Map.fromList [("getSchemaInfo", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("getSchemaInfoForSchema", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("validateSchema", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("sendBatch", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("enqueueBatch", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("finishBatch", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("sendJsonBatch", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("kickOff", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("updateProperties", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("completePredicates", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("finish", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("finalize", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("queryFact", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("factIdRange", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("predicateStats", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("listDatabases", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("getDatabase", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("deleteDatabase", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("restore", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("userQueryFacts", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("userQuery", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("userQueryBatch", Thrift.MethodInfo Thrift.NormalPriority Prelude.False), ("deriveStored", Thrift.MethodInfo Thrift.NormalPriority Prelude.False)]) FacebookService.methodsInfo'