-- SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

{-# OPTIONS_GHC -fno-warn-orphans #-}

module Ldap.Client.Instances
  (
  ) where

import ClassyPrelude

import Data.Aeson.TH
import Data.Data (Data)

import Database.Persist.TH (derivePersistField)

import Utils.PathPiece (derivePathPiece)

import Ldap.Client

import Network.HTTP.Types.Method.Instances () -- for FromJSON instance for ByteString


deriving instance Ord Attr
deriving instance Ord Dn
deriving instance Ord Password
deriving instance Ord ResultCode
deriving instance Ord Scope

deriving instance Read Attr
deriving instance Read Dn
deriving instance Read Password
deriving instance Read Scope

deriving instance Data Attr
deriving instance Data Dn
deriving instance Data Password
deriving instance Data Scope

deriving instance Generic Attr
deriving instance Generic Dn
deriving instance Generic Password
deriving instance Generic Scope

deriving anyclass instance NFData Attr
deriving anyclass instance NFData Dn
deriving anyclass instance NFData Password
deriving instance NFData Scope

derivePathPiece ''Dn id "--"
derivePathPiece ''Scope id "--"

derivePersistField "Dn"
derivePersistField "Password"
derivePersistField "Scope"

deriveJSON defaultOptions ''Attr
deriveJSON defaultOptions ''Dn
deriveJSON defaultOptions ''Scope
deriveJSON defaultOptions ''SearchEntry
