{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}

module Discord.Internal.Rest.ApplicationCommands where

import Data.Aeson (Value)
import Discord.Internal.Rest.Prelude
import Discord.Internal.Types
import Discord.Internal.Types.ApplicationCommands
    ( ApplicationCommandPermissions,
      GuildApplicationCommandPermissions(GuildApplicationCommandPermissions),
      EditApplicationCommand,
      CreateApplicationCommand,
      ApplicationCommand )
import Network.HTTP.Req as R

instance Request (ApplicationCommandRequest a) where
  jsonRequest :: ApplicationCommandRequest a -> JsonRequest
jsonRequest = ApplicationCommandRequest a -> JsonRequest
forall a. ApplicationCommandRequest a -> JsonRequest
applicationCommandJsonRequest
  majorRoute :: ApplicationCommandRequest a -> String
majorRoute = ApplicationCommandRequest a -> String
forall a. ApplicationCommandRequest a -> String
applicationCommandMajorRoute

data ApplicationCommandRequest a where
  GetGlobalApplicationCommands :: ApplicationId -> ApplicationCommandRequest [ApplicationCommand]
  CreateGlobalApplicationCommand :: ApplicationId -> CreateApplicationCommand -> ApplicationCommandRequest ApplicationCommand
  GetGlobalApplicationCommand :: ApplicationId -> ApplicationCommandId -> ApplicationCommandRequest ApplicationCommand
  EditGlobalApplicationCommand :: ApplicationId -> ApplicationCommandId -> EditApplicationCommand -> ApplicationCommandRequest ApplicationCommand
  DeleteGlobalApplicationCommand :: ApplicationId -> ApplicationCommandId -> ApplicationCommandRequest ()
  BulkOverWriteGlobalApplicationCommand :: ApplicationId -> [CreateApplicationCommand] -> ApplicationCommandRequest ()
  GetGuildApplicationCommands :: ApplicationId -> GuildId -> ApplicationCommandRequest [ApplicationCommand]
  CreateGuildApplicationCommand :: ApplicationId -> GuildId -> CreateApplicationCommand -> ApplicationCommandRequest ApplicationCommand
  GetGuildApplicationCommand :: ApplicationId -> GuildId -> ApplicationCommandId -> ApplicationCommandRequest ApplicationCommand
  EditGuildApplicationCommand :: ApplicationId -> GuildId -> ApplicationCommandId -> CreateApplicationCommand -> ApplicationCommandRequest ApplicationCommand
  DeleteGuildApplicationCommand :: ApplicationId -> GuildId -> ApplicationCommandId -> ApplicationCommandRequest ()
  BulkOverWriteGuildApplicationCommand :: ApplicationId -> GuildId -> [CreateApplicationCommand] -> ApplicationCommandRequest ()
  GetGuildApplicationCommandPermissions :: ApplicationId -> GuildId -> ApplicationCommandRequest GuildApplicationCommandPermissions
  GetApplicationCommandPermissions :: ApplicationId -> GuildId -> ApplicationCommandId -> ApplicationCommandRequest GuildApplicationCommandPermissions
  EditApplicationCommandPermissions :: ApplicationId -> GuildId -> ApplicationCommandId -> [ApplicationCommandPermissions] -> ApplicationCommandRequest GuildApplicationCommandPermissions
  -- | The only parameters needed in the GuildApplicationCommandPermissions
  -- objects are id and permissions.
  BatchEditApplicationCommandPermissions :: ApplicationId -> GuildId -> [GuildApplicationCommandPermissions] -> ApplicationCommandRequest [GuildApplicationCommandPermissions]

applications :: ApplicationId -> R.Url 'R.Https
applications :: ApplicationId -> Url 'Https
applications ApplicationId
s = Url 'Https
baseUrl Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"applications" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
s

applicationCommandMajorRoute :: ApplicationCommandRequest a -> String
applicationCommandMajorRoute :: ApplicationCommandRequest a -> String
applicationCommandMajorRoute ApplicationCommandRequest a
a = case ApplicationCommandRequest a
a of
  (GetGlobalApplicationCommands ApplicationId
aid) -> String
"get_glob_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (CreateGlobalApplicationCommand ApplicationId
aid CreateApplicationCommand
_) -> String
"write_glob_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (GetGlobalApplicationCommand ApplicationId
aid ApplicationId
_) -> String
"get_glob_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (EditGlobalApplicationCommand ApplicationId
aid ApplicationId
_ EditApplicationCommand
_) -> String
"write_glob_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (DeleteGlobalApplicationCommand ApplicationId
aid ApplicationId
_) -> String
"write_glob_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (BulkOverWriteGlobalApplicationCommand ApplicationId
aid [CreateApplicationCommand]
_) -> String
"write_glob_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (GetGuildApplicationCommands ApplicationId
aid ApplicationId
_) -> String
"get_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (CreateGuildApplicationCommand ApplicationId
aid ApplicationId
_ CreateApplicationCommand
_) -> String
"write_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (GetGuildApplicationCommand ApplicationId
aid ApplicationId
_ ApplicationId
_) -> String
"get_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (EditGuildApplicationCommand ApplicationId
aid ApplicationId
_ ApplicationId
_ CreateApplicationCommand
_) -> String
"write_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (DeleteGuildApplicationCommand ApplicationId
aid ApplicationId
_ ApplicationId
_) -> String
"write_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (BulkOverWriteGuildApplicationCommand ApplicationId
aid ApplicationId
_ [CreateApplicationCommand]
_) -> String
"write_appcomm" String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (GetGuildApplicationCommandPermissions ApplicationId
aid ApplicationId
_) -> String
"appcom_perm " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (GetApplicationCommandPermissions ApplicationId
aid ApplicationId
_ ApplicationId
_) -> String
"appcom_perm " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (EditApplicationCommandPermissions ApplicationId
aid ApplicationId
_ ApplicationId
_ [ApplicationCommandPermissions]
_) -> String
"appcom_perm " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid
  (BatchEditApplicationCommandPermissions ApplicationId
aid ApplicationId
_ [GuildApplicationCommandPermissions]
_) -> String
"appcom_perm " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> ApplicationId -> String
forall a. Show a => a -> String
show ApplicationId
aid

applicationCommandJsonRequest :: ApplicationCommandRequest a -> JsonRequest
applicationCommandJsonRequest :: ApplicationCommandRequest a -> JsonRequest
applicationCommandJsonRequest ApplicationCommandRequest a
a = case ApplicationCommandRequest a
a of
  (GetGlobalApplicationCommands ApplicationId
aid) ->
    Url 'Https -> Option 'Https -> JsonRequest
Get (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands") Option 'Https
forall a. Monoid a => a
mempty
  (CreateGlobalApplicationCommand ApplicationId
aid CreateApplicationCommand
cac) ->
    Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands") (CreateApplicationCommand -> RestIO (ReqBodyJson Value)
forall a. ToJSON a => a -> RestIO (ReqBodyJson Value)
convert CreateApplicationCommand
cac) Option 'Https
forall a. Monoid a => a
mempty
  (GetGlobalApplicationCommand ApplicationId
aid ApplicationId
aci) ->
    Url 'Https -> Option 'Https -> JsonRequest
Get (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
aci) Option 'Https
forall a. Monoid a => a
mempty
  (EditGlobalApplicationCommand ApplicationId
aid ApplicationId
aci EditApplicationCommand
eac) ->
    Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
aci) (EditApplicationCommand -> RestIO (ReqBodyJson Value)
forall a. ToJSON a => a -> RestIO (ReqBodyJson Value)
convert EditApplicationCommand
eac) Option 'Https
forall a. Monoid a => a
mempty
  (DeleteGlobalApplicationCommand ApplicationId
aid ApplicationId
aci) ->
    Url 'Https -> Option 'Https -> JsonRequest
Delete (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
aci) Option 'Https
forall a. Monoid a => a
mempty
  (BulkOverWriteGlobalApplicationCommand ApplicationId
aid [CreateApplicationCommand]
cacs) ->
    Url 'Https -> ReqBodyJson Value -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands") (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> ReqBodyJson Value) -> Value -> ReqBodyJson Value
forall a b. (a -> b) -> a -> b
$ [CreateApplicationCommand] -> Value
forall a. ToJSON a => a -> Value
toJSON [CreateApplicationCommand]
cacs) Option 'Https
forall a. Monoid a => a
mempty
  (GetGuildApplicationCommands ApplicationId
aid ApplicationId
gid) ->
    Url 'Https -> Option 'Https -> JsonRequest
Get (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands") Option 'Https
forall a. Monoid a => a
mempty
  (CreateGuildApplicationCommand ApplicationId
aid ApplicationId
gid CreateApplicationCommand
cac) ->
    Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Post (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands") (CreateApplicationCommand -> RestIO (ReqBodyJson Value)
forall a. ToJSON a => a -> RestIO (ReqBodyJson Value)
convert CreateApplicationCommand
cac) Option 'Https
forall a. Monoid a => a
mempty
  (GetGuildApplicationCommand ApplicationId
aid ApplicationId
gid ApplicationId
aci) ->
    Url 'Https -> Option 'Https -> JsonRequest
Get (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
aci) Option 'Https
forall a. Monoid a => a
mempty
  (EditGuildApplicationCommand ApplicationId
aid ApplicationId
gid ApplicationId
aci CreateApplicationCommand
eac) ->
    Url 'Https
-> RestIO (ReqBodyJson Value) -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> RestIO a -> Option 'Https -> JsonRequest
Patch (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
aci) (CreateApplicationCommand -> RestIO (ReqBodyJson Value)
forall a. ToJSON a => a -> RestIO (ReqBodyJson Value)
convert CreateApplicationCommand
eac) Option 'Https
forall a. Monoid a => a
mempty
  (DeleteGuildApplicationCommand ApplicationId
aid ApplicationId
gid ApplicationId
aci) ->
    Url 'Https -> Option 'Https -> JsonRequest
Delete (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
aci) Option 'Https
forall a. Monoid a => a
mempty
  (BulkOverWriteGuildApplicationCommand ApplicationId
aid ApplicationId
gid [CreateApplicationCommand]
cacs) ->
    Url 'Https -> ReqBodyJson Value -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands") (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> ReqBodyJson Value) -> Value -> ReqBodyJson Value
forall a b. (a -> b) -> a -> b
$ [CreateApplicationCommand] -> Value
forall a. ToJSON a => a -> Value
toJSON [CreateApplicationCommand]
cacs) Option 'Https
forall a. Monoid a => a
mempty
  (GetGuildApplicationCommandPermissions ApplicationId
aid ApplicationId
gid) ->
    Url 'Https -> Option 'Https -> JsonRequest
Get (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"permissions") Option 'Https
forall a. Monoid a => a
mempty
  (GetApplicationCommandPermissions ApplicationId
aid ApplicationId
gid ApplicationId
cid) ->
    Url 'Https -> Option 'Https -> JsonRequest
Get (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
cid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"permissions") Option 'Https
forall a. Monoid a => a
mempty
  (EditApplicationCommandPermissions ApplicationId
aid ApplicationId
gid ApplicationId
cid [ApplicationCommandPermissions]
ps) ->
    Url 'Https -> ReqBodyJson Value -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
cid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"permissions") (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> ReqBodyJson Value) -> Value -> ReqBodyJson Value
forall a b. (a -> b) -> a -> b
$ GuildApplicationCommandPermissions -> Value
forall a. ToJSON a => a -> Value
toJSON (ApplicationId
-> ApplicationId
-> ApplicationId
-> [ApplicationCommandPermissions]
-> GuildApplicationCommandPermissions
GuildApplicationCommandPermissions ApplicationId
aid ApplicationId
cid ApplicationId
gid [ApplicationCommandPermissions]
ps)) Option 'Https
forall a. Monoid a => a
mempty
  (BatchEditApplicationCommandPermissions ApplicationId
aid ApplicationId
gid [GuildApplicationCommandPermissions]
ps) ->
    Url 'Https -> ReqBodyJson Value -> Option 'Https -> JsonRequest
forall a.
HttpBody a =>
Url 'Https -> a -> Option 'Https -> JsonRequest
Put (ApplicationId -> Url 'Https
applications ApplicationId
aid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"guilds" Url 'Https -> ApplicationId -> Url 'Https
forall a (scheme :: Scheme).
Show a =>
Url scheme -> a -> Url scheme
// ApplicationId
gid Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"commands" Url 'Https -> Text -> Url 'Https
forall (scheme :: Scheme). Url scheme -> Text -> Url scheme
/: Text
"permissions") (Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> ReqBodyJson Value) -> Value -> ReqBodyJson Value
forall a b. (a -> b) -> a -> b
$ [GuildApplicationCommandPermissions] -> Value
forall a. ToJSON a => a -> Value
toJSON [GuildApplicationCommandPermissions]
ps) Option 'Https
forall a. Monoid a => a
mempty
  where
    convert :: (ToJSON a) => a -> RestIO (ReqBodyJson Value)
    convert :: a -> RestIO (ReqBodyJson Value)
convert = (forall a. Applicative RestIO => a -> RestIO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure @RestIO) (ReqBodyJson Value -> RestIO (ReqBodyJson Value))
-> (a -> ReqBodyJson Value) -> a -> RestIO (ReqBodyJson Value)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> ReqBodyJson Value
forall a. a -> ReqBodyJson a
R.ReqBodyJson (Value -> ReqBodyJson Value)
-> (a -> Value) -> a -> ReqBodyJson Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Value
forall a. ToJSON a => a -> Value
toJSON