{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}

module Hercules.API.State.StateVersion where

import Data.OpenApi qualified as O3
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. StateVersion -> Rep StateVersion x)
-> (forall x. Rep StateVersion x -> StateVersion)
-> Generic StateVersion
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
$cfrom :: forall x. StateVersion -> Rep StateVersion x
from :: forall x. StateVersion -> Rep StateVersion x
$cto :: forall x. Rep StateVersion x -> StateVersion
to :: forall x. Rep StateVersion x -> StateVersion
Generic, Int -> StateVersion -> ShowS
[StateVersion] -> ShowS
StateVersion -> String
(Int -> StateVersion -> ShowS)
-> (StateVersion -> String)
-> ([StateVersion] -> ShowS)
-> Show StateVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StateVersion -> ShowS
showsPrec :: Int -> StateVersion -> ShowS
$cshow :: StateVersion -> String
show :: StateVersion -> String
$cshowList :: [StateVersion] -> ShowS
showList :: [StateVersion] -> ShowS
Show, StateVersion -> StateVersion -> Bool
(StateVersion -> StateVersion -> Bool)
-> (StateVersion -> StateVersion -> Bool) -> Eq StateVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StateVersion -> StateVersion -> Bool
== :: StateVersion -> StateVersion -> Bool
$c/= :: StateVersion -> StateVersion -> Bool
/= :: StateVersion -> StateVersion -> Bool
Eq)
  deriving anyclass (StateVersion -> ()
(StateVersion -> ()) -> NFData StateVersion
forall a. (a -> ()) -> NFData a
$crnf :: StateVersion -> ()
rnf :: StateVersion -> ()
NFData, [StateVersion] -> Value
[StateVersion] -> Encoding
StateVersion -> Value
StateVersion -> Encoding
(StateVersion -> Value)
-> (StateVersion -> Encoding)
-> ([StateVersion] -> Value)
-> ([StateVersion] -> Encoding)
-> ToJSON StateVersion
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: StateVersion -> Value
toJSON :: StateVersion -> Value
$ctoEncoding :: StateVersion -> Encoding
toEncoding :: StateVersion -> Encoding
$ctoJSONList :: [StateVersion] -> Value
toJSONList :: [StateVersion] -> Value
$ctoEncodingList :: [StateVersion] -> Encoding
toEncodingList :: [StateVersion] -> Encoding
ToJSON, Value -> Parser [StateVersion]
Value -> Parser StateVersion
(Value -> Parser StateVersion)
-> (Value -> Parser [StateVersion]) -> FromJSON StateVersion
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser StateVersion
parseJSON :: Value -> Parser StateVersion
$cparseJSONList :: Value -> Parser [StateVersion]
parseJSONList :: Value -> Parser [StateVersion]
FromJSON, Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
(Proxy StateVersion -> Declare (Definitions Schema) NamedSchema)
-> ToSchema StateVersion
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
ToSchema, Typeable StateVersion
Typeable StateVersion =>
(Proxy StateVersion -> Declare (Definitions Schema) NamedSchema)
-> ToSchema StateVersion
Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a =>
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy StateVersion -> Declare (Definitions Schema) NamedSchema
O3.ToSchema)