{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module Discord.Internal.Rest.Guild
( GuildRequest(..)
, CreateGuildChannelOpts(..)
, ModifyGuildOpts(..)
, AddGuildMemberOpts(..)
, ModifyGuildMemberOpts(..)
, GuildMembersTiming(..)
, CreateGuildBanOpts(..)
, ModifyGuildRoleOpts(..)
, CreateGuildIntegrationOpts(..)
, ModifyGuildIntegrationOpts(..)
, ListActiveThreads (..)
) 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(..))
import Discord.Internal.Types.AuditLog ( AuditLogEvent(MkAuditLogEvent) )
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]
ListActiveGuildThreads :: GuildId -> GuildRequest ListActiveThreads
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
GetGuildAuditLog :: GuildId -> GetAuditLogOpts -> GuildRequest AuditLog
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
$cshowsPrec :: Int -> ModifyGuildIntegrationOpts -> ShowS
showsPrec :: Int -> ModifyGuildIntegrationOpts -> ShowS
$cshow :: ModifyGuildIntegrationOpts -> String
show :: ModifyGuildIntegrationOpts -> String
$cshowList :: [ModifyGuildIntegrationOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS ModifyGuildIntegrationOpts
readsPrec :: Int -> ReadS ModifyGuildIntegrationOpts
$creadList :: ReadS [ModifyGuildIntegrationOpts]
readList :: ReadS [ModifyGuildIntegrationOpts]
$creadPrec :: ReadPrec ModifyGuildIntegrationOpts
readPrec :: ReadPrec ModifyGuildIntegrationOpts
$creadListPrec :: ReadPrec [ModifyGuildIntegrationOpts]
readListPrec :: ReadPrec [ModifyGuildIntegrationOpts]
Read, ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
(ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool)
-> (ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Bool)
-> Eq ModifyGuildIntegrationOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
== :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$c/= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
/= :: 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
$ccompare :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Ordering
compare :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> Ordering
$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
>= :: ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts -> Bool
$cmax :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
max :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
$cmin :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
min :: ModifyGuildIntegrationOpts
-> ModifyGuildIntegrationOpts -> ModifyGuildIntegrationOpts
Ord)
instance ToJSON ModifyGuildIntegrationOpts where
toJSON :: ModifyGuildIntegrationOpts -> Value
toJSON ModifyGuildIntegrationOpts{Bool
Integer
modifyGuildIntegrationOptsExpireBehavior :: ModifyGuildIntegrationOpts -> Integer
modifyGuildIntegrationOptsExpireGraceSeconds :: ModifyGuildIntegrationOpts -> Integer
modifyGuildIntegrationOptsEmoticonsEnabled :: ModifyGuildIntegrationOpts -> Bool
modifyGuildIntegrationOptsExpireBehavior :: Integer
modifyGuildIntegrationOptsExpireGraceSeconds :: Integer
modifyGuildIntegrationOptsEmoticonsEnabled :: Bool
..} = [Maybe Pair] -> Value
objectFromMaybes
[ Key
"expire_grace_period" Key -> Integer -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Integer
modifyGuildIntegrationOptsExpireGraceSeconds
, Key
"expire_behavior" Key -> Integer -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Integer
modifyGuildIntegrationOptsExpireBehavior
, Key
"enable_emoticons" Key -> Bool -> Maybe Pair
forall a. ToJSON a => Key -> 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
$cshowsPrec :: Int -> CreateGuildIntegrationOpts -> ShowS
showsPrec :: Int -> CreateGuildIntegrationOpts -> ShowS
$cshow :: CreateGuildIntegrationOpts -> String
show :: CreateGuildIntegrationOpts -> String
$cshowList :: [CreateGuildIntegrationOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS CreateGuildIntegrationOpts
readsPrec :: Int -> ReadS CreateGuildIntegrationOpts
$creadList :: ReadS [CreateGuildIntegrationOpts]
readList :: ReadS [CreateGuildIntegrationOpts]
$creadPrec :: ReadPrec CreateGuildIntegrationOpts
readPrec :: ReadPrec CreateGuildIntegrationOpts
$creadListPrec :: ReadPrec [CreateGuildIntegrationOpts]
readListPrec :: ReadPrec [CreateGuildIntegrationOpts]
Read, CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
(CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool)
-> (CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Bool)
-> Eq CreateGuildIntegrationOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
== :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$c/= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
/= :: 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
$ccompare :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Ordering
compare :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> Ordering
$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
>= :: CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts -> Bool
$cmax :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
max :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
$cmin :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
min :: CreateGuildIntegrationOpts
-> CreateGuildIntegrationOpts -> CreateGuildIntegrationOpts
Ord)
instance ToJSON CreateGuildIntegrationOpts where
toJSON :: CreateGuildIntegrationOpts -> Value
toJSON CreateGuildIntegrationOpts{Text
createGuildIntegrationOptsType :: CreateGuildIntegrationOpts -> Text
createGuildIntegrationOptsType :: Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[Key
"type" Key -> Text -> Maybe Pair
forall a. ToJSON a => Key -> 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
$cshowsPrec :: Int -> CreateGuildBanOpts -> ShowS
showsPrec :: Int -> CreateGuildBanOpts -> ShowS
$cshow :: CreateGuildBanOpts -> String
show :: CreateGuildBanOpts -> String
$cshowList :: [CreateGuildBanOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS CreateGuildBanOpts
readsPrec :: Int -> ReadS CreateGuildBanOpts
$creadList :: ReadS [CreateGuildBanOpts]
readList :: ReadS [CreateGuildBanOpts]
$creadPrec :: ReadPrec CreateGuildBanOpts
readPrec :: ReadPrec CreateGuildBanOpts
$creadListPrec :: ReadPrec [CreateGuildBanOpts]
readListPrec :: ReadPrec [CreateGuildBanOpts]
Read, CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
(CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> (CreateGuildBanOpts -> CreateGuildBanOpts -> Bool)
-> Eq CreateGuildBanOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
== :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$c/= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
/= :: 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
$ccompare :: CreateGuildBanOpts -> CreateGuildBanOpts -> Ordering
compare :: CreateGuildBanOpts -> CreateGuildBanOpts -> Ordering
$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
>= :: CreateGuildBanOpts -> CreateGuildBanOpts -> Bool
$cmax :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
max :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
$cmin :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
min :: CreateGuildBanOpts -> CreateGuildBanOpts -> CreateGuildBanOpts
Ord)
instance ToJSON CreateGuildBanOpts where
toJSON :: CreateGuildBanOpts -> Value
toJSON CreateGuildBanOpts{Maybe Int
Maybe Text
createGuildBanOptsDeleteLastNMessages :: CreateGuildBanOpts -> Maybe Int
createGuildBanOptsReason :: CreateGuildBanOpts -> Maybe Text
createGuildBanOptsDeleteLastNMessages :: Maybe Int
createGuildBanOptsReason :: Maybe Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[ Key
"delete_message_days"
Key -> Maybe Int -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Int
createGuildBanOptsDeleteLastNMessages
, Key
"reason" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
createGuildBanOptsReason]
data ModifyGuildRoleOpts = ModifyGuildRoleOpts
{ ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsName :: Maybe T.Text
, ModifyGuildRoleOpts -> Maybe RolePermissions
modifyGuildRoleOptsPermissions :: Maybe RolePermissions
, ModifyGuildRoleOpts -> Maybe DiscordColor
modifyGuildRoleOptsColor :: Maybe DiscordColor
, :: Maybe Bool
, ModifyGuildRoleOpts -> Maybe Bool
modifyGuildRoleOptsMentionable :: Maybe Bool
, ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsIcon :: Maybe T.Text
} 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
$cshowsPrec :: Int -> ModifyGuildRoleOpts -> ShowS
showsPrec :: Int -> ModifyGuildRoleOpts -> ShowS
$cshow :: ModifyGuildRoleOpts -> String
show :: ModifyGuildRoleOpts -> String
$cshowList :: [ModifyGuildRoleOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS ModifyGuildRoleOpts
readsPrec :: Int -> ReadS ModifyGuildRoleOpts
$creadList :: ReadS [ModifyGuildRoleOpts]
readList :: ReadS [ModifyGuildRoleOpts]
$creadPrec :: ReadPrec ModifyGuildRoleOpts
readPrec :: ReadPrec ModifyGuildRoleOpts
$creadListPrec :: ReadPrec [ModifyGuildRoleOpts]
readListPrec :: ReadPrec [ModifyGuildRoleOpts]
Read, ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
(ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> (ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool)
-> Eq ModifyGuildRoleOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
== :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$c/= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
/= :: 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
$ccompare :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Ordering
compare :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Ordering
$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
>= :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> Bool
$cmax :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
max :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
$cmin :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
min :: ModifyGuildRoleOpts -> ModifyGuildRoleOpts -> ModifyGuildRoleOpts
Ord)
instance ToJSON ModifyGuildRoleOpts where
toJSON :: ModifyGuildRoleOpts -> Value
toJSON ModifyGuildRoleOpts{Maybe Bool
Maybe Text
Maybe RolePermissions
Maybe DiscordColor
modifyGuildRoleOptsName :: ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsPermissions :: ModifyGuildRoleOpts -> Maybe RolePermissions
modifyGuildRoleOptsColor :: ModifyGuildRoleOpts -> Maybe DiscordColor
modifyGuildRoleOptsSeparateSidebar :: ModifyGuildRoleOpts -> Maybe Bool
modifyGuildRoleOptsMentionable :: ModifyGuildRoleOpts -> Maybe Bool
modifyGuildRoleOptsIcon :: ModifyGuildRoleOpts -> Maybe Text
modifyGuildRoleOptsName :: Maybe Text
modifyGuildRoleOptsPermissions :: Maybe RolePermissions
modifyGuildRoleOptsColor :: Maybe DiscordColor
modifyGuildRoleOptsSeparateSidebar :: Maybe Bool
modifyGuildRoleOptsMentionable :: Maybe Bool
modifyGuildRoleOptsIcon :: Maybe Text
..} = [Maybe Pair] -> Value
objectFromMaybes
[Key
"name" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildRoleOptsName,
Key
"permissions" Key -> Maybe RolePermissions -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe RolePermissions
modifyGuildRoleOptsPermissions,
Key
"color" Key -> Maybe DiscordColor -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe DiscordColor
modifyGuildRoleOptsColor,
Key
"hoist" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildRoleOptsSeparateSidebar,
Key
"mentionable" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildRoleOptsMentionable,
Key
"icon" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildRoleOptsIcon]
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
$cshowsPrec :: Int -> AddGuildMemberOpts -> ShowS
showsPrec :: Int -> AddGuildMemberOpts -> ShowS
$cshow :: AddGuildMemberOpts -> String
show :: AddGuildMemberOpts -> String
$cshowList :: [AddGuildMemberOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS AddGuildMemberOpts
readsPrec :: Int -> ReadS AddGuildMemberOpts
$creadList :: ReadS [AddGuildMemberOpts]
readList :: ReadS [AddGuildMemberOpts]
$creadPrec :: ReadPrec AddGuildMemberOpts
readPrec :: ReadPrec AddGuildMemberOpts
$creadListPrec :: ReadPrec [AddGuildMemberOpts]
readListPrec :: ReadPrec [AddGuildMemberOpts]
Read, AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
(AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> (AddGuildMemberOpts -> AddGuildMemberOpts -> Bool)
-> Eq AddGuildMemberOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
== :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$c/= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
/= :: 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
$ccompare :: AddGuildMemberOpts -> AddGuildMemberOpts -> Ordering
compare :: AddGuildMemberOpts -> AddGuildMemberOpts -> Ordering
$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
>= :: AddGuildMemberOpts -> AddGuildMemberOpts -> Bool
$cmax :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
max :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
$cmin :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
min :: AddGuildMemberOpts -> AddGuildMemberOpts -> AddGuildMemberOpts
Ord)
instance ToJSON AddGuildMemberOpts where
toJSON :: AddGuildMemberOpts -> Value
toJSON AddGuildMemberOpts{Maybe Bool
Maybe [RoleId]
Maybe Text
Text
addGuildMemberOptsAccessToken :: AddGuildMemberOpts -> Text
addGuildMemberOptsNickname :: AddGuildMemberOpts -> Maybe Text
addGuildMemberOptsRoles :: AddGuildMemberOpts -> Maybe [RoleId]
addGuildMemberOptsIsMuted :: AddGuildMemberOpts -> Maybe Bool
addGuildMemberOptsIsDeafened :: AddGuildMemberOpts -> Maybe Bool
addGuildMemberOptsAccessToken :: Text
addGuildMemberOptsNickname :: Maybe Text
addGuildMemberOptsRoles :: Maybe [RoleId]
addGuildMemberOptsIsMuted :: Maybe Bool
addGuildMemberOptsIsDeafened :: Maybe Bool
..} = [Maybe Pair] -> Value
objectFromMaybes
[Key
"access_token" Key -> Text -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Text
addGuildMemberOptsAccessToken,
Key
"nick" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
addGuildMemberOptsNickname,
Key
"roles" Key -> Maybe [RoleId] -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe [RoleId]
addGuildMemberOptsRoles,
Key
"mute" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Bool
addGuildMemberOptsIsMuted,
Key
"deaf" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> 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
$cshowsPrec :: Int -> ModifyGuildMemberOpts -> ShowS
showsPrec :: Int -> ModifyGuildMemberOpts -> ShowS
$cshow :: ModifyGuildMemberOpts -> String
show :: ModifyGuildMemberOpts -> String
$cshowList :: [ModifyGuildMemberOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS ModifyGuildMemberOpts
readsPrec :: Int -> ReadS ModifyGuildMemberOpts
$creadList :: ReadS [ModifyGuildMemberOpts]
readList :: ReadS [ModifyGuildMemberOpts]
$creadPrec :: ReadPrec ModifyGuildMemberOpts
readPrec :: ReadPrec ModifyGuildMemberOpts
$creadListPrec :: ReadPrec [ModifyGuildMemberOpts]
readListPrec :: ReadPrec [ModifyGuildMemberOpts]
Read, ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
(ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> (ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool)
-> Eq ModifyGuildMemberOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
== :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$c/= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
/= :: 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
$ccompare :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Ordering
compare :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Ordering
$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
>= :: ModifyGuildMemberOpts -> ModifyGuildMemberOpts -> Bool
$cmax :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
max :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
$cmin :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> ModifyGuildMemberOpts
min :: ModifyGuildMemberOpts
-> ModifyGuildMemberOpts -> 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
modifyGuildMemberOptsNickname :: ModifyGuildMemberOpts -> Maybe Text
modifyGuildMemberOptsRoles :: ModifyGuildMemberOpts -> Maybe [RoleId]
modifyGuildMemberOptsIsMuted :: ModifyGuildMemberOpts -> Maybe Bool
modifyGuildMemberOptsIsDeafened :: ModifyGuildMemberOpts -> Maybe Bool
modifyGuildMemberOptsMoveToChannel :: ModifyGuildMemberOpts -> Maybe ChannelId
modifyGuildMemberOptsTimeoutUntil :: ModifyGuildMemberOpts -> Maybe (Maybe UTCTime)
modifyGuildMemberOptsNickname :: Maybe Text
modifyGuildMemberOptsRoles :: Maybe [RoleId]
modifyGuildMemberOptsIsMuted :: Maybe Bool
modifyGuildMemberOptsIsDeafened :: Maybe Bool
modifyGuildMemberOptsMoveToChannel :: Maybe ChannelId
modifyGuildMemberOptsTimeoutUntil :: Maybe (Maybe UTCTime)
..} = [Maybe Pair] -> Value
objectFromMaybes
[Key
"nick" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildMemberOptsNickname,
Key
"roles" Key -> Maybe [RoleId] -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe [RoleId]
modifyGuildMemberOptsRoles,
Key
"mute" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildMemberOptsIsMuted,
Key
"deaf" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Bool
modifyGuildMemberOptsIsDeafened,
Key
"channel_id" Key -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
modifyGuildMemberOptsMoveToChannel,
Key
"communication_disabled_until" Key -> Maybe (Maybe UTCTime) -> Maybe Pair
forall a. ToJSON a => Key -> 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
$cshowsPrec :: Int -> CreateGuildChannelOpts -> ShowS
showsPrec :: Int -> CreateGuildChannelOpts -> ShowS
$cshow :: CreateGuildChannelOpts -> String
show :: CreateGuildChannelOpts -> String
$cshowList :: [CreateGuildChannelOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS CreateGuildChannelOpts
readsPrec :: Int -> ReadS CreateGuildChannelOpts
$creadList :: ReadS [CreateGuildChannelOpts]
readList :: ReadS [CreateGuildChannelOpts]
$creadPrec :: ReadPrec CreateGuildChannelOpts
readPrec :: ReadPrec CreateGuildChannelOpts
$creadListPrec :: ReadPrec [CreateGuildChannelOpts]
readListPrec :: ReadPrec [CreateGuildChannelOpts]
Read, CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
(CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> (CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool)
-> Eq CreateGuildChannelOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
== :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$c/= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
/= :: 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
$ccompare :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Ordering
compare :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Ordering
$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
>= :: CreateGuildChannelOpts -> CreateGuildChannelOpts -> Bool
$cmax :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
max :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
$cmin :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> CreateGuildChannelOpts
min :: CreateGuildChannelOpts
-> CreateGuildChannelOpts -> 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
createGuildChannelOptsTopic :: CreateGuildChannelOpts -> Maybe Text
createGuildChannelOptsUserMessageRateDelay :: CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsIsNSFW :: CreateGuildChannelOpts -> Maybe Bool
createGuildChannelOptsCategoryId :: CreateGuildChannelOpts -> Maybe ChannelId
createGuildChannelOptsTopic :: Maybe Text
createGuildChannelOptsUserMessageRateDelay :: Maybe Integer
createGuildChannelOptsIsNSFW :: Maybe Bool
createGuildChannelOptsCategoryId :: Maybe ChannelId
..} ->
[Key
"name" Key -> Value -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Text -> Value
String Text
name
,Key
"type" Key -> Value -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Scientific -> Value
Number Scientific
0
,Key
"permission_overwrites" Key -> [Overwrite] -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== [Overwrite]
perms
,Key
"topic" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
createGuildChannelOptsTopic
,Key
"rate_limit_per_user" Key -> Maybe Integer -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Integer
createGuildChannelOptsUserMessageRateDelay
,Key
"nsfw" Key -> Maybe Bool -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Bool
createGuildChannelOptsIsNSFW
,Key
"parent_id" Key -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
createGuildChannelOptsCategoryId]
CreateGuildChannelOptsVoice{Maybe Integer
Maybe ChannelId
createGuildChannelOptsCategoryId :: CreateGuildChannelOpts -> Maybe ChannelId
createGuildChannelOptsBitrate :: CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsMaxUsers :: CreateGuildChannelOpts -> Maybe Integer
createGuildChannelOptsBitrate :: Maybe Integer
createGuildChannelOptsMaxUsers :: Maybe Integer
createGuildChannelOptsCategoryId :: Maybe ChannelId
..} ->
[Key
"name" Key -> Value -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Text -> Value
String Text
name
,Key
"type" Key -> Value -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Scientific -> Value
Number Scientific
2
,Key
"permission_overwrites" Key -> [Overwrite] -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== [Overwrite]
perms
,Key
"bitrate" Key -> Maybe Integer -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Integer
createGuildChannelOptsBitrate
,Key
"user_limit" Key -> Maybe Integer -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Integer
createGuildChannelOptsMaxUsers
,Key
"parent_id" Key -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
createGuildChannelOptsCategoryId]
CreateGuildChannelOpts
CreateGuildChannelOptsCategory ->
[Key
"name" Key -> Value -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Text -> Value
String Text
name
,Key
"type" Key -> Value -> Maybe Pair
forall a. ToJSON a => Key -> a -> Maybe Pair
.== Scientific -> Value
Number Scientific
4
,Key
"permission_overwrites" Key -> [Overwrite] -> Maybe Pair
forall a. ToJSON a => Key -> 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
$cshowsPrec :: Int -> ModifyGuildOpts -> ShowS
showsPrec :: Int -> ModifyGuildOpts -> ShowS
$cshow :: ModifyGuildOpts -> String
show :: ModifyGuildOpts -> String
$cshowList :: [ModifyGuildOpts] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS ModifyGuildOpts
readsPrec :: Int -> ReadS ModifyGuildOpts
$creadList :: ReadS [ModifyGuildOpts]
readList :: ReadS [ModifyGuildOpts]
$creadPrec :: ReadPrec ModifyGuildOpts
readPrec :: ReadPrec ModifyGuildOpts
$creadListPrec :: ReadPrec [ModifyGuildOpts]
readListPrec :: ReadPrec [ModifyGuildOpts]
Read, ModifyGuildOpts -> ModifyGuildOpts -> Bool
(ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> (ModifyGuildOpts -> ModifyGuildOpts -> Bool)
-> Eq ModifyGuildOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
== :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$c/= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
/= :: 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
$ccompare :: ModifyGuildOpts -> ModifyGuildOpts -> Ordering
compare :: ModifyGuildOpts -> ModifyGuildOpts -> Ordering
$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
>= :: ModifyGuildOpts -> ModifyGuildOpts -> Bool
$cmax :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
max :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
$cmin :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
min :: ModifyGuildOpts -> ModifyGuildOpts -> ModifyGuildOpts
Ord)
instance ToJSON ModifyGuildOpts where
toJSON :: ModifyGuildOpts -> Value
toJSON ModifyGuildOpts{Maybe Text
Maybe UserId
Maybe ChannelId
modifyGuildOptsName :: ModifyGuildOpts -> Maybe Text
modifyGuildOptsAFKChannelId :: ModifyGuildOpts -> Maybe ChannelId
modifyGuildOptsIcon :: ModifyGuildOpts -> Maybe Text
modifyGuildOptsOwnerId :: ModifyGuildOpts -> Maybe UserId
modifyGuildOptsName :: Maybe Text
modifyGuildOptsAFKChannelId :: Maybe ChannelId
modifyGuildOptsIcon :: Maybe Text
modifyGuildOptsOwnerId :: Maybe UserId
..} = [Maybe Pair] -> Value
objectFromMaybes
[Key
"name" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildOptsName,
Key
"afk_channel_id" Key -> Maybe ChannelId -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe ChannelId
modifyGuildOptsAFKChannelId,
Key
"icon" Key -> Maybe Text -> Maybe Pair
forall a. ToJSON a => Key -> Maybe a -> Maybe Pair
.=? Maybe Text
modifyGuildOptsIcon,
Key
"owner_id" Key -> Maybe UserId -> Maybe Pair
forall a. ToJSON a => Key -> 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
$cshowsPrec :: Int -> GuildMembersTiming -> ShowS
showsPrec :: Int -> GuildMembersTiming -> ShowS
$cshow :: GuildMembersTiming -> String
show :: GuildMembersTiming -> String
$cshowList :: [GuildMembersTiming] -> ShowS
showList :: [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
$creadsPrec :: Int -> ReadS GuildMembersTiming
readsPrec :: Int -> ReadS GuildMembersTiming
$creadList :: ReadS [GuildMembersTiming]
readList :: ReadS [GuildMembersTiming]
$creadPrec :: ReadPrec GuildMembersTiming
readPrec :: ReadPrec GuildMembersTiming
$creadListPrec :: ReadPrec [GuildMembersTiming]
readListPrec :: ReadPrec [GuildMembersTiming]
Read, GuildMembersTiming -> GuildMembersTiming -> Bool
(GuildMembersTiming -> GuildMembersTiming -> Bool)
-> (GuildMembersTiming -> GuildMembersTiming -> Bool)
-> Eq GuildMembersTiming
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GuildMembersTiming -> GuildMembersTiming -> Bool
== :: GuildMembersTiming -> GuildMembersTiming -> Bool
$c/= :: GuildMembersTiming -> GuildMembersTiming -> Bool
/= :: 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
$ccompare :: GuildMembersTiming -> GuildMembersTiming -> Ordering
compare :: GuildMembersTiming -> GuildMembersTiming -> Ordering
$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
>= :: GuildMembersTiming -> GuildMembersTiming -> Bool
$cmax :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
max :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
$cmin :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
min :: GuildMembersTiming -> GuildMembersTiming -> GuildMembersTiming
Ord)
data ListActiveThreads = ListActiveThreads
{ ListActiveThreads -> [Channel]
listActiveThreadsThreads :: [Channel]
, ListActiveThreads -> [ThreadMember]
listActiveThreadsMembers :: [ThreadMember]
} deriving (Int -> ListActiveThreads -> ShowS
[ListActiveThreads] -> ShowS
ListActiveThreads -> String
(Int -> ListActiveThreads -> ShowS)
-> (ListActiveThreads -> String)
-> ([ListActiveThreads] -> ShowS)
-> Show ListActiveThreads
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListActiveThreads -> ShowS
showsPrec :: Int -> ListActiveThreads -> ShowS
$cshow :: ListActiveThreads -> String
show :: ListActiveThreads -> String
$cshowList :: [ListActiveThreads] -> ShowS
showList :: [ListActiveThreads] -> ShowS
Show, ReadPrec [ListActiveThreads]
ReadPrec ListActiveThreads
Int -> ReadS ListActiveThreads
ReadS [ListActiveThreads]
(Int -> ReadS ListActiveThreads)
-> ReadS [ListActiveThreads]
-> ReadPrec ListActiveThreads
-> ReadPrec [ListActiveThreads]
-> Read ListActiveThreads
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ListActiveThreads
readsPrec :: Int -> ReadS ListActiveThreads
$creadList :: ReadS [ListActiveThreads]
readList :: ReadS [ListActiveThreads]
$creadPrec :: ReadPrec ListActiveThreads
readPrec :: ReadPrec ListActiveThreads
$creadListPrec :: ReadPrec [ListActiveThreads]
readListPrec :: ReadPrec [ListActiveThreads]
Read, ListActiveThreads -> ListActiveThreads -> Bool
(ListActiveThreads -> ListActiveThreads -> Bool)
-> (ListActiveThreads -> ListActiveThreads -> Bool)
-> Eq ListActiveThreads
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListActiveThreads -> ListActiveThreads -> Bool
== :: ListActiveThreads -> ListActiveThreads -> Bool
$c/= :: ListActiveThreads -> ListActiveThreads -> Bool
/= :: ListActiveThreads -> ListActiveThreads -> Bool
Eq, Eq ListActiveThreads
Eq ListActiveThreads =>
(ListActiveThreads -> ListActiveThreads -> Ordering)
-> (ListActiveThreads -> ListActiveThreads -> Bool)
-> (ListActiveThreads -> ListActiveThreads -> Bool)
-> (ListActiveThreads -> ListActiveThreads -> Bool)
-> (ListActiveThreads -> ListActiveThreads -> Bool)
-> (ListActiveThreads -> ListActiveThreads -> ListActiveThreads)
-> (ListActiveThreads -> ListActiveThreads -> ListActiveThreads)
-> Ord ListActiveThreads
ListActiveThreads -> ListActiveThreads -> Bool
ListActiveThreads -> ListActiveThreads -> Ordering
ListActiveThreads -> ListActiveThreads -> ListActiveThreads
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
$ccompare :: ListActiveThreads -> ListActiveThreads -> Ordering
compare :: ListActiveThreads -> ListActiveThreads -> Ordering
$c< :: ListActiveThreads -> ListActiveThreads -> Bool
< :: ListActiveThreads -> ListActiveThreads -> Bool
$c<= :: ListActiveThreads -> ListActiveThreads -> Bool
<= :: ListActiveThreads -> ListActiveThreads -> Bool
$c> :: ListActiveThreads -> ListActiveThreads -> Bool
> :: ListActiveThreads -> ListActiveThreads -> Bool
$c>= :: ListActiveThreads -> ListActiveThreads -> Bool
>= :: ListActiveThreads -> ListActiveThreads -> Bool
$cmax :: ListActiveThreads -> ListActiveThreads -> ListActiveThreads
max :: ListActiveThreads -> ListActiveThreads -> ListActiveThreads
$cmin :: ListActiveThreads -> ListActiveThreads -> ListActiveThreads
min :: ListActiveThreads -> ListActiveThreads -> ListActiveThreads
Ord)
instance ToJSON ListActiveThreads where
toJSON :: ListActiveThreads -> Value
toJSON ListActiveThreads{[ThreadMember]
[Channel]
listActiveThreadsThreads :: ListActiveThreads -> [Channel]
listActiveThreadsMembers :: ListActiveThreads -> [ThreadMember]
listActiveThreadsThreads :: [Channel]
listActiveThreadsMembers :: [ThreadMember]
..} = [Pair] -> Value
object
[ (Key
"threads", [Channel] -> Value
forall a. ToJSON a => a -> Value
toJSON [Channel]
listActiveThreadsThreads)
, (Key
"members", [ThreadMember] -> Value
forall a. ToJSON a => a -> Value
toJSON [ThreadMember]
listActiveThreadsMembers)
]
instance FromJSON ListActiveThreads where
parseJSON :: Value -> Parser ListActiveThreads
parseJSON = String
-> (Object -> Parser ListActiveThreads)
-> Value
-> Parser ListActiveThreads
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"ListActiveThreads" ((Object -> Parser ListActiveThreads)
-> Value -> Parser ListActiveThreads)
-> (Object -> Parser ListActiveThreads)
-> Value
-> Parser ListActiveThreads
forall a b. (a -> b) -> a -> b
$ \Object
o ->
[Channel] -> [ThreadMember] -> ListActiveThreads
ListActiveThreads ([Channel] -> [ThreadMember] -> ListActiveThreads)
-> Parser [Channel] -> Parser ([ThreadMember] -> ListActiveThreads)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser [Channel]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"threads"
Parser ([ThreadMember] -> ListActiveThreads)
-> Parser [ThreadMember] -> Parser ListActiveThreads
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
o Object -> Key -> Parser [ThreadMember]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"members"
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 :: forall a. 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
(ListActiveGuildThreads 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
(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
(GetGuildAuditLog GuildId
g GetAuditLogOpts
_) -> String
"guild " 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 :: forall a. GuildRequest a -> 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 a. a -> RestIO a
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 a. a -> RestIO a
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 [(Key
"id", ChannelId -> Value
forall a. ToJSON a => a -> Value
toJSON ChannelId
a)
,(Key
"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 a. a -> RestIO a
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
(ListActiveGuildThreads 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
"threads" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"active") 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 a. a -> RestIO a
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 [Key
"nick" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> 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 a. a -> RestIO a
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 a. a -> RestIO a
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 [Key
"id"Key -> RoleId -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=RoleId
role, Key
"position"Key -> Integer -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> 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 a. a -> RestIO a
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 a. a -> RestIO a
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)
(GetGuildAuditLog GuildId
guild GetAuditLogOpts
auditOpts) ->
let user_id :: Option 'Https
user_id = case GetAuditLogOpts -> Maybe UserId
getAuditLogUserId GetAuditLogOpts
auditOpts of
Maybe UserId
Nothing -> Option 'Https
forall a. Monoid a => a
mempty
Just UserId
uid -> Text
"user_id" Text -> UserId -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: UserId
uid
action_type :: Option 'Https
action_type = case GetAuditLogOpts -> Maybe AuditLogEvent
getAuditLogActionType GetAuditLogOpts
auditOpts of
Maybe AuditLogEvent
Nothing -> Option 'Https
forall a. Monoid a => a
mempty
Just (MkAuditLogEvent Int
n) -> Text
"action_type" Text -> Int -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Int
n
timing :: Option 'Https
timing = case GetAuditLogOpts -> Maybe AuditLogTiming
getAuditLogTiming GetAuditLogOpts
auditOpts of
Maybe AuditLogTiming
Nothing -> Option 'Https
forall a. Monoid a => a
mempty
Just AuditLogTiming
LatestLogEntries -> Option 'Https
forall a. Monoid a => a
mempty
Just (BeforeLogEntry AuditLogEntryId
snow) -> Text
"before" Text -> AuditLogEntryId -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: AuditLogEntryId
snow
Just (AfterLogEntry AuditLogEntryId
snow) -> Text
"after" Text -> AuditLogEntryId -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: AuditLogEntryId
snow
limit :: Option 'Https
limit = case GetAuditLogOpts -> Maybe Int
getAuditLogLimit GetAuditLogOpts
auditOpts of
Maybe Int
Nothing -> Option 'Https
forall a. Monoid a => a
mempty
Just Int
n -> Text
"limit" Text -> Int -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
1 (Int -> Int -> Int
forall a. Ord a => a -> a -> a
min Int
100 Int
n)
body :: Option 'Https
body = Option 'Https
user_id Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Option 'Https
action_type Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Option 'Https
timing Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> Option 'Https
limit
in 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
"audit-logs") Option 'Https
body
(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 a. a -> RestIO a
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 [Key
"type" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= CreateGuildIntegrationOpts -> Text
createGuildIntegrationOptsType CreateGuildIntegrationOpts
opts, Key
"id" Key -> IntegrationId -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> 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 a. a -> RestIO a
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 a. a -> RestIO a
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 a. a -> RestIO a
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 a. a -> RestIO a
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