{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}

-- | Response types for the Arbiter REST API
module Arbiter.Servant.Types
  ( module Arbiter.Servant.Types
  , CronScheduleRow (..)
  , CronScheduleUpdate (..)
  ) where

import Arbiter.Core.CronSchedule (CronScheduleRow (..), CronScheduleUpdate (..))
import Arbiter.Core.Job.DLQ qualified as DLQ
import Arbiter.Core.Job.Types (Job (..), JobRead, JobWrite)
import Arbiter.Core.Job.Types qualified as Arb
import Arbiter.Core.Operations (QueueStats)
import Data.Aeson (FromJSON (..), ToJSON (..), object, withObject, (.!=), (.:), (.:?), (.=))
import Data.Int (Int64)
import Data.Map.Strict (Map)
import Data.Text (Text)
import Data.Time (UTCTime)
import GHC.Generics (Generic)

data ApiJob payload = ApiJob
  { forall payload. ApiJob payload -> JobRead payload
unApiJob :: JobRead payload
  , forall payload. ApiJob payload -> UTCTime
apiJobNow :: UTCTime
  }
  deriving stock (ApiJob payload -> ApiJob payload -> Bool
(ApiJob payload -> ApiJob payload -> Bool)
-> (ApiJob payload -> ApiJob payload -> Bool)
-> Eq (ApiJob payload)
forall payload.
Eq payload =>
ApiJob payload -> ApiJob payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
ApiJob payload -> ApiJob payload -> Bool
== :: ApiJob payload -> ApiJob payload -> Bool
$c/= :: forall payload.
Eq payload =>
ApiJob payload -> ApiJob payload -> Bool
/= :: ApiJob payload -> ApiJob payload -> Bool
Eq, Int -> ApiJob payload -> ShowS
[ApiJob payload] -> ShowS
ApiJob payload -> String
(Int -> ApiJob payload -> ShowS)
-> (ApiJob payload -> String)
-> ([ApiJob payload] -> ShowS)
-> Show (ApiJob payload)
forall payload. Show payload => Int -> ApiJob payload -> ShowS
forall payload. Show payload => [ApiJob payload] -> ShowS
forall payload. Show payload => ApiJob payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload. Show payload => Int -> ApiJob payload -> ShowS
showsPrec :: Int -> ApiJob payload -> ShowS
$cshow :: forall payload. Show payload => ApiJob payload -> String
show :: ApiJob payload -> String
$cshowList :: forall payload. Show payload => [ApiJob payload] -> ShowS
showList :: [ApiJob payload] -> ShowS
Show)

-- | Write-side job type for REST API insertion.
--
-- Accepts @payload@, @groupKey@, @priority@, @notVisibleUntil@, @dedupKey@,
-- and @maxAttempts@. Fields like @parentId@, @isRollup@, and @suspended@ are
-- managed internally and cannot be set through the REST API.
newtype ApiJobWrite payload = ApiJobWrite {forall payload. ApiJobWrite payload -> JobWrite payload
unApiJobWrite :: JobWrite payload}
  deriving newtype (ApiJobWrite payload -> ApiJobWrite payload -> Bool
(ApiJobWrite payload -> ApiJobWrite payload -> Bool)
-> (ApiJobWrite payload -> ApiJobWrite payload -> Bool)
-> Eq (ApiJobWrite payload)
forall payload.
Eq payload =>
ApiJobWrite payload -> ApiJobWrite payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
ApiJobWrite payload -> ApiJobWrite payload -> Bool
== :: ApiJobWrite payload -> ApiJobWrite payload -> Bool
$c/= :: forall payload.
Eq payload =>
ApiJobWrite payload -> ApiJobWrite payload -> Bool
/= :: ApiJobWrite payload -> ApiJobWrite payload -> Bool
Eq, Int -> ApiJobWrite payload -> ShowS
[ApiJobWrite payload] -> ShowS
ApiJobWrite payload -> String
(Int -> ApiJobWrite payload -> ShowS)
-> (ApiJobWrite payload -> String)
-> ([ApiJobWrite payload] -> ShowS)
-> Show (ApiJobWrite payload)
forall payload. Show payload => Int -> ApiJobWrite payload -> ShowS
forall payload. Show payload => [ApiJobWrite payload] -> ShowS
forall payload. Show payload => ApiJobWrite payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload. Show payload => Int -> ApiJobWrite payload -> ShowS
showsPrec :: Int -> ApiJobWrite payload -> ShowS
$cshow :: forall payload. Show payload => ApiJobWrite payload -> String
show :: ApiJobWrite payload -> String
$cshowList :: forall payload. Show payload => [ApiJobWrite payload] -> ShowS
showList :: [ApiJobWrite payload] -> ShowS
Show)

-- | Derive the effective status of a job.
jobStatus :: UTCTime -> JobRead payload -> Text
jobStatus :: forall payload. UTCTime -> JobRead payload -> Text
jobStatus UTCTime
now JobRead payload
job
  | JobRead payload -> Bool
forall payload key q insertedAt.
Job payload key q insertedAt -> Bool
suspended JobRead payload
job = Text
"suspended"
  | JobRead payload -> Int32
forall payload key q insertedAt.
Job payload key q insertedAt -> Int32
attempts JobRead payload
job Int32 -> Int32 -> Bool
forall a. Ord a => a -> a -> Bool
> Int32
0, Just UTCTime
nvu <- JobRead payload -> Maybe UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe UTCTime
notVisibleUntil JobRead payload
job, UTCTime
nvu UTCTime -> UTCTime -> Bool
forall a. Ord a => a -> a -> Bool
> UTCTime
now = Text
"in_flight"
  | Just UTCTime
nvu <- JobRead payload -> Maybe UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe UTCTime
notVisibleUntil JobRead payload
job, UTCTime
nvu UTCTime -> UTCTime -> Bool
forall a. Ord a => a -> a -> Bool
> UTCTime
now = Text
"scheduled"
  | Bool
otherwise = Text
"ready"

instance (ToJSON payload) => ToJSON (ApiJob payload) where
  toJSON :: ApiJob payload -> Value
toJSON (ApiJob JobRead payload
job UTCTime
now) =
    [Pair] -> Value
object
      [ Key
"primaryKey" Key -> Int64 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Int64
forall payload key q insertedAt.
Job payload key q insertedAt -> key
primaryKey JobRead payload
job
      , Key
"payload" Key -> payload -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> payload
forall payload key q insertedAt.
Job payload key q insertedAt -> payload
payload JobRead payload
job
      , Key
"queueName" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Text
forall payload key q insertedAt. Job payload key q insertedAt -> q
Arb.queueName JobRead payload
job
      , Key
"groupKey" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe Text
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe Text
groupKey JobRead payload
job
      , Key
"insertedAt" Key -> UTCTime -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> insertedAt
insertedAt JobRead payload
job
      , Key
"updatedAt" Key -> Maybe UTCTime -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe UTCTime
Arb.updatedAt JobRead payload
job
      , Key
"attempts" Key -> Int32 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Int32
forall payload key q insertedAt.
Job payload key q insertedAt -> Int32
attempts JobRead payload
job
      , Key
"lastError" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe Text
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe Text
lastError JobRead payload
job
      , Key
"priority" Key -> Int32 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Int32
forall payload key q insertedAt.
Job payload key q insertedAt -> Int32
priority JobRead payload
job
      , Key
"lastAttemptedAt" Key -> Maybe UTCTime -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe UTCTime
lastAttemptedAt JobRead payload
job
      , Key
"notVisibleUntil" Key -> Maybe UTCTime -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe UTCTime
notVisibleUntil JobRead payload
job
      , Key
"dedupKey" Key -> Maybe DedupKey -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe DedupKey
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe DedupKey
dedupKey JobRead payload
job
      , Key
"maxAttempts" Key -> Maybe Int32 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe Int32
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe Int32
maxAttempts JobRead payload
job
      , Key
"parentId" Key -> Maybe Int64 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Maybe Int64
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe Int64
parentId JobRead payload
job
      , Key
"isRollup" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Bool
forall payload key q insertedAt.
Job payload key q insertedAt -> Bool
isRollup JobRead payload
job
      , Key
"suspended" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> Bool
forall payload key q insertedAt.
Job payload key q insertedAt -> Bool
suspended JobRead payload
job
      , Key
"status" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= UTCTime -> JobRead payload -> Text
forall payload. UTCTime -> JobRead payload -> Text
jobStatus UTCTime
now JobRead payload
job
      ]

instance (FromJSON payload) => FromJSON (ApiJob payload) where
  parseJSON :: Value -> Parser (ApiJob payload)
parseJSON = String
-> (Object -> Parser (ApiJob payload))
-> Value
-> Parser (ApiJob payload)
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"Job" ((Object -> Parser (ApiJob payload))
 -> Value -> Parser (ApiJob payload))
-> (Object -> Parser (ApiJob payload))
-> Value
-> Parser (ApiJob payload)
forall a b. (a -> b) -> a -> b
$ \Object
v -> do
    job <-
      Int64
-> payload
-> Text
-> Maybe Text
-> UTCTime
-> Maybe UTCTime
-> Int32
-> Maybe Text
-> Int32
-> Maybe UTCTime
-> Maybe UTCTime
-> Maybe DedupKey
-> Maybe Int32
-> Maybe Int64
-> Bool
-> Bool
-> Job payload Int64 Text UTCTime
forall payload key q insertedAt.
key
-> payload
-> q
-> Maybe Text
-> insertedAt
-> Maybe UTCTime
-> Int32
-> Maybe Text
-> Int32
-> Maybe UTCTime
-> Maybe UTCTime
-> Maybe DedupKey
-> Maybe Int32
-> Maybe Int64
-> Bool
-> Bool
-> Job payload key q insertedAt
Job
        (Int64
 -> payload
 -> Text
 -> Maybe Text
 -> UTCTime
 -> Maybe UTCTime
 -> Int32
 -> Maybe Text
 -> Int32
 -> Maybe UTCTime
 -> Maybe UTCTime
 -> Maybe DedupKey
 -> Maybe Int32
 -> Maybe Int64
 -> Bool
 -> Bool
 -> Job payload Int64 Text UTCTime)
-> Parser Int64
-> Parser
     (payload
      -> Text
      -> Maybe Text
      -> UTCTime
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Key -> Parser Int64
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"primaryKey"
        Parser
  (payload
   -> Text
   -> Maybe Text
   -> UTCTime
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser payload
-> Parser
     (Text
      -> Maybe Text
      -> UTCTime
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser payload
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"payload"
        Parser
  (Text
   -> Maybe Text
   -> UTCTime
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser Text
-> Parser
     (Maybe Text
      -> UTCTime
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"queueName"
        Parser
  (Maybe Text
   -> UTCTime
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser (Maybe Text)
-> Parser
     (UTCTime
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"groupKey"
        Parser
  (UTCTime
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser UTCTime
-> Parser
     (Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser UTCTime
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"insertedAt"
        Parser
  (Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser (Maybe UTCTime)
-> Parser
     (Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe UTCTime)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"updatedAt"
        Parser
  (Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser Int32
-> Parser
     (Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser Int32
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"attempts"
        Parser
  (Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser (Maybe Text)
-> Parser
     (Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"lastError"
        Parser
  (Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser Int32
-> Parser
     (Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser Int32
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"priority"
        Parser
  (Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser (Maybe UTCTime)
-> Parser
     (Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe UTCTime)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"lastAttemptedAt"
        Parser
  (Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser (Maybe UTCTime)
-> Parser
     (Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe UTCTime)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"notVisibleUntil"
        Parser
  (Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> Job payload Int64 Text UTCTime)
-> Parser (Maybe DedupKey)
-> Parser
     (Maybe Int32
      -> Maybe Int64 -> Bool -> Bool -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe DedupKey)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"dedupKey"
        Parser
  (Maybe Int32
   -> Maybe Int64 -> Bool -> Bool -> Job payload Int64 Text UTCTime)
-> Parser (Maybe Int32)
-> Parser
     (Maybe Int64 -> Bool -> Bool -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe Int32)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"maxAttempts"
        Parser
  (Maybe Int64 -> Bool -> Bool -> Job payload Int64 Text UTCTime)
-> Parser (Maybe Int64)
-> Parser (Bool -> Bool -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe (Maybe Int64))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"parentId" Parser (Maybe (Maybe Int64)) -> Maybe Int64 -> Parser (Maybe Int64)
forall a. Parser (Maybe a) -> a -> Parser a
.!= Maybe Int64
forall a. Maybe a
Nothing
        Parser (Bool -> Bool -> Job payload Int64 Text UTCTime)
-> Parser Bool -> Parser (Bool -> Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"isRollup" Parser (Maybe Bool) -> Bool -> Parser Bool
forall a. Parser (Maybe a) -> a -> Parser a
.!= Bool
False
        Parser (Bool -> Job payload Int64 Text UTCTime)
-> Parser Bool -> Parser (Job payload Int64 Text UTCTime)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"suspended" Parser (Maybe Bool) -> Bool -> Parser Bool
forall a. Parser (Maybe a) -> a -> Parser a
.!= Bool
False
    -- Use insertedAt as fallback for now (status is recomputed server-side anyway)
    pure $ ApiJob job (insertedAt job)

instance (ToJSON payload) => ToJSON (ApiJobWrite payload) where
  toJSON :: ApiJobWrite payload -> Value
toJSON (ApiJobWrite JobWrite payload
job) =
    [Pair] -> Value
object
      [ Key
"payload" Key -> payload -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobWrite payload -> payload
forall payload key q insertedAt.
Job payload key q insertedAt -> payload
payload JobWrite payload
job
      , Key
"groupKey" Key -> Maybe Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobWrite payload -> Maybe Text
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe Text
groupKey JobWrite payload
job
      , Key
"priority" Key -> Int32 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobWrite payload -> Int32
forall payload key q insertedAt.
Job payload key q insertedAt -> Int32
priority JobWrite payload
job
      , Key
"notVisibleUntil" Key -> Maybe UTCTime -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobWrite payload -> Maybe UTCTime
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe UTCTime
notVisibleUntil JobWrite payload
job
      , Key
"dedupKey" Key -> Maybe DedupKey -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobWrite payload -> Maybe DedupKey
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe DedupKey
dedupKey JobWrite payload
job
      , Key
"maxAttempts" Key -> Maybe Int32 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobWrite payload -> Maybe Int32
forall payload key q insertedAt.
Job payload key q insertedAt -> Maybe Int32
maxAttempts JobWrite payload
job
      ]

instance (FromJSON payload) => FromJSON (ApiJobWrite payload) where
  parseJSON :: Value -> Parser (ApiJobWrite payload)
parseJSON = String
-> (Object -> Parser (ApiJobWrite payload))
-> Value
-> Parser (ApiJobWrite payload)
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"JobWrite" ((Object -> Parser (ApiJobWrite payload))
 -> Value -> Parser (ApiJobWrite payload))
-> (Object -> Parser (ApiJobWrite payload))
-> Value
-> Parser (ApiJobWrite payload)
forall a b. (a -> b) -> a -> b
$ \Object
v ->
    (JobWrite payload -> ApiJobWrite payload)
-> Parser (JobWrite payload) -> Parser (ApiJobWrite payload)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap JobWrite payload -> ApiJobWrite payload
forall payload. JobWrite payload -> ApiJobWrite payload
ApiJobWrite (Parser (JobWrite payload) -> Parser (ApiJobWrite payload))
-> Parser (JobWrite payload) -> Parser (ApiJobWrite payload)
forall a b. (a -> b) -> a -> b
$
      ()
-> payload
-> ()
-> Maybe Text
-> ()
-> Maybe UTCTime
-> Int32
-> Maybe Text
-> Int32
-> Maybe UTCTime
-> Maybe UTCTime
-> Maybe DedupKey
-> Maybe Int32
-> Maybe Int64
-> Bool
-> Bool
-> JobWrite payload
forall payload key q insertedAt.
key
-> payload
-> q
-> Maybe Text
-> insertedAt
-> Maybe UTCTime
-> Int32
-> Maybe Text
-> Int32
-> Maybe UTCTime
-> Maybe UTCTime
-> Maybe DedupKey
-> Maybe Int32
-> Maybe Int64
-> Bool
-> Bool
-> Job payload key q insertedAt
Job
        (()
 -> payload
 -> ()
 -> Maybe Text
 -> ()
 -> Maybe UTCTime
 -> Int32
 -> Maybe Text
 -> Int32
 -> Maybe UTCTime
 -> Maybe UTCTime
 -> Maybe DedupKey
 -> Maybe Int32
 -> Maybe Int64
 -> Bool
 -> Bool
 -> JobWrite payload)
-> Parser ()
-> Parser
     (payload
      -> ()
      -> Maybe Text
      -> ()
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> () -> Parser ()
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
        Parser
  (payload
   -> ()
   -> Maybe Text
   -> ()
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser payload
-> Parser
     (()
      -> Maybe Text
      -> ()
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser payload
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"payload"
        Parser
  (()
   -> Maybe Text
   -> ()
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser ()
-> Parser
     (Maybe Text
      -> ()
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> () -> Parser ()
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
        Parser
  (Maybe Text
   -> ()
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser (Maybe Text)
-> Parser
     (()
      -> Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe (Maybe Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"groupKey" Parser (Maybe (Maybe Text)) -> Maybe Text -> Parser (Maybe Text)
forall a. Parser (Maybe a) -> a -> Parser a
.!= Maybe Text
forall a. Maybe a
Nothing
        Parser
  (()
   -> Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser ()
-> Parser
     (Maybe UTCTime
      -> Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> () -> Parser ()
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
        Parser
  (Maybe UTCTime
   -> Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser (Maybe UTCTime)
-> Parser
     (Int32
      -> Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe UTCTime -> Parser (Maybe UTCTime)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe UTCTime
forall a. Maybe a
Nothing
        Parser
  (Int32
   -> Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser Int32
-> Parser
     (Maybe Text
      -> Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Int32 -> Parser Int32
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Int32
0
        Parser
  (Maybe Text
   -> Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser (Maybe Text)
-> Parser
     (Int32
      -> Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe Text -> Parser (Maybe Text)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe Text
forall a. Maybe a
Nothing
        Parser
  (Int32
   -> Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser Int32
-> Parser
     (Maybe UTCTime
      -> Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe Int32)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"priority" Parser (Maybe Int32) -> Int32 -> Parser Int32
forall a. Parser (Maybe a) -> a -> Parser a
.!= Int32
0
        Parser
  (Maybe UTCTime
   -> Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser (Maybe UTCTime)
-> Parser
     (Maybe UTCTime
      -> Maybe DedupKey
      -> Maybe Int32
      -> Maybe Int64
      -> Bool
      -> Bool
      -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe UTCTime -> Parser (Maybe UTCTime)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe UTCTime
forall a. Maybe a
Nothing
        Parser
  (Maybe UTCTime
   -> Maybe DedupKey
   -> Maybe Int32
   -> Maybe Int64
   -> Bool
   -> Bool
   -> JobWrite payload)
-> Parser (Maybe UTCTime)
-> Parser
     (Maybe DedupKey
      -> Maybe Int32 -> Maybe Int64 -> Bool -> Bool -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe UTCTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"notVisibleUntil"
        Parser
  (Maybe DedupKey
   -> Maybe Int32 -> Maybe Int64 -> Bool -> Bool -> JobWrite payload)
-> Parser (Maybe DedupKey)
-> Parser
     (Maybe Int32 -> Maybe Int64 -> Bool -> Bool -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe (Maybe DedupKey))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"dedupKey" Parser (Maybe (Maybe DedupKey))
-> Maybe DedupKey -> Parser (Maybe DedupKey)
forall a. Parser (Maybe a) -> a -> Parser a
.!= Maybe DedupKey
forall a. Maybe a
Nothing
        Parser
  (Maybe Int32 -> Maybe Int64 -> Bool -> Bool -> JobWrite payload)
-> Parser (Maybe Int32)
-> Parser (Maybe Int64 -> Bool -> Bool -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
v Object -> Key -> Parser (Maybe (Maybe Int32))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"maxAttempts" Parser (Maybe (Maybe Int32)) -> Maybe Int32 -> Parser (Maybe Int32)
forall a. Parser (Maybe a) -> a -> Parser a
.!= Maybe Int32
forall a. Maybe a
Nothing
        Parser (Maybe Int64 -> Bool -> Bool -> JobWrite payload)
-> Parser (Maybe Int64)
-> Parser (Bool -> Bool -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe Int64 -> Parser (Maybe Int64)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe Int64
forall a. Maybe a
Nothing -- parentId: managed internally
        Parser (Bool -> Bool -> JobWrite payload)
-> Parser Bool -> Parser (Bool -> JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Bool -> Parser Bool
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Bool
False -- isRollup: managed internally
        Parser (Bool -> JobWrite payload)
-> Parser Bool -> Parser (JobWrite payload)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Bool -> Parser Bool
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Bool
False -- suspended: managed internally

data ApiDLQJob payload = ApiDLQJob
  { forall payload. ApiDLQJob payload -> DLQJob payload
unApiDLQJob :: DLQ.DLQJob payload
  , forall payload. ApiDLQJob payload -> UTCTime
apiDLQNow :: UTCTime
  }
  deriving stock (ApiDLQJob payload -> ApiDLQJob payload -> Bool
(ApiDLQJob payload -> ApiDLQJob payload -> Bool)
-> (ApiDLQJob payload -> ApiDLQJob payload -> Bool)
-> Eq (ApiDLQJob payload)
forall payload.
Eq payload =>
ApiDLQJob payload -> ApiDLQJob payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
ApiDLQJob payload -> ApiDLQJob payload -> Bool
== :: ApiDLQJob payload -> ApiDLQJob payload -> Bool
$c/= :: forall payload.
Eq payload =>
ApiDLQJob payload -> ApiDLQJob payload -> Bool
/= :: ApiDLQJob payload -> ApiDLQJob payload -> Bool
Eq, Int -> ApiDLQJob payload -> ShowS
[ApiDLQJob payload] -> ShowS
ApiDLQJob payload -> String
(Int -> ApiDLQJob payload -> ShowS)
-> (ApiDLQJob payload -> String)
-> ([ApiDLQJob payload] -> ShowS)
-> Show (ApiDLQJob payload)
forall payload. Show payload => Int -> ApiDLQJob payload -> ShowS
forall payload. Show payload => [ApiDLQJob payload] -> ShowS
forall payload. Show payload => ApiDLQJob payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload. Show payload => Int -> ApiDLQJob payload -> ShowS
showsPrec :: Int -> ApiDLQJob payload -> ShowS
$cshow :: forall payload. Show payload => ApiDLQJob payload -> String
show :: ApiDLQJob payload -> String
$cshowList :: forall payload. Show payload => [ApiDLQJob payload] -> ShowS
showList :: [ApiDLQJob payload] -> ShowS
Show)

instance (ToJSON payload) => ToJSON (ApiDLQJob payload) where
  toJSON :: ApiDLQJob payload -> Value
toJSON (ApiDLQJob DLQJob payload
dlq UTCTime
now) =
    [Pair] -> Value
object
      [ Key
"dlqPrimaryKey" Key -> Int64 -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DLQJob payload -> Int64
forall payload. DLQJob payload -> Int64
DLQ.dlqPrimaryKey DLQJob payload
dlq
      , Key
"failedAt" Key -> UTCTime -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= DLQJob payload -> UTCTime
forall payload. DLQJob payload -> UTCTime
DLQ.failedAt DLQJob payload
dlq
      , Key
"jobSnapshot" Key -> ApiJob payload -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= JobRead payload -> UTCTime -> ApiJob payload
forall payload. JobRead payload -> UTCTime -> ApiJob payload
ApiJob (DLQJob payload -> JobRead payload
forall payload. DLQJob payload -> JobSnapshot payload
DLQ.jobSnapshot DLQJob payload
dlq) UTCTime
now
      ]

instance (FromJSON payload) => FromJSON (ApiDLQJob payload) where
  parseJSON :: Value -> Parser (ApiDLQJob payload)
parseJSON = String
-> (Object -> Parser (ApiDLQJob payload))
-> Value
-> Parser (ApiDLQJob payload)
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"DLQJob" ((Object -> Parser (ApiDLQJob payload))
 -> Value -> Parser (ApiDLQJob payload))
-> (Object -> Parser (ApiDLQJob payload))
-> Value
-> Parser (ApiDLQJob payload)
forall a b. (a -> b) -> a -> b
$ \Object
v -> do
    apiJob <- Object
v Object -> Key -> Parser (ApiJob payload)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"jobSnapshot"
    dlq <-
      DLQ.DLQJob
        <$> v .: "dlqPrimaryKey"
        <*> v .: "failedAt"
        <*> pure (unApiJob apiJob)
    pure $ ApiDLQJob dlq (apiJobNow apiJob)

-- | Response wrapper for job operations
data JobResponse payload = JobResponse
  { forall payload. JobResponse payload -> ApiJob payload
job :: ApiJob payload
  }
  deriving stock (JobResponse payload -> JobResponse payload -> Bool
(JobResponse payload -> JobResponse payload -> Bool)
-> (JobResponse payload -> JobResponse payload -> Bool)
-> Eq (JobResponse payload)
forall payload.
Eq payload =>
JobResponse payload -> JobResponse payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
JobResponse payload -> JobResponse payload -> Bool
== :: JobResponse payload -> JobResponse payload -> Bool
$c/= :: forall payload.
Eq payload =>
JobResponse payload -> JobResponse payload -> Bool
/= :: JobResponse payload -> JobResponse payload -> Bool
Eq, (forall x. JobResponse payload -> Rep (JobResponse payload) x)
-> (forall x. Rep (JobResponse payload) x -> JobResponse payload)
-> Generic (JobResponse payload)
forall x. Rep (JobResponse payload) x -> JobResponse payload
forall x. JobResponse payload -> Rep (JobResponse payload) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall payload x.
Rep (JobResponse payload) x -> JobResponse payload
forall payload x.
JobResponse payload -> Rep (JobResponse payload) x
$cfrom :: forall payload x.
JobResponse payload -> Rep (JobResponse payload) x
from :: forall x. JobResponse payload -> Rep (JobResponse payload) x
$cto :: forall payload x.
Rep (JobResponse payload) x -> JobResponse payload
to :: forall x. Rep (JobResponse payload) x -> JobResponse payload
Generic, Int -> JobResponse payload -> ShowS
[JobResponse payload] -> ShowS
JobResponse payload -> String
(Int -> JobResponse payload -> ShowS)
-> (JobResponse payload -> String)
-> ([JobResponse payload] -> ShowS)
-> Show (JobResponse payload)
forall payload. Show payload => Int -> JobResponse payload -> ShowS
forall payload. Show payload => [JobResponse payload] -> ShowS
forall payload. Show payload => JobResponse payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload. Show payload => Int -> JobResponse payload -> ShowS
showsPrec :: Int -> JobResponse payload -> ShowS
$cshow :: forall payload. Show payload => JobResponse payload -> String
show :: JobResponse payload -> String
$cshowList :: forall payload. Show payload => [JobResponse payload] -> ShowS
showList :: [JobResponse payload] -> ShowS
Show)
  deriving anyclass (Maybe (JobResponse payload)
Value -> Parser [JobResponse payload]
Value -> Parser (JobResponse payload)
(Value -> Parser (JobResponse payload))
-> (Value -> Parser [JobResponse payload])
-> Maybe (JobResponse payload)
-> FromJSON (JobResponse payload)
forall payload. FromJSON payload => Maybe (JobResponse payload)
forall payload.
FromJSON payload =>
Value -> Parser [JobResponse payload]
forall payload.
FromJSON payload =>
Value -> Parser (JobResponse payload)
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: forall payload.
FromJSON payload =>
Value -> Parser (JobResponse payload)
parseJSON :: Value -> Parser (JobResponse payload)
$cparseJSONList :: forall payload.
FromJSON payload =>
Value -> Parser [JobResponse payload]
parseJSONList :: Value -> Parser [JobResponse payload]
$comittedField :: forall payload. FromJSON payload => Maybe (JobResponse payload)
omittedField :: Maybe (JobResponse payload)
FromJSON, [JobResponse payload] -> Value
[JobResponse payload] -> Encoding
JobResponse payload -> Bool
JobResponse payload -> Value
JobResponse payload -> Encoding
(JobResponse payload -> Value)
-> (JobResponse payload -> Encoding)
-> ([JobResponse payload] -> Value)
-> ([JobResponse payload] -> Encoding)
-> (JobResponse payload -> Bool)
-> ToJSON (JobResponse payload)
forall payload. ToJSON payload => [JobResponse payload] -> Value
forall payload. ToJSON payload => [JobResponse payload] -> Encoding
forall payload. ToJSON payload => JobResponse payload -> Bool
forall payload. ToJSON payload => JobResponse payload -> Value
forall payload. ToJSON payload => JobResponse payload -> Encoding
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: forall payload. ToJSON payload => JobResponse payload -> Value
toJSON :: JobResponse payload -> Value
$ctoEncoding :: forall payload. ToJSON payload => JobResponse payload -> Encoding
toEncoding :: JobResponse payload -> Encoding
$ctoJSONList :: forall payload. ToJSON payload => [JobResponse payload] -> Value
toJSONList :: [JobResponse payload] -> Value
$ctoEncodingList :: forall payload. ToJSON payload => [JobResponse payload] -> Encoding
toEncodingList :: [JobResponse payload] -> Encoding
$comitField :: forall payload. ToJSON payload => JobResponse payload -> Bool
omitField :: JobResponse payload -> Bool
ToJSON)

-- | Response wrapper for multiple jobs
data JobsResponse payload = JobsResponse
  { forall payload. JobsResponse payload -> [ApiJob payload]
jobs :: [ApiJob payload]
  , forall payload. JobsResponse payload -> Int
jobsTotal :: Int
  , forall payload. JobsResponse payload -> Int
jobsOffset :: Int
  , forall payload. JobsResponse payload -> Int
jobsLimit :: Int
  , forall payload. JobsResponse payload -> Map Int64 Int64
childCounts :: Map Int64 Int64
  , forall payload. JobsResponse payload -> [Int64]
pausedParents :: [Int64]
  , forall payload. JobsResponse payload -> Map Int64 Int64
dlqChildCounts :: Map Int64 Int64
  }
  deriving stock (JobsResponse payload -> JobsResponse payload -> Bool
(JobsResponse payload -> JobsResponse payload -> Bool)
-> (JobsResponse payload -> JobsResponse payload -> Bool)
-> Eq (JobsResponse payload)
forall payload.
Eq payload =>
JobsResponse payload -> JobsResponse payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
JobsResponse payload -> JobsResponse payload -> Bool
== :: JobsResponse payload -> JobsResponse payload -> Bool
$c/= :: forall payload.
Eq payload =>
JobsResponse payload -> JobsResponse payload -> Bool
/= :: JobsResponse payload -> JobsResponse payload -> Bool
Eq, (forall x. JobsResponse payload -> Rep (JobsResponse payload) x)
-> (forall x. Rep (JobsResponse payload) x -> JobsResponse payload)
-> Generic (JobsResponse payload)
forall x. Rep (JobsResponse payload) x -> JobsResponse payload
forall x. JobsResponse payload -> Rep (JobsResponse payload) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall payload x.
Rep (JobsResponse payload) x -> JobsResponse payload
forall payload x.
JobsResponse payload -> Rep (JobsResponse payload) x
$cfrom :: forall payload x.
JobsResponse payload -> Rep (JobsResponse payload) x
from :: forall x. JobsResponse payload -> Rep (JobsResponse payload) x
$cto :: forall payload x.
Rep (JobsResponse payload) x -> JobsResponse payload
to :: forall x. Rep (JobsResponse payload) x -> JobsResponse payload
Generic, Int -> JobsResponse payload -> ShowS
[JobsResponse payload] -> ShowS
JobsResponse payload -> String
(Int -> JobsResponse payload -> ShowS)
-> (JobsResponse payload -> String)
-> ([JobsResponse payload] -> ShowS)
-> Show (JobsResponse payload)
forall payload.
Show payload =>
Int -> JobsResponse payload -> ShowS
forall payload. Show payload => [JobsResponse payload] -> ShowS
forall payload. Show payload => JobsResponse payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload.
Show payload =>
Int -> JobsResponse payload -> ShowS
showsPrec :: Int -> JobsResponse payload -> ShowS
$cshow :: forall payload. Show payload => JobsResponse payload -> String
show :: JobsResponse payload -> String
$cshowList :: forall payload. Show payload => [JobsResponse payload] -> ShowS
showList :: [JobsResponse payload] -> ShowS
Show)
  deriving anyclass (Maybe (JobsResponse payload)
Value -> Parser [JobsResponse payload]
Value -> Parser (JobsResponse payload)
(Value -> Parser (JobsResponse payload))
-> (Value -> Parser [JobsResponse payload])
-> Maybe (JobsResponse payload)
-> FromJSON (JobsResponse payload)
forall payload. FromJSON payload => Maybe (JobsResponse payload)
forall payload.
FromJSON payload =>
Value -> Parser [JobsResponse payload]
forall payload.
FromJSON payload =>
Value -> Parser (JobsResponse payload)
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: forall payload.
FromJSON payload =>
Value -> Parser (JobsResponse payload)
parseJSON :: Value -> Parser (JobsResponse payload)
$cparseJSONList :: forall payload.
FromJSON payload =>
Value -> Parser [JobsResponse payload]
parseJSONList :: Value -> Parser [JobsResponse payload]
$comittedField :: forall payload. FromJSON payload => Maybe (JobsResponse payload)
omittedField :: Maybe (JobsResponse payload)
FromJSON, [JobsResponse payload] -> Value
[JobsResponse payload] -> Encoding
JobsResponse payload -> Bool
JobsResponse payload -> Value
JobsResponse payload -> Encoding
(JobsResponse payload -> Value)
-> (JobsResponse payload -> Encoding)
-> ([JobsResponse payload] -> Value)
-> ([JobsResponse payload] -> Encoding)
-> (JobsResponse payload -> Bool)
-> ToJSON (JobsResponse payload)
forall payload. ToJSON payload => [JobsResponse payload] -> Value
forall payload.
ToJSON payload =>
[JobsResponse payload] -> Encoding
forall payload. ToJSON payload => JobsResponse payload -> Bool
forall payload. ToJSON payload => JobsResponse payload -> Value
forall payload. ToJSON payload => JobsResponse payload -> Encoding
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: forall payload. ToJSON payload => JobsResponse payload -> Value
toJSON :: JobsResponse payload -> Value
$ctoEncoding :: forall payload. ToJSON payload => JobsResponse payload -> Encoding
toEncoding :: JobsResponse payload -> Encoding
$ctoJSONList :: forall payload. ToJSON payload => [JobsResponse payload] -> Value
toJSONList :: [JobsResponse payload] -> Value
$ctoEncodingList :: forall payload.
ToJSON payload =>
[JobsResponse payload] -> Encoding
toEncodingList :: [JobsResponse payload] -> Encoding
$comitField :: forall payload. ToJSON payload => JobsResponse payload -> Bool
omitField :: JobsResponse payload -> Bool
ToJSON)

-- | Response wrapper for DLQ jobs
data DLQResponse payload = DLQResponse
  { forall payload. DLQResponse payload -> [ApiDLQJob payload]
dlqJobs :: [ApiDLQJob payload]
  , forall payload. DLQResponse payload -> Int
dlqTotal :: Int
  , forall payload. DLQResponse payload -> Int
dlqOffset :: Int
  , forall payload. DLQResponse payload -> Int
dlqLimit :: Int
  }
  deriving stock (DLQResponse payload -> DLQResponse payload -> Bool
(DLQResponse payload -> DLQResponse payload -> Bool)
-> (DLQResponse payload -> DLQResponse payload -> Bool)
-> Eq (DLQResponse payload)
forall payload.
Eq payload =>
DLQResponse payload -> DLQResponse payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
DLQResponse payload -> DLQResponse payload -> Bool
== :: DLQResponse payload -> DLQResponse payload -> Bool
$c/= :: forall payload.
Eq payload =>
DLQResponse payload -> DLQResponse payload -> Bool
/= :: DLQResponse payload -> DLQResponse payload -> Bool
Eq, (forall x. DLQResponse payload -> Rep (DLQResponse payload) x)
-> (forall x. Rep (DLQResponse payload) x -> DLQResponse payload)
-> Generic (DLQResponse payload)
forall x. Rep (DLQResponse payload) x -> DLQResponse payload
forall x. DLQResponse payload -> Rep (DLQResponse payload) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall payload x.
Rep (DLQResponse payload) x -> DLQResponse payload
forall payload x.
DLQResponse payload -> Rep (DLQResponse payload) x
$cfrom :: forall payload x.
DLQResponse payload -> Rep (DLQResponse payload) x
from :: forall x. DLQResponse payload -> Rep (DLQResponse payload) x
$cto :: forall payload x.
Rep (DLQResponse payload) x -> DLQResponse payload
to :: forall x. Rep (DLQResponse payload) x -> DLQResponse payload
Generic, Int -> DLQResponse payload -> ShowS
[DLQResponse payload] -> ShowS
DLQResponse payload -> String
(Int -> DLQResponse payload -> ShowS)
-> (DLQResponse payload -> String)
-> ([DLQResponse payload] -> ShowS)
-> Show (DLQResponse payload)
forall payload. Show payload => Int -> DLQResponse payload -> ShowS
forall payload. Show payload => [DLQResponse payload] -> ShowS
forall payload. Show payload => DLQResponse payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload. Show payload => Int -> DLQResponse payload -> ShowS
showsPrec :: Int -> DLQResponse payload -> ShowS
$cshow :: forall payload. Show payload => DLQResponse payload -> String
show :: DLQResponse payload -> String
$cshowList :: forall payload. Show payload => [DLQResponse payload] -> ShowS
showList :: [DLQResponse payload] -> ShowS
Show)
  deriving anyclass (Maybe (DLQResponse payload)
Value -> Parser [DLQResponse payload]
Value -> Parser (DLQResponse payload)
(Value -> Parser (DLQResponse payload))
-> (Value -> Parser [DLQResponse payload])
-> Maybe (DLQResponse payload)
-> FromJSON (DLQResponse payload)
forall payload. FromJSON payload => Maybe (DLQResponse payload)
forall payload.
FromJSON payload =>
Value -> Parser [DLQResponse payload]
forall payload.
FromJSON payload =>
Value -> Parser (DLQResponse payload)
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: forall payload.
FromJSON payload =>
Value -> Parser (DLQResponse payload)
parseJSON :: Value -> Parser (DLQResponse payload)
$cparseJSONList :: forall payload.
FromJSON payload =>
Value -> Parser [DLQResponse payload]
parseJSONList :: Value -> Parser [DLQResponse payload]
$comittedField :: forall payload. FromJSON payload => Maybe (DLQResponse payload)
omittedField :: Maybe (DLQResponse payload)
FromJSON, [DLQResponse payload] -> Value
[DLQResponse payload] -> Encoding
DLQResponse payload -> Bool
DLQResponse payload -> Value
DLQResponse payload -> Encoding
(DLQResponse payload -> Value)
-> (DLQResponse payload -> Encoding)
-> ([DLQResponse payload] -> Value)
-> ([DLQResponse payload] -> Encoding)
-> (DLQResponse payload -> Bool)
-> ToJSON (DLQResponse payload)
forall payload. ToJSON payload => [DLQResponse payload] -> Value
forall payload. ToJSON payload => [DLQResponse payload] -> Encoding
forall payload. ToJSON payload => DLQResponse payload -> Bool
forall payload. ToJSON payload => DLQResponse payload -> Value
forall payload. ToJSON payload => DLQResponse payload -> Encoding
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: forall payload. ToJSON payload => DLQResponse payload -> Value
toJSON :: DLQResponse payload -> Value
$ctoEncoding :: forall payload. ToJSON payload => DLQResponse payload -> Encoding
toEncoding :: DLQResponse payload -> Encoding
$ctoJSONList :: forall payload. ToJSON payload => [DLQResponse payload] -> Value
toJSONList :: [DLQResponse payload] -> Value
$ctoEncodingList :: forall payload. ToJSON payload => [DLQResponse payload] -> Encoding
toEncodingList :: [DLQResponse payload] -> Encoding
$comitField :: forall payload. ToJSON payload => DLQResponse payload -> Bool
omitField :: DLQResponse payload -> Bool
ToJSON)

-- | Queue statistics response
data StatsResponse = StatsResponse
  { StatsResponse -> QueueStats
stats :: QueueStats
  , StatsResponse -> Text
timestamp :: Text
  }
  deriving stock (StatsResponse -> StatsResponse -> Bool
(StatsResponse -> StatsResponse -> Bool)
-> (StatsResponse -> StatsResponse -> Bool) -> Eq StatsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StatsResponse -> StatsResponse -> Bool
== :: StatsResponse -> StatsResponse -> Bool
$c/= :: StatsResponse -> StatsResponse -> Bool
/= :: StatsResponse -> StatsResponse -> Bool
Eq, (forall x. StatsResponse -> Rep StatsResponse x)
-> (forall x. Rep StatsResponse x -> StatsResponse)
-> Generic StatsResponse
forall x. Rep StatsResponse x -> StatsResponse
forall x. StatsResponse -> Rep StatsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StatsResponse -> Rep StatsResponse x
from :: forall x. StatsResponse -> Rep StatsResponse x
$cto :: forall x. Rep StatsResponse x -> StatsResponse
to :: forall x. Rep StatsResponse x -> StatsResponse
Generic, Int -> StatsResponse -> ShowS
[StatsResponse] -> ShowS
StatsResponse -> String
(Int -> StatsResponse -> ShowS)
-> (StatsResponse -> String)
-> ([StatsResponse] -> ShowS)
-> Show StatsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StatsResponse -> ShowS
showsPrec :: Int -> StatsResponse -> ShowS
$cshow :: StatsResponse -> String
show :: StatsResponse -> String
$cshowList :: [StatsResponse] -> ShowS
showList :: [StatsResponse] -> ShowS
Show)
  deriving anyclass (Maybe StatsResponse
Value -> Parser [StatsResponse]
Value -> Parser StatsResponse
(Value -> Parser StatsResponse)
-> (Value -> Parser [StatsResponse])
-> Maybe StatsResponse
-> FromJSON StatsResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser StatsResponse
parseJSON :: Value -> Parser StatsResponse
$cparseJSONList :: Value -> Parser [StatsResponse]
parseJSONList :: Value -> Parser [StatsResponse]
$comittedField :: Maybe StatsResponse
omittedField :: Maybe StatsResponse
FromJSON, [StatsResponse] -> Value
[StatsResponse] -> Encoding
StatsResponse -> Bool
StatsResponse -> Value
StatsResponse -> Encoding
(StatsResponse -> Value)
-> (StatsResponse -> Encoding)
-> ([StatsResponse] -> Value)
-> ([StatsResponse] -> Encoding)
-> (StatsResponse -> Bool)
-> ToJSON StatsResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: StatsResponse -> Value
toJSON :: StatsResponse -> Value
$ctoEncoding :: StatsResponse -> Encoding
toEncoding :: StatsResponse -> Encoding
$ctoJSONList :: [StatsResponse] -> Value
toJSONList :: [StatsResponse] -> Value
$ctoEncodingList :: [StatsResponse] -> Encoding
toEncodingList :: [StatsResponse] -> Encoding
$comitField :: StatsResponse -> Bool
omitField :: StatsResponse -> Bool
ToJSON)

-- | Queues list response
data QueuesResponse = QueuesResponse
  { QueuesResponse -> [Text]
queues :: [Text]
  }
  deriving stock (QueuesResponse -> QueuesResponse -> Bool
(QueuesResponse -> QueuesResponse -> Bool)
-> (QueuesResponse -> QueuesResponse -> Bool) -> Eq QueuesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueuesResponse -> QueuesResponse -> Bool
== :: QueuesResponse -> QueuesResponse -> Bool
$c/= :: QueuesResponse -> QueuesResponse -> Bool
/= :: QueuesResponse -> QueuesResponse -> Bool
Eq, (forall x. QueuesResponse -> Rep QueuesResponse x)
-> (forall x. Rep QueuesResponse x -> QueuesResponse)
-> Generic QueuesResponse
forall x. Rep QueuesResponse x -> QueuesResponse
forall x. QueuesResponse -> Rep QueuesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. QueuesResponse -> Rep QueuesResponse x
from :: forall x. QueuesResponse -> Rep QueuesResponse x
$cto :: forall x. Rep QueuesResponse x -> QueuesResponse
to :: forall x. Rep QueuesResponse x -> QueuesResponse
Generic, Int -> QueuesResponse -> ShowS
[QueuesResponse] -> ShowS
QueuesResponse -> String
(Int -> QueuesResponse -> ShowS)
-> (QueuesResponse -> String)
-> ([QueuesResponse] -> ShowS)
-> Show QueuesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueuesResponse -> ShowS
showsPrec :: Int -> QueuesResponse -> ShowS
$cshow :: QueuesResponse -> String
show :: QueuesResponse -> String
$cshowList :: [QueuesResponse] -> ShowS
showList :: [QueuesResponse] -> ShowS
Show)
  deriving anyclass (Maybe QueuesResponse
Value -> Parser [QueuesResponse]
Value -> Parser QueuesResponse
(Value -> Parser QueuesResponse)
-> (Value -> Parser [QueuesResponse])
-> Maybe QueuesResponse
-> FromJSON QueuesResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser QueuesResponse
parseJSON :: Value -> Parser QueuesResponse
$cparseJSONList :: Value -> Parser [QueuesResponse]
parseJSONList :: Value -> Parser [QueuesResponse]
$comittedField :: Maybe QueuesResponse
omittedField :: Maybe QueuesResponse
FromJSON, [QueuesResponse] -> Value
[QueuesResponse] -> Encoding
QueuesResponse -> Bool
QueuesResponse -> Value
QueuesResponse -> Encoding
(QueuesResponse -> Value)
-> (QueuesResponse -> Encoding)
-> ([QueuesResponse] -> Value)
-> ([QueuesResponse] -> Encoding)
-> (QueuesResponse -> Bool)
-> ToJSON QueuesResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: QueuesResponse -> Value
toJSON :: QueuesResponse -> Value
$ctoEncoding :: QueuesResponse -> Encoding
toEncoding :: QueuesResponse -> Encoding
$ctoJSONList :: [QueuesResponse] -> Value
toJSONList :: [QueuesResponse] -> Value
$ctoEncodingList :: [QueuesResponse] -> Encoding
toEncodingList :: [QueuesResponse] -> Encoding
$comitField :: QueuesResponse -> Bool
omitField :: QueuesResponse -> Bool
ToJSON)

-- | Request body for batch job insert
newtype BatchInsertRequest payload = BatchInsertRequest
  { forall payload. BatchInsertRequest payload -> [ApiJobWrite payload]
jobWrites :: [ApiJobWrite payload]
  }
  deriving stock (BatchInsertRequest payload -> BatchInsertRequest payload -> Bool
(BatchInsertRequest payload -> BatchInsertRequest payload -> Bool)
-> (BatchInsertRequest payload
    -> BatchInsertRequest payload -> Bool)
-> Eq (BatchInsertRequest payload)
forall payload.
Eq payload =>
BatchInsertRequest payload -> BatchInsertRequest payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
BatchInsertRequest payload -> BatchInsertRequest payload -> Bool
== :: BatchInsertRequest payload -> BatchInsertRequest payload -> Bool
$c/= :: forall payload.
Eq payload =>
BatchInsertRequest payload -> BatchInsertRequest payload -> Bool
/= :: BatchInsertRequest payload -> BatchInsertRequest payload -> Bool
Eq, (forall x.
 BatchInsertRequest payload -> Rep (BatchInsertRequest payload) x)
-> (forall x.
    Rep (BatchInsertRequest payload) x -> BatchInsertRequest payload)
-> Generic (BatchInsertRequest payload)
forall x.
Rep (BatchInsertRequest payload) x -> BatchInsertRequest payload
forall x.
BatchInsertRequest payload -> Rep (BatchInsertRequest payload) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall payload x.
Rep (BatchInsertRequest payload) x -> BatchInsertRequest payload
forall payload x.
BatchInsertRequest payload -> Rep (BatchInsertRequest payload) x
$cfrom :: forall payload x.
BatchInsertRequest payload -> Rep (BatchInsertRequest payload) x
from :: forall x.
BatchInsertRequest payload -> Rep (BatchInsertRequest payload) x
$cto :: forall payload x.
Rep (BatchInsertRequest payload) x -> BatchInsertRequest payload
to :: forall x.
Rep (BatchInsertRequest payload) x -> BatchInsertRequest payload
Generic, Int -> BatchInsertRequest payload -> ShowS
[BatchInsertRequest payload] -> ShowS
BatchInsertRequest payload -> String
(Int -> BatchInsertRequest payload -> ShowS)
-> (BatchInsertRequest payload -> String)
-> ([BatchInsertRequest payload] -> ShowS)
-> Show (BatchInsertRequest payload)
forall payload.
Show payload =>
Int -> BatchInsertRequest payload -> ShowS
forall payload.
Show payload =>
[BatchInsertRequest payload] -> ShowS
forall payload.
Show payload =>
BatchInsertRequest payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload.
Show payload =>
Int -> BatchInsertRequest payload -> ShowS
showsPrec :: Int -> BatchInsertRequest payload -> ShowS
$cshow :: forall payload.
Show payload =>
BatchInsertRequest payload -> String
show :: BatchInsertRequest payload -> String
$cshowList :: forall payload.
Show payload =>
[BatchInsertRequest payload] -> ShowS
showList :: [BatchInsertRequest payload] -> ShowS
Show)
  deriving anyclass (Maybe (BatchInsertRequest payload)
Value -> Parser [BatchInsertRequest payload]
Value -> Parser (BatchInsertRequest payload)
(Value -> Parser (BatchInsertRequest payload))
-> (Value -> Parser [BatchInsertRequest payload])
-> Maybe (BatchInsertRequest payload)
-> FromJSON (BatchInsertRequest payload)
forall payload.
FromJSON payload =>
Maybe (BatchInsertRequest payload)
forall payload.
FromJSON payload =>
Value -> Parser [BatchInsertRequest payload]
forall payload.
FromJSON payload =>
Value -> Parser (BatchInsertRequest payload)
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: forall payload.
FromJSON payload =>
Value -> Parser (BatchInsertRequest payload)
parseJSON :: Value -> Parser (BatchInsertRequest payload)
$cparseJSONList :: forall payload.
FromJSON payload =>
Value -> Parser [BatchInsertRequest payload]
parseJSONList :: Value -> Parser [BatchInsertRequest payload]
$comittedField :: forall payload.
FromJSON payload =>
Maybe (BatchInsertRequest payload)
omittedField :: Maybe (BatchInsertRequest payload)
FromJSON, [BatchInsertRequest payload] -> Value
[BatchInsertRequest payload] -> Encoding
BatchInsertRequest payload -> Bool
BatchInsertRequest payload -> Value
BatchInsertRequest payload -> Encoding
(BatchInsertRequest payload -> Value)
-> (BatchInsertRequest payload -> Encoding)
-> ([BatchInsertRequest payload] -> Value)
-> ([BatchInsertRequest payload] -> Encoding)
-> (BatchInsertRequest payload -> Bool)
-> ToJSON (BatchInsertRequest payload)
forall payload.
ToJSON payload =>
[BatchInsertRequest payload] -> Value
forall payload.
ToJSON payload =>
[BatchInsertRequest payload] -> Encoding
forall payload.
ToJSON payload =>
BatchInsertRequest payload -> Bool
forall payload.
ToJSON payload =>
BatchInsertRequest payload -> Value
forall payload.
ToJSON payload =>
BatchInsertRequest payload -> Encoding
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: forall payload.
ToJSON payload =>
BatchInsertRequest payload -> Value
toJSON :: BatchInsertRequest payload -> Value
$ctoEncoding :: forall payload.
ToJSON payload =>
BatchInsertRequest payload -> Encoding
toEncoding :: BatchInsertRequest payload -> Encoding
$ctoJSONList :: forall payload.
ToJSON payload =>
[BatchInsertRequest payload] -> Value
toJSONList :: [BatchInsertRequest payload] -> Value
$ctoEncodingList :: forall payload.
ToJSON payload =>
[BatchInsertRequest payload] -> Encoding
toEncodingList :: [BatchInsertRequest payload] -> Encoding
$comitField :: forall payload.
ToJSON payload =>
BatchInsertRequest payload -> Bool
omitField :: BatchInsertRequest payload -> Bool
ToJSON)

-- | Response body for batch job insert
data BatchInsertResponse payload = BatchInsertResponse
  { forall payload. BatchInsertResponse payload -> [ApiJob payload]
inserted :: [ApiJob payload]
  , forall payload. BatchInsertResponse payload -> Int
insertedCount :: Int
  }
  deriving stock (BatchInsertResponse payload -> BatchInsertResponse payload -> Bool
(BatchInsertResponse payload
 -> BatchInsertResponse payload -> Bool)
-> (BatchInsertResponse payload
    -> BatchInsertResponse payload -> Bool)
-> Eq (BatchInsertResponse payload)
forall payload.
Eq payload =>
BatchInsertResponse payload -> BatchInsertResponse payload -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall payload.
Eq payload =>
BatchInsertResponse payload -> BatchInsertResponse payload -> Bool
== :: BatchInsertResponse payload -> BatchInsertResponse payload -> Bool
$c/= :: forall payload.
Eq payload =>
BatchInsertResponse payload -> BatchInsertResponse payload -> Bool
/= :: BatchInsertResponse payload -> BatchInsertResponse payload -> Bool
Eq, (forall x.
 BatchInsertResponse payload -> Rep (BatchInsertResponse payload) x)
-> (forall x.
    Rep (BatchInsertResponse payload) x -> BatchInsertResponse payload)
-> Generic (BatchInsertResponse payload)
forall x.
Rep (BatchInsertResponse payload) x -> BatchInsertResponse payload
forall x.
BatchInsertResponse payload -> Rep (BatchInsertResponse payload) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall payload x.
Rep (BatchInsertResponse payload) x -> BatchInsertResponse payload
forall payload x.
BatchInsertResponse payload -> Rep (BatchInsertResponse payload) x
$cfrom :: forall payload x.
BatchInsertResponse payload -> Rep (BatchInsertResponse payload) x
from :: forall x.
BatchInsertResponse payload -> Rep (BatchInsertResponse payload) x
$cto :: forall payload x.
Rep (BatchInsertResponse payload) x -> BatchInsertResponse payload
to :: forall x.
Rep (BatchInsertResponse payload) x -> BatchInsertResponse payload
Generic, Int -> BatchInsertResponse payload -> ShowS
[BatchInsertResponse payload] -> ShowS
BatchInsertResponse payload -> String
(Int -> BatchInsertResponse payload -> ShowS)
-> (BatchInsertResponse payload -> String)
-> ([BatchInsertResponse payload] -> ShowS)
-> Show (BatchInsertResponse payload)
forall payload.
Show payload =>
Int -> BatchInsertResponse payload -> ShowS
forall payload.
Show payload =>
[BatchInsertResponse payload] -> ShowS
forall payload.
Show payload =>
BatchInsertResponse payload -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall payload.
Show payload =>
Int -> BatchInsertResponse payload -> ShowS
showsPrec :: Int -> BatchInsertResponse payload -> ShowS
$cshow :: forall payload.
Show payload =>
BatchInsertResponse payload -> String
show :: BatchInsertResponse payload -> String
$cshowList :: forall payload.
Show payload =>
[BatchInsertResponse payload] -> ShowS
showList :: [BatchInsertResponse payload] -> ShowS
Show)
  deriving anyclass (Maybe (BatchInsertResponse payload)
Value -> Parser [BatchInsertResponse payload]
Value -> Parser (BatchInsertResponse payload)
(Value -> Parser (BatchInsertResponse payload))
-> (Value -> Parser [BatchInsertResponse payload])
-> Maybe (BatchInsertResponse payload)
-> FromJSON (BatchInsertResponse payload)
forall payload.
FromJSON payload =>
Maybe (BatchInsertResponse payload)
forall payload.
FromJSON payload =>
Value -> Parser [BatchInsertResponse payload]
forall payload.
FromJSON payload =>
Value -> Parser (BatchInsertResponse payload)
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: forall payload.
FromJSON payload =>
Value -> Parser (BatchInsertResponse payload)
parseJSON :: Value -> Parser (BatchInsertResponse payload)
$cparseJSONList :: forall payload.
FromJSON payload =>
Value -> Parser [BatchInsertResponse payload]
parseJSONList :: Value -> Parser [BatchInsertResponse payload]
$comittedField :: forall payload.
FromJSON payload =>
Maybe (BatchInsertResponse payload)
omittedField :: Maybe (BatchInsertResponse payload)
FromJSON, [BatchInsertResponse payload] -> Value
[BatchInsertResponse payload] -> Encoding
BatchInsertResponse payload -> Bool
BatchInsertResponse payload -> Value
BatchInsertResponse payload -> Encoding
(BatchInsertResponse payload -> Value)
-> (BatchInsertResponse payload -> Encoding)
-> ([BatchInsertResponse payload] -> Value)
-> ([BatchInsertResponse payload] -> Encoding)
-> (BatchInsertResponse payload -> Bool)
-> ToJSON (BatchInsertResponse payload)
forall payload.
ToJSON payload =>
[BatchInsertResponse payload] -> Value
forall payload.
ToJSON payload =>
[BatchInsertResponse payload] -> Encoding
forall payload.
ToJSON payload =>
BatchInsertResponse payload -> Bool
forall payload.
ToJSON payload =>
BatchInsertResponse payload -> Value
forall payload.
ToJSON payload =>
BatchInsertResponse payload -> Encoding
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: forall payload.
ToJSON payload =>
BatchInsertResponse payload -> Value
toJSON :: BatchInsertResponse payload -> Value
$ctoEncoding :: forall payload.
ToJSON payload =>
BatchInsertResponse payload -> Encoding
toEncoding :: BatchInsertResponse payload -> Encoding
$ctoJSONList :: forall payload.
ToJSON payload =>
[BatchInsertResponse payload] -> Value
toJSONList :: [BatchInsertResponse payload] -> Value
$ctoEncodingList :: forall payload.
ToJSON payload =>
[BatchInsertResponse payload] -> Encoding
toEncodingList :: [BatchInsertResponse payload] -> Encoding
$comitField :: forall payload.
ToJSON payload =>
BatchInsertResponse payload -> Bool
omitField :: BatchInsertResponse payload -> Bool
ToJSON)

-- | Request body for batch DLQ delete
data BatchDeleteRequest = BatchDeleteRequest
  { BatchDeleteRequest -> [Int64]
ids :: [Int64]
  }
  deriving stock (BatchDeleteRequest -> BatchDeleteRequest -> Bool
(BatchDeleteRequest -> BatchDeleteRequest -> Bool)
-> (BatchDeleteRequest -> BatchDeleteRequest -> Bool)
-> Eq BatchDeleteRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchDeleteRequest -> BatchDeleteRequest -> Bool
== :: BatchDeleteRequest -> BatchDeleteRequest -> Bool
$c/= :: BatchDeleteRequest -> BatchDeleteRequest -> Bool
/= :: BatchDeleteRequest -> BatchDeleteRequest -> Bool
Eq, (forall x. BatchDeleteRequest -> Rep BatchDeleteRequest x)
-> (forall x. Rep BatchDeleteRequest x -> BatchDeleteRequest)
-> Generic BatchDeleteRequest
forall x. Rep BatchDeleteRequest x -> BatchDeleteRequest
forall x. BatchDeleteRequest -> Rep BatchDeleteRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BatchDeleteRequest -> Rep BatchDeleteRequest x
from :: forall x. BatchDeleteRequest -> Rep BatchDeleteRequest x
$cto :: forall x. Rep BatchDeleteRequest x -> BatchDeleteRequest
to :: forall x. Rep BatchDeleteRequest x -> BatchDeleteRequest
Generic, Int -> BatchDeleteRequest -> ShowS
[BatchDeleteRequest] -> ShowS
BatchDeleteRequest -> String
(Int -> BatchDeleteRequest -> ShowS)
-> (BatchDeleteRequest -> String)
-> ([BatchDeleteRequest] -> ShowS)
-> Show BatchDeleteRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchDeleteRequest -> ShowS
showsPrec :: Int -> BatchDeleteRequest -> ShowS
$cshow :: BatchDeleteRequest -> String
show :: BatchDeleteRequest -> String
$cshowList :: [BatchDeleteRequest] -> ShowS
showList :: [BatchDeleteRequest] -> ShowS
Show)
  deriving anyclass (Maybe BatchDeleteRequest
Value -> Parser [BatchDeleteRequest]
Value -> Parser BatchDeleteRequest
(Value -> Parser BatchDeleteRequest)
-> (Value -> Parser [BatchDeleteRequest])
-> Maybe BatchDeleteRequest
-> FromJSON BatchDeleteRequest
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser BatchDeleteRequest
parseJSON :: Value -> Parser BatchDeleteRequest
$cparseJSONList :: Value -> Parser [BatchDeleteRequest]
parseJSONList :: Value -> Parser [BatchDeleteRequest]
$comittedField :: Maybe BatchDeleteRequest
omittedField :: Maybe BatchDeleteRequest
FromJSON, [BatchDeleteRequest] -> Value
[BatchDeleteRequest] -> Encoding
BatchDeleteRequest -> Bool
BatchDeleteRequest -> Value
BatchDeleteRequest -> Encoding
(BatchDeleteRequest -> Value)
-> (BatchDeleteRequest -> Encoding)
-> ([BatchDeleteRequest] -> Value)
-> ([BatchDeleteRequest] -> Encoding)
-> (BatchDeleteRequest -> Bool)
-> ToJSON BatchDeleteRequest
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: BatchDeleteRequest -> Value
toJSON :: BatchDeleteRequest -> Value
$ctoEncoding :: BatchDeleteRequest -> Encoding
toEncoding :: BatchDeleteRequest -> Encoding
$ctoJSONList :: [BatchDeleteRequest] -> Value
toJSONList :: [BatchDeleteRequest] -> Value
$ctoEncodingList :: [BatchDeleteRequest] -> Encoding
toEncodingList :: [BatchDeleteRequest] -> Encoding
$comitField :: BatchDeleteRequest -> Bool
omitField :: BatchDeleteRequest -> Bool
ToJSON)

-- | Response body for batch DLQ delete
data BatchDeleteResponse = BatchDeleteResponse
  { BatchDeleteResponse -> Int64
deleted :: Int64
  }
  deriving stock (BatchDeleteResponse -> BatchDeleteResponse -> Bool
(BatchDeleteResponse -> BatchDeleteResponse -> Bool)
-> (BatchDeleteResponse -> BatchDeleteResponse -> Bool)
-> Eq BatchDeleteResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
== :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
$c/= :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
/= :: BatchDeleteResponse -> BatchDeleteResponse -> Bool
Eq, (forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x)
-> (forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse)
-> Generic BatchDeleteResponse
forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse
forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x
from :: forall x. BatchDeleteResponse -> Rep BatchDeleteResponse x
$cto :: forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse
to :: forall x. Rep BatchDeleteResponse x -> BatchDeleteResponse
Generic, Int -> BatchDeleteResponse -> ShowS
[BatchDeleteResponse] -> ShowS
BatchDeleteResponse -> String
(Int -> BatchDeleteResponse -> ShowS)
-> (BatchDeleteResponse -> String)
-> ([BatchDeleteResponse] -> ShowS)
-> Show BatchDeleteResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BatchDeleteResponse -> ShowS
showsPrec :: Int -> BatchDeleteResponse -> ShowS
$cshow :: BatchDeleteResponse -> String
show :: BatchDeleteResponse -> String
$cshowList :: [BatchDeleteResponse] -> ShowS
showList :: [BatchDeleteResponse] -> ShowS
Show)
  deriving anyclass (Maybe BatchDeleteResponse
Value -> Parser [BatchDeleteResponse]
Value -> Parser BatchDeleteResponse
(Value -> Parser BatchDeleteResponse)
-> (Value -> Parser [BatchDeleteResponse])
-> Maybe BatchDeleteResponse
-> FromJSON BatchDeleteResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser BatchDeleteResponse
parseJSON :: Value -> Parser BatchDeleteResponse
$cparseJSONList :: Value -> Parser [BatchDeleteResponse]
parseJSONList :: Value -> Parser [BatchDeleteResponse]
$comittedField :: Maybe BatchDeleteResponse
omittedField :: Maybe BatchDeleteResponse
FromJSON, [BatchDeleteResponse] -> Value
[BatchDeleteResponse] -> Encoding
BatchDeleteResponse -> Bool
BatchDeleteResponse -> Value
BatchDeleteResponse -> Encoding
(BatchDeleteResponse -> Value)
-> (BatchDeleteResponse -> Encoding)
-> ([BatchDeleteResponse] -> Value)
-> ([BatchDeleteResponse] -> Encoding)
-> (BatchDeleteResponse -> Bool)
-> ToJSON BatchDeleteResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: BatchDeleteResponse -> Value
toJSON :: BatchDeleteResponse -> Value
$ctoEncoding :: BatchDeleteResponse -> Encoding
toEncoding :: BatchDeleteResponse -> Encoding
$ctoJSONList :: [BatchDeleteResponse] -> Value
toJSONList :: [BatchDeleteResponse] -> Value
$ctoEncodingList :: [BatchDeleteResponse] -> Encoding
toEncodingList :: [BatchDeleteResponse] -> Encoding
$comitField :: BatchDeleteResponse -> Bool
omitField :: BatchDeleteResponse -> Bool
ToJSON)

-- | Cron schedules response
data CronSchedulesResponse = CronSchedulesResponse
  { CronSchedulesResponse -> [CronScheduleRow]
cronSchedules :: [CronScheduleRow]
  }
  deriving stock (CronSchedulesResponse -> CronSchedulesResponse -> Bool
(CronSchedulesResponse -> CronSchedulesResponse -> Bool)
-> (CronSchedulesResponse -> CronSchedulesResponse -> Bool)
-> Eq CronSchedulesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CronSchedulesResponse -> CronSchedulesResponse -> Bool
== :: CronSchedulesResponse -> CronSchedulesResponse -> Bool
$c/= :: CronSchedulesResponse -> CronSchedulesResponse -> Bool
/= :: CronSchedulesResponse -> CronSchedulesResponse -> Bool
Eq, (forall x. CronSchedulesResponse -> Rep CronSchedulesResponse x)
-> (forall x. Rep CronSchedulesResponse x -> CronSchedulesResponse)
-> Generic CronSchedulesResponse
forall x. Rep CronSchedulesResponse x -> CronSchedulesResponse
forall x. CronSchedulesResponse -> Rep CronSchedulesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CronSchedulesResponse -> Rep CronSchedulesResponse x
from :: forall x. CronSchedulesResponse -> Rep CronSchedulesResponse x
$cto :: forall x. Rep CronSchedulesResponse x -> CronSchedulesResponse
to :: forall x. Rep CronSchedulesResponse x -> CronSchedulesResponse
Generic, Int -> CronSchedulesResponse -> ShowS
[CronSchedulesResponse] -> ShowS
CronSchedulesResponse -> String
(Int -> CronSchedulesResponse -> ShowS)
-> (CronSchedulesResponse -> String)
-> ([CronSchedulesResponse] -> ShowS)
-> Show CronSchedulesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CronSchedulesResponse -> ShowS
showsPrec :: Int -> CronSchedulesResponse -> ShowS
$cshow :: CronSchedulesResponse -> String
show :: CronSchedulesResponse -> String
$cshowList :: [CronSchedulesResponse] -> ShowS
showList :: [CronSchedulesResponse] -> ShowS
Show)
  deriving anyclass (Maybe CronSchedulesResponse
Value -> Parser [CronSchedulesResponse]
Value -> Parser CronSchedulesResponse
(Value -> Parser CronSchedulesResponse)
-> (Value -> Parser [CronSchedulesResponse])
-> Maybe CronSchedulesResponse
-> FromJSON CronSchedulesResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser CronSchedulesResponse
parseJSON :: Value -> Parser CronSchedulesResponse
$cparseJSONList :: Value -> Parser [CronSchedulesResponse]
parseJSONList :: Value -> Parser [CronSchedulesResponse]
$comittedField :: Maybe CronSchedulesResponse
omittedField :: Maybe CronSchedulesResponse
FromJSON, [CronSchedulesResponse] -> Value
[CronSchedulesResponse] -> Encoding
CronSchedulesResponse -> Bool
CronSchedulesResponse -> Value
CronSchedulesResponse -> Encoding
(CronSchedulesResponse -> Value)
-> (CronSchedulesResponse -> Encoding)
-> ([CronSchedulesResponse] -> Value)
-> ([CronSchedulesResponse] -> Encoding)
-> (CronSchedulesResponse -> Bool)
-> ToJSON CronSchedulesResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: CronSchedulesResponse -> Value
toJSON :: CronSchedulesResponse -> Value
$ctoEncoding :: CronSchedulesResponse -> Encoding
toEncoding :: CronSchedulesResponse -> Encoding
$ctoJSONList :: [CronSchedulesResponse] -> Value
toJSONList :: [CronSchedulesResponse] -> Value
$ctoEncodingList :: [CronSchedulesResponse] -> Encoding
toEncodingList :: [CronSchedulesResponse] -> Encoding
$comitField :: CronSchedulesResponse -> Bool
omitField :: CronSchedulesResponse -> Bool
ToJSON)