{-# LANGUAGE DeriveAnyClass #-}
module Arbiter.Test.Fixtures
( TestPayload (..)
, WorkerTestPayload (..)
, QueueAPayload (..)
, QueueBPayload (..)
) where
import Arbiter.Core.Job.Kind (HasKind)
import Data.Aeson (FromJSON, ToJSON)
import Data.Text (Text)
import GHC.Generics (Generic)
newtype TestPayload = TestMessage Text
deriving stock (TestPayload -> TestPayload -> Bool
(TestPayload -> TestPayload -> Bool)
-> (TestPayload -> TestPayload -> Bool) -> Eq TestPayload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TestPayload -> TestPayload -> Bool
== :: TestPayload -> TestPayload -> Bool
$c/= :: TestPayload -> TestPayload -> Bool
/= :: TestPayload -> TestPayload -> Bool
Eq, (forall x. TestPayload -> Rep TestPayload x)
-> (forall x. Rep TestPayload x -> TestPayload)
-> Generic TestPayload
forall x. Rep TestPayload x -> TestPayload
forall x. TestPayload -> Rep TestPayload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TestPayload -> Rep TestPayload x
from :: forall x. TestPayload -> Rep TestPayload x
$cto :: forall x. Rep TestPayload x -> TestPayload
to :: forall x. Rep TestPayload x -> TestPayload
Generic, Int -> TestPayload -> ShowS
[TestPayload] -> ShowS
TestPayload -> String
(Int -> TestPayload -> ShowS)
-> (TestPayload -> String)
-> ([TestPayload] -> ShowS)
-> Show TestPayload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TestPayload -> ShowS
showsPrec :: Int -> TestPayload -> ShowS
$cshow :: TestPayload -> String
show :: TestPayload -> String
$cshowList :: [TestPayload] -> ShowS
showList :: [TestPayload] -> ShowS
Show)
deriving anyclass (Maybe TestPayload
Value -> Parser [TestPayload]
Value -> Parser TestPayload
(Value -> Parser TestPayload)
-> (Value -> Parser [TestPayload])
-> Maybe TestPayload
-> FromJSON TestPayload
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser TestPayload
parseJSON :: Value -> Parser TestPayload
$cparseJSONList :: Value -> Parser [TestPayload]
parseJSONList :: Value -> Parser [TestPayload]
$comittedField :: Maybe TestPayload
omittedField :: Maybe TestPayload
FromJSON, [TestPayload] -> Value
[TestPayload] -> Encoding
TestPayload -> Bool
TestPayload -> Value
TestPayload -> Encoding
(TestPayload -> Value)
-> (TestPayload -> Encoding)
-> ([TestPayload] -> Value)
-> ([TestPayload] -> Encoding)
-> (TestPayload -> Bool)
-> ToJSON TestPayload
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: TestPayload -> Value
toJSON :: TestPayload -> Value
$ctoEncoding :: TestPayload -> Encoding
toEncoding :: TestPayload -> Encoding
$ctoJSONList :: [TestPayload] -> Value
toJSONList :: [TestPayload] -> Value
$ctoEncodingList :: [TestPayload] -> Encoding
toEncodingList :: [TestPayload] -> Encoding
$comitField :: TestPayload -> Bool
omitField :: TestPayload -> Bool
ToJSON)
instance HasKind TestPayload
data WorkerTestPayload
= SimpleTask Text
| FailingTask Int
deriving stock (WorkerTestPayload -> WorkerTestPayload -> Bool
(WorkerTestPayload -> WorkerTestPayload -> Bool)
-> (WorkerTestPayload -> WorkerTestPayload -> Bool)
-> Eq WorkerTestPayload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkerTestPayload -> WorkerTestPayload -> Bool
== :: WorkerTestPayload -> WorkerTestPayload -> Bool
$c/= :: WorkerTestPayload -> WorkerTestPayload -> Bool
/= :: WorkerTestPayload -> WorkerTestPayload -> Bool
Eq, (forall x. WorkerTestPayload -> Rep WorkerTestPayload x)
-> (forall x. Rep WorkerTestPayload x -> WorkerTestPayload)
-> Generic WorkerTestPayload
forall x. Rep WorkerTestPayload x -> WorkerTestPayload
forall x. WorkerTestPayload -> Rep WorkerTestPayload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkerTestPayload -> Rep WorkerTestPayload x
from :: forall x. WorkerTestPayload -> Rep WorkerTestPayload x
$cto :: forall x. Rep WorkerTestPayload x -> WorkerTestPayload
to :: forall x. Rep WorkerTestPayload x -> WorkerTestPayload
Generic, Int -> WorkerTestPayload -> ShowS
[WorkerTestPayload] -> ShowS
WorkerTestPayload -> String
(Int -> WorkerTestPayload -> ShowS)
-> (WorkerTestPayload -> String)
-> ([WorkerTestPayload] -> ShowS)
-> Show WorkerTestPayload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkerTestPayload -> ShowS
showsPrec :: Int -> WorkerTestPayload -> ShowS
$cshow :: WorkerTestPayload -> String
show :: WorkerTestPayload -> String
$cshowList :: [WorkerTestPayload] -> ShowS
showList :: [WorkerTestPayload] -> ShowS
Show)
deriving anyclass (Maybe WorkerTestPayload
Value -> Parser [WorkerTestPayload]
Value -> Parser WorkerTestPayload
(Value -> Parser WorkerTestPayload)
-> (Value -> Parser [WorkerTestPayload])
-> Maybe WorkerTestPayload
-> FromJSON WorkerTestPayload
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser WorkerTestPayload
parseJSON :: Value -> Parser WorkerTestPayload
$cparseJSONList :: Value -> Parser [WorkerTestPayload]
parseJSONList :: Value -> Parser [WorkerTestPayload]
$comittedField :: Maybe WorkerTestPayload
omittedField :: Maybe WorkerTestPayload
FromJSON, [WorkerTestPayload] -> Value
[WorkerTestPayload] -> Encoding
WorkerTestPayload -> Bool
WorkerTestPayload -> Value
WorkerTestPayload -> Encoding
(WorkerTestPayload -> Value)
-> (WorkerTestPayload -> Encoding)
-> ([WorkerTestPayload] -> Value)
-> ([WorkerTestPayload] -> Encoding)
-> (WorkerTestPayload -> Bool)
-> ToJSON WorkerTestPayload
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: WorkerTestPayload -> Value
toJSON :: WorkerTestPayload -> Value
$ctoEncoding :: WorkerTestPayload -> Encoding
toEncoding :: WorkerTestPayload -> Encoding
$ctoJSONList :: [WorkerTestPayload] -> Value
toJSONList :: [WorkerTestPayload] -> Value
$ctoEncodingList :: [WorkerTestPayload] -> Encoding
toEncodingList :: [WorkerTestPayload] -> Encoding
$comitField :: WorkerTestPayload -> Bool
omitField :: WorkerTestPayload -> Bool
ToJSON)
instance HasKind WorkerTestPayload
newtype QueueAPayload = QueueAPayload Text
deriving stock (QueueAPayload -> QueueAPayload -> Bool
(QueueAPayload -> QueueAPayload -> Bool)
-> (QueueAPayload -> QueueAPayload -> Bool) -> Eq QueueAPayload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueueAPayload -> QueueAPayload -> Bool
== :: QueueAPayload -> QueueAPayload -> Bool
$c/= :: QueueAPayload -> QueueAPayload -> Bool
/= :: QueueAPayload -> QueueAPayload -> Bool
Eq, (forall x. QueueAPayload -> Rep QueueAPayload x)
-> (forall x. Rep QueueAPayload x -> QueueAPayload)
-> Generic QueueAPayload
forall x. Rep QueueAPayload x -> QueueAPayload
forall x. QueueAPayload -> Rep QueueAPayload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. QueueAPayload -> Rep QueueAPayload x
from :: forall x. QueueAPayload -> Rep QueueAPayload x
$cto :: forall x. Rep QueueAPayload x -> QueueAPayload
to :: forall x. Rep QueueAPayload x -> QueueAPayload
Generic, Int -> QueueAPayload -> ShowS
[QueueAPayload] -> ShowS
QueueAPayload -> String
(Int -> QueueAPayload -> ShowS)
-> (QueueAPayload -> String)
-> ([QueueAPayload] -> ShowS)
-> Show QueueAPayload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueueAPayload -> ShowS
showsPrec :: Int -> QueueAPayload -> ShowS
$cshow :: QueueAPayload -> String
show :: QueueAPayload -> String
$cshowList :: [QueueAPayload] -> ShowS
showList :: [QueueAPayload] -> ShowS
Show)
deriving anyclass (Maybe QueueAPayload
Value -> Parser [QueueAPayload]
Value -> Parser QueueAPayload
(Value -> Parser QueueAPayload)
-> (Value -> Parser [QueueAPayload])
-> Maybe QueueAPayload
-> FromJSON QueueAPayload
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser QueueAPayload
parseJSON :: Value -> Parser QueueAPayload
$cparseJSONList :: Value -> Parser [QueueAPayload]
parseJSONList :: Value -> Parser [QueueAPayload]
$comittedField :: Maybe QueueAPayload
omittedField :: Maybe QueueAPayload
FromJSON, [QueueAPayload] -> Value
[QueueAPayload] -> Encoding
QueueAPayload -> Bool
QueueAPayload -> Value
QueueAPayload -> Encoding
(QueueAPayload -> Value)
-> (QueueAPayload -> Encoding)
-> ([QueueAPayload] -> Value)
-> ([QueueAPayload] -> Encoding)
-> (QueueAPayload -> Bool)
-> ToJSON QueueAPayload
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: QueueAPayload -> Value
toJSON :: QueueAPayload -> Value
$ctoEncoding :: QueueAPayload -> Encoding
toEncoding :: QueueAPayload -> Encoding
$ctoJSONList :: [QueueAPayload] -> Value
toJSONList :: [QueueAPayload] -> Value
$ctoEncodingList :: [QueueAPayload] -> Encoding
toEncodingList :: [QueueAPayload] -> Encoding
$comitField :: QueueAPayload -> Bool
omitField :: QueueAPayload -> Bool
ToJSON)
newtype QueueBPayload = QueueBPayload Text
deriving stock (QueueBPayload -> QueueBPayload -> Bool
(QueueBPayload -> QueueBPayload -> Bool)
-> (QueueBPayload -> QueueBPayload -> Bool) -> Eq QueueBPayload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueueBPayload -> QueueBPayload -> Bool
== :: QueueBPayload -> QueueBPayload -> Bool
$c/= :: QueueBPayload -> QueueBPayload -> Bool
/= :: QueueBPayload -> QueueBPayload -> Bool
Eq, (forall x. QueueBPayload -> Rep QueueBPayload x)
-> (forall x. Rep QueueBPayload x -> QueueBPayload)
-> Generic QueueBPayload
forall x. Rep QueueBPayload x -> QueueBPayload
forall x. QueueBPayload -> Rep QueueBPayload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. QueueBPayload -> Rep QueueBPayload x
from :: forall x. QueueBPayload -> Rep QueueBPayload x
$cto :: forall x. Rep QueueBPayload x -> QueueBPayload
to :: forall x. Rep QueueBPayload x -> QueueBPayload
Generic, Int -> QueueBPayload -> ShowS
[QueueBPayload] -> ShowS
QueueBPayload -> String
(Int -> QueueBPayload -> ShowS)
-> (QueueBPayload -> String)
-> ([QueueBPayload] -> ShowS)
-> Show QueueBPayload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueueBPayload -> ShowS
showsPrec :: Int -> QueueBPayload -> ShowS
$cshow :: QueueBPayload -> String
show :: QueueBPayload -> String
$cshowList :: [QueueBPayload] -> ShowS
showList :: [QueueBPayload] -> ShowS
Show)
deriving anyclass (Maybe QueueBPayload
Value -> Parser [QueueBPayload]
Value -> Parser QueueBPayload
(Value -> Parser QueueBPayload)
-> (Value -> Parser [QueueBPayload])
-> Maybe QueueBPayload
-> FromJSON QueueBPayload
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser QueueBPayload
parseJSON :: Value -> Parser QueueBPayload
$cparseJSONList :: Value -> Parser [QueueBPayload]
parseJSONList :: Value -> Parser [QueueBPayload]
$comittedField :: Maybe QueueBPayload
omittedField :: Maybe QueueBPayload
FromJSON, [QueueBPayload] -> Value
[QueueBPayload] -> Encoding
QueueBPayload -> Bool
QueueBPayload -> Value
QueueBPayload -> Encoding
(QueueBPayload -> Value)
-> (QueueBPayload -> Encoding)
-> ([QueueBPayload] -> Value)
-> ([QueueBPayload] -> Encoding)
-> (QueueBPayload -> Bool)
-> ToJSON QueueBPayload
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: QueueBPayload -> Value
toJSON :: QueueBPayload -> Value
$ctoEncoding :: QueueBPayload -> Encoding
toEncoding :: QueueBPayload -> Encoding
$ctoJSONList :: [QueueBPayload] -> Value
toJSONList :: [QueueBPayload] -> Value
$ctoEncodingList :: [QueueBPayload] -> Encoding
toEncodingList :: [QueueBPayload] -> Encoding
$comitField :: QueueBPayload -> Bool
omitField :: QueueBPayload -> Bool
ToJSON)