module IHP.AuthSupport.Types where

import IHP.Prelude
import Data.Data
import IHP.ModelSupport

data PasswordReset = PasswordReset
    { PasswordReset -> UUID
id :: UUID
    , PasswordReset -> Text
email :: Text
    , PasswordReset -> MetaBag
meta :: MetaBag
    } deriving (PasswordReset -> PasswordReset -> Bool
(PasswordReset -> PasswordReset -> Bool)
-> (PasswordReset -> PasswordReset -> Bool) -> Eq PasswordReset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PasswordReset -> PasswordReset -> Bool
$c/= :: PasswordReset -> PasswordReset -> Bool
== :: PasswordReset -> PasswordReset -> Bool
$c== :: PasswordReset -> PasswordReset -> Bool
Eq)

type instance GetModelName PasswordReset = "PasswordReset"

instance SetField "email" PasswordReset Text where
    {-# INLINE setField #-}
    setField :: Text -> PasswordReset -> PasswordReset
setField Text
newValue PasswordReset { Text
UUID
MetaBag
meta :: MetaBag
email :: Text
id :: UUID
$sel:meta:PasswordReset :: PasswordReset -> MetaBag
$sel:email:PasswordReset :: PasswordReset -> Text
$sel:id:PasswordReset :: PasswordReset -> UUID
.. } = PasswordReset :: UUID -> Text -> MetaBag -> PasswordReset
PasswordReset { UUID
id :: UUID
$sel:id:PasswordReset :: UUID
id, $sel:email:PasswordReset :: Text
email = Text
newValue, $sel:meta:PasswordReset :: MetaBag
meta = MetaBag
meta { $sel:touchedFields:MetaBag :: [Text]
touchedFields = Text
"email" Text -> [Text] -> [Text]
forall a. a -> [a] -> [a]
: MetaBag -> [Text]
touchedFields MetaBag
meta } }

instance SetField "meta" PasswordReset MetaBag where
    {-# INLINE setField #-}
    setField :: MetaBag -> PasswordReset -> PasswordReset
setField MetaBag
newValue PasswordReset { Text
UUID
MetaBag
meta :: MetaBag
email :: Text
id :: UUID
$sel:meta:PasswordReset :: PasswordReset -> MetaBag
$sel:email:PasswordReset :: PasswordReset -> Text
$sel:id:PasswordReset :: PasswordReset -> UUID
.. } = PasswordReset :: UUID -> Text -> MetaBag -> PasswordReset
PasswordReset { UUID
id :: UUID
$sel:id:PasswordReset :: UUID
id, Text
email :: Text
$sel:email:PasswordReset :: Text
email, $sel:meta:PasswordReset :: MetaBag
meta = MetaBag
newValue }

instance Record PasswordReset where
    newRecord :: PasswordReset
newRecord = PasswordReset :: UUID -> Text -> MetaBag -> PasswordReset
PasswordReset { $sel:id:PasswordReset :: UUID
id = UUID
forall a. Default a => a
def, $sel:email:PasswordReset :: Text
email = Text
forall a. Default a => a
def, $sel:meta:PasswordReset :: MetaBag
meta = MetaBag
forall a. Default a => a
def }