{-# LANGUAGE DeriveAnyClass #-}

module Hercules.API.State.StateVersion where

import Hercules.API.Accounts.Account (Account)
import Hercules.API.Prelude
import Hercules.API.Projects.Job (Job)
import Hercules.API.Projects.Project (Project)

data StateVersion = StateVersion
  { StateVersion -> Id Project
projectId :: Id Project,
    StateVersion -> Text
name :: Text,
    StateVersion -> Int
version :: Int,
    StateVersion -> UTCTime
creationTime :: UTCTime,
    -- jobId :: Maybe (Id Job),
    StateVersion -> Maybe Job
job :: Maybe Job,
    -- effectEventId :: Maybe (Id "EffectEvent"),
    --  agentId :: Maybe (Id AgentSession),
    StateVersion -> Maybe Account
uploader :: Maybe Account,
    StateVersion -> Maybe Text
sha256 :: Maybe Text,
    StateVersion -> Maybe Int
size :: Maybe Int
  }
  deriving (forall x. Rep StateVersion x -> StateVersion
forall x. StateVersion -> Rep StateVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StateVersion x -> StateVersion
$cfrom :: forall x. StateVersion -> Rep StateVersion x
Generic, Int -> StateVersion -> ShowS
[StateVersion] -> ShowS
StateVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StateVersion] -> ShowS
$cshowList :: [StateVersion] -> ShowS
show :: StateVersion -> String
$cshow :: StateVersion -> String
showsPrec :: Int -> StateVersion -> ShowS
$cshowsPrec :: Int -> StateVersion -> ShowS
Show, StateVersion -> StateVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StateVersion -> StateVersion -> Bool
$c/= :: StateVersion -> StateVersion -> Bool
== :: StateVersion -> StateVersion -> Bool
$c== :: StateVersion -> StateVersion -> Bool
Eq, StateVersion -> ()
forall a. (a -> ()) -> NFData a
rnf :: StateVersion -> ()
$crnf :: StateVersion -> ()
NFData, [StateVersion] -> Encoding
[StateVersion] -> Value
StateVersion -> Encoding
StateVersion -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [StateVersion] -> Encoding
$ctoEncodingList :: [StateVersion] -> Encoding
toJSONList :: [StateVersion] -> Value
$ctoJSONList :: [StateVersion] -> Value
toEncoding :: StateVersion -> Encoding
$ctoEncoding :: StateVersion -> Encoding
toJSON :: StateVersion -> Value
$ctoJSON :: StateVersion -> Value
ToJSON, Value -> Parser [StateVersion]
Value -> Parser StateVersion
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [StateVersion]
$cparseJSONList :: Value -> Parser [StateVersion]
parseJSON :: Value -> Parser StateVersion
$cparseJSON :: Value -> Parser StateVersion
FromJSON, Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
declareNamedSchema :: Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
ToSchema)