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

module Hercules.API.State.ProjectState where

import Data.OpenApi qualified as O3
import Hercules.API.Prelude
import Hercules.API.Projects.Project (Project)
import Hercules.API.State.StateFile (StateFile)

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