packages feed

telegram-types-0.2.2 / src / Web / Telegram / Types / Interaction.hs

{-# LANGUAGE DataKinds #-}{-# LANGUAGE DeriveAnyClass #-}{-# LANGUAGE DeriveGeneric #-}{-# LANGUAGE DerivingVia #-}{-# LANGUAGE FlexibleInstances #-}{-# LANGUAGE ScopedTypeVariables #-}{-# LANGUAGE StandaloneDeriving #-}-- | User interactions: customized keyboards, clickable buttons, popups and inline displaysmodule Web.Telegram.Types.Interaction  ( -- ** queries    CallbackQuery (..),    ShippingQuery (..),    PreCheckoutQuery (..),    -- ** replys    ReplyKeyboardMarkup (..),    KeyboardButton (..),    KeyboardButtonPollType (..),    ReplyKeyboardRemove (..),    InlineKeyboardMarkup (..),    InlineKeyboardButton (..),    ForceReply (..),    LoginUrl (..),    ReplyMarkup,    Action (..),  )whereimport Data.Aesonimport Data.OpenUnionimport Deriving.Aesonimport Servant.APIimport Web.Telegram.Types.Internal.Keyboardimport Web.Telegram.Types.Internal.Utilsimport Web.Telegram.Types.Internal.Commontype ReplyMarkup =  Union    '[ InlineKeyboardMarkup,       ReplyKeyboardMarkup,       ReplyKeyboardRemove,       ForceReply     ]instance ToJSON ReplyMarkup where  toJSON =    (\(inlineM :: InlineKeyboardMarkup) -> toJSON inlineM)      @> (\(replyM :: ReplyKeyboardMarkup) -> toJSON replyM)      @> (\(replyR :: ReplyKeyboardRemove) -> toJSON replyR)      @> (\(forceR :: ForceReply) -> toJSON forceR)      @> typesExhaustedderiving via Serialize ReplyMarkup instance ToHttpApiData ReplyMarkupdata Action  = Typing  | UploadPhoto  | RecordVideo  | UploadVideo  | RecordAudio  | UploadAudio  | UploadDocument  | FindLocation  | RecordVideoNote  | UploadVideoNote  deriving (Show, Eq, Ord, Generic, Default)  deriving (ToJSON, FromJSON) via Snake Action  deriving (ToHttpApiData) via Serialize Action