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

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

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

deriving instance (ToSchema a) => ToSchema (SimpleAttribute a)

deriving instance (O3.ToSchema a) => O3.ToSchema (SimpleAttribute a)

deriving instance Functor SimpleAttribute

deriving instance Foldable SimpleAttribute

deriving instance Traversable SimpleAttribute