{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.SetStickerEmojiList where

import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Proxy
import Data.Text
import GHC.Generics (Generic)
import Servant.API
import Servant.Client hiding (Response)

import Telegram.Bot.API.Internal.Utils
import Telegram.Bot.API.MakingRequests
import Telegram.Bot.API.Internal.TH

-- ** 'setStickerEmojiList'

-- | Request parameters for 'setStickerEmojiList'.
data SetStickerEmojiListRequest = SetStickerEmojiListRequest
  { SetStickerEmojiListRequest -> Text
setStickerEmojiListSticker :: Text -- ^ File identifier of the sticker
  , SetStickerEmojiListRequest -> [Text]
setStickerEmojiListEmojiList :: [Text] -- ^ A JSON-serialized list of 1-20 emoji associated with the sticker
  }
  deriving forall x.
Rep SetStickerEmojiListRequest x -> SetStickerEmojiListRequest
forall x.
SetStickerEmojiListRequest -> Rep SetStickerEmojiListRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetStickerEmojiListRequest x -> SetStickerEmojiListRequest
$cfrom :: forall x.
SetStickerEmojiListRequest -> Rep SetStickerEmojiListRequest x
Generic

instance ToJSON   SetStickerEmojiListRequest where toJSON :: SetStickerEmojiListRequest -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON SetStickerEmojiListRequest where parseJSON :: Value -> Parser SetStickerEmojiListRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON

type SetStickerEmojiList = "setStickerEmojiList"
  :> ReqBody '[JSON] SetStickerEmojiListRequest
  :> Post '[JSON] (Response Bool)
 
-- | Use this method to change the list of
--   emoji assigned to a regular or custom emoji sticker.
--   The sticker must belong to a sticker set created by the bot.
--   Returns 'True' on success.
setStickerEmojiList :: SetStickerEmojiListRequest ->  ClientM (Response Bool)
setStickerEmojiList :: SetStickerEmojiListRequest -> ClientM (Response Bool)
setStickerEmojiList = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @SetStickerEmojiList)

makeDefault ''SetStickerEmojiListRequest