-- | Guild Members
module Calamity.Types.Model.Guild.Member (Member (..)) where

import Calamity.Internal.AesonThings
import Calamity.Internal.OverriddenVia
import Calamity.Internal.Utils
import Calamity.Types.Model.Guild.Role
import Calamity.Types.Model.User
import Calamity.Types.Snowflake
import Control.DeepSeq (NFData)
import Data.Aeson
import Data.Text (Text)
import Data.Time
import Data.Vector.Unboxing (Vector)
import Data.Word (Word64)
import GHC.Generics
import TextShow
import qualified TextShow.Generic as TSG

data Member' = Member'
  { Member' -> Snowflake User
id :: Snowflake User
  , Member' -> Text
username :: Text
  , Member' -> Text
discriminator :: Text
  , Member' -> Maybe Bool
bot :: Maybe Bool
  , Member' -> Maybe Text
avatar :: Maybe Text
  , Member' -> Maybe Bool
mfaEnabled :: Maybe Bool
  , Member' -> Maybe Bool
verified :: Maybe Bool
  , Member' -> Maybe Text
email :: Maybe Text
  , Member' -> Maybe Word64
flags :: Maybe Word64
  , Member' -> Maybe Word64
premiumType :: Maybe Word64
  , Member' -> Maybe Text
nick :: Maybe Text
  , Member' -> AesonVector (Snowflake Role)
roles :: AesonVector (Snowflake Role)
  , Member' -> CalamityFromStringShow UTCTime
joinedAt :: CalamityFromStringShow UTCTime
  , Member' -> Bool
deaf :: Bool
  , Member' -> Bool
mute :: Bool
  }
  deriving ((forall x. Member' -> Rep Member' x)
-> (forall x. Rep Member' x -> Member') -> Generic Member'
forall x. Rep Member' x -> Member'
forall x. Member' -> Rep Member' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Member' x -> Member'
$cfrom :: forall x. Member' -> Rep Member' x
Generic)
  deriving (Int -> Member' -> Builder
Int -> Member' -> Text
Int -> Member' -> Text
[Member'] -> Builder
[Member'] -> Text
[Member'] -> Text
Member' -> Builder
Member' -> Text
Member' -> Text
(Int -> Member' -> Builder)
-> (Member' -> Builder)
-> ([Member'] -> Builder)
-> (Int -> Member' -> Text)
-> (Member' -> Text)
-> ([Member'] -> Text)
-> (Int -> Member' -> Text)
-> (Member' -> Text)
-> ([Member'] -> Text)
-> TextShow Member'
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [Member'] -> Text
$cshowtlList :: [Member'] -> Text
showtl :: Member' -> Text
$cshowtl :: Member' -> Text
showtlPrec :: Int -> Member' -> Text
$cshowtlPrec :: Int -> Member' -> Text
showtList :: [Member'] -> Text
$cshowtList :: [Member'] -> Text
showt :: Member' -> Text
$cshowt :: Member' -> Text
showtPrec :: Int -> Member' -> Text
$cshowtPrec :: Int -> Member' -> Text
showbList :: [Member'] -> Builder
$cshowbList :: [Member'] -> Builder
showb :: Member' -> Builder
$cshowb :: Member' -> Builder
showbPrec :: Int -> Member' -> Builder
$cshowbPrec :: Int -> Member' -> Builder
TextShow) via TSG.FromGeneric Member'
  deriving
    (Value -> Parser [Member']
Value -> Parser Member'
(Value -> Parser Member')
-> (Value -> Parser [Member']) -> FromJSON Member'
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Member']
$cparseJSONList :: Value -> Parser [Member']
parseJSON :: Value -> Parser Member'
$cparseJSON :: Value -> Parser Member'
FromJSON)
    via WithSpecialCases
          '[ "user"
              `ExtractFields` [ "id"
                              , "username"
                              , "discriminator"
                              , "bot"
                              , "avatar"
                              , "mfa_enabled"
                              , "verified"
                              , "email"
                              , "flags"
                              , "premium_type"
                              ]
           ]
          Member'

data Member = Member
  { Member -> Snowflake User
id :: Snowflake User
  , Member -> Text
username :: Text
  , Member -> Text
discriminator :: Text
  , Member -> Maybe Bool
bot :: Maybe Bool
  , Member -> Maybe Text
avatar :: Maybe Text
  , Member -> Maybe Bool
mfaEnabled :: Maybe Bool
  , Member -> Maybe Bool
verified :: Maybe Bool
  , Member -> Maybe Text
email :: Maybe Text
  , Member -> Maybe Word64
flags :: Maybe Word64
  , Member -> Maybe Word64
premiumType :: Maybe Word64
  , Member -> Maybe Text
nick :: Maybe Text
  , Member -> Vector (Snowflake Role)
roles :: Vector (Snowflake Role)
  , Member -> UTCTime
joinedAt :: UTCTime
  , Member -> Bool
deaf :: Bool
  , Member -> Bool
mute :: Bool
  }
  deriving (Member -> Member -> Bool
(Member -> Member -> Bool)
-> (Member -> Member -> Bool) -> Eq Member
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Member -> Member -> Bool
$c/= :: Member -> Member -> Bool
== :: Member -> Member -> Bool
$c== :: Member -> Member -> Bool
Eq, Int -> Member -> ShowS
[Member] -> ShowS
Member -> String
(Int -> Member -> ShowS)
-> (Member -> String) -> ([Member] -> ShowS) -> Show Member
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Member] -> ShowS
$cshowList :: [Member] -> ShowS
show :: Member -> String
$cshow :: Member -> String
showsPrec :: Int -> Member -> ShowS
$cshowsPrec :: Int -> Member -> ShowS
Show, (forall x. Member -> Rep Member x)
-> (forall x. Rep Member x -> Member) -> Generic Member
forall x. Rep Member x -> Member
forall x. Member -> Rep Member x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Member x -> Member
$cfrom :: forall x. Member -> Rep Member x
Generic, Member -> ()
(Member -> ()) -> NFData Member
forall a. (a -> ()) -> NFData a
rnf :: Member -> ()
$crnf :: Member -> ()
NFData)
  deriving (Int -> Member -> Builder
Int -> Member -> Text
Int -> Member -> Text
[Member] -> Builder
[Member] -> Text
[Member] -> Text
Member -> Builder
Member -> Text
Member -> Text
(Int -> Member -> Builder)
-> (Member -> Builder)
-> ([Member] -> Builder)
-> (Int -> Member -> Text)
-> (Member -> Text)
-> ([Member] -> Text)
-> (Int -> Member -> Text)
-> (Member -> Text)
-> ([Member] -> Text)
-> TextShow Member
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [Member] -> Text
$cshowtlList :: [Member] -> Text
showtl :: Member -> Text
$cshowtl :: Member -> Text
showtlPrec :: Int -> Member -> Text
$cshowtlPrec :: Int -> Member -> Text
showtList :: [Member] -> Text
$cshowtList :: [Member] -> Text
showt :: Member -> Text
$cshowt :: Member -> Text
showtPrec :: Int -> Member -> Text
$cshowtPrec :: Int -> Member -> Text
showbList :: [Member] -> Builder
$cshowbList :: [Member] -> Builder
showb :: Member -> Builder
$cshowb :: Member -> Builder
showbPrec :: Int -> Member -> Builder
$cshowbPrec :: Int -> Member -> Builder
TextShow, Value -> Parser [Member]
Value -> Parser Member
(Value -> Parser Member)
-> (Value -> Parser [Member]) -> FromJSON Member
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Member]
$cparseJSONList :: Value -> Parser [Member]
parseJSON :: Value -> Parser Member
$cparseJSON :: Value -> Parser Member
FromJSON) via OverriddenVia Member Member'
  deriving (HasID Member) via HasIDFieldCoerce "id" Member User
  deriving (HasID User) via HasIDField "id" Member