{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
module Discord.Internal.Rest.Channel
( ChannelRequest(..)
, MessageDetailedOpts(..)
, AllowedMentions(..)
, ReactionTiming(..)
, MessageTiming(..)
, ChannelInviteOpts(..)
, ModifyChannelOpts(..)
, ChannelPermissionsOpts(..)
, GroupDMAddRecipientOpts(..)
, ChannelPermissionsOptsType(..)
) where
import Data.Aeson
import Data.Default (Default, def)
import Data.Emoji (unicodeByName)
import qualified Data.Text as T
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import Network.HTTP.Client (RequestBody (RequestBodyBS))
import Network.HTTP.Client.MultipartFormData (partFileRequestBody, partBS)
import Network.HTTP.Req ((/:))
import qualified Network.HTTP.Req as R
import Discord.Internal.Rest.Prelude
import Discord.Internal.Types
import Control.Monad (join)
instance Request (ChannelRequest a) where
majorRoute :: ChannelRequest a -> String
majorRoute = ChannelRequest a -> String
forall a. ChannelRequest a -> String
channelMajorRoute
jsonRequest :: ChannelRequest a -> JsonRequest
jsonRequest = ChannelRequest a -> JsonRequest
forall a. ChannelRequest a -> JsonRequest
channelJsonRequest
data ChannelRequest a where
GetChannel :: ChannelId -> ChannelRequest Channel
ModifyChannel :: ChannelId -> ModifyChannelOpts -> ChannelRequest Channel
DeleteChannel :: ChannelId -> ChannelRequest Channel
GetChannelMessages :: ChannelId -> (Int, MessageTiming) -> ChannelRequest [Message]
GetChannelMessage :: (ChannelId, MessageId) -> ChannelRequest Message
CreateMessage :: ChannelId -> T.Text -> ChannelRequest Message
CreateMessageUploadFile :: ChannelId -> T.Text -> B.ByteString -> ChannelRequest Message
CreateMessageDetailed :: ChannelId -> MessageDetailedOpts -> ChannelRequest Message
CreateReaction :: (ChannelId, MessageId) -> T.Text -> ChannelRequest ()
DeleteOwnReaction :: (ChannelId, MessageId) -> T.Text -> ChannelRequest ()
DeleteUserReaction :: (ChannelId, MessageId) -> UserId -> T.Text -> ChannelRequest ()
DeleteSingleReaction :: (ChannelId, MessageId) -> T.Text -> ChannelRequest ()
GetReactions :: (ChannelId, MessageId) -> T.Text -> (Int, ReactionTiming) -> ChannelRequest [User]
DeleteAllReactions :: (ChannelId, MessageId) -> ChannelRequest ()
EditMessage :: (ChannelId, MessageId) -> T.Text -> Maybe CreateEmbed
-> ChannelRequest Message
DeleteMessage :: (ChannelId, MessageId) -> ChannelRequest ()
BulkDeleteMessage :: (ChannelId, [MessageId]) -> ChannelRequest ()
EditChannelPermissions :: ChannelId -> OverwriteId -> ChannelPermissionsOpts -> ChannelRequest ()
GetChannelInvites :: ChannelId -> ChannelRequest Object
CreateChannelInvite :: ChannelId -> ChannelInviteOpts -> ChannelRequest Invite
DeleteChannelPermission :: ChannelId -> OverwriteId -> ChannelRequest ()
TriggerTypingIndicator :: ChannelId -> ChannelRequest ()
GetPinnedMessages :: ChannelId -> ChannelRequest [Message]
AddPinnedMessage :: (ChannelId, MessageId) -> ChannelRequest ()
DeletePinnedMessage :: (ChannelId, MessageId) -> ChannelRequest ()
GroupDMAddRecipient :: ChannelId -> GroupDMAddRecipientOpts -> ChannelRequest ()
GroupDMRemoveRecipient :: ChannelId -> UserId -> ChannelRequest ()
data MessageDetailedOpts = MessageDetailedOpts
{ MessageDetailedOpts -> Text
messageDetailedContent :: T.Text
, MessageDetailedOpts -> Bool
messageDetailedTTS :: Bool
, MessageDetailedOpts -> Maybe [CreateEmbed]
messageDetailedEmbeds :: Maybe [CreateEmbed]
, MessageDetailedOpts -> Maybe (Text, ByteString)
messageDetailedFile :: Maybe (T.Text, B.ByteString)
, MessageDetailedOpts -> Maybe AllowedMentions
messageDetailedAllowedMentions :: Maybe AllowedMentions
, MessageDetailedOpts -> Maybe MessageReference
messageDetailedReference :: Maybe MessageReference
, MessageDetailedOpts -> Maybe [ComponentActionRow]
messageDetailedComponents :: Maybe [ComponentActionRow]
, MessageDetailedOpts -> Maybe [StickerId]
messageDetailedStickerIds :: Maybe [StickerId]
} deriving (Int -> MessageDetailedOpts -> ShowS
[MessageDetailedOpts] -> ShowS
MessageDetailedOpts -> String
(Int -> MessageDetailedOpts -> ShowS)
-> (MessageDetailedOpts -> String)
-> ([MessageDetailedOpts] -> ShowS)
-> Show MessageDetailedOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageDetailedOpts] -> ShowS
$cshowList :: [MessageDetailedOpts] -> ShowS
show :: MessageDetailedOpts -> String
$cshow :: MessageDetailedOpts -> String
showsPrec :: Int -> MessageDetailedOpts -> ShowS
$cshowsPrec :: Int -> MessageDetailedOpts -> ShowS
Show, MessageDetailedOpts -> MessageDetailedOpts -> Bool
(MessageDetailedOpts -> MessageDetailedOpts -> Bool)
-> (MessageDetailedOpts -> MessageDetailedOpts -> Bool)
-> Eq MessageDetailedOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
$c/= :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
== :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
$c== :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
Eq, Eq MessageDetailedOpts
Eq MessageDetailedOpts
-> (MessageDetailedOpts -> MessageDetailedOpts -> Ordering)
-> (MessageDetailedOpts -> MessageDetailedOpts -> Bool)
-> (MessageDetailedOpts -> MessageDetailedOpts -> Bool)
-> (MessageDetailedOpts -> MessageDetailedOpts -> Bool)
-> (MessageDetailedOpts -> MessageDetailedOpts -> Bool)
-> (MessageDetailedOpts
-> MessageDetailedOpts -> MessageDetailedOpts)
-> (MessageDetailedOpts
-> MessageDetailedOpts -> MessageDetailedOpts)
-> Ord MessageDetailedOpts
MessageDetailedOpts -> MessageDetailedOpts -> Bool
MessageDetailedOpts -> MessageDetailedOpts -> Ordering
MessageDetailedOpts -> MessageDetailedOpts -> MessageDetailedOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MessageDetailedOpts -> MessageDetailedOpts -> MessageDetailedOpts
$cmin :: MessageDetailedOpts -> MessageDetailedOpts -> MessageDetailedOpts
max :: MessageDetailedOpts -> MessageDetailedOpts -> MessageDetailedOpts
$cmax :: MessageDetailedOpts -> MessageDetailedOpts -> MessageDetailedOpts
>= :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
$c>= :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
> :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
$c> :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
<= :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
$c<= :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
< :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
$c< :: MessageDetailedOpts -> MessageDetailedOpts -> Bool
compare :: MessageDetailedOpts -> MessageDetailedOpts -> Ordering
$ccompare :: MessageDetailedOpts -> MessageDetailedOpts -> Ordering
$cp1Ord :: Eq MessageDetailedOpts
Ord, ReadPrec [MessageDetailedOpts]
ReadPrec MessageDetailedOpts
Int -> ReadS MessageDetailedOpts
ReadS [MessageDetailedOpts]
(Int -> ReadS MessageDetailedOpts)
-> ReadS [MessageDetailedOpts]
-> ReadPrec MessageDetailedOpts
-> ReadPrec [MessageDetailedOpts]
-> Read MessageDetailedOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MessageDetailedOpts]
$creadListPrec :: ReadPrec [MessageDetailedOpts]
readPrec :: ReadPrec MessageDetailedOpts
$creadPrec :: ReadPrec MessageDetailedOpts
readList :: ReadS [MessageDetailedOpts]
$creadList :: ReadS [MessageDetailedOpts]
readsPrec :: Int -> ReadS MessageDetailedOpts
$creadsPrec :: Int -> ReadS MessageDetailedOpts
Read)
instance Default MessageDetailedOpts where
def :: MessageDetailedOpts
def = MessageDetailedOpts :: Text
-> Bool
-> Maybe [CreateEmbed]
-> Maybe (Text, ByteString)
-> Maybe AllowedMentions
-> Maybe MessageReference
-> Maybe [ComponentActionRow]
-> Maybe [StickerId]
-> MessageDetailedOpts
MessageDetailedOpts { messageDetailedContent :: Text
messageDetailedContent = Text
""
, messageDetailedTTS :: Bool
messageDetailedTTS = Bool
False
, messageDetailedEmbeds :: Maybe [CreateEmbed]
messageDetailedEmbeds = Maybe [CreateEmbed]
forall a. Maybe a
Nothing
, messageDetailedFile :: Maybe (Text, ByteString)
messageDetailedFile = Maybe (Text, ByteString)
forall a. Maybe a
Nothing
, messageDetailedAllowedMentions :: Maybe AllowedMentions
messageDetailedAllowedMentions = Maybe AllowedMentions
forall a. Maybe a
Nothing
, messageDetailedReference :: Maybe MessageReference
messageDetailedReference = Maybe MessageReference
forall a. Maybe a
Nothing
, messageDetailedComponents :: Maybe [ComponentActionRow]
messageDetailedComponents = Maybe [ComponentActionRow]
forall a. Maybe a
Nothing
, messageDetailedStickerIds :: Maybe [StickerId]
messageDetailedStickerIds = Maybe [StickerId]
forall a. Maybe a
Nothing
}
data ReactionTiming = BeforeReaction MessageId
| AfterReaction MessageId
| LatestReaction
deriving (Int -> ReactionTiming -> ShowS
[ReactionTiming] -> ShowS
ReactionTiming -> String
(Int -> ReactionTiming -> ShowS)
-> (ReactionTiming -> String)
-> ([ReactionTiming] -> ShowS)
-> Show ReactionTiming
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReactionTiming] -> ShowS
$cshowList :: [ReactionTiming] -> ShowS
show :: ReactionTiming -> String
$cshow :: ReactionTiming -> String
showsPrec :: Int -> ReactionTiming -> ShowS
$cshowsPrec :: Int -> ReactionTiming -> ShowS
Show, ReadPrec [ReactionTiming]
ReadPrec ReactionTiming
Int -> ReadS ReactionTiming
ReadS [ReactionTiming]
(Int -> ReadS ReactionTiming)
-> ReadS [ReactionTiming]
-> ReadPrec ReactionTiming
-> ReadPrec [ReactionTiming]
-> Read ReactionTiming
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReactionTiming]
$creadListPrec :: ReadPrec [ReactionTiming]
readPrec :: ReadPrec ReactionTiming
$creadPrec :: ReadPrec ReactionTiming
readList :: ReadS [ReactionTiming]
$creadList :: ReadS [ReactionTiming]
readsPrec :: Int -> ReadS ReactionTiming
$creadsPrec :: Int -> ReadS ReactionTiming
Read, ReactionTiming -> ReactionTiming -> Bool
(ReactionTiming -> ReactionTiming -> Bool)
-> (ReactionTiming -> ReactionTiming -> Bool) -> Eq ReactionTiming
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReactionTiming -> ReactionTiming -> Bool
$c/= :: ReactionTiming -> ReactionTiming -> Bool
== :: ReactionTiming -> ReactionTiming -> Bool
$c== :: ReactionTiming -> ReactionTiming -> Bool
Eq, Eq ReactionTiming
Eq ReactionTiming
-> (ReactionTiming -> ReactionTiming -> Ordering)
-> (ReactionTiming -> ReactionTiming -> Bool)
-> (ReactionTiming -> ReactionTiming -> Bool)
-> (ReactionTiming -> ReactionTiming -> Bool)
-> (ReactionTiming -> ReactionTiming -> Bool)
-> (ReactionTiming -> ReactionTiming -> ReactionTiming)
-> (ReactionTiming -> ReactionTiming -> ReactionTiming)
-> Ord ReactionTiming
ReactionTiming -> ReactionTiming -> Bool
ReactionTiming -> ReactionTiming -> Ordering
ReactionTiming -> ReactionTiming -> ReactionTiming
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ReactionTiming -> ReactionTiming -> ReactionTiming
$cmin :: ReactionTiming -> ReactionTiming -> ReactionTiming
max :: ReactionTiming -> ReactionTiming -> ReactionTiming
$cmax :: ReactionTiming -> ReactionTiming -> ReactionTiming
>= :: ReactionTiming -> ReactionTiming -> Bool
$c>= :: ReactionTiming -> ReactionTiming -> Bool
> :: ReactionTiming -> ReactionTiming -> Bool
$c> :: ReactionTiming -> ReactionTiming -> Bool
<= :: ReactionTiming -> ReactionTiming -> Bool
$c<= :: ReactionTiming -> ReactionTiming -> Bool
< :: ReactionTiming -> ReactionTiming -> Bool
$c< :: ReactionTiming -> ReactionTiming -> Bool
compare :: ReactionTiming -> ReactionTiming -> Ordering
$ccompare :: ReactionTiming -> ReactionTiming -> Ordering
$cp1Ord :: Eq ReactionTiming
Ord)
reactionTimingToQuery :: ReactionTiming -> R.Option 'R.Https
reactionTimingToQuery :: ReactionTiming -> Option 'Https
reactionTimingToQuery ReactionTiming
t = case ReactionTiming
t of
(BeforeReaction StickerId
snow) -> Text
"before" Text -> String -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: StickerId -> String
forall a. Show a => a -> String
show StickerId
snow
(AfterReaction StickerId
snow) -> Text
"after" Text -> String -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: StickerId -> String
forall a. Show a => a -> String
show StickerId
snow
(ReactionTiming
LatestReaction) -> Option 'Https
forall a. Monoid a => a
mempty
data MessageTiming = AroundMessage MessageId
| BeforeMessage MessageId
| AfterMessage MessageId
| LatestMessages
deriving (Int -> MessageTiming -> ShowS
[MessageTiming] -> ShowS
MessageTiming -> String
(Int -> MessageTiming -> ShowS)
-> (MessageTiming -> String)
-> ([MessageTiming] -> ShowS)
-> Show MessageTiming
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageTiming] -> ShowS
$cshowList :: [MessageTiming] -> ShowS
show :: MessageTiming -> String
$cshow :: MessageTiming -> String
showsPrec :: Int -> MessageTiming -> ShowS
$cshowsPrec :: Int -> MessageTiming -> ShowS
Show, ReadPrec [MessageTiming]
ReadPrec MessageTiming
Int -> ReadS MessageTiming
ReadS [MessageTiming]
(Int -> ReadS MessageTiming)
-> ReadS [MessageTiming]
-> ReadPrec MessageTiming
-> ReadPrec [MessageTiming]
-> Read MessageTiming
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MessageTiming]
$creadListPrec :: ReadPrec [MessageTiming]
readPrec :: ReadPrec MessageTiming
$creadPrec :: ReadPrec MessageTiming
readList :: ReadS [MessageTiming]
$creadList :: ReadS [MessageTiming]
readsPrec :: Int -> ReadS MessageTiming
$creadsPrec :: Int -> ReadS MessageTiming
Read, MessageTiming -> MessageTiming -> Bool
(MessageTiming -> MessageTiming -> Bool)
-> (MessageTiming -> MessageTiming -> Bool) -> Eq MessageTiming
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageTiming -> MessageTiming -> Bool
$c/= :: MessageTiming -> MessageTiming -> Bool
== :: MessageTiming -> MessageTiming -> Bool
$c== :: MessageTiming -> MessageTiming -> Bool
Eq, Eq MessageTiming
Eq MessageTiming
-> (MessageTiming -> MessageTiming -> Ordering)
-> (MessageTiming -> MessageTiming -> Bool)
-> (MessageTiming -> MessageTiming -> Bool)
-> (MessageTiming -> MessageTiming -> Bool)
-> (MessageTiming -> MessageTiming -> Bool)
-> (MessageTiming -> MessageTiming -> MessageTiming)
-> (MessageTiming -> MessageTiming -> MessageTiming)
-> Ord MessageTiming
MessageTiming -> MessageTiming -> Bool
MessageTiming -> MessageTiming -> Ordering
MessageTiming -> MessageTiming -> MessageTiming
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: MessageTiming -> MessageTiming -> MessageTiming
$cmin :: MessageTiming -> MessageTiming -> MessageTiming
max :: MessageTiming -> MessageTiming -> MessageTiming
$cmax :: MessageTiming -> MessageTiming -> MessageTiming
>= :: MessageTiming -> MessageTiming -> Bool
$c>= :: MessageTiming -> MessageTiming -> Bool
> :: MessageTiming -> MessageTiming -> Bool
$c> :: MessageTiming -> MessageTiming -> Bool
<= :: MessageTiming -> MessageTiming -> Bool
$c<= :: MessageTiming -> MessageTiming -> Bool
< :: MessageTiming -> MessageTiming -> Bool
$c< :: MessageTiming -> MessageTiming -> Bool
compare :: MessageTiming -> MessageTiming -> Ordering
$ccompare :: MessageTiming -> MessageTiming -> Ordering
$cp1Ord :: Eq MessageTiming
Ord)
messageTimingToQuery :: MessageTiming -> R.Option 'R.Https
messageTimingToQuery :: MessageTiming -> Option 'Https
messageTimingToQuery MessageTiming
t = case MessageTiming
t of
(AroundMessage StickerId
snow) -> Text
"around" Text -> String -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: StickerId -> String
forall a. Show a => a -> String
show StickerId
snow
(BeforeMessage StickerId
snow) -> Text
"before" Text -> String -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: StickerId -> String
forall a. Show a => a -> String
show StickerId
snow
(AfterMessage StickerId
snow) -> Text
"after" Text -> String -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: StickerId -> String
forall a. Show a => a -> String
show StickerId
snow
(MessageTiming
LatestMessages) -> Option 'Https
forall a. Monoid a => a
mempty
data ChannelInviteOpts = ChannelInviteOpts
{ ChannelInviteOpts -> Maybe Integer
channelInviteOptsMaxAgeSeconds :: Maybe Integer
, ChannelInviteOpts -> Maybe Integer
channelInviteOptsMaxUsages :: Maybe Integer
, ChannelInviteOpts -> Maybe Bool
channelInviteOptsIsTemporary :: Maybe Bool
, ChannelInviteOpts -> Maybe Bool
channelInviteOptsDontReuseSimilarInvite :: Maybe Bool
} deriving (Int -> ChannelInviteOpts -> ShowS
[ChannelInviteOpts] -> ShowS
ChannelInviteOpts -> String
(Int -> ChannelInviteOpts -> ShowS)
-> (ChannelInviteOpts -> String)
-> ([ChannelInviteOpts] -> ShowS)
-> Show ChannelInviteOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelInviteOpts] -> ShowS
$cshowList :: [ChannelInviteOpts] -> ShowS
show :: ChannelInviteOpts -> String
$cshow :: ChannelInviteOpts -> String
showsPrec :: Int -> ChannelInviteOpts -> ShowS
$cshowsPrec :: Int -> ChannelInviteOpts -> ShowS
Show, ReadPrec [ChannelInviteOpts]
ReadPrec ChannelInviteOpts
Int -> ReadS ChannelInviteOpts
ReadS [ChannelInviteOpts]
(Int -> ReadS ChannelInviteOpts)
-> ReadS [ChannelInviteOpts]
-> ReadPrec ChannelInviteOpts
-> ReadPrec [ChannelInviteOpts]
-> Read ChannelInviteOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelInviteOpts]
$creadListPrec :: ReadPrec [ChannelInviteOpts]
readPrec :: ReadPrec ChannelInviteOpts
$creadPrec :: ReadPrec ChannelInviteOpts
readList :: ReadS [ChannelInviteOpts]
$creadList :: ReadS [ChannelInviteOpts]
readsPrec :: Int -> ReadS ChannelInviteOpts
$creadsPrec :: Int -> ReadS ChannelInviteOpts
Read, ChannelInviteOpts -> ChannelInviteOpts -> Bool
(ChannelInviteOpts -> ChannelInviteOpts -> Bool)
-> (ChannelInviteOpts -> ChannelInviteOpts -> Bool)
-> Eq ChannelInviteOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
$c/= :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
== :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
$c== :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
Eq, Eq ChannelInviteOpts
Eq ChannelInviteOpts
-> (ChannelInviteOpts -> ChannelInviteOpts -> Ordering)
-> (ChannelInviteOpts -> ChannelInviteOpts -> Bool)
-> (ChannelInviteOpts -> ChannelInviteOpts -> Bool)
-> (ChannelInviteOpts -> ChannelInviteOpts -> Bool)
-> (ChannelInviteOpts -> ChannelInviteOpts -> Bool)
-> (ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts)
-> (ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts)
-> Ord ChannelInviteOpts
ChannelInviteOpts -> ChannelInviteOpts -> Bool
ChannelInviteOpts -> ChannelInviteOpts -> Ordering
ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts
$cmin :: ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts
max :: ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts
$cmax :: ChannelInviteOpts -> ChannelInviteOpts -> ChannelInviteOpts
>= :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
$c>= :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
> :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
$c> :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
<= :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
$c<= :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
< :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
$c< :: ChannelInviteOpts -> ChannelInviteOpts -> Bool
compare :: ChannelInviteOpts -> ChannelInviteOpts -> Ordering
$ccompare :: ChannelInviteOpts -> ChannelInviteOpts -> Ordering
$cp1Ord :: Eq ChannelInviteOpts
Ord)
instance ToJSON ChannelInviteOpts where
toJSON :: ChannelInviteOpts -> Value
toJSON ChannelInviteOpts{Maybe Bool
Maybe Integer
channelInviteOptsDontReuseSimilarInvite :: Maybe Bool
channelInviteOptsIsTemporary :: Maybe Bool
channelInviteOptsMaxUsages :: Maybe Integer
channelInviteOptsMaxAgeSeconds :: Maybe Integer
channelInviteOptsDontReuseSimilarInvite :: ChannelInviteOpts -> Maybe Bool
channelInviteOptsIsTemporary :: ChannelInviteOpts -> Maybe Bool
channelInviteOptsMaxUsages :: ChannelInviteOpts -> Maybe Integer
channelInviteOptsMaxAgeSeconds :: ChannelInviteOpts -> Maybe Integer
..} = [Pair] -> Value
object [(Key
name, Value
val) | (Key
name, Just Value
val) <-
[(Key
"max_age", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON (Integer -> Value) -> Maybe Integer -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Integer
channelInviteOptsMaxAgeSeconds),
(Key
"max_uses", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON (Integer -> Value) -> Maybe Integer -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Integer
channelInviteOptsMaxUsages),
(Key
"temporary", Bool -> Value
forall a. ToJSON a => a -> Value
toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Bool
channelInviteOptsIsTemporary),
(Key
"unique", Bool -> Value
forall a. ToJSON a => a -> Value
toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Bool
channelInviteOptsDontReuseSimilarInvite) ] ]
data ModifyChannelOpts = ModifyChannelOpts
{ ModifyChannelOpts -> Maybe Text
modifyChannelName :: Maybe T.Text
, ModifyChannelOpts -> Maybe Integer
modifyChannelPosition :: Maybe Integer
, ModifyChannelOpts -> Maybe Text
modifyChannelTopic :: Maybe T.Text
, ModifyChannelOpts -> Maybe Bool
modifyChannelNSFW :: Maybe Bool
, ModifyChannelOpts -> Maybe Integer
modifyChannelBitrate :: Maybe Integer
, ModifyChannelOpts -> Maybe Integer
modifyChannelUserRateLimit :: Maybe Integer
, ModifyChannelOpts -> Maybe [Overwrite]
modifyChannelPermissionOverwrites :: Maybe [Overwrite]
, ModifyChannelOpts -> Maybe StickerId
modifyChannelParentId :: Maybe ChannelId
} deriving (Int -> ModifyChannelOpts -> ShowS
[ModifyChannelOpts] -> ShowS
ModifyChannelOpts -> String
(Int -> ModifyChannelOpts -> ShowS)
-> (ModifyChannelOpts -> String)
-> ([ModifyChannelOpts] -> ShowS)
-> Show ModifyChannelOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyChannelOpts] -> ShowS
$cshowList :: [ModifyChannelOpts] -> ShowS
show :: ModifyChannelOpts -> String
$cshow :: ModifyChannelOpts -> String
showsPrec :: Int -> ModifyChannelOpts -> ShowS
$cshowsPrec :: Int -> ModifyChannelOpts -> ShowS
Show, ReadPrec [ModifyChannelOpts]
ReadPrec ModifyChannelOpts
Int -> ReadS ModifyChannelOpts
ReadS [ModifyChannelOpts]
(Int -> ReadS ModifyChannelOpts)
-> ReadS [ModifyChannelOpts]
-> ReadPrec ModifyChannelOpts
-> ReadPrec [ModifyChannelOpts]
-> Read ModifyChannelOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyChannelOpts]
$creadListPrec :: ReadPrec [ModifyChannelOpts]
readPrec :: ReadPrec ModifyChannelOpts
$creadPrec :: ReadPrec ModifyChannelOpts
readList :: ReadS [ModifyChannelOpts]
$creadList :: ReadS [ModifyChannelOpts]
readsPrec :: Int -> ReadS ModifyChannelOpts
$creadsPrec :: Int -> ReadS ModifyChannelOpts
Read, ModifyChannelOpts -> ModifyChannelOpts -> Bool
(ModifyChannelOpts -> ModifyChannelOpts -> Bool)
-> (ModifyChannelOpts -> ModifyChannelOpts -> Bool)
-> Eq ModifyChannelOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
$c/= :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
== :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
$c== :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
Eq, Eq ModifyChannelOpts
Eq ModifyChannelOpts
-> (ModifyChannelOpts -> ModifyChannelOpts -> Ordering)
-> (ModifyChannelOpts -> ModifyChannelOpts -> Bool)
-> (ModifyChannelOpts -> ModifyChannelOpts -> Bool)
-> (ModifyChannelOpts -> ModifyChannelOpts -> Bool)
-> (ModifyChannelOpts -> ModifyChannelOpts -> Bool)
-> (ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts)
-> (ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts)
-> Ord ModifyChannelOpts
ModifyChannelOpts -> ModifyChannelOpts -> Bool
ModifyChannelOpts -> ModifyChannelOpts -> Ordering
ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts
$cmin :: ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts
max :: ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts
$cmax :: ModifyChannelOpts -> ModifyChannelOpts -> ModifyChannelOpts
>= :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
$c>= :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
> :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
$c> :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
<= :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
$c<= :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
< :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
$c< :: ModifyChannelOpts -> ModifyChannelOpts -> Bool
compare :: ModifyChannelOpts -> ModifyChannelOpts -> Ordering
$ccompare :: ModifyChannelOpts -> ModifyChannelOpts -> Ordering
$cp1Ord :: Eq ModifyChannelOpts
Ord)
instance ToJSON ModifyChannelOpts where
toJSON :: ModifyChannelOpts -> Value
toJSON ModifyChannelOpts{Maybe Bool
Maybe Integer
Maybe [Overwrite]
Maybe Text
Maybe StickerId
modifyChannelParentId :: Maybe StickerId
modifyChannelPermissionOverwrites :: Maybe [Overwrite]
modifyChannelUserRateLimit :: Maybe Integer
modifyChannelBitrate :: Maybe Integer
modifyChannelNSFW :: Maybe Bool
modifyChannelTopic :: Maybe Text
modifyChannelPosition :: Maybe Integer
modifyChannelName :: Maybe Text
modifyChannelParentId :: ModifyChannelOpts -> Maybe StickerId
modifyChannelPermissionOverwrites :: ModifyChannelOpts -> Maybe [Overwrite]
modifyChannelUserRateLimit :: ModifyChannelOpts -> Maybe Integer
modifyChannelBitrate :: ModifyChannelOpts -> Maybe Integer
modifyChannelNSFW :: ModifyChannelOpts -> Maybe Bool
modifyChannelTopic :: ModifyChannelOpts -> Maybe Text
modifyChannelPosition :: ModifyChannelOpts -> Maybe Integer
modifyChannelName :: ModifyChannelOpts -> Maybe Text
..} = [Pair] -> Value
object [(Key
name, Value
val) | (Key
name, Just Value
val) <-
[(Key
"name", Text -> Value
forall a. ToJSON a => a -> Value
toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
modifyChannelName),
(Key
"position", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON (Integer -> Value) -> Maybe Integer -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Integer
modifyChannelPosition),
(Key
"topic", Text -> Value
forall a. ToJSON a => a -> Value
toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
modifyChannelTopic),
(Key
"nsfw", Bool -> Value
forall a. ToJSON a => a -> Value
toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Bool
modifyChannelNSFW),
(Key
"bitrate", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON (Integer -> Value) -> Maybe Integer -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Integer
modifyChannelBitrate),
(Key
"user_limit", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON (Integer -> Value) -> Maybe Integer -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Integer
modifyChannelUserRateLimit),
(Key
"permission_overwrites", [Overwrite] -> Value
forall a. ToJSON a => a -> Value
toJSON ([Overwrite] -> Value) -> Maybe [Overwrite] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe [Overwrite]
modifyChannelPermissionOverwrites),
(Key
"parent_id", StickerId -> Value
forall a. ToJSON a => a -> Value
toJSON (StickerId -> Value) -> Maybe StickerId -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe StickerId
modifyChannelParentId) ] ]
data ChannelPermissionsOpts = ChannelPermissionsOpts
{ ChannelPermissionsOpts -> Integer
channelPermissionsOptsAllow :: Integer
, ChannelPermissionsOpts -> Integer
channelPermissionsOptsDeny :: Integer
, ChannelPermissionsOpts -> ChannelPermissionsOptsType
channelPermissionsOptsType :: ChannelPermissionsOptsType
} deriving (Int -> ChannelPermissionsOpts -> ShowS
[ChannelPermissionsOpts] -> ShowS
ChannelPermissionsOpts -> String
(Int -> ChannelPermissionsOpts -> ShowS)
-> (ChannelPermissionsOpts -> String)
-> ([ChannelPermissionsOpts] -> ShowS)
-> Show ChannelPermissionsOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelPermissionsOpts] -> ShowS
$cshowList :: [ChannelPermissionsOpts] -> ShowS
show :: ChannelPermissionsOpts -> String
$cshow :: ChannelPermissionsOpts -> String
showsPrec :: Int -> ChannelPermissionsOpts -> ShowS
$cshowsPrec :: Int -> ChannelPermissionsOpts -> ShowS
Show, ReadPrec [ChannelPermissionsOpts]
ReadPrec ChannelPermissionsOpts
Int -> ReadS ChannelPermissionsOpts
ReadS [ChannelPermissionsOpts]
(Int -> ReadS ChannelPermissionsOpts)
-> ReadS [ChannelPermissionsOpts]
-> ReadPrec ChannelPermissionsOpts
-> ReadPrec [ChannelPermissionsOpts]
-> Read ChannelPermissionsOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelPermissionsOpts]
$creadListPrec :: ReadPrec [ChannelPermissionsOpts]
readPrec :: ReadPrec ChannelPermissionsOpts
$creadPrec :: ReadPrec ChannelPermissionsOpts
readList :: ReadS [ChannelPermissionsOpts]
$creadList :: ReadS [ChannelPermissionsOpts]
readsPrec :: Int -> ReadS ChannelPermissionsOpts
$creadsPrec :: Int -> ReadS ChannelPermissionsOpts
Read, ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
(ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool)
-> (ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool)
-> Eq ChannelPermissionsOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
$c/= :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
== :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
$c== :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
Eq, Eq ChannelPermissionsOpts
Eq ChannelPermissionsOpts
-> (ChannelPermissionsOpts -> ChannelPermissionsOpts -> Ordering)
-> (ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool)
-> (ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool)
-> (ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool)
-> (ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool)
-> (ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts)
-> (ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts)
-> Ord ChannelPermissionsOpts
ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
ChannelPermissionsOpts -> ChannelPermissionsOpts -> Ordering
ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts
$cmin :: ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts
max :: ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts
$cmax :: ChannelPermissionsOpts
-> ChannelPermissionsOpts -> ChannelPermissionsOpts
>= :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
$c>= :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
> :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
$c> :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
<= :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
$c<= :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
< :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
$c< :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Bool
compare :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Ordering
$ccompare :: ChannelPermissionsOpts -> ChannelPermissionsOpts -> Ordering
$cp1Ord :: Eq ChannelPermissionsOpts
Ord)
data ChannelPermissionsOptsType = ChannelPermissionsOptsUser
| ChannelPermissionsOptsRole
deriving (Int -> ChannelPermissionsOptsType -> ShowS
[ChannelPermissionsOptsType] -> ShowS
ChannelPermissionsOptsType -> String
(Int -> ChannelPermissionsOptsType -> ShowS)
-> (ChannelPermissionsOptsType -> String)
-> ([ChannelPermissionsOptsType] -> ShowS)
-> Show ChannelPermissionsOptsType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelPermissionsOptsType] -> ShowS
$cshowList :: [ChannelPermissionsOptsType] -> ShowS
show :: ChannelPermissionsOptsType -> String
$cshow :: ChannelPermissionsOptsType -> String
showsPrec :: Int -> ChannelPermissionsOptsType -> ShowS
$cshowsPrec :: Int -> ChannelPermissionsOptsType -> ShowS
Show, ReadPrec [ChannelPermissionsOptsType]
ReadPrec ChannelPermissionsOptsType
Int -> ReadS ChannelPermissionsOptsType
ReadS [ChannelPermissionsOptsType]
(Int -> ReadS ChannelPermissionsOptsType)
-> ReadS [ChannelPermissionsOptsType]
-> ReadPrec ChannelPermissionsOptsType
-> ReadPrec [ChannelPermissionsOptsType]
-> Read ChannelPermissionsOptsType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelPermissionsOptsType]
$creadListPrec :: ReadPrec [ChannelPermissionsOptsType]
readPrec :: ReadPrec ChannelPermissionsOptsType
$creadPrec :: ReadPrec ChannelPermissionsOptsType
readList :: ReadS [ChannelPermissionsOptsType]
$creadList :: ReadS [ChannelPermissionsOptsType]
readsPrec :: Int -> ReadS ChannelPermissionsOptsType
$creadsPrec :: Int -> ReadS ChannelPermissionsOptsType
Read, ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
(ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Bool)
-> Eq ChannelPermissionsOptsType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
$c/= :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
== :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
$c== :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
Eq, Eq ChannelPermissionsOptsType
Eq ChannelPermissionsOptsType
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Ordering)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Bool)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Bool)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Bool)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Bool)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType)
-> (ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType)
-> Ord ChannelPermissionsOptsType
ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Ordering
ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType
$cmin :: ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType
max :: ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType
$cmax :: ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> ChannelPermissionsOptsType
>= :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
$c>= :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
> :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
$c> :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
<= :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
$c<= :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
< :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
$c< :: ChannelPermissionsOptsType -> ChannelPermissionsOptsType -> Bool
compare :: ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Ordering
$ccompare :: ChannelPermissionsOptsType
-> ChannelPermissionsOptsType -> Ordering
$cp1Ord :: Eq ChannelPermissionsOptsType
Ord)
instance ToJSON ChannelPermissionsOptsType where
toJSON :: ChannelPermissionsOptsType -> Value
toJSON ChannelPermissionsOptsType
t = case ChannelPermissionsOptsType
t of ChannelPermissionsOptsType
ChannelPermissionsOptsUser -> Text -> Value
String Text
"member"
ChannelPermissionsOptsType
ChannelPermissionsOptsRole -> Text -> Value
String Text
"role"
instance ToJSON ChannelPermissionsOpts where
toJSON :: ChannelPermissionsOpts -> Value
toJSON (ChannelPermissionsOpts Integer
a Integer
d ChannelPermissionsOptsType
t) = [Pair] -> Value
object [ (Key
"allow", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON Integer
a )
, (Key
"deny", Integer -> Value
forall a. ToJSON a => a -> Value
toJSON Integer
d)
, (Key
"type", ChannelPermissionsOptsType -> Value
forall a. ToJSON a => a -> Value
toJSON ChannelPermissionsOptsType
t)]
data GroupDMAddRecipientOpts = GroupDMAddRecipientOpts
{ GroupDMAddRecipientOpts -> StickerId
groupDMAddRecipientUserToAdd :: UserId
, GroupDMAddRecipientOpts -> Text
groupDMAddRecipientUserToAddNickName :: T.Text
, GroupDMAddRecipientOpts -> Text
groupDMAddRecipientGDMJoinAccessToken :: T.Text
} deriving (Int -> GroupDMAddRecipientOpts -> ShowS
[GroupDMAddRecipientOpts] -> ShowS
GroupDMAddRecipientOpts -> String
(Int -> GroupDMAddRecipientOpts -> ShowS)
-> (GroupDMAddRecipientOpts -> String)
-> ([GroupDMAddRecipientOpts] -> ShowS)
-> Show GroupDMAddRecipientOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupDMAddRecipientOpts] -> ShowS
$cshowList :: [GroupDMAddRecipientOpts] -> ShowS
show :: GroupDMAddRecipientOpts -> String
$cshow :: GroupDMAddRecipientOpts -> String
showsPrec :: Int -> GroupDMAddRecipientOpts -> ShowS
$cshowsPrec :: Int -> GroupDMAddRecipientOpts -> ShowS
Show, ReadPrec [GroupDMAddRecipientOpts]
ReadPrec GroupDMAddRecipientOpts
Int -> ReadS GroupDMAddRecipientOpts
ReadS [GroupDMAddRecipientOpts]
(Int -> ReadS GroupDMAddRecipientOpts)
-> ReadS [GroupDMAddRecipientOpts]
-> ReadPrec GroupDMAddRecipientOpts
-> ReadPrec [GroupDMAddRecipientOpts]
-> Read GroupDMAddRecipientOpts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GroupDMAddRecipientOpts]
$creadListPrec :: ReadPrec [GroupDMAddRecipientOpts]
readPrec :: ReadPrec GroupDMAddRecipientOpts
$creadPrec :: ReadPrec GroupDMAddRecipientOpts
readList :: ReadS [GroupDMAddRecipientOpts]
$creadList :: ReadS [GroupDMAddRecipientOpts]
readsPrec :: Int -> ReadS GroupDMAddRecipientOpts
$creadsPrec :: Int -> ReadS GroupDMAddRecipientOpts
Read, GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
(GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool)
-> (GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool)
-> Eq GroupDMAddRecipientOpts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
$c/= :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
== :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
$c== :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
Eq, Eq GroupDMAddRecipientOpts
Eq GroupDMAddRecipientOpts
-> (GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Ordering)
-> (GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool)
-> (GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool)
-> (GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool)
-> (GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool)
-> (GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts)
-> (GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts)
-> Ord GroupDMAddRecipientOpts
GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Ordering
GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts
$cmin :: GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts
max :: GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts
$cmax :: GroupDMAddRecipientOpts
-> GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts
>= :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
$c>= :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
> :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
$c> :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
<= :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
$c<= :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
< :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
$c< :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Bool
compare :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Ordering
$ccompare :: GroupDMAddRecipientOpts -> GroupDMAddRecipientOpts -> Ordering
$cp1Ord :: Eq GroupDMAddRecipientOpts
Ord)
channelMajorRoute :: ChannelRequest a -> String
channelMajorRoute :: ChannelRequest a -> String
channelMajorRoute ChannelRequest a
c = case ChannelRequest a
c of
(GetChannel StickerId
chan) -> String
"get_chan " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(ModifyChannel StickerId
chan ModifyChannelOpts
_) -> String
"mod_chan " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteChannel StickerId
chan) -> String
"mod_chan " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GetChannelMessages StickerId
chan (Int, MessageTiming)
_) -> String
"msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GetChannelMessage (StickerId
chan, StickerId
_)) -> String
"get_msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(CreateMessage StickerId
chan Text
_) -> String
"msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(CreateMessageUploadFile StickerId
chan Text
_ ByteString
_) -> String
"msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(CreateMessageDetailed StickerId
chan MessageDetailedOpts
_) -> String
"msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(CreateReaction (StickerId
chan, StickerId
_) Text
_) -> String
"add_react " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteOwnReaction (StickerId
chan, StickerId
_) Text
_) -> String
"react " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteUserReaction (StickerId
chan, StickerId
_) StickerId
_ Text
_) -> String
"react " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteSingleReaction (StickerId
chan, StickerId
_) Text
_) -> String
"react " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GetReactions (StickerId
chan, StickerId
_) Text
_ (Int, ReactionTiming)
_) -> String
"react " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteAllReactions (StickerId
chan, StickerId
_)) -> String
"react " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(EditMessage (StickerId
chan, StickerId
_) Text
_ Maybe CreateEmbed
_) -> String
"get_msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteMessage (StickerId
chan, StickerId
_)) -> String
"get_msg " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(BulkDeleteMessage (StickerId
chan, [StickerId]
_)) -> String
"del_msgs " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(EditChannelPermissions StickerId
chan StickerId
_ ChannelPermissionsOpts
_) -> String
"perms " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GetChannelInvites StickerId
chan) -> String
"invites " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(CreateChannelInvite StickerId
chan ChannelInviteOpts
_) -> String
"invites " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeleteChannelPermission StickerId
chan StickerId
_) -> String
"perms " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(TriggerTypingIndicator StickerId
chan) -> String
"tti " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GetPinnedMessages StickerId
chan) -> String
"pins " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(AddPinnedMessage (StickerId
chan, StickerId
_)) -> String
"pin " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(DeletePinnedMessage (StickerId
chan, StickerId
_)) -> String
"pin " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GroupDMAddRecipient StickerId
chan GroupDMAddRecipientOpts
_) -> String
"groupdm " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
(GroupDMRemoveRecipient StickerId
chan StickerId
_) -> String
"groupdm " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> StickerId -> String
forall a. Show a => a -> String
show StickerId
chan
cleanupEmoji :: T.Text -> T.Text
cleanupEmoji :: Text -> Text
cleanupEmoji Text
emoji =
let noAngles :: Text
noAngles = Text -> Text -> Text -> Text
T.replace Text
"<" Text
"" (Text -> Text -> Text -> Text
T.replace Text
">" Text
"" Text
emoji)
byName :: Maybe Text
byName = String -> Text
T.pack (String -> Text) -> Maybe String -> Maybe Text
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> Maybe String
unicodeByName (Text -> String
T.unpack (Text -> Text -> Text -> Text
T.replace Text
":" Text
"" Text
emoji))
in case (Maybe Text
byName, Text -> Text -> Maybe Text
T.stripPrefix Text
":" Text
noAngles) of
(Just Text
e, Maybe Text
_) -> Text
e
(Maybe Text
_, Just Text
a) -> Text
"custom:" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
a
(Maybe Text
_, Maybe Text
Nothing) -> Text
noAngles
channels :: R.Url 'R.Https
channels :: Url 'Https
channels = Url 'Https
baseUrl Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"channels"
channelJsonRequest :: ChannelRequest r -> JsonRequest
channelJsonRequest :: ChannelRequest r -> JsonRequest
channelJsonRequest ChannelRequest r
c = case ChannelRequest r
c of
(GetChannel StickerId
chan) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan) Option 'Https
forall a. Monoid a => a
mempty
(ModifyChannel StickerId
chan ModifyChannelOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson ModifyChannelOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan) (ReqBodyJson ModifyChannelOpts
-> RestIO (ReqBodyJson ModifyChannelOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ModifyChannelOpts -> ReqBodyJson ModifyChannelOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ModifyChannelOpts
patch)) Option 'Https
forall a. Monoid a => a
mempty
(DeleteChannel StickerId
chan) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan) Option 'Https
forall a. Monoid a => a
mempty
(GetChannelMessages StickerId
chan (Int
n,MessageTiming
timing)) ->
let n' :: Int
n' = 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)
options :: Option 'Https
options = Text
"limit" Text -> Int -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Int
n' Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> MessageTiming -> Option 'Https
messageTimingToQuery MessageTiming
timing
in Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages") Option 'Https
options
(GetChannelMessage (StickerId
chan, StickerId
msg)) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msg) Option 'Https
forall a. Monoid a => a
mempty
(CreateMessage StickerId
chan Text
msg) ->
let content :: [Pair]
content = [Key
"content" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
msg]
body :: RestIO (ReqBodyJson Value)
body = ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ReqBodyJson Value -> RestIO (ReqBodyJson Value))
-> ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall a b. (a -> b) -> a -> b
$ Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> ReqBodyJson Value) -> Value -> ReqBodyJson Value
forall a b. (a -> b) -> a -> b
$ [Pair] -> Value
object [Pair]
content
in Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages") RestIO (ReqBodyJson Value)
body Option 'Https
forall a. Monoid a => a
mempty
(CreateMessageUploadFile StickerId
chan Text
fileName ByteString
file) ->
let part :: PartM IO
part = Text -> String -> RequestBody -> PartM IO
forall (m :: * -> *).
Applicative m =>
Text -> String -> RequestBody -> PartM m
partFileRequestBody Text
"file" (Text -> String
T.unpack Text
fileName) (RequestBody -> PartM IO) -> RequestBody -> PartM IO
forall a b. (a -> b) -> a -> b
$ ByteString -> RequestBody
RequestBodyBS ByteString
file
body :: RestIO ReqBodyMultipart
body = [PartM IO] -> RestIO ReqBodyMultipart
forall (m :: * -> *). MonadIO m => [PartM IO] -> m ReqBodyMultipart
R.reqBodyMultipart [PartM IO
part]
in Url 'Https
-> RestIO ReqBodyMultipart -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages") RestIO ReqBodyMultipart
body Option 'Https
forall a. Monoid a => a
mempty
(CreateMessageDetailed StickerId
chan MessageDetailedOpts
msgOpts) ->
let fileUpload :: Maybe (Text, ByteString)
fileUpload = MessageDetailedOpts -> Maybe (Text, ByteString)
messageDetailedFile MessageDetailedOpts
msgOpts
filePart :: [PartM IO]
filePart =
( case Maybe (Text, ByteString)
fileUpload of
Maybe (Text, ByteString)
Nothing -> []
Just (Text, ByteString)
f ->
[ Text -> String -> RequestBody -> PartM IO
forall (m :: * -> *).
Applicative m =>
Text -> String -> RequestBody -> PartM m
partFileRequestBody
Text
"file"
(Text -> String
T.unpack (Text -> String) -> Text -> String
forall a b. (a -> b) -> a -> b
$ (Text, ByteString) -> Text
forall a b. (a, b) -> a
fst (Text, ByteString)
f)
(ByteString -> RequestBody
RequestBodyBS (ByteString -> RequestBody) -> ByteString -> RequestBody
forall a b. (a -> b) -> a -> b
$ (Text, ByteString) -> ByteString
forall a b. (a, b) -> b
snd (Text, ByteString)
f)
]
)
[PartM IO] -> [PartM IO] -> [PartM IO]
forall a. [a] -> [a] -> [a]
++ [[PartM IO]] -> [PartM IO]
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join ([[PartM IO]]
-> ([CreateEmbed] -> [[PartM IO]])
-> Maybe [CreateEmbed]
-> [[PartM IO]]
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] (Maybe CreateEmbed -> [PartM IO]
maybeEmbed (Maybe CreateEmbed -> [PartM IO])
-> (CreateEmbed -> Maybe CreateEmbed) -> CreateEmbed -> [PartM IO]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CreateEmbed -> Maybe CreateEmbed
forall a. a -> Maybe a
Just (CreateEmbed -> [PartM IO]) -> [CreateEmbed] -> [[PartM IO]]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>) (MessageDetailedOpts -> Maybe [CreateEmbed]
messageDetailedEmbeds MessageDetailedOpts
msgOpts))
payloadData :: Value
payloadData = [Pair] -> Value
object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [ Key
"content" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= MessageDetailedOpts -> Text
messageDetailedContent MessageDetailedOpts
msgOpts
, Key
"tts" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= MessageDetailedOpts -> Bool
messageDetailedTTS MessageDetailedOpts
msgOpts ] [Pair] -> [Pair] -> [Pair]
forall a. [a] -> [a] -> [a]
++
[ Key
name Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Value
value | (Key
name, Just Value
value) <-
[ (Key
"embeds", [Embed] -> Value
forall a. ToJSON a => a -> Value
toJSON ([Embed] -> Value)
-> ([CreateEmbed] -> [Embed]) -> [CreateEmbed] -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CreateEmbed -> Embed
createEmbed (CreateEmbed -> Embed) -> [CreateEmbed] -> [Embed]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>) ([CreateEmbed] -> Value) -> Maybe [CreateEmbed] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> MessageDetailedOpts -> Maybe [CreateEmbed]
messageDetailedEmbeds MessageDetailedOpts
msgOpts)
, (Key
"allowed_mentions", AllowedMentions -> Value
forall a. ToJSON a => a -> Value
toJSON (AllowedMentions -> Value) -> Maybe AllowedMentions -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> MessageDetailedOpts -> Maybe AllowedMentions
messageDetailedAllowedMentions MessageDetailedOpts
msgOpts)
, (Key
"message_reference", MessageReference -> Value
forall a. ToJSON a => a -> Value
toJSON (MessageReference -> Value)
-> Maybe MessageReference -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> MessageDetailedOpts -> Maybe MessageReference
messageDetailedReference MessageDetailedOpts
msgOpts)
, (Key
"components", [ComponentActionRow] -> Value
forall a. ToJSON a => a -> Value
toJSON ([ComponentActionRow] -> Value)
-> Maybe [ComponentActionRow] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> MessageDetailedOpts -> Maybe [ComponentActionRow]
messageDetailedComponents MessageDetailedOpts
msgOpts)
, (Key
"sticker_ids", [StickerId] -> Value
forall a. ToJSON a => a -> Value
toJSON ([StickerId] -> Value) -> Maybe [StickerId] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> MessageDetailedOpts -> Maybe [StickerId]
messageDetailedStickerIds MessageDetailedOpts
msgOpts)
] ]
payloadPart :: PartM IO
payloadPart = Text -> ByteString -> PartM IO
forall (m :: * -> *).
Applicative m =>
Text -> ByteString -> PartM m
partBS Text
"payload_json" (ByteString -> PartM IO) -> ByteString -> PartM IO
forall a b. (a -> b) -> a -> b
$ ByteString -> ByteString
BL.toStrict (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
$ Value -> ByteString
forall a. ToJSON a => a -> ByteString
encode Value
payloadData
body :: RestIO ReqBodyMultipart
body = [PartM IO] -> RestIO ReqBodyMultipart
forall (m :: * -> *). MonadIO m => [PartM IO] -> m ReqBodyMultipart
R.reqBodyMultipart (PartM IO
payloadPart PartM IO -> [PartM IO] -> [PartM IO]
forall a. a -> [a] -> [a]
: [PartM IO]
filePart)
in Url 'Https
-> RestIO ReqBodyMultipart -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages") RestIO ReqBodyMultipart
body Option 'Https
forall a. Monoid a => a
mempty
(CreateReaction (StickerId
chan, StickerId
msgid) Text
emoji) ->
let e :: Text
e = Text -> Text
cleanupEmoji Text
emoji
in Url 'Https -> NoReqBody -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msgid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"reactions" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
e Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"@me" )
NoReqBody
R.NoReqBody Option 'Https
forall a. Monoid a => a
mempty
(DeleteOwnReaction (StickerId
chan, StickerId
msgid) Text
emoji) ->
let e :: Text
e = Text -> Text
cleanupEmoji Text
emoji
in Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msgid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"reactions" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
e Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"@me" ) Option 'Https
forall a. Monoid a => a
mempty
(DeleteUserReaction (StickerId
chan, StickerId
msgid) StickerId
uID Text
emoji) ->
let e :: Text
e = Text -> Text
cleanupEmoji Text
emoji
in Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msgid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"reactions" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
e Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
uID ) Option 'Https
forall a. Monoid a => a
mempty
(DeleteSingleReaction (StickerId
chan, StickerId
msgid) Text
emoji) ->
let e :: Text
e = Text -> Text
cleanupEmoji Text
emoji
in Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msgid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"reactions" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
e) Option 'Https
forall a. Monoid a => a
mempty
(GetReactions (StickerId
chan, StickerId
msgid) Text
emoji (Int
n, ReactionTiming
timing)) ->
let e :: Text
e = Text -> Text
cleanupEmoji Text
emoji
n' :: Int
n' = 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)
options :: Option 'Https
options = Text
"limit" Text -> Int -> Option 'Https
forall param a.
(QueryParam param, ToHttpApiData a) =>
Text -> a -> param
R.=: Int
n' Option 'Https -> Option 'Https -> Option 'Https
forall a. Semigroup a => a -> a -> a
<> ReactionTiming -> Option 'Https
reactionTimingToQuery ReactionTiming
timing
in Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msgid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"reactions" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
e) Option 'Https
options
(DeleteAllReactions (StickerId
chan, StickerId
msgid)) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msgid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"reactions" ) Option 'Https
forall a. Monoid a => a
mempty
(EditMessage (StickerId
chan, StickerId
msg) Text
new Maybe CreateEmbed
embed) ->
let partJson :: Value
partJson = Value -> Value
forall a. ToJSON a => a -> Value
toJSON (Value -> Value) -> Value -> Value
forall a b. (a -> b) -> a -> b
$ [Pair] -> Value
object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [Key
"content" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= Text
new] [Pair] -> [Pair] -> [Pair]
forall a. [a] -> [a] -> [a]
++ case Maybe CreateEmbed
embed of
Just CreateEmbed
e -> [Key
"embed" Key -> Embed -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= CreateEmbed -> Embed
createEmbed CreateEmbed
e]
Maybe CreateEmbed
Nothing -> []
body :: RestIO (ReqBodyJson Value)
body = ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson Value
partJson)
in Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msg) RestIO (ReqBodyJson Value)
body Option 'Https
forall a. Monoid a => a
mempty
(DeleteMessage (StickerId
chan, StickerId
msg)) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msg) Option 'Https
forall a. Monoid a => a
mempty
(BulkDeleteMessage (StickerId
chan, [StickerId]
msgs)) ->
let body :: RestIO (ReqBodyJson Value)
body = ReqBodyJson Value -> RestIO (ReqBodyJson Value)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ReqBodyJson Value -> RestIO (ReqBodyJson Value))
-> (Value -> ReqBodyJson Value)
-> Value
-> RestIO (ReqBodyJson Value)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> RestIO (ReqBodyJson Value))
-> Value -> RestIO (ReqBodyJson Value)
forall a b. (a -> b) -> a -> b
$ [Pair] -> Value
object [Key
"messages" Key -> [StickerId] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
.= [StickerId]
msgs]
in Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"messages" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"bulk-delete") RestIO (ReqBodyJson Value)
body Option 'Https
forall a. Monoid a => a
mempty
(EditChannelPermissions StickerId
chan StickerId
perm ChannelPermissionsOpts
patch) ->
Url 'Https
-> ReqBodyJson ChannelPermissionsOpts
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"permissions" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
perm) (ChannelPermissionsOpts -> ReqBodyJson ChannelPermissionsOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ChannelPermissionsOpts
patch) Option 'Https
forall a. Monoid a => a
mempty
(GetChannelInvites StickerId
chan) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"invites") Option 'Https
forall a. Monoid a => a
mempty
(CreateChannelInvite StickerId
chan ChannelInviteOpts
patch) ->
Url 'Https
-> RestIO (ReqBodyJson ChannelInviteOpts)
-> Option 'Https
-> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"invites") (ReqBodyJson ChannelInviteOpts
-> RestIO (ReqBodyJson ChannelInviteOpts)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChannelInviteOpts -> ReqBodyJson ChannelInviteOpts
forall a. a -> ReqBodyJson a
R.ReqBodyJson ChannelInviteOpts
patch)) Option 'Https
forall a. Monoid a => a
mempty
(DeleteChannelPermission StickerId
chan StickerId
perm) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"permissions" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
perm) Option 'Https
forall a. Monoid a => a
mempty
(TriggerTypingIndicator StickerId
chan) ->
Url 'Https -> RestIO NoReqBody -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"typing") (NoReqBody -> RestIO NoReqBody
forall (f :: * -> *) a. Applicative f => a -> f a
pure NoReqBody
R.NoReqBody) Option 'Https
forall a. Monoid a => a
mempty
(GetPinnedMessages StickerId
chan) ->
Url 'Https -> Option 'Https -> JsonRequest
Get (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"pins") Option 'Https
forall a. Monoid a => a
mempty
(AddPinnedMessage (StickerId
chan, StickerId
msg)) ->
Url 'Https -> NoReqBody -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"pins" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msg) NoReqBody
R.NoReqBody Option 'Https
forall a. Monoid a => a
mempty
(DeletePinnedMessage (StickerId
chan, StickerId
msg)) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"pins" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
msg) Option 'Https
forall a. Monoid a => a
mempty
(GroupDMAddRecipient StickerId
chan (GroupDMAddRecipientOpts StickerId
uid Text
nick Text
tok)) ->
Url 'Https -> ReqBodyJson Value -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"recipients" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
uid)
(Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson ([Pair] -> Value
object [ (Key
"access_token", Text -> Value
forall a. ToJSON a => a -> Value
toJSON Text
tok)
, (Key
"nick", Text -> Value
forall a. ToJSON a => a -> Value
toJSON Text
nick)]))
Option 'Https
forall a. Monoid a => a
mempty
(GroupDMRemoveRecipient StickerId
chan StickerId
userid) ->
Url 'Https -> Option 'Https -> JsonRequest
Delete (Url 'Https
channels Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
chan Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"recipients" Url 'Https -> StickerId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// StickerId
userid) Option 'Https
forall a. Monoid a => a
mempty