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

module Hercules.API.SimpleAttribute
  ( SimpleAttribute (..),
  )
where

import Hercules.API.Prelude
import Prelude ()

-- | NOTE: Generic types must always be wrapped in a newtype, so as to avoid ambiguities in the generated schema.
data SimpleAttribute a = SimpleAttribute
  { forall a. SimpleAttribute a -> [Text]
path :: [Text],
    forall a. SimpleAttribute a -> a
value :: a
  }
  deriving (forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (SimpleAttribute a) x -> SimpleAttribute a
forall a x. SimpleAttribute a -> Rep (SimpleAttribute a) x
$cto :: forall a x. Rep (SimpleAttribute a) x -> SimpleAttribute a
$cfrom :: forall a x. SimpleAttribute a -> Rep (SimpleAttribute a) x
Generic, Int -> SimpleAttribute a -> ShowS
forall a. Show a => Int -> SimpleAttribute a -> ShowS
forall a. Show a => [SimpleAttribute a] -> ShowS
forall a. Show a => SimpleAttribute a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SimpleAttribute a] -> ShowS
$cshowList :: forall a. Show a => [SimpleAttribute a] -> ShowS
show :: SimpleAttribute a -> String
$cshow :: forall a. Show a => SimpleAttribute a -> String
showsPrec :: Int -> SimpleAttribute a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> SimpleAttribute a -> ShowS
Show, SimpleAttribute a -> SimpleAttribute a -> Bool
forall a. Eq a => SimpleAttribute a -> SimpleAttribute a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimpleAttribute a -> SimpleAttribute a -> Bool
$c/= :: forall a. Eq a => SimpleAttribute a -> SimpleAttribute a -> Bool
== :: SimpleAttribute a -> SimpleAttribute a -> Bool
$c== :: forall a. Eq a => SimpleAttribute a -> SimpleAttribute a -> Bool
Eq)
  deriving anyclass (forall a. NFData a => SimpleAttribute a -> ()
forall a. (a -> ()) -> NFData a
rnf :: SimpleAttribute a -> ()
$crnf :: forall a. NFData a => SimpleAttribute a -> ()
NFData, forall a. FromJSON a => Value -> Parser [SimpleAttribute a]
forall a. FromJSON a => Value -> Parser (SimpleAttribute a)
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [SimpleAttribute a]
$cparseJSONList :: forall a. FromJSON a => Value -> Parser [SimpleAttribute a]
parseJSON :: Value -> Parser (SimpleAttribute a)
$cparseJSON :: forall a. FromJSON a => Value -> Parser (SimpleAttribute a)
FromJSON, forall a. ToJSON a => [SimpleAttribute a] -> Encoding
forall a. ToJSON a => [SimpleAttribute a] -> Value
forall a. ToJSON a => SimpleAttribute a -> Encoding
forall a. ToJSON a => SimpleAttribute a -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [SimpleAttribute a] -> Encoding
$ctoEncodingList :: forall a. ToJSON a => [SimpleAttribute a] -> Encoding
toJSONList :: [SimpleAttribute a] -> Value
$ctoJSONList :: forall a. ToJSON a => [SimpleAttribute a] -> Value
toEncoding :: SimpleAttribute a -> Encoding
$ctoEncoding :: forall a. ToJSON a => SimpleAttribute a -> Encoding
toJSON :: SimpleAttribute a -> Value
$ctoJSON :: forall a. ToJSON a => SimpleAttribute a -> Value
ToJSON)

deriving instance ToSchema a => ToSchema (SimpleAttribute a)

deriving instance Functor SimpleAttribute

deriving instance Foldable SimpleAttribute

deriving instance Traversable SimpleAttribute