{-# LANGUAGE DeriveAnyClass #-}

module Hercules.API.State.StateFile where

import Hercules.API.Prelude
import Hercules.API.Projects.Project (Project)
import Hercules.API.State.StateVersion (StateVersion)

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