{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module Discord.Internal.Rest.Guild
( GuildRequest(..)
, CreateGuildChannelOpts(..)
, ModifyGuildOpts(..)
, AddGuildMemberOpts(..)
, ModifyGuildMemberOpts(..)
, GuildMembersTiming(..)
, CreateGuildBanOpts(..)
, ModifyGuildRoleOpts(..)
, CreateGuildIntegrationOpts(..)
, ModifyGuildIntegrationOpts(..)
) where
import Data.Aeson
import Network.HTTP.Req ((/:), (/~))
import qualified Network.HTTP.Req as R
import qualified Data.Text as T
import Discord.Internal.Rest.Prelude
import Discord.Internal.Types
import Data.Default (Default(..))
instance Request (GuildRequest a) where
majorRoute :: GuildRequest a -> String
majorRoute = GuildRequest a -> String
forall a. GuildRequest a -> String
guildMajorRoute
jsonRequest :: GuildRequest a -> JsonRequest
jsonRequest = GuildRequest a -> JsonRequest
forall a. GuildRequest a -> JsonRequest
guildJsonRequest
data GuildRequest a where
GetGuild :: GuildId -> GuildRequest Guild
ModifyGuild :: GuildId -> ModifyGuildOpts -> GuildRequest Guild
DeleteGuild :: GuildId -> GuildRequest ()
GetGuildChannels :: GuildId -> GuildRequest [Channel]
CreateGuildChannel :: GuildId -> T.Text -> [Overwrite] -> CreateGuildChannelOpts -> GuildRequest Channel
ModifyGuildChannelPositions :: GuildId -> [(ChannelId,Int)] -> GuildRequest [Channel]
GetGuildMember :: GuildId -> UserId -> GuildRequest GuildMember
ListGuildMembers :: GuildId -> GuildMembersTiming -> GuildRequest [GuildMember]
AddGuildMember :: GuildId -> UserId -> AddGuildMemberOpts
-> GuildRequest ()
ModifyGuildMember :: GuildId -> UserId -> ModifyGuildMemberOpts -> GuildRequest GuildMember
ModifyCurrentUserNick :: GuildId -> T.Text -> GuildRequest ()
AddGuildMemberRole :: GuildId -> UserId -> RoleId -> GuildRequest ()
RemoveGuildMemberRole :: GuildId -> UserId -> RoleId -> GuildRequest ()
RemoveGuildMember :: GuildId -> UserId -> GuildRequest ()
GetGuildBans :: GuildId -> GuildRequest [GuildBan]
GetGuildBan :: GuildId -> UserId -> GuildRequest GuildBan
CreateGuildBan :: GuildId -> UserId -> CreateGuildBanOpts -> GuildRequest ()
RemoveGuildBan :: GuildId -> UserId -> GuildRequest ()
GetGuildRoles :: GuildId -> GuildRequest [Role]
CreateGuildRole :: GuildId -> ModifyGuildRoleOpts -> GuildRequest Role
ModifyGuildRolePositions :: GuildId -> [(RoleId, Integer)] -> GuildRequest [Role]
ModifyGuildRole :: GuildId -> RoleId -> ModifyGuildRoleOpts -> GuildRequest Role
DeleteGuildRole :: GuildId -> RoleId -> GuildRequest ()
GetGuildPruneCount :: GuildId -> Integer -> GuildRequest Object
BeginGuildPrune :: GuildId -> Integer -> GuildRequest Object
GetGuildVoiceRegions :: GuildId -> GuildRequest [VoiceRegion]
GetGuildInvites :: GuildId -> GuildRequest [Invite]
GetGuildIntegrations :: GuildId -> GuildRequest [Integration]
CreateGuildIntegration :: GuildId -> IntegrationId -> CreateGuildIntegrationOpts -> GuildRequest ()
ModifyGuildIntegration :: GuildId -> IntegrationId -> ModifyGuildIntegrationOpts
-> GuildRequest ()
DeleteGuildIntegration :: GuildId -> IntegrationId -> GuildRequest ()
SyncGuildIntegration :: GuildId -> IntegrationId -> GuildRequest ()
GetGuildWidget :: GuildId -> GuildRequest GuildWidget
ModifyGuildWidget :: GuildId -> GuildWidget -> GuildRequest GuildWidget
GetGuildVanityURL :: GuildId -> GuildRequest T.Text
data ModifyGuildIntegrationOpts = ModifyGuildIntegrationOpts
{ ModifyGuildIntegrationOpts -> Integer
modifyGuildIntegrationOptsExpireBehavior :: Integer
, ModifyGuildIntegrationOpts -> Integer
modifyGuildIntegrationOptsExpireGraceSeconds :: Integer
, ModifyGuildIntegrationOpts -> Bool
modifyGuildIntegrationOptsEmoticonsEnabled :: Bool
} deriving (Int -> ModifyGuildIntegrationOpts -> ShowS
[ModifyGuildIntegrationOpts] -> ShowS
ModifyGuildIntegrationOpts -> String
(Int -> ModifyGuildIntegrationOpts -> ShowS)
-> (ModifyGuildIntegrationOpts -> String)
-> ([ModifyGuildIntegrationOpts] -> ShowS)
-> Show ModifyGuildIntegrationOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyGuildIntegrationOpts] -> ShowS
$cshowList :: [ModifyGuildIntegrationOpts] -> ShowS
show :: ModifyGuildIntegrationOpts -> String
$cshow :: ModifyGuildIntegrationOpts -> String
showsPrec :: Int -> ModifyGuildIntegrationOpts -> ShowS
$cshowsPrec :: Int -> ModifyGuildIntegrationOpts -> ShowS
Show, ReadPrec [ModifyGuildIntegrationOpts]
ReadPrec ModifyGuildIntegrationOpts
Int -> ReadS ModifyGuildIntegrationOpts
ReadS [ModifyGuildIntegrationOpts]
(Int -> ReadS ModifyGuildIntegrationOpts)
-> ReadS [ModifyGuildIntegrationOpts]
-> ReadPrec ModifyGuildIntegrationOpts
-> ReadPrec [ModifyGuildIntegrationOpts]
-> Read ModifyGuildIntegrationOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyGuildIntegrationOpts]
$creadListPrec :: ReadPrec [ModifyGuildIntegrationOpts]
readPrec :: ReadPrec ModifyGuildIntegrationOpts
$creadPrec :: ReadPrec ModifyGuildIntegrationOpts
readList :: ReadS [ModifyGuildIntegrationOpts]
$creadList :: ReadS [ModifyGuildIntegrationOpts]
readsPrec :: Int -> ReadS ModifyGuildIntegrationOpts
$creadsPrec :: Int -> ReadS ModifyGuildIntegrationOpts
Read, ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
(ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Bool)
-> Eq ModifyGuildIntegrationOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c/= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
== :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c== :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
Eq, Eq ModifyGuildIntegrationOpts
Eq ModifyGuildIntegrationOpts
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Ordering)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Bool)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Bool)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Bool)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Bool)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts)
-> Ord ModifyGuildIntegrationOpts
ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Ordering
ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
$cmin :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
max :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
$cmax :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
>= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c>= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
> :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c> :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
<= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c<= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
< :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c< :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
compare :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Ordering
$ccompare :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Ordering
$cp1Ord :: Eq ModifyGuildIntegrationOpts
Ord)
instance ToJSON ModifyGuildIntegrationOpts where
toJSON :: ModifyGuildIntegrationOpts -> Value
toJSON ModifyGuildIntegrationOpts{Bool
Integer
modifyGuildIntegrationOptsEmoticonsEnabled :: Bool
modifyGuildIntegrationOptsExpireGraceSeconds :: Integer
modifyGuildIntegrationOptsExpireBehavior :: Integer
modifyGuildIntegrationOptsEmoticonsEnabled :: ModifyGuildIntegrationOpts -> Bool
modifyGuildIntegrationOptsExpireGraceSeconds :: ModifyGuildIntegrationOpts -> Integer
modifyGuildIntegrationOptsExpireBehavior :: ModifyGuildIntegrationOpts -> Integer
..} = [Maybe Pair] -> Value
objectFromMaybes
[ AesonKey
"expire_grace_period" AesonKey -> Integer -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Integer
modifyGuildIntegrationOptsExpireGraceSeconds
, AesonKey
"expire_behavior" AesonKey -> Integer -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Integer
modifyGuildIntegrationOptsExpireBehavior
, AesonKey
"enable_emoticons" AesonKey -> Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Bool
modifyGuildIntegrationOptsEmoticonsEnabled ]
newtype CreateGuildIntegrationOpts = CreateGuildIntegrationOpts
{ CreateGuildIntegrationOpts -> Text
createGuildIntegrationOptsType :: T.Text
} deriving (Int -> CreateGuildIntegrationOpts -> ShowS
[CreateGuildIntegrationOpts] -> ShowS
CreateGuildIntegrationOpts -> String
(Int -> CreateGuildIntegrationOpts -> ShowS)
-> (CreateGuildIntegrationOpts -> String)
-> ([CreateGuildIntegrationOpts] -> ShowS)
-> Show CreateGuildIntegrationOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGuildIntegrationOpts] -> ShowS
$cshowList :: [CreateGuildIntegrationOpts] -> ShowS
show :: CreateGuildIntegrationOpts -> String
$cshow :: CreateGuildIntegrationOpts -> String
showsPrec :: Int -> CreateGuildIntegrationOpts -> ShowS
$cshowsPrec :: Int -> CreateGuildIntegrationOpts -> ShowS
Show, ReadPrec [CreateGuildIntegrationOpts]
ReadPrec CreateGuildIntegrationOpts
Int -> ReadS CreateGuildIntegrationOpts
ReadS [CreateGuildIntegrationOpts]
(Int -> ReadS CreateGuildIntegrationOpts)
-> ReadS [CreateGuildIntegrationOpts]
-> ReadPrec CreateGuildIntegrationOpts
-> ReadPrec [CreateGuildIntegrationOpts]
-> Read CreateGuildIntegrationOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGuildIntegrationOpts]
$creadListPrec :: ReadPrec [CreateGuildIntegrationOpts]
readPrec :: ReadPrec CreateGuildIntegrationOpts
$creadPrec :: ReadPrec CreateGuildIntegrationOpts
readList :: ReadS [CreateGuildIntegrationOpts]
$creadList :: ReadS [CreateGuildIntegrationOpts]
readsPrec :: Int -> ReadS CreateGuildIntegrationOpts
$creadsPrec :: Int -> ReadS CreateGuildIntegrationOpts
Read, CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
(CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Bool)
-> Eq CreateGuildIntegrationOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c/= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
== :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c== :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
Eq, Eq CreateGuildIntegrationOpts
Eq CreateGuildIntegrationOpts
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Ordering)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Bool)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Bool)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Bool)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Bool)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts)
-> Ord CreateGuildIntegrationOpts
CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Ordering
CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
$cmin :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
max :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
$cmax :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
>= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c>= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
> :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c> :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
<= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c<= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
< :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c< :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
compare :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Ordering
$ccompare :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Ordering
$cp1Ord :: Eq CreateGuildIntegrationOpts
Ord)
instance ToJSON CreateGuildIntegrationOpts where
toJSON :: CreateGuildIntegrationOpts -> Value
toJSON CreateGuildIntegrationOpts{Text
createGuildIntegrationOptsType :: Text
createGuildIntegrationOptsType :: CreateGuildIntegrationOpts -> Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[AesonKey
"type" AesonKey -> Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Text
createGuildIntegrationOptsType]
data CreateGuildBanOpts = CreateGuildBanOpts
{ CreateGuildBanOpts -> Maybe Int
createGuildBanOptsDeleteLastNMessages :: Maybe Int
, CreateGuildBanOpts -> Maybe Text
createGuildBanOptsReason :: Maybe T.Text
} deriving (Int -> CreateGuildBanOpts -> ShowS
[CreateGuildBanOpts] -> ShowS
CreateGuildBanOpts -> String
(Int -> CreateGuildBanOpts -> ShowS)
-> (CreateGuildBanOpts -> String)
-> ([CreateGuildBanOpts] -> ShowS)
-> Show CreateGuildBanOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGuildBanOpts] -> ShowS
$cshowList :: [CreateGuildBanOpts] -> ShowS
show :: CreateGuildBanOpts -> String
$cshow :: CreateGuildBanOpts -> String
showsPrec :: Int -> CreateGuildBanOpts -> ShowS
$cshowsPrec :: Int -> CreateGuildBanOpts -> ShowS
Show, ReadPrec [CreateGuildBanOpts]
ReadPrec CreateGuildBanOpts
Int -> ReadS CreateGuildBanOpts
ReadS [CreateGuildBanOpts]
(Int -> ReadS CreateGuildBanOpts)
-> ReadS [CreateGuildBanOpts]
-> ReadPrec CreateGuildBanOpts
-> ReadPrec [CreateGuildBanOpts]
-> Read CreateGuildBanOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGuildBanOpts]
$creadListPrec :: ReadPrec [CreateGuildBanOpts]
readPrec :: ReadPrec CreateGuildBanOpts
$creadPrec :: ReadPrec CreateGuildBanOpts
readList :: ReadS [CreateGuildBanOpts]
$creadList :: ReadS [CreateGuildBanOpts]
readsPrec :: Int -> ReadS CreateGuildBanOpts
$creadsPrec :: Int -> ReadS CreateGuildBanOpts
Read, CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
(CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> Eq CreateGuildBanOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c/= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
== :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c== :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
Eq, Eq CreateGuildBanOpts
Eq CreateGuildBanOpts
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Ordering)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts)
-> Ord CreateGuildBanOpts
CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
CreateGuildBanOpts -> CreateGuildBanOpts -> Ordering
CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
$cmin :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
max :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
$cmax :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
>= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c>= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
> :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c> :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
<= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c<= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
< :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c< :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
compare :: CreateGuildBanOpts -> CreateGuildBanOpts -> Ordering
$ccompare :: CreateGuildBanOpts -> CreateGuildBanOpts -> Ordering
$cp1Ord :: Eq CreateGuildBanOpts
Ord)
instance ToJSON CreateGuildBanOpts where
toJSON :: CreateGuildBanOpts -> Value
toJSON CreateGuildBanOpts{Maybe Int
Maybe Text
createGuildBanOptsReason :: Maybe Text
createGuildBanOptsDeleteLastNMessages :: Maybe Int
createGuildBanOptsReason :: CreateGuildBanOpts -> Maybe Text
createGuildBanOptsDeleteLastNMessages :: CreateGuildBanOpts -> Maybe Int
..} = [Maybe Pair] -> Value
objectFromMaybes
[ AesonKey
"delete_message_days"
AesonKey -> Maybe Int -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Int
createGuildBanOptsDeleteLastNMessages
, AesonKey
"reason" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
createGuildBanOptsReason]
data ModifyGuildRoleOpts = ModifyGuildRoleOpts
{ ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsName :: Maybe T.Text
, ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsPermissions :: Maybe T.Text
, ModifyGuildRoleOpts -> Maybe DiscordColor
modifyGuildRoleOptsColor :: Maybe DiscordColor
, :: Maybe Bool
, ModifyGuildRoleOpts -> Maybe Bool
modifyGuildRoleOptsMentionable :: Maybe Bool
} deriving (Int -> ModifyGuildRoleOpts -> ShowS
[ModifyGuildRoleOpts] -> ShowS
ModifyGuildRoleOpts -> String
(Int -> ModifyGuildRoleOpts -> ShowS)
-> (ModifyGuildRoleOpts -> String)
-> ([ModifyGuildRoleOpts] -> ShowS)
-> Show ModifyGuildRoleOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyGuildRoleOpts] -> ShowS
$cshowList :: [ModifyGuildRoleOpts] -> ShowS
show :: ModifyGuildRoleOpts -> String
$cshow :: ModifyGuildRoleOpts -> String
showsPrec :: Int -> ModifyGuildRoleOpts -> ShowS
$cshowsPrec :: Int -> ModifyGuildRoleOpts -> ShowS
Show, ReadPrec [ModifyGuildRoleOpts]
ReadPrec ModifyGuildRoleOpts
Int -> ReadS ModifyGuildRoleOpts
ReadS [ModifyGuildRoleOpts]
(Int -> ReadS ModifyGuildRoleOpts)
-> ReadS [ModifyGuildRoleOpts]
-> ReadPrec ModifyGuildRoleOpts
-> ReadPrec [ModifyGuildRoleOpts]
-> Read ModifyGuildRoleOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyGuildRoleOpts]
$creadListPrec :: ReadPrec [ModifyGuildRoleOpts]
readPrec :: ReadPrec ModifyGuildRoleOpts
$creadPrec :: ReadPrec ModifyGuildRoleOpts
readList :: ReadS [ModifyGuildRoleOpts]
$creadList :: ReadS [ModifyGuildRoleOpts]
readsPrec :: Int -> ReadS ModifyGuildRoleOpts
$creadsPrec :: Int -> ReadS ModifyGuildRoleOpts
Read, ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
(ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> Eq ModifyGuildRoleOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c/= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
== :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c== :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
Eq, Eq ModifyGuildRoleOpts
Eq ModifyGuildRoleOpts
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Ordering)
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> (ModifyGuildRoleOpts
-> ModifyGuildRoleOpts -> ModifyGuildRoleOpts)
-> (ModifyGuildRoleOpts
-> ModifyGuildRoleOpts -> ModifyGuildRoleOpts)
-> Ord ModifyGuildRoleOpts
ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Ordering
ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
$cmin :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
max :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
$cmax :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
>= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c>= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
> :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c> :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
<= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c<= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
< :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c< :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
compare :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Ordering
$ccompare :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Ordering
$cp1Ord :: Eq ModifyGuildRoleOpts
Ord)
instance ToJSON ModifyGuildRoleOpts where
toJSON :: ModifyGuildRoleOpts -> Value
toJSON ModifyGuildRoleOpts{Maybe Bool
Maybe Text
Maybe DiscordColor
modifyGuildRoleOptsMentionable :: Maybe Bool
modifyGuildRoleOptsSeparateSidebar :: Maybe Bool
modifyGuildRoleOptsColor :: Maybe DiscordColor
modifyGuildRoleOptsPermissions :: Maybe Text
modifyGuildRoleOptsName :: Maybe Text
modifyGuildRoleOptsMentionable :: ModifyGuildRoleOpts -> Maybe Bool
modifyGuildRoleOptsSeparateSidebar :: ModifyGuildRoleOpts -> Maybe Bool
modifyGuildRoleOptsColor :: ModifyGuildRoleOpts -> Maybe DiscordColor
modifyGuildRoleOptsPermissions :: ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsName :: ModifyGuildRoleOpts -> Maybe Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[AesonKey
"name" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildRoleOptsName,
AesonKey
"permissions" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildRoleOptsPermissions,
AesonKey
"color" AesonKey -> Maybe DiscordColor -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe DiscordColor
modifyGuildRoleOptsColor,
AesonKey
"hoist" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildRoleOptsSeparateSidebar,
AesonKey
"mentionable" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildRoleOptsMentionable]
data AddGuildMemberOpts = AddGuildMemberOpts
{ AddGuildMemberOpts -> Text
addGuildMemberOptsAccessToken :: T.Text
, AddGuildMemberOpts -> Maybe Text
addGuildMemberOptsNickname :: Maybe T.Text
, AddGuildMemberOpts -> Maybe [RoleId]
addGuildMemberOptsRoles :: Maybe [RoleId]
, AddGuildMemberOpts -> Maybe Bool
addGuildMemberOptsIsMuted :: Maybe Bool
, AddGuildMemberOpts -> Maybe Bool
addGuildMemberOptsIsDeafened :: Maybe Bool
} deriving (Int -> AddGuildMemberOpts -> ShowS
[AddGuildMemberOpts] -> ShowS
AddGuildMemberOpts -> String
(Int -> AddGuildMemberOpts -> ShowS)
-> (AddGuildMemberOpts -> String)
-> ([AddGuildMemberOpts] -> ShowS)
-> Show AddGuildMemberOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddGuildMemberOpts] -> ShowS
$cshowList :: [AddGuildMemberOpts] -> ShowS
show :: AddGuildMemberOpts -> String
$cshow :: AddGuildMemberOpts -> String
showsPrec :: Int -> AddGuildMemberOpts -> ShowS
$cshowsPrec :: Int -> AddGuildMemberOpts -> ShowS
Show, ReadPrec [AddGuildMemberOpts]
ReadPrec AddGuildMemberOpts
Int -> ReadS AddGuildMemberOpts
ReadS [AddGuildMemberOpts]
(Int -> ReadS AddGuildMemberOpts)
-> ReadS [AddGuildMemberOpts]
-> ReadPrec AddGuildMemberOpts
-> ReadPrec [AddGuildMemberOpts]
-> Read AddGuildMemberOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddGuildMemberOpts]
$creadListPrec :: ReadPrec [AddGuildMemberOpts]
readPrec :: ReadPrec AddGuildMemberOpts
$creadPrec :: ReadPrec AddGuildMemberOpts
readList :: ReadS [AddGuildMemberOpts]
$creadList :: ReadS [AddGuildMemberOpts]
readsPrec :: Int -> ReadS AddGuildMemberOpts
$creadsPrec :: Int -> ReadS AddGuildMemberOpts
Read, AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
(AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> Eq AddGuildMemberOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c/= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
== :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c== :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
Eq, Eq AddGuildMemberOpts
Eq AddGuildMemberOpts
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Ordering)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts)
-> Ord AddGuildMemberOpts
AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
AddGuildMemberOpts -> AddGuildMemberOpts -> Ordering
AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
$cmin :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
max :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
$cmax :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
>= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c>= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
> :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c> :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
<= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c<= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
< :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c< :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
compare :: AddGuildMemberOpts -> AddGuildMemberOpts -> Ordering
$ccompare :: AddGuildMemberOpts -> AddGuildMemberOpts -> Ordering
$cp1Ord :: Eq AddGuildMemberOpts
Ord)
instance ToJSON AddGuildMemberOpts where
toJSON :: AddGuildMemberOpts -> Value
toJSON AddGuildMemberOpts{Maybe Bool
Maybe [RoleId]
Maybe Text
Text
addGuildMemberOptsIsDeafened :: Maybe Bool
addGuildMemberOptsIsMuted :: Maybe Bool
addGuildMemberOptsRoles :: Maybe [RoleId]
addGuildMemberOptsNickname :: Maybe Text
addGuildMemberOptsAccessToken :: Text
addGuildMemberOptsIsDeafened :: AddGuildMemberOpts -> Maybe Bool
addGuildMemberOptsIsMuted :: AddGuildMemberOpts -> Maybe Bool
addGuildMemberOptsRoles :: AddGuildMemberOpts -> Maybe [RoleId]
addGuildMemberOptsNickname :: AddGuildMemberOpts -> Maybe Text
addGuildMemberOptsAccessToken :: AddGuildMemberOpts -> Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[AesonKey
"access_token" AesonKey -> Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Text
addGuildMemberOptsAccessToken,
AesonKey
"nick" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
addGuildMemberOptsNickname,
AesonKey
"roles" AesonKey -> Maybe [RoleId] -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe [RoleId]
addGuildMemberOptsRoles,
AesonKey
"mute" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
addGuildMemberOptsIsMuted,
AesonKey
"deaf" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
addGuildMemberOptsIsDeafened]
data ModifyGuildMemberOpts = ModifyGuildMemberOpts
{ ModifyGuildMemberOpts -> Maybe Text
modifyGuildMemberOptsNickname :: Maybe T.Text
, ModifyGuildMemberOpts -> Maybe [RoleId]
modifyGuildMemberOptsRoles :: Maybe [RoleId]
, ModifyGuildMemberOpts -> Maybe Bool
modifyGuildMemberOptsIsMuted :: Maybe Bool
, ModifyGuildMemberOpts -> Maybe Bool
modifyGuildMemberOptsIsDeafened :: Maybe Bool
, ModifyGuildMemberOpts -> Maybe ChannelId
modifyGuildMemberOptsMoveToChannel :: Maybe ChannelId
, ModifyGuildMemberOpts -> Maybe (Maybe UTCTime)
modifyGuildMemberOptsTimeoutUntil :: Maybe (Maybe UTCTime)
} deriving (Int -> ModifyGuildMemberOpts -> ShowS
[ModifyGuildMemberOpts] -> ShowS
ModifyGuildMemberOpts -> String
(Int -> ModifyGuildMemberOpts -> ShowS)
-> (ModifyGuildMemberOpts -> String)
-> ([ModifyGuildMemberOpts] -> ShowS)
-> Show ModifyGuildMemberOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyGuildMemberOpts] -> ShowS
$cshowList :: [ModifyGuildMemberOpts] -> ShowS
show :: ModifyGuildMemberOpts -> String
$cshow :: ModifyGuildMemberOpts -> String
showsPrec :: Int -> ModifyGuildMemberOpts -> ShowS
$cshowsPrec :: Int -> ModifyGuildMemberOpts -> ShowS
Show, ReadPrec [ModifyGuildMemberOpts]
ReadPrec ModifyGuildMemberOpts
Int -> ReadS ModifyGuildMemberOpts
ReadS [ModifyGuildMemberOpts]
(Int -> ReadS ModifyGuildMemberOpts)
-> ReadS [ModifyGuildMemberOpts]
-> ReadPrec ModifyGuildMemberOpts
-> ReadPrec [ModifyGuildMemberOpts]
-> Read ModifyGuildMemberOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyGuildMemberOpts]
$creadListPrec :: ReadPrec [ModifyGuildMemberOpts]
readPrec :: ReadPrec ModifyGuildMemberOpts
$creadPrec :: ReadPrec ModifyGuildMemberOpts
readList :: ReadS [ModifyGuildMemberOpts]
$creadList :: ReadS [ModifyGuildMemberOpts]
readsPrec :: Int -> ReadS ModifyGuildMemberOpts
$creadsPrec :: Int -> ReadS ModifyGuildMemberOpts
Read, ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
(ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> Eq ModifyGuildMemberOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c/= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
== :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c== :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
Eq, Eq ModifyGuildMemberOpts
Eq ModifyGuildMemberOpts
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Ordering)
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> (ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts)
-> (ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts)
-> Ord ModifyGuildMemberOpts
ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Ordering
ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
$cmin :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
max :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
$cmax :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
>= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c>= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
> :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c> :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
<= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c<= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
< :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c< :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
compare :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Ordering
$ccompare :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Ordering
$cp1Ord :: Eq ModifyGuildMemberOpts
Ord)
instance Default ModifyGuildMemberOpts where
def :: ModifyGuildMemberOpts
def = Maybe Text
-> Maybe [RoleId]
-> Maybe Bool
-> Maybe Bool
-> Maybe ChannelId
-> Maybe (Maybe UTCTime)
-> ModifyGuildMemberOpts
ModifyGuildMemberOpts Maybe Text
forall a. Maybe a
Nothing Maybe [RoleId]
forall a. Maybe a
Nothing Maybe Bool
forall a. Maybe a
Nothing Maybe Bool
forall a. Maybe a
Nothing Maybe ChannelId
forall a. Maybe a
Nothing Maybe (Maybe UTCTime)
forall a. Maybe a
Nothing
instance ToJSON ModifyGuildMemberOpts where
toJSON :: ModifyGuildMemberOpts -> Value
toJSON ModifyGuildMemberOpts{Maybe Bool
Maybe [RoleId]
Maybe (Maybe UTCTime)
Maybe Text
Maybe ChannelId
modifyGuildMemberOptsTimeoutUntil :: Maybe (Maybe UTCTime)
modifyGuildMemberOptsMoveToChannel :: Maybe ChannelId
modifyGuildMemberOptsIsDeafened :: Maybe Bool
modifyGuildMemberOptsIsMuted :: Maybe Bool
modifyGuildMemberOptsRoles :: Maybe [RoleId]
modifyGuildMemberOptsNickname :: Maybe Text
modifyGuildMemberOptsTimeoutUntil :: ModifyGuildMemberOpts -> Maybe (Maybe UTCTime)
modifyGuildMemberOptsMoveToChannel :: ModifyGuildMemberOpts -> Maybe ChannelId
modifyGuildMemberOptsIsDeafened :: ModifyGuildMemberOpts -> Maybe Bool
modifyGuildMemberOptsIsMuted :: ModifyGuildMemberOpts -> Maybe Bool
modifyGuildMemberOptsRoles :: ModifyGuildMemberOpts -> Maybe [RoleId]
modifyGuildMemberOptsNickname :: ModifyGuildMemberOpts -> Maybe Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[AesonKey
"nick" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildMemberOptsNickname,
AesonKey
"roles" AesonKey -> Maybe [RoleId] -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe [RoleId]
modifyGuildMemberOptsRoles,
AesonKey
"mute" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildMemberOptsIsMuted,
AesonKey
"deaf" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildMemberOptsIsDeafened,
AesonKey
"channel_id" AesonKey -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
modifyGuildMemberOptsMoveToChannel,
AesonKey
"communication_disabled_until" AesonKey -> Maybe (Maybe UTCTime) -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe (Maybe UTCTime)
modifyGuildMemberOptsTimeoutUntil]
data CreateGuildChannelOpts
= CreateGuildChannelOptsText {
CreateGuildChannelOpts -> Maybe Text
createGuildChannelOptsTopic :: Maybe T.Text
, CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsUserMessageRateDelay :: Maybe Integer
, CreateGuildChannelOpts -> Maybe Bool
createGuildChannelOptsIsNSFW :: Maybe Bool
, CreateGuildChannelOpts -> Maybe ChannelId
createGuildChannelOptsCategoryId :: Maybe ChannelId }
| CreateGuildChannelOptsVoice {
CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsBitrate :: Maybe Integer
, CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsMaxUsers :: Maybe Integer
, createGuildChannelOptsCategoryId :: Maybe ChannelId }
| CreateGuildChannelOptsCategory
deriving (Int -> CreateGuildChannelOpts -> ShowS
[CreateGuildChannelOpts] -> ShowS
CreateGuildChannelOpts -> String
(Int -> CreateGuildChannelOpts -> ShowS)
-> (CreateGuildChannelOpts -> String)
-> ([CreateGuildChannelOpts] -> ShowS)
-> Show CreateGuildChannelOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGuildChannelOpts] -> ShowS
$cshowList :: [CreateGuildChannelOpts] -> ShowS
show :: CreateGuildChannelOpts -> String
$cshow :: CreateGuildChannelOpts -> String
showsPrec :: Int -> CreateGuildChannelOpts -> ShowS
$cshowsPrec :: Int -> CreateGuildChannelOpts -> ShowS
Show, ReadPrec [CreateGuildChannelOpts]
ReadPrec CreateGuildChannelOpts
Int -> ReadS CreateGuildChannelOpts
ReadS [CreateGuildChannelOpts]
(Int -> ReadS CreateGuildChannelOpts)
-> ReadS [CreateGuildChannelOpts]
-> ReadPrec CreateGuildChannelOpts
-> ReadPrec [CreateGuildChannelOpts]
-> Read CreateGuildChannelOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGuildChannelOpts]
$creadListPrec :: ReadPrec [CreateGuildChannelOpts]
readPrec :: ReadPrec CreateGuildChannelOpts
$creadPrec :: ReadPrec CreateGuildChannelOpts
readList :: ReadS [CreateGuildChannelOpts]
$creadList :: ReadS [CreateGuildChannelOpts]
readsPrec :: Int -> ReadS CreateGuildChannelOpts
$creadsPrec :: Int -> ReadS CreateGuildChannelOpts
Read, CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
(CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> Eq CreateGuildChannelOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c/= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
== :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c== :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
Eq, Eq CreateGuildChannelOpts
Eq CreateGuildChannelOpts
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Ordering)
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> (CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts)
-> (CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts)
-> Ord CreateGuildChannelOpts
CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
CreateGuildChannelOpts -> CreateGuildChannelOpts -> Ordering
CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
$cmin :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
max :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
$cmax :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
>= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c>= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
> :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c> :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
<= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c<= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
< :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c< :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
compare :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Ordering
$ccompare :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Ordering
$cp1Ord :: Eq CreateGuildChannelOpts
Ord)
createChannelOptsToJSON :: T.Text -> [Overwrite] -> CreateGuildChannelOpts -> Value
createChannelOptsToJSON :: Text -> [Overwrite] -> CreateGuildChannelOpts -> Value
createChannelOptsToJSON Text
name [Overwrite]
perms CreateGuildChannelOpts
opts = [Maybe Pair] -> Value
objectFromMaybes [Maybe Pair]
optsJSON
where
optsJSON :: [Maybe Pair]
optsJSON = case CreateGuildChannelOpts
opts of
CreateGuildChannelOptsText{Maybe Bool
Maybe Integer
Maybe Text
Maybe ChannelId
createGuildChannelOptsCategoryId :: Maybe ChannelId
createGuildChannelOptsIsNSFW :: Maybe Bool
createGuildChannelOptsUserMessageRateDelay :: Maybe Integer
createGuildChannelOptsTopic :: Maybe Text
createGuildChannelOptsCategoryId :: CreateGuildChannelOpts -> Maybe ChannelId
createGuildChannelOptsIsNSFW :: CreateGuildChannelOpts -> Maybe Bool
createGuildChannelOptsUserMessageRateDelay :: CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsTopic :: CreateGuildChannelOpts -> Maybe Text
..} ->
[AesonKey
"name" AesonKey -> Value -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Text -> Value
String Text
name
,AesonKey
"type" AesonKey -> Value -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Scientific -> Value
Number Scientific
0
,AesonKey
"permission_overwrites" AesonKey -> [Overwrite] -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== [Overwrite]
perms
,AesonKey
"topic" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
createGuildChannelOptsTopic
,AesonKey
"rate_limit_per_user" AesonKey -> Maybe Integer -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Integer
createGuildChannelOptsUserMessageRateDelay
,AesonKey
"nsfw" AesonKey -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Bool
createGuildChannelOptsIsNSFW
,AesonKey
"parent_id" AesonKey -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
createGuildChannelOptsCategoryId]
CreateGuildChannelOptsVoice{Maybe Integer
Maybe ChannelId
createGuildChannelOptsCategoryId :: Maybe ChannelId
createGuildChannelOptsMaxUsers :: Maybe Integer
createGuildChannelOptsBitrate :: Maybe Integer
createGuildChannelOptsMaxUsers :: CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsBitrate :: CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsCategoryId :: CreateGuildChannelOpts -> Maybe ChannelId
..} ->
[AesonKey
"name" AesonKey -> Value -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Text -> Value
String Text
name
,AesonKey
"type" AesonKey -> Value -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Scientific -> Value
Number Scientific
2
,AesonKey
"permission_overwrites" AesonKey -> [Overwrite] -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== [Overwrite]
perms
,AesonKey
"bitrate" AesonKey -> Maybe Integer -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Integer
createGuildChannelOptsBitrate
,AesonKey
"user_limit" AesonKey -> Maybe Integer -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Integer
createGuildChannelOptsMaxUsers
,AesonKey
"parent_id" AesonKey -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
createGuildChannelOptsCategoryId]
CreateGuildChannelOpts
CreateGuildChannelOptsCategory ->
[AesonKey
"name" AesonKey -> Value -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Text -> Value
String Text
name
,AesonKey
"type" AesonKey -> Value -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== Scientific -> Value
Number Scientific
4
,AesonKey
"permission_overwrites" AesonKey -> [Overwrite] -> Maybe Pair
forall a. ToJSON a => AesonKey -> a -> Maybe Pair
.== [Overwrite]
perms]
data ModifyGuildOpts = ModifyGuildOpts
{ ModifyGuildOpts -> Maybe Text
modifyGuildOptsName :: Maybe T.Text
, ModifyGuildOpts -> Maybe ChannelId
modifyGuildOptsAFKChannelId :: Maybe ChannelId
, ModifyGuildOpts -> Maybe Text
modifyGuildOptsIcon :: Maybe T.Text
, ModifyGuildOpts -> Maybe UserId
modifyGuildOptsOwnerId :: Maybe UserId
} deriving (Int -> ModifyGuildOpts -> ShowS
[ModifyGuildOpts] -> ShowS
ModifyGuildOpts -> String
(Int -> ModifyGuildOpts -> ShowS)
-> (ModifyGuildOpts -> String)
-> ([ModifyGuildOpts] -> ShowS)
-> Show ModifyGuildOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyGuildOpts] -> ShowS
$cshowList :: [ModifyGuildOpts] -> ShowS
show :: ModifyGuildOpts -> String
$cshow :: ModifyGuildOpts -> String
showsPrec :: Int -> ModifyGuildOpts -> ShowS
$cshowsPrec :: Int -> ModifyGuildOpts -> ShowS
Show, ReadPrec [ModifyGuildOpts]
ReadPrec ModifyGuildOpts
Int -> ReadS ModifyGuildOpts
ReadS [ModifyGuildOpts]
(Int -> ReadS ModifyGuildOpts)
-> ReadS [ModifyGuildOpts]
-> ReadPrec ModifyGuildOpts
-> ReadPrec [ModifyGuildOpts]
-> Read ModifyGuildOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyGuildOpts]
$creadListPrec :: ReadPrec [ModifyGuildOpts]
readPrec :: ReadPrec ModifyGuildOpts
$creadPrec :: ReadPrec ModifyGuildOpts
readList :: ReadS [ModifyGuildOpts]
$creadList :: ReadS [ModifyGuildOpts]
readsPrec :: Int -> ReadS ModifyGuildOpts
$creadsPrec :: Int -> ReadS ModifyGuildOpts
Read, ModifyGuildOpts -> ModifyGuildOpts -> Bool
(ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> (ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> Eq ModifyGuildOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c/= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
== :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c== :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
Eq, Eq ModifyGuildOpts
Eq ModifyGuildOpts
-> (ModifyGuildOpts -> ModifyGuildOpts -> Ordering)
-> (ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> (ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> (ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> (ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> (ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts)
-> (ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts)
-> Ord ModifyGuildOpts
ModifyGuildOpts -> ModifyGuildOpts -> Bool
ModifyGuildOpts -> ModifyGuildOpts -> Ordering
ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
$cmin :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
max :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
$cmax :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
>= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c>= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
> :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c> :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
<= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c<= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
< :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c< :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
compare :: ModifyGuildOpts -> ModifyGuildOpts -> Ordering
$ccompare :: ModifyGuildOpts -> ModifyGuildOpts -> Ordering
$cp1Ord :: Eq ModifyGuildOpts
Ord)
instance ToJSON ModifyGuildOpts where
toJSON :: ModifyGuildOpts -> Value
toJSON ModifyGuildOpts{Maybe Text
Maybe UserId
Maybe ChannelId
modifyGuildOptsOwnerId :: Maybe UserId
modifyGuildOptsIcon :: Maybe Text
modifyGuildOptsAFKChannelId :: Maybe ChannelId
modifyGuildOptsName :: Maybe Text
modifyGuildOptsOwnerId :: ModifyGuildOpts -> Maybe UserId
modifyGuildOptsIcon :: ModifyGuildOpts -> Maybe Text
modifyGuildOptsAFKChannelId :: ModifyGuildOpts -> Maybe ChannelId
modifyGuildOptsName :: ModifyGuildOpts -> Maybe Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[AesonKey
"name" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildOptsName,
AesonKey
"afk_channel_id" AesonKey -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
modifyGuildOptsAFKChannelId,
AesonKey
"icon" AesonKey -> Maybe Text -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildOptsIcon,
AesonKey
"owner_id" AesonKey -> Maybe UserId -> Maybe Pair
forall a. ToJSON a => AesonKey -> Maybe a -> Maybe Pair
.=? Maybe UserId
modifyGuildOptsOwnerId]
data GuildMembersTiming = GuildMembersTiming
{ GuildMembersTiming -> Maybe Int
guildMembersTimingLimit :: Maybe Int
, GuildMembersTiming -> Maybe UserId
guildMembersTimingAfter :: Maybe UserId
} deriving (Int -> GuildMembersTiming -> ShowS
[GuildMembersTiming] -> ShowS
GuildMembersTiming -> String
(Int -> GuildMembersTiming -> ShowS)
-> (GuildMembersTiming -> String)
-> ([GuildMembersTiming] -> ShowS)
-> Show GuildMembersTiming
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GuildMembersTiming] -> ShowS
$cshowList :: [GuildMembersTiming] -> ShowS
show :: GuildMembersTiming -> String
$cshow :: GuildMembersTiming -> String
showsPrec :: Int -> GuildMembersTiming -> ShowS
$cshowsPrec :: Int -> GuildMembersTiming -> ShowS
Show, ReadPrec [GuildMembersTiming]
ReadPrec GuildMembersTiming
Int -> ReadS GuildMembersTiming
ReadS [GuildMembersTiming]
(Int -> ReadS GuildMembersTiming)
-> ReadS [GuildMembersTiming]
-> ReadPrec GuildMembersTiming
-> ReadPrec [GuildMembersTiming]
-> Read GuildMembersTiming
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GuildMembersTiming]
$creadListPrec :: ReadPrec [GuildMembersTiming]
readPrec :: ReadPrec GuildMembersTiming
$creadPrec :: ReadPrec GuildMembersTiming
readList :: ReadS [GuildMembersTiming]
$creadList :: ReadS [GuildMembersTiming]
readsPrec :: Int -> ReadS GuildMembersTiming
$creadsPrec :: Int -> ReadS GuildMembersTiming
Read, GuildMembersTiming -> GuildMembersTiming -> Bool
(GuildMembersTiming -> GuildMembersTiming -> Bool)
-> (GuildMembersTiming -> GuildMembersTiming -> Bool)
-> Eq GuildMembersTiming
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c/= :: GuildMembersTiming -> GuildMembersTiming -> Bool
== :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c== :: GuildMembersTiming -> GuildMembersTiming -> Bool
Eq, Eq GuildMembersTiming
Eq GuildMembersTiming
-> (GuildMembersTiming -> GuildMembersTiming -> Ordering)
-> (GuildMembersTiming -> GuildMembersTiming -> Bool)
-> (GuildMembersTiming -> GuildMembersTiming -> Bool)
-> (GuildMembersTiming -> GuildMembersTiming -> Bool)
-> (GuildMembersTiming -> GuildMembersTiming -> Bool)
-> (GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming)
-> (GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming)
-> Ord GuildMembersTiming
GuildMembersTiming -> GuildMembersTiming -> Bool
GuildMembersTiming -> GuildMembersTiming -> Ordering
GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
$cmin :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
max :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
$cmax :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
>= :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c>= :: GuildMembersTiming -> GuildMembersTiming -> Bool
> :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c> :: GuildMembersTiming -> GuildMembersTiming -> Bool
<= :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c<= :: GuildMembersTiming -> GuildMembersTiming -> Bool
< :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c< :: GuildMembersTiming -> GuildMembersTiming -> Bool
compare :: GuildMembersTiming -> GuildMembersTiming -> Ordering
$ccompare :: GuildMembersTiming -> GuildMembersTiming -> Ordering
$cp1Ord :: Eq GuildMembersTiming
Ord)
guildMembersTimingToQuery :: GuildMembersTiming -> R.Option 'R.Https
guildMembersTimingToQuery :: GuildMembersTiming -> Option 'Https
guildMembersTimingToQuery (GuildMembersTiming Maybe Int
mLimit Maybe UserId
mAfter) =
let limit :: Option 'Https
limit = case Maybe Int
mLimit of
Maybe Int
Nothing -> Option 'Https
forall a. Monoid a => a
mempty
Just Int
lim -> Text
"limit" Text -> Int -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Int
lim
after :: Option 'Https
after = case Maybe UserId
mAfter of
Maybe UserId
Nothing -> Option 'Https
forall a. Monoid a => a
mempty
Just UserId
aft -> Text
"after" Text -> String -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: UserId -> String
forall a. Show a => a -> String
show UserId
aft
in Option 'Https
limit Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Option 'Https
after
guildMajorRoute :: GuildRequest a -> String
guildMajorRoute :: GuildRequest a -> String
guildMajorRoute GuildRequest a
c = case GuildRequest a
c of
(GetGuild GuildId
g) -> String
"guild " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuild GuildId
g ModifyGuildOpts
_) -> String
"guild " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(DeleteGuild GuildId
g) -> String
"guild " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildChannels GuildId
g) -> String
"guild_chan " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(CreateGuildChannel GuildId
g Text
_ [Overwrite]
_ CreateGuildChannelOpts
_) -> String
"guild_chan " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuildChannelPositions GuildId
g [(ChannelId, Int)]
_) -> String
"guild_chan " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildMember GuildId
g UserId
_) -> String
"guild_memb " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ListGuildMembers GuildId
g GuildMembersTiming
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(AddGuildMember GuildId
g UserId
_ AddGuildMemberOpts
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuildMember GuildId
g UserId
_ ModifyGuildMemberOpts
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyCurrentUserNick GuildId
g Text
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(AddGuildMemberRole GuildId
g UserId
_ RoleId
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(RemoveGuildMemberRole GuildId
g UserId
_ RoleId
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(RemoveGuildMember GuildId
g UserId
_) -> String
"guild_membs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildBan GuildId
g UserId
_) -> String
"guild_bans " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildBans GuildId
g) -> String
"guild_bans " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(CreateGuildBan GuildId
g UserId
_ CreateGuildBanOpts
_) -> String
"guild_ban " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(RemoveGuildBan GuildId
g UserId
_) -> String
"guild_ban " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildRoles GuildId
g) -> String
"guild_roles " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(CreateGuildRole GuildId
g ModifyGuildRoleOpts
_) -> String
"guild_roles " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuildRolePositions GuildId
g [(RoleId, Integer)]
_) -> String
"guild_roles " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuildRole GuildId
g RoleId
_ ModifyGuildRoleOpts
_) -> String
"guild_role " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(DeleteGuildRole GuildId
g RoleId
_) -> String
"guild_role " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildPruneCount GuildId
g Integer
_) -> String
"guild_prune " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(BeginGuildPrune GuildId
g Integer
_) -> String
"guild_prune " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildVoiceRegions GuildId
g) -> String
"guild_voice " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildInvites GuildId
g) -> String
"guild_invit " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildIntegrations GuildId
g) -> String
"guild_integ " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(CreateGuildIntegration GuildId
g IntegrationId
_ CreateGuildIntegrationOpts
_) -> String
"guild_integ " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuildIntegration GuildId
g IntegrationId
_ ModifyGuildIntegrationOpts
_) -> String
"guild_intgr " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(DeleteGuildIntegration GuildId
g IntegrationId
_) -> String
"guild_intgr " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(SyncGuildIntegration GuildId
g IntegrationId
_) -> String
"guild_sync " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildWidget GuildId
g) -> String
"guild_widget " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(ModifyGuildWidget GuildId
g GuildWidget
_) -> String
"guild_widget " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
(GetGuildVanityURL GuildId
g) -> String
"guild " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> GuildId -> String
forall a. Show a => a -> String
show GuildId
g
guilds :: R.Url 'R.Https
guilds :: Url 'Https
guilds = Url 'Https
baseUrl Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds"
guildJsonRequest :: GuildRequest r -> JsonRequest
guildJsonRequest :: GuildRequest r -> JsonRequest
guildJsonRequest GuildRequest r
c = case GuildRequest r
c of
(GetGuild GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild) Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuild GuildId
guild ModifyGuildOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson ModifyGuildOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild) (ReqBodyJson ModifyGuildOpts -> RestIO (ReqBodyJson ModifyGuildOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModifyGuildOpts -> ReqBodyJson ModifyGuildOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ModifyGuildOpts
patch)) Option 'Https
forall a. Monoid a => a
mempty
(DeleteGuild GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildChannels GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"channels") Option 'Https
forall a. Monoid a => a
mempty
(CreateGuildChannel GuildId
guild Text
name [Overwrite]
perms CreateGuildChannelOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"channels")
(ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Text -> [Overwrite] -> CreateGuildChannelOpts -> Value
createChannelOptsToJSON Text
name [Overwrite]
perms CreateGuildChannelOpts
patch))) Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuildChannelPositions GuildId
guild [(ChannelId, Int)]
newlocs) ->
let patch :: [Value]
patch = ((ChannelId, Int) -> Value) -> [(ChannelId, Int)] -> [Value]
forall a b. (a -> b) -> [a] -> [b]
map (\(ChannelId
a, Int
b) -> [Pair] -> Value
object [(AesonKey
"id", ChannelId -> Value
forall a. ToJSON a => a -> Value
toJSON ChannelId
a)
,(AesonKey
"position", Int -> Value
forall a. ToJSON a => a -> Value
toJSON Int
b)]) [(ChannelId, Int)]
newlocs
in Url 'Https
-> RestIO (ReqBodyJson [Value]) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"channels") (ReqBodyJson [Value] -> RestIO (ReqBodyJson [Value])
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([Value] -> ReqBodyJson [Value]
forall a. a -> ReqBodyJson a
R.ReqBodyJson [Value]
patch)) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildMember GuildId
guild UserId
member) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
member) Option 'Https
forall a. Monoid a => a
mempty
(ListGuildMembers GuildId
guild GuildMembersTiming
range) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members") (GuildMembersTiming -> Option 'Https
guildMembersTimingToQuery GuildMembersTiming
range)
(AddGuildMember GuildId
guild UserId
user AddGuildMemberOpts
patch) ->
Url 'Https
-> ReqBodyJson AddGuildMemberOpts -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
user) (AddGuildMemberOpts -> ReqBodyJson AddGuildMemberOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson AddGuildMemberOpts
patch) Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuildMember GuildId
guild UserId
member ModifyGuildMemberOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson ModifyGuildMemberOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
member) (ReqBodyJson ModifyGuildMemberOpts
-> RestIO (ReqBodyJson ModifyGuildMemberOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModifyGuildMemberOpts -> ReqBodyJson ModifyGuildMemberOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ModifyGuildMemberOpts
patch)) Option 'Https
forall a. Monoid a => a
mempty
(ModifyCurrentUserNick GuildId
guild Text
name) ->
let patch :: Value
patch = [Pair] -> Value
object [AesonKey
"nick" AesonKey -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => AesonKey -> v -> kv
.= Text
name]
in Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members/@me/nick") (ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson Value
patch)) Option 'Https
forall a. Monoid a => a
mempty
(AddGuildMemberRole GuildId
guild UserId
user RoleId
role) ->
let body :: ReqBodyJson Value
body = Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson ([Pair] -> Value
object [])
in Url 'Https -> ReqBodyJson Value -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
user Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles" Url 'Https -> RoleId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ RoleId
role) ReqBodyJson Value
body Option 'Https
forall a. Monoid a => a
mempty
(RemoveGuildMemberRole GuildId
guild UserId
user RoleId
role) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
user Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles" Url 'Https -> RoleId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ RoleId
role) Option 'Https
forall a. Monoid a => a
mempty
(RemoveGuildMember GuildId
guild UserId
user) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"members" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
user) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildBan GuildId
guild UserId
user) -> Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"bans" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
user) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildBans GuildId
guild) -> Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"bans") Option 'Https
forall a. Monoid a => a
mempty
(CreateGuildBan GuildId
guild UserId
user CreateGuildBanOpts
patch) ->
Url 'Https
-> ReqBodyJson CreateGuildBanOpts -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"bans" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
user) (CreateGuildBanOpts -> ReqBodyJson CreateGuildBanOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson CreateGuildBanOpts
patch) Option 'Https
forall a. Monoid a => a
mempty
(RemoveGuildBan GuildId
guild UserId
ban) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"bans" Url 'Https -> UserId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ UserId
ban) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildRoles GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles") Option 'Https
forall a. Monoid a => a
mempty
(CreateGuildRole GuildId
guild ModifyGuildRoleOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson ModifyGuildRoleOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles") (ReqBodyJson ModifyGuildRoleOpts
-> RestIO (ReqBodyJson ModifyGuildRoleOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModifyGuildRoleOpts -> ReqBodyJson ModifyGuildRoleOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ModifyGuildRoleOpts
patch)) Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuildRolePositions GuildId
guild [(RoleId, Integer)]
patch) ->
let body :: [Value]
body = ((RoleId, Integer) -> Value) -> [(RoleId, Integer)] -> [Value]
forall a b. (a -> b) -> [a] -> [b]
map (\(RoleId
role, Integer
pos) -> [Pair] -> Value
object [AesonKey
"id"AesonKey -> RoleId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => AesonKey -> v -> kv
.=RoleId
role, AesonKey
"position"AesonKey -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => AesonKey -> v -> kv
.=Integer
pos]) [(RoleId, Integer)]
patch
in Url 'Https
-> RestIO (ReqBodyJson [Value]) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles") (ReqBodyJson [Value] -> RestIO (ReqBodyJson [Value])
forall (f :: * -> *) a. Applicative f => a -> f a
pure ([Value] -> ReqBodyJson [Value]
forall a. a -> ReqBodyJson a
R.ReqBodyJson [Value]
body)) Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuildRole GuildId
guild RoleId
role ModifyGuildRoleOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson ModifyGuildRoleOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles" Url 'Https -> RoleId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ RoleId
role) (ReqBodyJson ModifyGuildRoleOpts
-> RestIO (ReqBodyJson ModifyGuildRoleOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModifyGuildRoleOpts -> ReqBodyJson ModifyGuildRoleOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ModifyGuildRoleOpts
patch)) Option 'Https
forall a. Monoid a => a
mempty
(DeleteGuildRole GuildId
guild RoleId
role) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"roles" Url 'Https -> RoleId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ RoleId
role) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildPruneCount GuildId
guild Integer
days) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"prune") (Text
"days" Text -> Integer -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Integer
days)
(BeginGuildPrune GuildId
guild Integer
days) ->
Url 'Https -> RestIO NoReqBody -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"prune") (NoReqBody -> RestIO NoReqBody
forall (f :: * -> *) a. Applicative f => a -> f a
pure NoReqBody
R.NoReqBody) (Text
"days" Text -> Integer -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Integer
days)
(GetGuildVoiceRegions GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"regions") Option 'Https
forall a. Monoid a => a
mempty
(GetGuildInvites GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"invites") Option 'Https
forall a. Monoid a => a
mempty
(GetGuildIntegrations GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"integrations") Option 'Https
forall a. Monoid a => a
mempty
(CreateGuildIntegration GuildId
guild IntegrationId
iid CreateGuildIntegrationOpts
opts) ->
let patch :: Value
patch = [Pair] -> Value
object [AesonKey
"type" AesonKey -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => AesonKey -> v -> kv
.= CreateGuildIntegrationOpts -> Text
createGuildIntegrationOptsType CreateGuildIntegrationOpts
opts, AesonKey
"id" AesonKey -> IntegrationId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => AesonKey -> v -> kv
.= IntegrationId
iid]
in Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"integrations") (ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson Value
patch)) Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuildIntegration GuildId
guild IntegrationId
iid ModifyGuildIntegrationOpts
patch) ->
let body :: RestIO (ReqBodyJson ModifyGuildIntegrationOpts)
body = ReqBodyJson ModifyGuildIntegrationOpts
-> RestIO (ReqBodyJson ModifyGuildIntegrationOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModifyGuildIntegrationOpts
-> ReqBodyJson ModifyGuildIntegrationOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ModifyGuildIntegrationOpts
patch)
in Url 'Https
-> RestIO (ReqBodyJson ModifyGuildIntegrationOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"integrations" Url 'Https -> IntegrationId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ IntegrationId
iid) RestIO (ReqBodyJson ModifyGuildIntegrationOpts)
body Option 'Https
forall a. Monoid a => a
mempty
(DeleteGuildIntegration GuildId
guild IntegrationId
integ) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"integrations" Url 'Https -> IntegrationId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ IntegrationId
integ) Option 'Https
forall a. Monoid a => a
mempty
(SyncGuildIntegration GuildId
guild IntegrationId
integ) ->
Url 'Https -> RestIO NoReqBody -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"integrations" Url 'Https -> IntegrationId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ IntegrationId
integ) (NoReqBody -> RestIO NoReqBody
forall (f :: * -> *) a. Applicative f => a -> f a
pure NoReqBody
R.NoReqBody) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildWidget GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"integrations") Option 'Https
forall a. Monoid a => a
mempty
(ModifyGuildWidget GuildId
guild GuildWidget
patch) ->
Url 'Https
-> RestIO (ReqBodyJson GuildWidget) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"widget") (ReqBodyJson GuildWidget -> RestIO (ReqBodyJson GuildWidget)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GuildWidget -> ReqBodyJson GuildWidget
forall a. a -> ReqBodyJson a
R.ReqBodyJson GuildWidget
patch)) Option 'Https
forall a. Monoid a => a
mempty
(GetGuildVanityURL GuildId
guild) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
guilds Url 'Https -> GuildId -> Url 'Https
forall a (scheme :: Scheme).
ToHttpApiData a =>
Url scheme -> a -> Url scheme
/~ GuildId
guild Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"vanity-url") Option 'Https
forall a. Monoid a => a
mempty