{-# LANGUAGE DeriveAnyClass #-}

module Hercules.API.Projects.JobHandlers
  ( JobHandlers (..),
  )
where

import Hercules.API.Prelude
import Hercules.API.Projects.Job (Job)
import Hercules.API.Projects.JobHandlers.OnPushHandler (OnPushHandler)
import Hercules.API.Projects.JobHandlers.OnScheduleHandler (OnScheduleHandler)

data JobHandlers = JobHandlers
  { JobHandlers -> Id Job
jobId :: Id Job,
    JobHandlers -> Map Text OnPushHandler
onPush :: Map Text OnPushHandler,
    JobHandlers -> Map Text OnScheduleHandler
onSchedule :: Map Text OnScheduleHandler
  }
  deriving (forall x. Rep JobHandlers x -> JobHandlers
forall x. JobHandlers -> Rep JobHandlers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobHandlers x -> JobHandlers
$cfrom :: forall x. JobHandlers -> Rep JobHandlers x
Generic, Int -> JobHandlers -> ShowS
[JobHandlers] -> ShowS
JobHandlers -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobHandlers] -> ShowS
$cshowList :: [JobHandlers] -> ShowS
show :: JobHandlers -> String
$cshow :: JobHandlers -> String
showsPrec :: Int -> JobHandlers -> ShowS
$cshowsPrec :: Int -> JobHandlers -> ShowS
Show, JobHandlers -> JobHandlers -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobHandlers -> JobHandlers -> Bool
$c/= :: JobHandlers -> JobHandlers -> Bool
== :: JobHandlers -> JobHandlers -> Bool
$c== :: JobHandlers -> JobHandlers -> Bool
Eq, JobHandlers -> ()
forall a. (a -> ()) -> NFData a
rnf :: JobHandlers -> ()
$crnf :: JobHandlers -> ()
NFData, [JobHandlers] -> Encoding
[JobHandlers] -> Value
JobHandlers -> Encoding
JobHandlers -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [JobHandlers] -> Encoding
$ctoEncodingList :: [JobHandlers] -> Encoding
toJSONList :: [JobHandlers] -> Value
$ctoJSONList :: [JobHandlers] -> Value
toEncoding :: JobHandlers -> Encoding
$ctoEncoding :: JobHandlers -> Encoding
toJSON :: JobHandlers -> Value
$ctoJSON :: JobHandlers -> Value
ToJSON, Value -> Parser [JobHandlers]
Value -> Parser JobHandlers
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [JobHandlers]
$cparseJSONList :: Value -> Parser [JobHandlers]
parseJSON :: Value -> Parser JobHandlers
$cparseJSON :: Value -> Parser JobHandlers
FromJSON, Proxy JobHandlers -> Declare (Definitions Schema) NamedSchema
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
declareNamedSchema :: Proxy JobHandlers -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: Proxy JobHandlers -> Declare (Definitions Schema) NamedSchema
ToSchema)