{-# LANGUAGE TypeFamilies, DeriveGeneric, TypeApplications, OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-name-shadowing -fno-warn-unused-matches #-}

module Jaeger.Server where

import  Jaeger.Types
import qualified Pinch.Server
import qualified Prelude
import qualified Control.Applicative
import qualified Control.Exception
import qualified Pinch
import qualified Pinch.Server
import qualified Pinch.Internal.RPC
import qualified Data.Text
import qualified Data.ByteString
import qualified Data.Int
import qualified Data.Vector
import qualified Data.HashMap.Strict
import qualified Data.HashSet
import qualified GHC.Generics
import qualified Data.Hashable
import  Data.Vector.Instances ()

data Collector
  = Collector { Collector
-> Context -> Vector Batch -> IO (Vector BatchSubmitResponse)
submitBatches :: (Pinch.Server.Context) -> ((Data.Vector.Vector Batch)) -> (Prelude.IO (Data.Vector.Vector BatchSubmitResponse)) }


collector_mkServer :: (Collector) -> Pinch.Server.ThriftServer
collector_mkServer :: Collector -> ThriftServer
collector_mkServer Collector
server = let functions :: HashMap Text Handler
functions =   [(Text, Handler)] -> HashMap Text Handler
forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
Data.HashMap.Strict.fromList ([ ( Text
"submitBatches"
                                                , (Context -> SubmitBatches_Args -> IO SubmitBatches_Result)
-> Handler
forall c r.
(Pinchable c, Tag c ~ TStruct, Pinchable r, Tag r ~ TStruct) =>
(Context -> c -> IO r) -> Handler
Pinch.Server.CallHandler ((\Context
ctx (SubmitBatches_Args Vector Batch
a) -> IO (ResultType SubmitBatches_Result) -> IO SubmitBatches_Result
forall a. ThriftResult a => IO (ResultType a) -> IO a
Pinch.Internal.RPC.wrap @(SubmitBatches_Result) (Collector
-> Context -> Vector Batch -> IO (Vector BatchSubmitResponse)
submitBatches (Collector
server) (Context
ctx) (Vector Batch
a)))) ) ]) in (Text -> Maybe Handler) -> ThriftServer
Pinch.Server.createServer ((\Text
nm -> Text -> HashMap Text Handler -> Maybe Handler
forall k v. (Eq k, Hashable k) => k -> HashMap k v -> Maybe v
Data.HashMap.Strict.lookup (Text
nm) (HashMap Text Handler
functions)))