{-# LANGUAGE DeriveAnyClass #-}

module Hercules.API.Agent.Evaluate.EvaluateEvent.SubstitutionQueryResult
  ( SubstitutionQueryResult (..),
  )
where

import Hercules.API.Agent.OutputInfo (OutputInfo)
import Hercules.API.Prelude

data SubstitutionQueryResult = SubstitutionQueryResult
  { SubstitutionQueryResult -> Text
storeURI :: !Text,
    -- | NB: does not necessarily match outputInfo.derivation
    SubstitutionQueryResult -> Text
derivation :: !Text,
    -- | NB: does not necessarily match outputInfo.name
    SubstitutionQueryResult -> Text
outputName :: !Text,
    -- | NB: does not necessarily match derivation and outputName
    --
    -- 'Nothing': not substitutable
    -- 'Just': substitutable, and expect the following metadata
    SubstitutionQueryResult -> Maybe OutputInfo
outputInfo :: !(Maybe OutputInfo)
  }
  deriving ((forall x.
 SubstitutionQueryResult -> Rep SubstitutionQueryResult x)
-> (forall x.
    Rep SubstitutionQueryResult x -> SubstitutionQueryResult)
-> Generic SubstitutionQueryResult
forall x. Rep SubstitutionQueryResult x -> SubstitutionQueryResult
forall x. SubstitutionQueryResult -> Rep SubstitutionQueryResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SubstitutionQueryResult -> Rep SubstitutionQueryResult x
from :: forall x. SubstitutionQueryResult -> Rep SubstitutionQueryResult x
$cto :: forall x. Rep SubstitutionQueryResult x -> SubstitutionQueryResult
to :: forall x. Rep SubstitutionQueryResult x -> SubstitutionQueryResult
Generic, Int -> SubstitutionQueryResult -> ShowS
[SubstitutionQueryResult] -> ShowS
SubstitutionQueryResult -> String
(Int -> SubstitutionQueryResult -> ShowS)
-> (SubstitutionQueryResult -> String)
-> ([SubstitutionQueryResult] -> ShowS)
-> Show SubstitutionQueryResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubstitutionQueryResult -> ShowS
showsPrec :: Int -> SubstitutionQueryResult -> ShowS
$cshow :: SubstitutionQueryResult -> String
show :: SubstitutionQueryResult -> String
$cshowList :: [SubstitutionQueryResult] -> ShowS
showList :: [SubstitutionQueryResult] -> ShowS
Show, SubstitutionQueryResult -> SubstitutionQueryResult -> Bool
(SubstitutionQueryResult -> SubstitutionQueryResult -> Bool)
-> (SubstitutionQueryResult -> SubstitutionQueryResult -> Bool)
-> Eq SubstitutionQueryResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubstitutionQueryResult -> SubstitutionQueryResult -> Bool
== :: SubstitutionQueryResult -> SubstitutionQueryResult -> Bool
$c/= :: SubstitutionQueryResult -> SubstitutionQueryResult -> Bool
/= :: SubstitutionQueryResult -> SubstitutionQueryResult -> Bool
Eq, SubstitutionQueryResult -> ()
(SubstitutionQueryResult -> ()) -> NFData SubstitutionQueryResult
forall a. (a -> ()) -> NFData a
$crnf :: SubstitutionQueryResult -> ()
rnf :: SubstitutionQueryResult -> ()
NFData, Value -> Parser [SubstitutionQueryResult]
Value -> Parser SubstitutionQueryResult
(Value -> Parser SubstitutionQueryResult)
-> (Value -> Parser [SubstitutionQueryResult])
-> FromJSON SubstitutionQueryResult
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser SubstitutionQueryResult
parseJSON :: Value -> Parser SubstitutionQueryResult
$cparseJSONList :: Value -> Parser [SubstitutionQueryResult]
parseJSONList :: Value -> Parser [SubstitutionQueryResult]
FromJSON, [SubstitutionQueryResult] -> Value
[SubstitutionQueryResult] -> Encoding
SubstitutionQueryResult -> Value
SubstitutionQueryResult -> Encoding
(SubstitutionQueryResult -> Value)
-> (SubstitutionQueryResult -> Encoding)
-> ([SubstitutionQueryResult] -> Value)
-> ([SubstitutionQueryResult] -> Encoding)
-> ToJSON SubstitutionQueryResult
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: SubstitutionQueryResult -> Value
toJSON :: SubstitutionQueryResult -> Value
$ctoEncoding :: SubstitutionQueryResult -> Encoding
toEncoding :: SubstitutionQueryResult -> Encoding
$ctoJSONList :: [SubstitutionQueryResult] -> Value
toJSONList :: [SubstitutionQueryResult] -> Value
$ctoEncodingList :: [SubstitutionQueryResult] -> Encoding
toEncodingList :: [SubstitutionQueryResult] -> Encoding
ToJSON)