module Web.Telegram.API.Bot.Responses
(
GetMeResponse (..)
, MessageResponse (..)
, ChatActionResponse (..)
, UpdatesResponse (..)
, FileResponse (..)
, UserProfilePhotosResponse (..)
, SetWebhookResponse (..)
, InlineQueryResponse (..)
) where
import Data.Aeson
import Data.Aeson.Types
import Data.Maybe
import Data.Proxy
import Data.Text (Text)
import qualified Data.Text as T
import GHC.Generics
import GHC.TypeLits
import Web.Telegram.API.Bot.Data
import Web.Telegram.API.Bot.JsonExt
data GetMeResponse = GetMeResponse
{
user_result :: User
} deriving (Show, Generic)
instance ToJSON GetMeResponse where
toJSON = toJsonDrop 5
instance FromJSON GetMeResponse where
parseJSON = parseJsonDrop 5
data MessageResponse = MessageResponse
{
message_result :: Message
} deriving (Show, Generic)
instance ToJSON MessageResponse where
toJSON = toJsonDrop 8
instance FromJSON MessageResponse where
parseJSON = parseJsonDrop 8
data ChatActionResponse = ChatActionResponse
{
action_result :: Bool
} deriving (Show, Generic)
instance ToJSON ChatActionResponse where
toJSON = toJsonDrop 7
instance FromJSON ChatActionResponse where
parseJSON = parseJsonDrop 7
data UpdatesResponse = UpdatesResponse
{
update_result :: [Update]
} deriving (Show, Generic)
instance ToJSON UpdatesResponse where
toJSON = toJsonDrop 7
instance FromJSON UpdatesResponse where
parseJSON = parseJsonDrop 7
data FileResponse = FileResponse
{
file_result :: File
} deriving (Show, Generic)
instance ToJSON FileResponse where
toJSON = toJsonDrop 5
instance FromJSON FileResponse where
parseJSON = parseJsonDrop 5
data UserProfilePhotosResponse = UserProfilePhotosResponse
{
photos_result :: UserProfilePhotos
} deriving (Show, Generic)
instance ToJSON UserProfilePhotosResponse where
toJSON = toJsonDrop 7
instance FromJSON UserProfilePhotosResponse where
parseJSON = parseJsonDrop 7
data SetWebhookResponse = SetWebhookResponse
{
webhook_result :: Bool
} deriving (Show, Generic)
instance ToJSON SetWebhookResponse where
toJSON = toJsonDrop 8
instance FromJSON SetWebhookResponse where
parseJSON = parseJsonDrop 8
data InlineQueryResponse = InlineQueryResponse
{
query_result :: Bool
} deriving (Show, Generic)
instance ToJSON InlineQueryResponse where
toJSON = toJsonDrop 6
instance FromJSON InlineQueryResponse where
parseJSON = parseJsonDrop 6