{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module Telegram.Bot.API.Methods.SetStickerKeywords 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

-- ** 'setStickerKeywords'

-- | Request parameters for 'setStickerKeywords'.
data SetStickerKeywordsRequest = SetStickerKeywordsRequest
  { SetStickerKeywordsRequest -> Text
setStickerKeywordsSticker :: Text -- ^ File identifier of the sticker
  , SetStickerKeywordsRequest -> Maybe [Text]
setStickerKeywordsKeywords :: Maybe [Text] -- ^ A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters
  }
  deriving forall x.
Rep SetStickerKeywordsRequest x -> SetStickerKeywordsRequest
forall x.
SetStickerKeywordsRequest -> Rep SetStickerKeywordsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetStickerKeywordsRequest x -> SetStickerKeywordsRequest
$cfrom :: forall x.
SetStickerKeywordsRequest -> Rep SetStickerKeywordsRequest x
Generic

instance ToJSON   SetStickerKeywordsRequest where toJSON :: SetStickerKeywordsRequest -> 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 SetStickerKeywordsRequest where parseJSON :: Value -> Parser SetStickerKeywordsRequest
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON

type SetStickerKeywords = "setStickerKeywords"
  :> ReqBody '[JSON] SetStickerKeywordsRequest
  :> Post '[JSON] (Response Bool)

-- | Use this method to change search keywords
--   assigned to a regular or custom emoji sticker.
--   The sticker must belong to a sticker set created by the bot.
--   Returns 'True' on success.
setStickerKeywords :: SetStickerKeywordsRequest -> ClientM (Response Bool)
setStickerKeywords :: SetStickerKeywordsRequest -> ClientM (Response Bool)
setStickerKeywords = forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client (forall {k} (t :: k). Proxy t
Proxy @SetStickerKeywords)

makeDefault ''SetStickerKeywordsRequest