module Web.Telegram.API.Bot.Responses
(
GetMeResponse (..)
, MessageResponse (..)
, ChatActionResponse (..)
, UpdatesResponse (..)
, FileResponse (..)
, UserProfilePhotosResponse (..)
, SetWebhookResponse (..)
, InlineQueryResponse (..)
, CallbackQueryResponse (..)
, KickChatMemberResponse (..)
, LeaveChatResponse (..)
, UnbanChatMemberResponse (..)
, GetChatResponse (..)
, GetChatAdministratorsResponse (..)
, GetChatMembersCountResponse (..)
, GetChatMemberResponse (..)
) where
import Data.Aeson
import GHC.Generics
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
data CallbackQueryResponse = CallbackQueryResponse
{
callback_result :: Bool
} deriving (Show, Generic)
instance ToJSON CallbackQueryResponse where
toJSON = toJsonDrop 9
instance FromJSON CallbackQueryResponse where
parseJSON = parseJsonDrop 9
data KickChatMemberResponse = KickChatMemberResponse
{
kick_result :: Bool
} deriving (Show, Generic)
instance ToJSON KickChatMemberResponse where
toJSON = toJsonDrop 5
instance FromJSON KickChatMemberResponse where
parseJSON = parseJsonDrop 5
data LeaveChatResponse = LeaveChatResponse
{
leave_result :: Bool
} deriving (Show, Generic)
instance ToJSON LeaveChatResponse where
toJSON = toJsonDrop 6
instance FromJSON LeaveChatResponse where
parseJSON = parseJsonDrop 6
data UnbanChatMemberResponse = UnbanChatMemberResponse
{
unban_result :: Bool
} deriving (Show, Generic)
instance ToJSON UnbanChatMemberResponse where
toJSON = toJsonDrop 6
instance FromJSON UnbanChatMemberResponse where
parseJSON = parseJsonDrop 6
data GetChatResponse = GetChatResponse
{
chat_result :: Chat
} deriving (Show, Generic)
instance ToJSON GetChatResponse where
toJSON = toJsonDrop 5
instance FromJSON GetChatResponse where
parseJSON = parseJsonDrop 5
data GetChatAdministratorsResponse = GetChatAdministratorsResponse
{
ca_result :: [ChatMember]
} deriving (Show, Generic)
instance ToJSON GetChatAdministratorsResponse where
toJSON = toJsonDrop 3
instance FromJSON GetChatAdministratorsResponse where
parseJSON = parseJsonDrop 3
data GetChatMembersCountResponse = GetChatMembersCountResponse
{
cmc_result :: Int
} deriving (Show, Generic)
instance ToJSON GetChatMembersCountResponse where
toJSON = toJsonDrop 4
instance FromJSON GetChatMembersCountResponse where
parseJSON = parseJsonDrop 4
data GetChatMemberResponse = GetChatMemberResponse
{
gcm_result :: Int
} deriving (Show, Generic)
instance ToJSON GetChatMemberResponse where
toJSON = toJsonDrop 4
instance FromJSON GetChatMemberResponse where
parseJSON = parseJsonDrop 4